Posts

Showing posts from September, 2010

Apache - Find the number of requests for a file -

so here's problem: want find out how many times file(or files) has been viewed(or downloaded). can kind of info apache logs, , if yes how? with apache access logs able identify whether particular resource accessed or not along response code. have count number of such accesses resulted in success response. this, may have grep previous logs. don't think there straight forward way this. if logs huge, consider map , reduce framework achieve this. another option have app server delivers resource using controller, , persist count in database, inefficient.

javascript - Data binding inside <option> element in angular.js and jQuery mobile -

i have added multi-language support jquery-mobile/phonegap app using this great repo on github . it uses firebase , angular.js bind language dependant labels , texts in app selected language, in example: <h2>{{getword("selection_criteria")}}</h2> however, there language-dependant texts in app cannot bound language data, have found far: <select id="sel" data-role="slider"> <option value="off">{{getword("select_off")}}</option> <option value="on">{{getword("select_on")}}</option> </select> the <option> element doesn't allow bind it's text data (the rendered text empty). don't know why. tried test whether work: <option value="off">{{1+2}}</option> and yes, displayed number 3 in slider. the angular.js part looks this: function languagectrl($scope) { $scope.words = json.parse('{}'); $...

sorting - Sort a table with multiple <tbody> in jquery table sorter 2.0 -

i have table lets say <table id="mytable"> <thead> <th>id</th> <th>name</th> </thead> <tbody> <tr> <td>1</td> <td>sam</td> </tbody> <tbody> <tr> <td>2</td> <td>alex</td> </tbody> </table> how can sort using tablesorter 2.0 if use $("#mytbale").tablesorter(); sort single tbody. i have fork of tablesorter sort each tbody separately. if have tbody don't want sort, add class name contained within cssinfoblock option - default tablesorter-infoonly . <tbody class="tablesorter-infoonly"> <tr> <th>the contents of tbody</th> </tr> <tr> <td>will not sorted</td> </tr> </tbody>

java - Preferences-like Framework for multiple VM's -

i coding settings project. today have found out project running on multiple vm's , why have scrap preferences wrapper , code new one. what java.util.prefs.preferences-like frameworks there except properties? want ability save more string types. thank you take apache commons preferences . supports several formats.

php - Unable to insert any record and returns error:MySQL returned an empty result set (i.e. zero rows) -

if(isset($_post['submitted'])) { //mysql_connect('localhost','root','')or die(mysql_error()); //mysql_select_db('ecommerce'); include_once ('mysql_connect.php'); if(is_uploaded_file($_files['image']['tmp_name'])) { // $image=$_files['image']['tmp_name']; if(move_uploaded_file($_files['image']['tmp_name'], "uploads/".$_files['image']['name'])) { if(!empty($_post['description'])) { $d=$_post['description']; } else { $d=null; } $query="insert uploads(file_name,file_size,file_type,description)values('{$_files['image']['name']}',{$_files['image']['size']},'{$_files['image']['type']}',$d)" or die(mysql_error()); mysql_query(...

java - Algorithm to calculate values based on width and height (coordinates and size) -

what want might separated several or 1 methods, whatever best. i have 4 values set (as fields): width of image whole image (canvas speak) height of whole image (height of canvas) padding (how many pixels want have padding) how many images in want in width , height separately (can separate values) what want have whole image, i'm putting small images inside (these bitmap sizes want method). i want have size of images inside, both width , height. , coordinates in of small images in whole image view. a small example might be: the width of image 200 , want padding of 4, , want have 3 images on 1 row of image. the calculation might this: (200 - (4*(3+1))) / 3 = 61,33; the 3+1 because want have padding on either side of small images. but width, have universal solution applies height well. and calculate height , width of every image inside canvas-image. and put sugar on top. have x , y coordinates of every image inside. how can done? , how every value? bi...

sh - Argument variables in a shell script -

i tips problem : i'd run script bash, 1 call suivitest2 launch ./suivitest2 : #!/bin/sh echo $1 echo"-----------------------------------" set classpath="" echo"-----------------------------------" echo $1 jar in lib/*.jar; classpath="$jar;${classpath}"; done echo using classpath $classpath /cygdrive/c/program\ files/java/jdk1.7.0_25/bin/java -classpath ${classpath} suivi.test.testsuivi conf/suivi.properties $1 echo $1 but gave me : $ ./suivitest2 chrp chrp ./suivitest2: line 4: echo----------------------------------- : command not found ./suivitest2: line 6: echo----------------------------------- : command not found classpath= using classpath lib/xmlsec-1.4.3.jar;lib/wss4j-1.5.9.jar;lib/velosurf-2.3-r526.jar;lib/velocity-> > 1.6-dev.jar;lib/suivi.jar;lib/stillness-0.1-dev.jar;lib/mysql-connector-java-5.1.13-bin.jar;lib/mail-1.4.jar;lib/jdom-1.1.jar;lib/dom4j-1.1.jar;lib/commons-net-3.1.jar;lib/...

iphone - managing keyboard in ios for number of textfields -

everything fine me except 1 case. when begin editing textfield, keyboard shown: method getting called, without resigning first 1 if edit next textfield, method not getting called. - (void)registerforkeyboardnotifications { [[nsnotificationcenter defaultcenter] addobserver:self selector:@selector(keyboardwasshown:) name:uikeyboarddidshownotification object:nil]; [[nsnotificationcenter defaultcenter] addobserver:self selector:@selector(keyboardwillbehidden:) name:uikeyboardwillhidenotification object:nil]; } -(void)keyboardwasshown:(nsnotification*)anotification { nsdictionary* info = [anotification userinfo]; cgsize kbsize = [[info objectforkey:uikeyboardframebeginuserinfokey] cgrectvalue].size; uiedgeinsets contentinsets = uiedgeinsetsmake(0.0, 0.0, kb...

maven - Execute command in different directories -

i have requirement need change pom version of projects , following steps involved: search projects pom having particular version "1". now navigate these projects directory 1 one , execute maven command update version 1 one. so far have been able list of projects using following command: find . -name "pom.xml" -print0 | xargs -0 grep -il '1' now need execute maven command 'mvn versions:update-parent' in directory of each of pom's found above. can done in single command? edit: if yes how go it? just tested this, seems work. run 'mvn clean' in directory of pom containing 1.8.6: find . -name 'pom.xml' -print0 \ | xargs -0 grep -l '1.8.6' \ | xargs -i xx find . -path xx -execdir mvn clean \;

asp.net - Error with partial postbacks -

i having issue application. web application quite large , works using number of ascx , vb server controls, each of various partial post backs using update panels. works fine on local machine when push application server (iis) notice application throw error during update of update panel. here error: sys.webforms.pagerequestmanagerservererrorexception: object reference not set instance of object. i'm not sure causing error or how track down control causing problem. i've tried debugging live application using ie's developer tools. error seems originating web resource, microsoftajaxwebforms.debug.js. function having problem is: _endpostback: function pagerequestmanager$_endpostback(error, executor, data) { if (this._request === executor.get_webrequest()) { this._processingrequest = false; this._additionalinput = null; this._request = null; } var eventargs = new sys.webforms.endrequesteventargs(error, data ? data.dataitems : ...

extjs4 - Maximize, minimize extjs panel -

how can add maximize , minimize in panel of extjs 4 portal example: http://docs.sencha.com/extjs/4.2.1/extjs-build/examples/portal/portal.html fully working code: ext.define('ext.app.portal', { extend: 'ext.container.viewport', requires: ['ext.app.portalpanel', 'ext.app.portalcolumn', 'ext.app.gridportlet', 'ext.app.chartportlet'], initcomponent: function(){ var content = '<div class="portlet-content">'+ext.example.shortbogusmarkup+'</div>'; var maincolumnpanelid; //var mainpanelid; var itemno=0; this.tools= [ { type:'minimize', hidden:true, scope:this, handler: function(e, target, panel) { var cardpanel=ext.getcmp("app-portal"); var c = panel.up("v...

TinyMCE multiple CSS classes -

i’ve been looking way this. have style sheet loaded tinymce. style sheet generated via content management system based of active template. problem can not tinymce let me select multiple css classes signle element. here example: .left_round_thumb_small { width:65px; height:65px; border-radius:35px; -moz-border-radius:35px; -webkit-border-radius:35px; -khtml-border-radius:35px; background:url(/skins/msc_2013/images/lines.png) repeat; float:left; margin:0 25px 0 0; } .center_round_thumb_large { width:162px; height:162px; border-radius:85px; -moz-border-radius:85px; -webkit-border-radius:85px; -khtml-border-radius:85px; background:url(/skins/msc_2013/images/lines.png) repeat; position:relative; margin:0 25px 0 0; } .round_border_black {border:1px solid black;} .round_border_red {border:1px solid red;} .round_border_blue {border:1px solid #00aeef;} .round_border_green {border:1px solid #3cb64b;} now know g...

statistics - Time Series Modeling of Choppy Data -

i'm trying model 10 years of monthly time series data choppy , overal has upward trend. @ first glance looks strong seasonal series, test results indicate not seasonal. pricing variable i'm trying model function of macroeconomic environment, such interest rates , yield curves. i've tryed linear ols regression (proc reg), don't goo dmodel that. i've tried autoregressive error models (proc autoreg), captures 7 lags of error term significant factors. don't want include many lag of error term in model. in addition of macroeconomic variables become insignificant when include these error lags in model. any suggestions on modeling method/technique me model choppy data appreciated. at past project, we've used proc arima predict future product sales based on time series of past sales: http://support.sas.com/documentation/cdl/en/etsug/60372/html/default/viewer.htm#etsug_arima_sect019.htm (note arima autoregressive model) but joe said, statistical fee...

MVP RadioButtonList SelectValue invalid -

i have radiobuttonlist 2 listitems. value of 2 list items true , false. i've boolean value called daily. daily set 'false' here's code snippet: <asp:radiobuttonlist runat="server" id="pfradiobuttonlist" selectedvalue="<%# model.daily.tostring() %>" autopostback="true" onselectedindexchanged="pfradiobuttonlist_onselectedindexchanged"> <asp:listitem text="item 1" value="false"></asp:listitem> <asp:listitem text="item 2" value="true"></asp:listitem> </asp:radiobuttonlist> the problem on running follwing error: 'pfradiobuttonlist' has selectedvalue invalid because not exist in list of items. any suggestions please?! booleans in c# output values capital letters, so bool f = false; console.write(f.tostring()); outputs false , not false . try reflecting in markup: <asp:listitem text="i...

java - how to add custom properties metadata to the pdf using apache fop -

i using apache fop create pdf files , need add specific metadata pdf. in adobe reader called "custom properties" , contains name , value. can add simple metadata this: out = new bytearrayoutputstream(); fop = fopfactory.newfop(mimeconstants.mime_pdf, fouseragent, out); fouseragent.setkeywords("some keywords"); but need add customised metadata name , value. idea how it? maybe you're lucky xmp support in fop 1.1 ? try keys find in xmp specification .

how to fire a function on a jquery tab getting shown? -

i have jquery tab set using wizard. start tab one's content, when click button in tab one, go tab 2 , on through flow. wizard flows dynamic not wizards have same steps. in 1 wizard flow have payment screen want show. on showing tab want pull data previous tabs build shopping cart screen. how can fire function on payment tab showing. want tab reusable different transaction flows cant rely on panel before. want keep event listening inside payment panel. any suggestions on coding this, or possible plugins? tie event: http://api.jqueryui.com/tabs/#event-beforeactivate $( ".selector" ).tabs({ beforeactivate: function( event, ui ) {} });

ios - Detect HTML encoding when NSURLResponse returns nil for textEncodingName -

i'm loading website html using call - nsmutableurlrequest *request = [nsmutableurlrequest requestwithurl:url]; [request setvalue:@"utf-8" forhttpheaderfield:@"accept-encoding"]; [request setvalue:@"text/html" forhttpheaderfield:@"accept"]; [nsurlconnection sendasynchronousrequest:request queue:[nsoperationqueue currentqueue] completionhandler:^(nsurlresponse *response, nsdata *data, nserror *error) { ... } and then, convert nsdata nsstring, need know encoding, call - nsstring *textencoding = [response textencodingname]; from code block, returns nil on websites won't specify "content-encoding" header field. if don't know encoding, [[nsstring alloc] initwithdata:data encoding:responseencoding] won't give me readable html. how can detect right encoding websites don't send "content-encoding" header field? ...

html - Get a text with <br /> tag in a div with children using xpath until another children tag -

i have html code like: <span class="content_font"> shinta geby, salah satu pendatang baru di dunia musik ingin kembali menghidupkan lagu 'tinggal kenangan' milik geby yang sempat populer beberapa waktu lalu.<br /> <br /> pemilik nama asli shita faula e itu mengemas lagu tersebut dengan gitar yang dimainkannya sendiri. maklum, shinta memang piawai dalam memetik gitar.<br /> <br /> "lagu itu membuat saya lebih modern dalam berkarir. jadi kenapa nggak mencoba dengan lagu itu, ternyata teman teman saya di media sosial kagumi saya bawakan lagu itu," ujar shinta, rabu (17/7/2013).<br /> <br /> perempuan kelahiran 1 desember 1995 itu juga mengaku tetap optimis meski hanya mendaur ulang lagu tersebut. shinta yang mengidolai tantri 'kotak' mengaku aransemen 'tinggal kenangan' ini lebih ngerock dan fresh.<br /> <br /> "saya percaya diri dalam karier saya. ini yang membuat ...

iis 7 - IIS 7 authorization rules not synced with web.config -

is there wrong iis setup? have 64-bit iis 7.0 installation. site has web.config, authorization rules specified. in iis manager, when open authorization rules, had expected rules web.config displayed , editable, changes make synced web.config. not seem case. from can tell, site obeys whatever rules put authorization settings in iis, ignores rules put web.config. is correct? how supposed work? there way force sync? it appears iis puts rules system.webserver section of web.config.

android - Make a button completely fill a framelayout -

edit: main goal have button have white behind it, looks white background behind button i can't seem make button fill framelayout. even after setting padding of encapsulating framelayout 0dp, (and i've tried negative dp values), button has white border around around 2dp thick. the button not totally fill framelayout should. code: <framelayout android:background="#ffffff" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="0dp" android:layout_gravity="top" android:padding="0dp"> <button android:id="@+id/create_list" android:layout_width="match_parent" android:layout_height="match_parent" android:clickable="true" android:layout_gravity="top" android:drawableleft="@drawable/plus" android:hin...

Copy Sql Server 2008 Databse schema only to Another Sql server 2008 Database on same machine -

i have sql server 2008 database is there way create new database , copy schema of existing database objects newly created database using sql query or stored procedure first you'll need make full backup of database want copy: backup database database1 disk = 'x:\fullpath\advworksdata.bak' format; where x:\fullpath full path location can backup on disk. next you'll need create new database (if haven't already): create database database2; and you'll need restore on top of database: restore filelistonly database1; restore database database2 database1 move 'database1_data' 'x:\fullpath\database2.mdf', move 'database1_log' 'x:\fullpath\database2.ldf'; go where x:\fullpath full path you're second databases files exist. some caveats move 'database1_data' , 'database1_log' default logical file names. can differ. can find logical names under properties of database...

c# - Cookie's value is doubled without any reason -

i've got problem cookie. that's code: namevaluecollection ncook = new namevaluecollection(); ncook = httpcontext.current.request.cookies["history"].values - in line what in cookie: item_0=nonpacket-program.aspx?id=360andcourse=1044andcenter=238andfeeding=andinhabitation= that's expect recieve line showen before. , here actualy recieve: item_0=nonpacket-program.aspx%3fid%3d360andcourse%3d1044andcenter%3d238andfeeding%3dandinhabitation%3d&item_0=nonpacket-program.aspx%3fid%3d360andcourse%3d1044andcenter%3d238andfeeding%3dandinhabitation%3d how can see value doubled. , that's problem.... doing wrong? first thought assigning ncook value of existing cookie, , postback happens, , "history" cookie has 2 entries in values. "history" cookie history, each postpack, i'm betting history cookie grows, , thus, ncook grow well.

css - CSS3 Fade In Before/After Content -

i have following hover effect, how make fade in , out? html <article> hello world </article> css article { position: relative; float: left; margin: 0 16px 16px 0; padding: 10px; width: 228px; height: 228px; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; overflow: hidden; background: green; } article:hover:after { content: ''; position: absolute; top: 0; left: 0; width: 322px; height: 322px; background: #fff; -webkit-transform: translate(-161px, -161px) rotate(135deg); -moz-transform: translate(-161px, -161px) rotate(135deg); transform: matrix(-161px, -161px) rotate(135deg); opacity: 0.5; -webkit-transition: opacity 1s ease-in-out; -moz-transition: opacity 1s ease-in-out; transition: opacity 1s ease-in-out; } jsfiddle your element won't transform or move if don't have start , end ...

In C# Class Program -

in c# class program doing prodram calculate employee gross salary , net salary. print name , department. if give details not calculating gross salary , net salary. printing not calculating gross salary , net salary. in c# class program doing prodram calculate employee gross salary , net salary. print name , department. if give details not calculating gross salary , net salary. printing not calculating gross salary , net salary. using system; using system.collections.generic; using system.linq; using system.text; namespace empid_071713 { class employee { private string employeename, department; private int basicsalary, hra, da, ta, grosssalary; private double netsalary; public void readdata() { employeename = console.readline(); department = console.readline(); basicsalary = convert.toint32(console.readline()); hra = convert.toint32(console.readline()); ...

file io - questions about sink, in R -

lets want use sink writing file in r. sink("outfile.txt") cat("line one.\n") cat("line two.") sink() question 1. have seen people writing sink() @ end, why need this? can go wrong when not have this? question 2. best way write many lines 1 one file for-loop, need format each line? might need have different number in each line, in python use outfile.write("line number %.3f",1.231) etc. question 1: sink function redirects text going stdout stream file handler give sink . means anything print out interactive r session, instead written file in sink, in case "outfile.txt". when call sink again without arguments telling resume using stdout instead of "outfile.txt". no, nothing go wrong if don't call sink() @ end, need use if want start seeing output again in r session/ as @roman has pointed out though, better explicitly tell cat output file. way want, , expect see in file, while still getting rest ou...

sql - Select records ignoring null values with date between some range -

i want records records must exist between particular dates. e.g. if date given between 2013-7-1 , 2013-7-17 , i've entry in purchase table dated: 2013-6-5 , entry in sale table dated 2013-7-17 particular product. should ignore these rows , select rows sale & purchase have occur in desired date range. below query not working properly. because of above defined situation divided 0 exception occurs. kindly me. select o.name owner, c.name company, sum(sq.pquantity) - sum(sq.squantity) quantity, sum(sq.pquantity * sq.prate) / sum(sq.pquantity) rate, (sum(sq.pquantity) - sum(sq.squantity)) * (sum(sq.pquantity * sq.prate) / sum(sq.pquantity)) amount,sq.companyid companyid, o.ownerid ownerid (select ownerid, companyid, quantity pquantity, ratepershare prate, 0 squantity, 0 srate, date purchase union select ownerid, c...

'Join' two models in angularjs -

i have form display editable values. 1 of values id of user. don't want display id of user want display users name. i , works great: <div class="control-group"> <label class="control-label" for="type">point of contact</label> <div class="controls"> <select ng-model="device.poc" ng-options="user._id user.username user in users"> </select> </div> now trying display list of devices in non-editable form loop devices ng-repeat. <div ng-repeat="device in devices | filter:{registered: true}" class="top-gap"> <div class="row"> <div class="span2"> {{device.name}} </div> <div class="span2"> {{device.poc}} </div> </div> but device.poc not want display, want display users name attached de...

Magento product category missing in breadcrumb -

on home page of magento site, used following code add latest products block {{block type="catalog/product_list" category_id="2" template="catalog/product/random.phtml"}} when clicking on latest products, work (the ones worked showed full breadcrumb) , others lead error: fatal error: call member function getname() on non-object in /var/www/vhosts/riderseyewear.net/httpdocs/app/design/frontend/fortium/default/template/page/1column-product.phtml on line 80 the error described more here http://i.imgur.com/rrg3ixu.png in 1column-product.phtml file, went line 80 , changed $currentcat = mage::registry('current_category')->getname(); to $currentcat = mage::registry('current_product')->getname(); changing line removed error. however, category name not show in breadcrumbs when clicking on product. breadcrumb shows home/product_name instead of home/category_name/product_name how can full breadcrumb show while not receiving ...

mysql - Composite key - one a foreign key, the other auto-incrementing -

i'm having trouble creating table in mysql. essentially, need composite key using "client_id" , "problem_id". in table "clients", "client_id" primary key want keep relationship, , "problem_id" needs auto incrementing. create table problems ( client_id bigint(10) not null references clients(client_id), problem_id int not null auto_increment, status char(1) not null, description varchar(100) not null, start_date varchar(10) not null, end_date varchar(10), primary key (client_id, problem_id) ); mysql won't accept this, seems logical me. how can achieve such table? two problems: innodb requires auto_increment column first column in primary key. innodb not support column-level references syntax, supports table-level foreign key constraint syntax. this should work: create table problems ( client_id bigint(10) not null, problem_id int not null auto_increment, status char(1) not null, description varchar(...

VIM search for characters starting with ampersand -

i have search &variable (and replace &variable.test ). \&variable , vim shows me characters starting &variable ( &variablexxx instance), not want. thought - /\<\&variable\> work, please let me know going wrong. the first problem \& not literal & special regex match matches branches in vim. match literal & use & . the second problem \< matches beginning of keyword looking see if next character keyword. & not keyword fails. to around can make & keyword doing set iskeyword+=& then can use regex \<&variable\> match things want. relevant pages :h iskeyword , :h /\< , :h \&

c# - Check or nickname already exists in List<User> -

i creating asp website possibility register. the nickname visitors choose register has unique. everytime when user registers, select users database, , using foreach loop check or username exists: private list<user> listexistingusers; listexistingusers = database.getusers(); foreach (user u in listexistingusers) { if (u.nickname == txtnickname.text) { error = "username in use."; } } but code above doesn't work properly. doesn't check items in list read database. possible have users same usernames, don't want. what can solve problem? read linq, think wrong way of checking usernames list<> in opinion. think username-check must done in way. can experts me? check sql-query, in c#. instead of returning users db, pass username query/stored procedure , let backend check, , return status flag 1/0 - exists/doesn't.

ruby on rails - Comments not displaying in songs#show.html.erb -

the comments don't appear showing after submitted (created). if @ songs#show.html.erb you'll see comments code. not sure why aren't showing, i've looked how ryan bates comments , code identical. please advise :) note: it's worth i'm running rails 4. your problem in song/show variable @song ok, render comments/_form uses @comment set new comment without song_id set. yo build comment song_id set id of @song could: # songs_controller.rb def show @comment = @song.comments.build end

rprofile - Mask a function from `ls` in R -

i want put following function in .rprofile make installation of bioconductor packages easier: install.bioconductor <- function(...) { source("http://bioconductor.org/bioclite.r") bioclite(...) } but when load new r session, function listed when call ls . there way of masking function being shown? you can put in own environment , attach environment search path. myfuns <- new.env() myfuns$install.bioconductor <- function(...) { source("http://bioconductor.org/bioclite.r") bioclite(...) } attach(myfuns) # attach search path rm(myfuns) # remove .globalenv # still accessible via # install.bioconductor(...) then accessible, not show in ls() . (you can see attached search path search() , , can see in myfuns ls(myfuns) ) alternatively, @joshuao'brien mentioned in comment can keep in .globalenv add dot beginning of name (i.e. name .install.bioconductor ) "hidden" such won't show ls() , show ls(all.names=true...

specflow - BDD how to isolate a test that depends on data -

i'd honest, new this. say have following scenario: scenario: user grid displays information users given application have @ least 1 user when go user grid page should see list of user data in user grid how ensure keep test isolated scenario while know application contains no user data @ start of test? i can see following options far: add create user scenario before firing scenario. (this breaks isolation.) have code check on have @ least 1 user , , inserts if doesn't. (never seen done on internet yet, normal or practice?) i think test abstract. try being little more concrete. if use: given add user called bob when view users grid page should see bob in user list then think more obvious need use option 2. might consider given add user called bob , add user called bill .... or if prefer given add accounts team ... don't forget specflow bindings methods behind scenes can [given ("i add accounts team")] public void giveniaddanacc...

see line length in visual studio 2012 -

i restrict 80 characters in each line in code readability. know if there scale show line length in visual studio 2012 how shows line number (i mean horizontal scale?) the visual studio productivity power pack has column guide setting draw vertical column guide in editor. column guides draws vertical line in code editor remind developers full line of code or comments may not fit 1 single screen. place cursor @ appropriate column , select add guideline context menu

jQuery .val() not working with jQueryUI autocomplete -

i've got 2 jqueryui autocomplete's on single form. 1 feeds off other. goal have first field autocomplete , populate ids (intended be) hidden fields. second autocomplete doing ajax call remote page, passing id first autocomplete. this working. first autocomplete works fine, , populates companyid field appropriate value. my problem second autocomplete passing value of 0 ajax requested page. it's if .val() returned call source in second autocomplete not reading value of companyid field properly. to make things more maddening, i'm calling alert() when community field changes, , it's reporting proper, accurate companyid! argh! my jquery: <script> $(document).ready(function() { var companies = [ { label: 'america first properties', value: '6' }, { label: 'western national group', value: '7' }, { label: 'greystar property management', value: '8' }, ...

html - joomla list from api -

how define selected in joomla list using api? if try use following snippet won't work. jhtml::_('select.genericlist', $options, 'jform[faculty]', array('class' => 'nourritures', 'option.attr' => 'data', 'selected'=> $actual_record)); it's "list.select" not "selected": please see http://www.fasterjoomla.com/joomla-dev/joomla-select-options-with-style complete example.

Javascript printing to html with percent sign -

i bunch of json data through xhr request, , following data back: {"data_list" : [[1, "title1", "0.54%"], [2, "title2", "2.98%"]]} then try loop through data, , put in console console.log: var len = json.data_list.length; for(var = 0; < len; i++) { console.log(json.data_list[i]); } but don't same percentages: [1, "title1", "0.24%"] [2, "title2", "0.00%"] anyone know why right data first 2 fields, not same percentages? if take out percent signs in json response, still wrong numbers. assume variable valid, i'm using library maps json variable json.data_list. i not bright somewhere xhr request got mangled dojo. help! "data-list" invalid identifier expect act, it's interpreted subtraction. try using bracket notation: json["data-list"].length and json["data-list"][i] demo: http://jsfiddle.net/7bgvv/

performance - Android tile movement -

Image
i'm looking implement movement character character on tiled board. have 7x7 board set each tile representing character. player able move in 8 directions around tile (providing proper game logic). able accurately character @ given tile based on ontouch() action_down . for more elegant solution though looking press , drag move between tiles/create words. i'm not sure should start this. i can figure out logic appropriate moves etc. question how recognize left movement 1 position selecting tiles? my current idea have hard boarders not work diagonal. next idea have diagonal boarders instead like: this solution seems little complex though. there easier way accomplish this?

java - How to access List of List of Beans in Javascript -

i'm using raphael charts jsf 2.1. i'm trying draw linechart takes input x-axis array of arrays , y-axis. x-axis should contain timestamps(xvals in xhtml) , y-axis should containing avgval(avgbpsvals in xhtml). how can access tbean instance variables dt, avgval in javascript? ui:repeat gives me result beans. class inputbean{ private list<list<tbean>> results; private list<tbean> result; private string resultjson; //getters , setters private string getresultjson(){ gson gson = new gson(); return gson.tojson(results); } } class tbean{ private timestamp dt; private long avgval; //getters , setters } in sample.xhtml <?xml version='1.0' encoding='utf-8' ?> <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf...

c++ - Grabbing a 10 second clip after motion detection in OpenCV -

i writing code in order detect small objects moving using opencv , c++. have motion detection, logging of detects, , bounding boxes working well. stuck on way take video, , after detection, grab 5 seconds before , 5 seconds after detection period , save out different .avi file. have ideas on way this? point in general direction helpful can't seem find on taking out clips .avi file , saving them different files.

ajax - "Screen is not a member of My.MyComputer" -

i interested in using ajax (via/with visual studio 2012) make webpage more dynamic. terribly confused error getting.. 'screen' not member of "my.mycomputer" all want screen size. i've looked on google , found every time way is: my.computer.screen.bounds.height my.computer.screen.bounds.width or screen.primaryscreen.bounds.width screen.priamryscreen.bounds.height i error every time.. it's little different second method; says: 'screen' hasn't been declared. in javascript lowercase screen : screen.height; screen.width; demo: jsfiddle in .net @georgejohnston pointed out need: the screen object found in namespace, system.windows.forms not going in web forms project default.

oracle11g - Unable to connect to Oracle 11g using node-oracle driver for Node.js: are they compatible? -

we trying use node.js app connect oracle 11g server (enterprise edition 11.2.0.1.0 - 64bit production) ubuntu 12.04.1 lts server. running node v0.10.12 , nearinfinity node-oracle module 0.3.1. there other posts here on stackoverflow talk other node oracle module node-db-oracle, version no longer maintained , cannot built node 0.10.12 due node-waf being deprecated. even tiniest node program not connect though using same connection info can connect sqlplus64 client , simple 3 line php program. have tried different options connecting, such specifying connection info in json passed connect function, specifying user, password, , referencing connection string in oracle tnsnames.ora file, or passing connection string directly json. 1 of 2 errors: error: ora-12154: tns:could not resolve connect identifier specified or if change parameters bit: error: ora-12514: tns:listener not know of service requested in connect descriptor i have tried connecting different oracle servers in our...

Can I duplicate this classic ASP pattern in ASP.NET MVC? -

virtuall every asp app i've written (hundreds) follows exact same pattern. "single page app" header , footer, , dynamically updated content area changes depending upon going on/in url. following (very simplified, demonstrates principle): [% select case lcase(request("action") %] [% case "home" %] [div class='class_home'...] home screen html/script/asp [/div] [% case "enroll" %] [div class='class_enroll'...] enroll screen html/script/asp [/div] [% case "checkout" %] [div class='class_checkout'...] [!-- if it's gonna lengthy, instead: --] [!-- #include file=checkout.inc.asp --] [/div] [% end select %] this pattern may nested several layers deep additional request("subaction") subarea/subforms involved. every form submits ([form action="" method=post]), , asp script @ top catches form , processes it, ...

Angularjs + Zurb Foundation, do they play well together? -

i'm having hard time setting project angular , foundation 3 (rails in backend). have been searching lot there aren't many results. i'm serving angular subfolder (localhost:3000/app), , started html this !!!5 %html{ "ng-app" => "app" } %head -# tried html5 url on angular, not so far %base{:href => "/app/"} %title ng app ... %body %header ... %main = yield %footer ... = javascript_include_tag "application" = yield :javascripts a couple of view work fine. when tried use foundations tab, make work, because angular pass anchor url shold check against $routeprovider. so, check question here, , part of answers give me impression foundation work fine enabling html5 mode in angular. (which make it) , other answers in order make work foundation angular should write directive every component on foundation. or last case moving twitter bootstrap. so, can find ...

c# - How to add rdlc file to ReportViewer in WPF projects -

i've added reportviewer in wpf app via xaml designer of main window , i'd add existing rdlc file it. i'd reportviewer show empty rdlc file (without parameters) on startup, , later upon selecting row datagrid (bound observablecollection) change parameters accordingly , show filled report definition instead of empty one. i'll make button selected row commandparameter , relevant events , everything, need able pass data report. realize not easy question i'll try simplify: how add existing rdlc file reportviewer (mvvm, wpf) ? i push button -> relevant command gets item observablecollection parameter (a row in datagrid) -> how pass data parts of item unfilled (or overwrite if filled of course) parts of report? i hope i've been clear. answer in advance! after set initilizemethod correct path report , dataset name this. private void initializereport() { this.mform_components = new system.componentmodel.container(); ...

sql server 2000 - How to concatenate month number into table name -

i concatenate month number text build table names. example, trying retreive data may 2013, select webproxylog5. the following script select * webproxylog + '' + cast(month(dateadd(m,-2,getdate())) varchar(2)) + '' will result in following error messsage: msg 170, level 15, state 1, line 4 line 4: incorrect syntax near '+'. what wrong syntax? thank you, seyed you need build dynamic sql that, declare @sql varchar(200) set @sql= 'select * webproxylog + ' + cast(month(dateadd(m,-2,getdate())) varchar(2)) exec(@sql)

java - Passing a Structure with a Memory field in JNA -

my dynamic c library receives (pointer to) structures include allocated pointer (by malloc). called function allowed call realloc on it. typedef struct mystruct { void * buf; int buflen; /* more fields... */ } mystruct; void myfunc(mystruct *s1, /* more args*/) { /* in dynamic library */ /* .... */ s1->buf = realloc(s1->buf,newsize); /* .... */ } i thought structure memory field trick, public class mystructjna extends structure { public memory buf; public integer buflen; /* .... */ } but exception: exception in thread "main" java.lang.illegalargumentexception: structure field "buf" declared class com.sun.jna.memory, not supported within structure @ com.sun.jna.structure.writefield(structure.java:792) any explanation and/or workaround? i'm using jna 4.0 the question answered , accepted, want add caveat, in case attempting similar approach: this not design, because dll side r...

How to terminate the running function in Python Shell? -

i thought easy task googled around , had no clue @ all. i'm trying run pyhook tutorial , once pythoncom.pumpmessages(), function stay idle , wait windows events. i don't want close down window nor restart shell because of imported library , defined functions. there way termindate function? i tried ctrl+c doesn't work @ all. thanks lot.

c# - How to get html from an element in WebKit.Net -

i'm migrating old project webkit.net 0.5 cairo. roadblocks i've gotten past can't figure out how html individual webkit.dom.element object. i can read html of entire document using webkitbrowser.documenttext, not need. below i'm trying accomplish. i've browsed through docs , done lot of searching , have come empty on fronts. i've found no way accomplish last line in snippet. webkit.dom.element newdiv = webkitbrowser1.document.createelement("div"); ... [ create span's , append them newdiv ] ... string divhtml = newdiv.documenttext // <-- documenttext not member of webkit.dom.element with ie control, divhtml = newdiv.innerhtml , can't find equivalent webkit.net. as alternative, accept solution inject html element such can manually add img tag without creating dom element it. using divhtml.textcontent, html interpreted plain text. thanks in advance! edit : further trial , error has led less optimal functional solution in for...

USB FPGA Firmware ISP1362: Enumeration, Empty OUT Packet -

i writing firmware interface fpga mat-lab data acquisition , control. setup far fpga (de2-115) -> isp 1362 -> pc (windows). using generic "usb view" program view device descriptors. i've hit wall. usb host resets device, sends 8-byte "get descriptor" request. fill in ep 18 bytes , validate it. 20? microseconds later isp1362 flags interrupt , status of in ep is empty (data sent, right?). more microseconds later there 0 length packet in out ep. clear out ep. after 220 microseconds host resets device again. darn 0 length packet mean? summarize: receive bus reset, receive descriptor, send description, receive empty packet, receive bus reset. also, there program let me @ raw data interaction of this? want see host (pc) sees. blength = 8'h12 ; bdescriptortype = 8'h01 ; bcdusb = 16'h0200 ; bdeviceclass = 8'h00 ; bdevicesubclass = 8'h00 ; bde...

python 2.7 - RDS - boto - how to get results from read_replica_dbinstance_identifiers? -

according understanding of boto.rds.dbinstance class, should able variable named read_replica_dbinstance_identifiers object, cannot , don't understand why. know doing wrong. when run rds-describe-db-instances --quiet --show-xml can find read replicas in xml: <readreplicadbinstanceidentifiers> <readreplicadbinstanceidentifier>my-dbinstance-id-1</readreplicadbinstanceidentifier> <readreplicadbinstanceidentifier>my-dbinstance-id-2</readreplicadbinstanceidentifier> </readreplicadbinstanceidentifiers> but when use boto same information test script 1 below, get: attributeerror: 'dbinstance' object has no attribute 'read_replica_dbinstance_identifiers' the script looks this: import boto dbinstanceid = 'my-dbinstance-id' rds = boto.connect_rds() instances = rds.get_all_dbinstances(dbinstanceid) in instances: property, value in vars(i).iteritems(): print property, ": ", value print ...

mysql - mysql_fetch_assoc to echo linked table results with php -

using php, trying link results 3 tables connected same value. each dynamic set of related results repeat while loop on page. result like: artist-> series1->piece1, piece2 series2->piece3, piece4 artists , series tables share matched column named 'artist'. series , piece table have matched column name 'series'. know these tables linked through same matched value in database on page cascade delete working. currently shows series echo repeat loop no artist or piece related on either side. so: http://www.exhibitjewellery.com/artistindex.php whether mysql_fetch_assoc right way, not sure. confused whether tables linking correctly @ or if problem how have divided body section formatting. have feeling multidimensional array may or nesting tables haven't quite grasped how details combine throughout each section of code. please help! php above head: <?php mysql_select_db($database_connectmysql, $connectmysql); $query_artistrecordset = "sel...