Posts

Showing posts from February, 2011

unity3d - Animated model from 3Ds Max doesn't perfom animation -

i have 3d model created in 3ds max embedded animation. after importing model unity 3d doesn't perform animation. is there method or property of model run animation? if click on model in project view, should open import options in inspector. 1 of tabs called "rig". try changing animation type legacy.

angularjs - ngProgress plugin is making http calls in Jasmine unit tests -

i have situation in unit test ngprogress plugin making http calls, messing unit tests getting unexpected errors: uncaught error: unexpected request: http://upda... here stack grace > request(), app.js:35 deferred.promise.then.wrappedcallback(), > angular.js:10597 deferred.promise.then.wrappedcallback(), > angular.js:10597 anonymous(), angular.js:10683 $get.scope.$eval(), > angular.js:11576 $get.scope.$digest(), angular.js:11421 > $get.scope.$apply(), angular.js:11682 updatecount(), > ngprogress.min.js:8 anonymous(), ngprogress.min.js:8 you can mock out in unit tests redefining empty module angular.module('ngprogress', function() {}); make sure testing code mocks lib out loaded browser after file defines module, or excluded ngprogress file loading altogether.

emacs - Links between org files -

say have 2 org files, file1.org , file2.org on disk (let's assume in same directory). how can create link on file1.org file2.org ? once have link on file1.org , let's assume have cursor (point) sitting on link. how can tell emacs show me corresponding file? finally, if want create link specific item of file2.org ? use c-c c-l shortcut create link , use syntax file:./file2.org and use c-c c-o cursor on link visit link. to link specific item, use file:projects.org::*task title heading search in org file the doc: http://orgmode.org/org.html#external-links you can search words: file:projects.org::some words

c# - How to extract multiple parameters from a binary chromosome -

i trying use aforge.net genetics library create simple application optimization purposes. have scenario have 4 input parameters, therefore tried modify " optimizationfunction2d.cs " class located in aforge.genetic project handle 4 parameters. while converting binary chromosomes 4 parameters (type = double) not sure if approach correct don't know how verify extracted values. below code segment code differs original aforge code: public double[] translate( ichromosome chromosome ) { // chromosome's value ulong val = ((binarychromosome) chromosome).value; // chromosome's length int length = ((binarychromosome) chromosome).length; // length of w component int wlength = length/4; // length of x component int xlength = length / 4; // length of y component int ylength = length / 4; // length of z component int zlength = length / 4; // w maximum value - eq...

Phpstorm. Can't access to mysql server through SSH tunnel (connection is closed by foreign host) -

Image
sorry mistakes i've made, i'm not englishman. i use vagrant deploy remote virtual machine web server configured use :private_network, ip: "192.168.10.10" . on machine installed nginx, php, mariadb etc. recently, start use phpstorm main ide. i'm trying configure access remote database server, fail. please, see screens additional information. to check ssh , mysql server access tried following: $ ssh vagrant@192.168.10.10 #ok $ mysql -h localhost -p 3306 -u root -p #ok (it's run on remote machine) $ telnet -l root localhost 3306 #also run on remote machine, output: 5.5.5-10.0.7-mariadb-1~precise-log%how)b3s?�o|g*=63=yi#qmysql_native_password connection closed foreign host. mariadb configuration file seems ok. changed bind-address in /etc/mysql/my.cnf 0.0.0.0 . i tried set different configuration data, like: localhost:8080 instead of 169.168.10.10:80, double check password in ssh tunnel window, nothing. please, me.. in case had enable ...

vb.net - How t insert a data to the database using query -

so have codes gets wrong syntax error.. dont know whats wrong can me?? im newbee in vb. programming private sub button1_click(byval sender system.object, byval e system.eventargs) handles button1.click try dim sqlquery = "insert sample (firstname,middlename,lastname,gender,age,year level,date of birth,date enrolled,citezenship,religion,address,telephone no,average grade,father,fathers occupation,fathers address,mother,mothers occupation,mothers address,guardian,guardians address,family income,payed amount,balance) values ('" & txtfname.text & "','" & txtmname.text & "','" & txtlname.text & "','" & combosex.text & "','" & comboage.text & "','" & comboyear.text & "','" & txtdateofbirth.text & "','" & txtdateenrolling.text & "','" & txtcitezen.tex...

javascript - Invalid assignment left-hand side. (line 1) -

i'm making adwords script (it uses javascript) , gives me error: "invalid assignment left-hand side. (line 1)" . can't find error. please help? thanks function main() { var todaydate = getdatestring(new date(),'h'); logger.log('son las '+todaydate+' horas'); if (todaydate = 11) { var spreadsheet = spreadsheetapp.create("cpc log "+getdatestring(new date(), 'dd-mm-yy')); var sheet = spreadsheet.getactivesheet(); var report = adwordsapp.report("select campaignname, adgroupname, keywordmaxcpc adgroup_performance_report during today"); report.exporttosheet(sheet); var expectedratio = 30; var cpcmultiplier = 1.2; cpcmodifier(expectedratio,sheet,cpcmultiplier); } } i add complete code, if needs take @ it: function main() { var todaydate = getdatestring(new date(), 'h'); logger.log('son las ' + todaydate + ' horas...

Python Matplotlib remove xlabels but not grid -

is there way remove labels of x axis, not grid lines? both solutions remove labels removed grid lines. i tried: axes.get_xaxis().set_visible(false) , axes.get_xaxis().set_ticks([]) try this: axes.xaxis.set_tick_params(label1on=false)

html - JavaScript - RegEx for time or a specific string -

in form have field asks user time me call them. the code input follows (excluding <form> tags): <p> <label>when can call you?:</label> <br> <input type="text" name="contactconvenience" placeholder="hh:mm or &#34;anytime&#34;" onchange="checkcalltime()"> </p> <div id="callbackwarn"></div> i want use regex check whether user has entered time in format hh:mm or specific string "anytime", code i'm using doesn't work. var callback = /^\d{2}([:]\d{2})$/; var callbackanytime = str.match(/anytime/g); function checkcalltime() { var valid = true; if ((!callback.test(document.bookingsform.contactconvenience.value)) || (!callbackanytime.test(document.bookingsform.contactconvenience.value))) { document.bookingsform.contactconvenience.style.border = "1px solid red"; document.getelementbyid("callbackwarn"...

oracle11g - XML or String function in Oracle -

i need find solution following. have xml files stored in 1 of columns of table , need extract hasnumber same file following conditions. if there file got <identification> along <impurities> or <additives> no hasnumber selected. if there <identification> without impurities or additive tag hasnumbers should selected. 1) don’t select hasnumber following condition <identification><impurities> <hasnumber>1113-22-1</hasnumber> <identification> <'additives> <hasnumber>1113-22-1</hasnumber> 2) select hasnumber following condition <identification> <hasnumber>1113-22-1</hasnumber>

JSON-RPC call from iOS homescreen bookmark? -

would possible have bookmark on iphone homescreen calls url url-encoded json rpc? if yes, way there on iphone? enter manually in safari , add bookmark? yes! why not. if can open url in safari, can save bookmark.

Angularjs (1.2.10) $http.post throws 404 error while posting from phonegap to node.js server (cors request) -

Image
i trying post comment nodejs server getting 404 error. have used cors module on server side handles cors request. using typescript. cors module: https://github.com/troygoode/node-cors var app = express(); app.use(cors()); (<any>app).options('*', cors()); // include before other routes app.use((<any>app).router); following endpoint code app.post("/api/object/addcomment/:id", authenticatebearer(), (req, res) => { var id = this.parseint(req.params.id); var comment: string = req.body.commenttext; if (this.isnullorundefined(id) && this.isnullorundefined(comment)) return this.sendinputerror("input empty.", res); (new om.objectmanager()).addcomment(req.user.userid, id, comment, (err, commentid) => { if (err) return this.sendinternalerror(err.message, res); return res.json(commentid); }); }); i calling above endpoint angularjs app, myapp.config(function ($httpprovider) { $http...

php - how i require session for a function -

i have in sandbox many of function, of function public, , other's want them website member's. example function want website members only function get_page ($dbc, $pg) { // database connection, our query $q = "select * pages name = '$pg' , status = 1 limit 1"; $r = mysqli_query($dbc, $q); $page = mysqli_fetch_assoc($r); echo '<div class=entry>'; echo '<h1>'.$page['title'].'</h1>'; echo '<div class="content_body">'.$page['body'].'</div>'; echo '</div>'; } is there way that? "how require session function" use following, example: if(!isset($_session['session_name'])){ die(); } and include session_start(); inside of files used, , @ * top. ( * depending on condition). for more information on sessions, visit following: http://www.php.net/man...

registry - Adding a right click menu option when highlighting text -

when highlight text, add menu option for eg: if highlight text should append text url , open in browser. i.e. if highlight gizmo, there should right click menu option 'open in youtube' , browser should go http://www.youtube.com/results?search_query=gizmo if open chrome browser extensions, consider trying: simple = select + search https://chrome.google.com/webstore/detail/simple-select-+-search/aagminaekdpcfimcbhknlgjmpnnnmooo?utm_source=gmail i able customize local dbs use. convenient.

ios - Custom UITableViewCell, button in cell not working -

i have uitableviewcontroller i'm working custom uitableviewcell. cell contains image, labels , buttons. working expected except of buttons. when pressing button, nothing happens. cell gets selected. i made connection in ib button custom tweettableviewcell class. @property (weak, nonatomic) iboutlet uibutton *cellfollowbutton; - (ibaction)followbuttontappedoncell:(id)sender; i'm writing text console in followbuttontappedoncell action. when pressing button, nothing happens. seems me view consumes tap before arrives button. make more confusing... when add button in may uitableviewcontroller programatically this: [cell.cellfollowbutton addtarget:self action:@selector(customactionpressed) forcontrolevents:uicontroleventtouchdown]; [cell addsubview:cell.cellfollowbutton]; ...it works. read in other articles disabling "user interaction enabled" solved similar problems, doesn't in case. i'm sure many others must have run problem when using buttons in uit...

c++ - Problems with pointers char **words; -

so i'm deleting pointers in functionr resetline(), , assigning them in function breakline(). i'm getting core dump, think i'm either deleting pointers wrong, or trying use null pointer somewhere in program. although can't see problem myself. appreciated! #include"online.h" //public funcions----------------------------------------------------- //creator function oneline::oneline() { oneline = ""; wordcount = 0; } //destructor oneline::~oneline() { //if allocation has occurred free words if(wordcount > 0) { delete [] words; } } istream& oneline::readline (istream& is) { //call resetline free memory , reset oneline , wordcount empty string , 0 respectively char test[12] = "heythere"; resetline(); //read 1 line (in case, file stream) , store in oneline { if(!getline(is, oneline)) // if eof reached return is; }while(oneline.empty()); //check empty lines //return return is...

python - Efficiently Searching Nested Lists -

i have csv file full of tax data. read data nested lists, formatted this: ['alabama', 'single rate', '0.02', '0.04', '5'] ['alabama', 'single bracket', '500', '3000'] ['alabama', 'couple rate', '0.02', '0.04', '0.05'] ['alabama', 'couple bracket', '1000', '6000'] i able input state , marital status , return relevant lists of rates , brackets. i've done here, feel there much simpler approach. suggestions? search_state = 'alabama' search_status = 'single' rates = [] brackets = [] sublist in cleaned_data: if search_state in sublist[0] , search_status in sublist[1]: if 'rate' in sublist[1]: rates = [eval(x) x in sublist[2:]] if 'bracket' in sublist[1]: brackets = [eval(x) x in sublist[2:]] you better served nested dictionary: rates={'alabama':{'single rate...

PHP Echo shorthand is removing all forward slashes -

here section of code should add background image label, reason when start using <?= shorthand, of forward slashes being removed: <label for="<?=$result_id?>_checkbox" id="<?=$result_id?>_label" style="background-image:url("<?=$img?>");" /> here code generates url: $img = $_session['root_dir']."data/images/".$folder."/".$result_imageset."/".str_replace(" ", "%20", $result_jpg); this $img variable generates: http://localhost:1234/ppa/data/images/20140130/0/rmeuvh3.jpg edit: echo var_dump(ini_get('short_hand_tags')); produces: bool(false) although, following works... <div class="jpg"><?=$result_jpg?></div> have @ source code of page being generated. works me, in sense forward slashes not removed. however there problem code: style="background-image:url("<?=$img?>")...

Python mapping between lists for duplicates -

i have 2 parallel lists following: list1 - list2 1 -------- 1 -------- b 1 -------- c 2 -------- d 2 -------- d 2 -------- d 2 -------- e 2 -------- 3 -------- 3 -------- l 3 -------- m i looking fast way in python count how many attributes of list 2 map different attributes in list 1. in example ouput like: a maps 1, 2, 3 use zip() pair values both lists , collections.defaultdict() produce mapping: from collections import defaultdict mapping = defaultdict(set) v1, v2 in zip(list1, list2): mapping[v2].add(v1) now have dictionary mapping values list 2 sets containing unique values list 1; can print these match sample output with: for v2 in sorted(mapping): print '{} maps {}'.format(v2, ', '.join(map(str, sorted(mapping[v2])))) for sample input, produces: >>> mapping defaultdict(<type 'set'>, {'a': set([1, 2, 3]), 'c': set([1]), 'b': set([1]), 'e': set([2]), 'd': set([2]...

arrays - Haskell - Error map function returning a list -

what want apply stoline function on each element ( string ) of list passed stomap .. type of stoline : stoline :: string -> [obj] . here code : stomap :: [[string]] -> [obj] stomap [[val]] = stoline val stomap (val:vals) = map (\a -> stoline a) val ++ ... example of data passed stomap : [["0","133","2"],["6","0","0"],["656","0","3"]] . error : couldn't match expected type obj actual type [obj] in return type of call of stoline . problem map function returns list (and shouldn't!), don't know how avoid problem.. your first case unnecessary, , there's error in second case: map (\a -> stoline a) val ++ ... val here [string] , map (\a -> stoline a) val [[obj]] . since you're using ++ combine rest of results, ultimate result of type [[obj]] , not [obj] . let's rework it: stomap :: [[string]] -> [obj] stomap lolos = conc...

javascript - Is it possible to permanently disable html buttons? -

i'm new programming don't know much, wondering if there way permanently disable button. i've used this: document.getelementbyid("whatevertheidis").disabled = true; but @ parts of document reverse using this: document.getelementbyid("whatevertheidis").disabled = false; i need can override that, , permanently disable button. there way this? there 1 way disable or enable button. so, if you're looking separate way permanently disable button (yet leave visible) override setting .disabled true - there no such property or feature button. there many ways fix code. example, when want permanently disable button, can set custom attribute on button , everywhere think enabling button, can check custom attribute , if it's set, don't enable button. other options consider hiding button or removing button dom. you can fix code making own permanent disable in own code. if, rather manipulating .disabled property directly, switch ...

ASP.NET Web Api: How to pass an access token (oAuth 2.0) using URL parameter? -

do have idea how can use, access_token generated default asp.net web api 2 oauth 2 authorization mechanism, in url parameters. able authorize sending request authorization header this: accept: application/json content-type: application/json authorization: bearer padksjwmv927u... what want enable authorization through url parameter this: https://www.domain.com/api/mycontroller?access_token=padksjwmv927u... well - agree header better alternative - there of course situations query string needed. oauth2 spec defines well. anyways - feature built katana oauth2 middleware: http://leastprivilege.com/2013/10/31/retrieving-bearer-tokens-from-alternative-locations-in-katanaowin/ public class querystringoauthbearerprovider : oauthbearerauthenticationprovider { readonly string _name; public querystringoauthbearerprovider(string name) { _name = name; } public override task requesttoken(oauthrequesttokencontext context) { var value =...

python - Field added to django querysets not working in django-tables2 -

i have set of imported bank account entries oredered date , sequence number within each date. i'm using django-tables2 display data, i'm adding running total column calculate before rendering view. to i'm trying add field query set following code: import django_tables2 tables django_tables2 import requestconfig .models import bank, bankimportfile, importfileentry ... other imports class banklistingtable(tables.table): memo = tables.column(verbose_name = 'description') total = tables.column(verbose_name = 'running total') class meta: model = importfileentry attrs = {'class': 'paleblue'} def bank_listing(request, bankname): bank = get_object_or_404(bank, pk=bankname) qs = importfileentry.objects.filter(account=bank(bank)).order_by('date', 'seq') total = 0 row in qs: total += row.amount row.total = total table = banklistingtable(qs) requestconfig(req...

c - Need explain a code in embedded program -

i new embedded programming, i'm examining code below , trying understand how work, got stuck. the program used count , print out numbers 0 9. so can please explain line const uint8_t ? why need array of heximal number here? #include <avr/io.h> #include <util/delay.h> #include "debug.h" const uint8_t segments[10] = {0xfc,0x60,0xda,0xf2,0x66,0xb6,0xbe,0xe4,0xfe,0xf6}; int main(void) { uint8_t i=0; //s int g; init_debug_uart0(); /* set port pins outputs */ ddra = 0xff; (;;) { porta = segments[i]; printf("%d\n\r",i); _delay_ms(1000); if (i >=9) { fprintf(stderr , "count overflow\n\r"); = 0; scanf("%d", &g); }else i++; } } and final question, know sources read embedded programming? i'm learning iimatto, 8-bits processor , has 32-registers, designed in harvard architecture , has 1 level pipeline. ...

Finding mean of ascii values in a string MATLAB -

the string given follows: scrap1 = le h ke fd zyq b ner you'll notice there 2 blank spaces indicating space (ascii 32) in each row. need find mean ascii value in each column without taking account spaces (32). first convert double(scrap1) how find mean without taking account spaces? if it's ascii 32 want omit: d = double(scrap1); result = mean(d(d~=32)); %// logical indexing remove unwanted value, mean

ruby on rails - Getting -0200 in DateTime from MySQL/Database -

i'm getting column type datetime , comes mysql database. but can't %h:%m:%s (it's showing me 00:00:00 ) because guess going wrong here. see: = debug current_user.last_access_at.to_s output: '2014-01-20 11:15:40 -0200' what -0200 there? , plus, how can time correctly? note i'm using ruby on rails. this timezone offset. it means have setting -2 hours timezone 0. for more useful format can use strftime(format) instead of to_s

java - How to disable spring destruction callback on object returned from controller -

edit: turned out else in configuration whenever return object inferable destruction method rest controller, returned object gets closed, possible disable this? for example if have object this: public class myobject implements autocloseable { // json private @jsonvalue string foo = "hello world"; public void close () throws exception { system.out.println ("close()"); new throwable ("stack trace").printstacktrace (system.out); } } and controller this: @controller public class mycontroller { private map<string, myobject> objects = new hashmap<> (); @postconstruct private void populate () { objects.put ("one", new myobject ()); objects.put ("two", new myobject ()); } @requestmapping ("/hello/{id}") @responsebody public myobject test (@pathvariable ("id") string id) { return objects.get (id); } } spring call myobject.close() after returned contro...

javascript - How can I add custom bullets to tinyMCE? -

i want add few option bullets dropdown on tinymce, possible? i want add ► type of bullet , different color options. (red, blue, etc...) yes. in tinymce config, need specify: style_formats: [ { title: 'custom bullet', selector: 'ul', classes: 'custom1' } ], from there, need specify styling in css: .custom1 { list-style-image: url('custom1.png'); } see more info: https://www.tinymce.com/docs/configure/content-formatting/#style_formats

php - ZF2 - Separating one form in many tabs -

i need help.. have unique form multiples fieldsets, , need separate fieldsets in tabs.. so, tried in view (form variable whole form): $form = $this->form; $customfieldset = $form->get('customfieldset'); $form->remove('customfieldset'); it works, fieldset form in $customfieldset.. but, can't render this! when try: echo $this->form($customfieldset); //or echo $this->forminput($customfieldset); //or $this->formcollection($customfieldset); none of works.. i'm doing right? how can it? thank much. to achieve result want (using form across several tabs, better construct form differently, based on tab's number. example, form constructor method below: <?php namespace application\form; use zend\form\form; // form model class yourform extends form { // constructor. public function __construct($tabnum) { // define form name parent::__construct('contact-form'); // set post method form $...

jquery - Showing a form and confirmation page in a modal / overlay window -

i'm building user registration modal / overlay form first time (using jquery). i'm bit of jquery noob, , i'm hoping can me question. presently, form displays in modal should. however, right now, modal closes on form submit , user taken 'full version' of confirmation page. ideally, confirmation page show in modal well. this standard html form, , validation handled server-side. i'm assuming need add kind of onclick event form submit button, i'm not sure should be. can point me in right direction? for that, i'd have submit button wired display processing indicator of sort, , make web service call. process response web service call, , update dialog content display either confirmation details, or else error message depending on result.

sql - Select sport results ordering by medals -

i have table: sport country place ski swe 1 ski nor 2 ski rus 3 luge swe 1 luge usa 2 luge ger 3 bob nor 1 bob rus 2 bob ger 3 where place 1 gold, 2 silver, 3 bronze now normal displying scenario list of countries, first max gold, silver bronze. exampe be: swe g:2 s:0 b:0 sum:2 rus g:0 s:1 b:1 sum:2 usa g:0 s:1 b:0 sum:1 nor g:0 s:0 b:2 sum:2 what sql query list of countries ordering way? regards select country, sum(case when place = 1 1 else 0 end) gold, sum(case when place = 2 1 else 0 end) silver, sum(case when place = 3 1 else 0 end) bronce, count(*) allmedals tab group country for ordering result might do order sum(4 - place) desc -- weighted medals

Plotting level plot in R -

Image
i have 12 variables, m1, m2, ..., m12 , compute statistic x . df = data.frame(model = paste("m", 1:28, sep = ""), x = runif(28, 1, 1.05)) levels = seq(0.8, 1.2, 0.05) i plot data follows: each circle (contour) represents level of statistic "x" . 3 blue lines represent 3 different scenarios. dataframe included in example represents 1 scenario. blue line join values of models m1 m28 specific scenario. is there tool in r allow such plot? tried contour() library(mass) contours not drawn perfect circles. any appreciated. thanks! here ggplot solution: library(ggplot2) ggplot(data=df, aes(x=model, y=x, group=1)) + geom_line() + coord_polar() + scale_y_continuous(limits=range(levels), breaks=levels, labels=levels) note little confusing because of names in data frame. x y variable here, , model real x , graph scale label seems odd. edit: had set factor levels model in data frame plot in correct order.

objective c - RestKit - Repeat request if auth timeout -

i'm talking .net web api 2 service, using it's default "individual user accounts" authentication. i'm using restkit 0.22.0. my issue when session timeout occurs, want have ios app re-authenticate stored credentials , replay request. way i've found like this - asked year ago. not think answer should check if status code 401, re-authenticate, retry request in every failure block . that's lot of copy , pasting! is there better way accomplish want? call common method failure block takes required inputs. preferably might want have multiple common methods capable of verifying response details , restarting process automatically (so 1 get, 1 post, ...). pseudo code - (void)do info: { ... calculate method specifics call general method ... [self getobjectsatpath:urlarg parameters:p success:s]; } - (void)getobjectsatpath:urlarg parameters:p success:s { [rk getobjectsatpath:urlarg param...

jquery - cakePHP dynamicaly adapting input JqueryUI suggestions how? -

i'm trying input suggestions. in it's self nothing special jqueryui able pretty out of box... where ran trouble providing jqueryui list of possible suggestions need provide... table use big dumped whole view... can't figure out how thake value user starts type field , give him first 100 suggestions remain... hope reduce load on db , speed loadtime of page because cakephp doesn't have pack whole table view each time user requires form! the code have far: (every helping hand appreciated! thx...) controller: <?php app::uses('appcontroller', 'controller'); class locationsmanagercontroller extends appcontroller { public $helpers = array('js'); public $components = array('requesthandler'); public function index() { } public function updatesuggestions() { /* * place passed value $locationname */ $this -> loadmodel('location'); if ($this -> requesthandler -> isajax()) { $this -> loc...

java - onActivityResult not being trigger from Alert Dialog FIXED -

im adding ability upload videos in addition photos in app. accomplish this, when click attach button b2 instead of image chooser loading loads alert dialog showdialog() ask upload (video or photo) upon selecting, loads image or video selector. problem when call method dopositiveclick(activity activity, int requestcode) inner class onactivityresult not being triggered , no data being returned. feel has being called inner class myalertdialogfragment i'm unsure how handle it. thank you. public static final int request_code = 0, result_photo = 1, result_vid = 2; void showdialog() { dialogfragment newfragment = myalertdialogfragment.newinstance( r.string.alert_dialog_two_buttons_title); newfragment.settargetfragment(chatroomfragment.this, request_code); newfragment.show(getfragmentmanager(), "dialog"); } @override if(requestcode == request_code && data.getdata() != null) { log.v("response...

web services - php pass variable amount of soap params to soap client -

i have php soap client generates xml envelope , request. need pass in variable amount of nodes request. not know how many arguments passed in needs dynamic. $output = $this->_client->updaterequest( new soapparam($this->_memberid, "memberid"), new soapparam($this->_userid, "userid"), new soapparam(functions::getremoteip(), "ipaddress"), new soapparam($this->_macaddress, "hardwareid"), new soapparam($data->applicationid, "applicationid"), new soapparam($application,"application"), new soapparam($applicants,"applicant") <----- array ); i need in request: <updaterequest> <memberid>1</memberid> etc etc... <applicant> <--------- repeating node ..... </applicant> <applicant> ..... </applicant> <applicant> ...

Should I clear unused javascript arrays? -

i'm working on page that, eventually, have more 100 arrays, few of used @ given time. at moment, i'm populating arrays global variables, suspect inefficient in terms of memory use. should change code clear arrays when not being used? if so, best way this? i'd guess var myarray = new array() perhaps there's better option. unless have many thousands of objects in arrays, don't need worry. don't prematurely optimize code; browser quite @ handling lots of small objects. if memory become issue or notice performance issues, can reassign new array variables: myarray = []; the garbage collector clean objects dereferenced. in broader case, if there's no need keep references objects, don't need arrays begin with. i.e., if never access elements put in arrays second time, remove arrays , don't bother assigning data.

c# - CloudTable ExecuteQuery async -

is possible run executequery asynchronously? consider following code: public virtual myentity mymethod(string parm1, string parm2) { string querystring = tablequery.combinefilters(tablequery.generatefiltercondition("partitionkey", querycomparisons.equal, parm1), tableoperators.and, tablequery.generatefiltercondition("rowkey", querycomparisons.equal, parm2)); tablequery<myentity> query = new tablequery<myentity>().where(querystring); return tenanttnstable.executequery(query).tolist().firstordefault(); } is possible make async method , use await on executequery call? try task.run . should able run non-async code asynchronously , await result.

javascript - Trying to remove jQuery -

this question has answer here: using queryselectorall retrieve direct children 8 answers there site : http://youmightnotneedjquery.com/ : , angularjs application, remove jquery. reason still need jquery , can't use jqlite angularjs comes because jqlite not support selectors based on classes. the issue queryselectorall() when try run this: el.queryselectorall('> .content') i this: syntaxerror: failed execute query: '> span' not valid selector. is there way write selector native dom methods? if forced use jquery find .content first level childs, use xpath instead, exact same thing: var xpathquery = "./*[@class='content'"; xpathquery += " or starts-with(@class,'content ')"; xpathquery += " or contains(@class,' content ')"; xpathquery += " or substring(@class, st...

objective c - NSDocument isDocumentEdited and undo -

in document-based application, every user action add entry in undomanager, including selection, meaning 'undo' restore previous selection. some times user open document, view items selecting them , close document, if user didn't 'alter' anything, user asked save changes, annoying , can misleading user. it seems document's dirty flag (isdocumentedited) automatically set when registering undo actions, there way can prevent particualr undoable actions, such selection change? thanks! you should able call -setactionisdiscardable:yes on undomanager when register actions don’t need saved.

compiler errors - C# - Why can't I change my int variables in another class? -

okay, have following variables: public static int cookiecount = 0; public static int cursorcount = 0; public static int grancount = 0; public static int farmcount = 0; public static int minecount = 0; public static int shipcount = 0; public static int alccount = 0; public static int portalcount = 0; public static int timecount = 0; public static int clickgain = 1; public static int cursorgain = 1; public static int grangain = 5; public static int farmgain = 10; public static int minegain = 50; public static int shipgain = 100; public static int alcgain = 500; public static int portalgain = 10000; public static int timegain = 123456; public static int cursorprice = 20; public static int granprice = 100; public static int farmprice = 500; public static int mineprice = 1000; public static int shipprice = 10000; public static int alcprice = 50000; public static int portalprice = 5000...

music - Automatically play a m3u file on website? -

i'm trying play m3u file in background of website (playing when no 1 on it). need way set default volume of m3u file. how possible? i've tried <embed src="listen.m3u" autostart="true" loop="false" hidden="true"> , did not work. i'm running website off own apache server , have index , listen.m3u file in same folder. (website).com/listen.m3u works. have yet find out how control volume though... i'm guessing through js?

java - Attempting to set JLabel icon to image directory, null pointer exception instead -

exception in thread "awt-eventqueue-0" java.lang.nullpointerexception @ javax.swing.imageicon.(imageicon.java:205) jlabel background = new jlabel(new imageicon(getclass().getresource("/resources/splashscreen.jpeg"))); the above line exact line throwing exception, , makes me believe location of file not correct, have tried numerous things no success. the folder structure seems correct, image within resources folder within project folder, , folder(with image) next src folder not within. application has have ability of being used offline otherwise use url. there known bug in eclipse ide? figured out. seems putting file in wrong location, putting .class files solved problem. not sure if proper solution or work around unfortunately. had go basics .java files compiled , .class files running, , need backtrack current working directory. actually, have put "resource" folder source folder in case.

python - Animating a Quadmesh from pcolormesh with matplotlib -

as result of full day of trial , error, i'm posting findings else may come across problem. for last couple days, i've been trying simulate real-time plot of radar data netcdf file work gui i'm building school project. first thing tried simple redrawing of data using 'interactive mode' of matplotlib, follows: import matplotlib.pylab plt fig = plt.figure() plt.ion() #interactive mode on in range(2,155): #set number of rows in quadmesh, start @ 2 overlap plt.hold(true) print #please note: use example must compute x, y, , c previously. #here take slice of data i'm plotting - if real-time #plot, insert new data plotted here. temp = plt.pcolormesh(x[i-2:i], y[i-2:i], c[i-2:i]) plt.draw() plt.pause(.001) #you must use plt.pause or figure freeze plt.hold(false) plt.ioff() #interactive mode off while technically works, disables zoom functions, pan, , well, everything! for radar display plot, unacceptable. see soluti...

javascript - validate array of checkbox using getElementById -

i've got bunch of checkboxes defined array: <input type="checkbox" value="1" id="courseinfo[]">content <input type="checkbox" value="2" id="courseinfo[]">reputation <input type="checkbox" value="3" id="courseinfo[]">duration <input type="checkbox" value="4" id="courseinfo[]">career <input type="checkbox" value="5" id="courseinfo[]">recommended <input type="checkbox" value="6" id="courseinfo[]">interests <input type="checkbox" value="7" id="courseinfo[]">other i trying see if last 1 (value=7) checked, tried: q2 = document.getelementbyid("courseinfo[6]").value; that doesn't seem work. how can access 7th 1 in array , check if been checked? i want use pure javascript. you don't have id attribute ...

vba - SQL UPDATE/WHERE Help... Updating columns not defined by WHERE -

basic sql update , access 2007 vba question. can explain me why query updating boxtype "60ct shipper tray" , not 60ct shipper pieces declared in where statement? thank you! elseif me!txtboxtype = "60ct shipper tray" 'cases use 60tray more complicated. use 1 each of base, header, , display 'aswell 3 shelves. qdf.sql = "update tblboxlist set qty = (qty+(" & me!txtqtychange & ")) boxtype = '60ct shipper base' or '60ct shipper header' or '60ct shipper display';" qdf.execute dbfailonerror you need include field name in each of conditions or together. use select query work out where clause logic. select * tblboxlist boxtype = '60ct shipper base' or boxtype = '60ct shipper header' or boxtype = '60ct shipper display' you might prefer approach instead. where boxtype in ( '60ct shipper base', '60ct shipper header...

javascript - Determine what CSS selectors are been applied to an element -

is there way determine if selector been applied given element? i know it´s possible iterate on css selectors, , test if each 1 applicably or not. i´m not sure if way firebug , other inspector it. edit: need way dynamically, js. you can check if element instance matched selector using document.queryselectorall , array.prototype.indexof : function elementmatchesselector(element, selector) { return array.prototype.indexof.call(document.queryselectorall(selector), element) > -1; } of course works modern browsers support aforementioned methods. alternatively can use element.matches : function elementmatchesselector(element, selector) { var fn; if (!element) { return false; } fn = element.matches || element.mozmatchesselector || element.msmatchesselector || element.webkitmatchesselector; if (fn) { return fn.call(element, selector); } return false; }

Matlab Issue with saving figure to an image file -

Image
i plotting equations figures in matlab , trying save figure screws saved image. this how image displayed matlab figure: however, when try save image gets screwed , comes out this: is there way me save properly? i have tried following commands , none of them work. print(gcf,'-dbmp', 'eqn') saveas(gcf,'eqn.bmp') i appreciate help! thanks! to faithful reproduction of see on screen, have use getframe , frame2im commands follows, f = getframe(gcf); [im,map] = frame2im(f); if isempty(map) imwrite(im,'figure.bmp'); else imwrite(im,map,'figure.bmp'); end if use saveas or print , file different dimensions , objects scaled differently, cause equations drawn incorrectly. operation of getframe ensures file resolution reflects have on screen. documentation: resolution of captured frames the resolution of framed image depends on size of axes in pixels when getframe called. getframe command takes snapsho...

osx - Can't run psql command, keep getting the same error -

i installed posgresql homebrew , when go on type command psql i following error: dyld: library not loaded: /usr/local/opt/readline/lib/libreadline.6.2.dylib referenced from: /usr/local/bin/psql reason: image not found [1] 69711 trace trap psql does have idea what's wrong? i getting exact same error, above answers didn't work me. had reinstall postgresql. brew reinstall postgresql

html - Twitter Bootstrap 3.1 Nav-stacked Spacing -

i'm quite new @ coding html , sort of business decided going use built , sturdy api. therefore, chose twitter bootstrap 3.1 i've had some prior experience it. anyway, current nav-stacked looks like. it's css butchered wanted collapsible. http://i.imgur.com/j8fpsj6.jpg and here code particular section of code. got rid of repeating parts save space. <div class="col-xs-3 sidebar" id="asesidenav"> <!this left vertical nav bar> <div class="navbar navbar-inverse" id="asesidenav"> <div class="collapse navbar-collapse" id="asesidenav"> <ul class="nav nav-stacked" id="menu-bar"> <!-- notice "nav-stacked" class added here --> <!-- add panel class workaround collapsing menu items in bootstrap --> <li class="panel dropdown"> ...