Posts

Showing posts from March, 2013

c++ - wxWidgets: How to adjust size of indent of wxDataViewCtrl? -

i using gtk port of wxwidgets 3.0.2. i have wxdataviewctrl displaying it's data model in tree-like fashion. possible make size of how child nodes indented underneath parent node bigger? i know there's wxdataviewctrl::setindent() method, doesn't seem anything. indeed, when @ source code setindent(), calls out dosetindent() method , gtk, method no-op :-(. currently impossible, seems simple using gtk_tree_view_set_level_indentation() , i've done this , setindent() work in wxwidgets 3.1.0 released soon. in meanwhile, can same thing in own code using wxwindow::gethandle() retrieve gtktreeview widget control.

python - indexing a dictionary with key hash values -

i going through learn python hard way, , find self stuck on dictionary exercise: http://learnpythonthehardway.org/book/ex39.html what gives me problems following code: def hash_key(amap, key): """given key create number , convert index amap's buckets.""" return hash(key) % len(amap) how can sure wont duplicate values hash_key function? since modulo being used, prevents hash() returning values such after modulo used on them return same hash_key. ex. len(amap)=10 , hash(key1) = 20 , hash(key2) = 30 , therefore hash_key both dict keys 0, though not equal. i'm having trouble grasping concepts behind hashing, if have reading material suitable skill level, please share. i'm not afraid work hard. thank help. the hashmap, proposed in linked exercise, intends generate key-collisions. the data structure list of lists, key's hash-modulus value determines 2nd-level list data goes. imagine structure array of n ...

Sending email with attachments using Gmail API in Android (execute() hangs) -

everything seems work long attachment small. however, try attach larger file (7mb example), execute() method of send hangs. tried go on documentation , if understand correctly should use send api performs upload however, didn't figure should provide these parameters. here email generation method : public mimemessage tomimemessage(string from, context context) throws messagingexception { properties props = new properties(); session session = session.getdefaultinstance(props, null); mimemessage mimemessage = new mimemessage(session); mimemessage.setfrom(new internetaddress(from)); mimemessage.addrecipient(javax.mail.message.recipienttype.to, new internetaddress(recipient)); mimemessage.setsubject(subject); mimebodypart mimebodytext = new mimebodypart(); mimebodytext.setcontent(body, "text/html"); mimebodytext.setheader("content-type", "text/plain; charset=\"utf-8\""); multipart mp = new ...

How to pass environment variable values into files in the docker container I'm trying to run -

let's have config file in docker container located here: /opt/jboss/bin/config.xml the config file looks this: <database-password>$password</database-password> i want pass actual password in when go run docker container using "--env-file" argument. this contents on env-file i'm passing in: password=mypassword i understand variable=value syntax. "mypassword" value of password variable. how docker know find specific file (/opt/jboss/bin/config.xml) variable , swap out? declaring variable correctly in config file? reason i'm having trouble finding information. the short answer - won't necessarily. unless have mechanism rewrite config file host environment. this pretty easy in shell script - can refer have done. but xml file isn't "run" in sense, probably won't work. as example - if want 'edit' xml, perl - you'll have install bit more stuff work: perl -mxml::twig -e'xml:...

c# - FacebookClient GetTaskAsync sometimes returns invalid JSON string(UWP 10) -

i'm trying data facebook using facebookclient api. error "invalid json string". strange thing data using same task. this code public async void getdata(string accesstoken, string task) { facebookclient fbclient = new facebookclient(accesstoken); try { var res = await fbclient.gettaskasync(task);//me/feed string data = res.tostring(); /*idictionary<string, object> o3 = (idictionary<string, object>)await fbclient.gettaskasync(task); jsonobject o2 = (jsonobject) await fbclient.gettaskasync(task);*/ } catch (exception e) { } } var res = ... gives error. don't know why works , time doesn't. thanks in advance. the sdk stopped working in windows 10 apps (uwp), continues work fine in windows 8.1 apps. it's been reported on github page of facebook-csharp-sdk. cause uwp's default newer http/2 protocol causing problems. unfor...

How to prevent Multi-Value field showing duplicates in Access 365 2016 -

Image
im using microsoft access 365 2016. i have created multi-value field in table can choose multiple values list of check box options (similar drop down menu in field table). when click drop down arrow shows values lookup table , displays duplicate options this: null, yes, yes, no, null, null, no how can display unique options this: null, yes, no thank you make unique values=yes on property sheet of . when selecting values other table multiselect combobox row source build query table , make unique values yes .

php - mysqli doesn't insert into database -

good day, i using code below: $stmt = $dbh->prepare("insert blogs (name, subject, message) values (?,?,?)"); $stmt->bind_param('sss',$name, $subj, $msg); it works without errors , page responding fine. problem is, don't think it's inserting database? could please advise causing this? thanks this prepare statement , bind parameters.. aren't have execution part? $stmt->execute(); this guide solution http://php.net/manual/en/mysqli-stmt.bind-param.php

php - Laravel 5.2 Eager Loading with multiple level one to may relationship -

i'm new laravel , i'm using laravel 5.2 want have comments of particular post of user. tables : user ----- id public function posts() { $this->hasmany( 'app\posts' ) } post ------ id user_id public function user() { $this->belongsto( 'app\user' ) } public function comments() { $this->hasmany( 'app\comment' ) } comments ---------- id post_id public function post() { $this->belongsto( 'app\post' ) } now want post perticular user logged in user. can comments long way : $comments = []; foreach( auth::user()->posts $post) { foreach( $post->comments $comment ) { $comments[] = $comment->title } } but wondering how comments without making these loops using relations only. in advance. you can double relationship existing user object: $posts = \auth::user()->posts()->with('comments')->get(); it should work levels. in project have organizations clients li...

c# - Use object name to return value of a specific property -

is there method object name return specified property value variable. example have following class class class1 { int valint; double valdouble; string valstring; public class1(int intvalue) { valint = intvalue; } public class1(double doublevalue) { valdouble = doublevalue; } public class1(string stringvalue) { valstring = stringvalue; } } so when use object this list<class1> list = new list<class1>(); list.add(new class1(25)); list.add(new class1(3.15)); list.add(new class1("name")); foreach (class1 item in list) { console.writeline(item); -> outputs 25, 3.15, name }

wso2is - Syncing seconday user store in WSO2 Identity Server cluster -

i have setup cluster wso2-is (2 instances on different machines) based on information provided here - https://docs.wso2.com/display/cluster44x/wso2+clustering+and+deployment+guide setup db user store, shared registry, 2 local registries copied db driver jar component lib updated master-datasource.xml updated registry.xml (made sure master read-only false , worker read-only true) updated axis2.xml , used wka membership scheme performed other changes suggested in link started master -dsetup option , worker without -dsetup option. verified governance folder shown symlink i can see interaction between both nodes, there hazelcast messages related node joining when worker started. user created in 1 able login other instance, service provider automatically available when viewed through ui. the problem when create secondary user store (jdbc) in first node , goto list in second node - secondary user store not present , cannot view users in user list too. am missing or way...

excel - VBA - Only Check for Date inside a DD/MM/YYYY - HH/MM/SS value -

i've checked through multiple topics unfortunately couldn't find solution need. i have cells needs include date , time in following custom format: dd/mm/yyyy hh:mm and have check cells see if matches. if does, notifies me approaching due time. dim mylimit double mylimit = date set formularange = range("e5:e35") each formulacell in formularange.cells formulacell if .value = mylimit *do action* this works if set date value such 02/05/2016 in cells, default midnight , triggers action. although 02/05/2016 2:45 pm doesn't work. so need check first part of cell date value , trigger action if fits today's date. i tried few solutions such as: dim mylimit double mylimit = cdate(format(date, "dd-mmm-yyyy")) set formularange = range("e5:e35") each formulacell in formularange.cells formulacell if .value = mylimit *do action* and dim mylimit...

javascript - Click one link disables other in java script -

hello disable other links except clicked 1 after click 1 of links. here code far: javascript $(".link-chart").click(function($e) { if($(this).find(".link-selector-two").hasclass('red')) { $('.link-selector-two', this).addclass('cssclass'); $('.link-selector-one', this).addclass('cssclass'); } else { $('.link-selector-two', this).removeclass('cssclass'); } }); html <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <a href="#" class="link-chart lx-link-chart"> <div class="link-selector-one"> <div class="link-selector-two red">one</div> </div> </a> <a href="#" class="link-chart lx-link-chart"> <div class="link-selector-one"> <div class="link-selector-two red"...

How to call parameterized method from JSP using JSTL/EL -

how call java method arguments defined in java class, jsp using jstl/el. method returning arrays. return value can used. you can invoke methods arguments in el if you're targeting , running servlet 3.0 compatible container (e.g. tomcat 7, glassfish 3, jboss 6, etc) web.xml declared conform servlet 3.0. servlet version comes along el 2.2 allows invoking arbitrary instance methods arguments. assuming you've ${bean} in scope refers instance of class has method public object[] getarray(string key) , should able this: <c:foreach items="${bean.getarray('foo')}" var="item"> ${item} <br /> </c:foreach> or variable argument <c:foreach items="${bean.getarray(foo)}" var="item"> ${item} <br /> </c:foreach> but if don't target servlet 3.0 container, cannot invoke methods arguments in el @ all. best bet job in preprocessing servlet suggested duffymo. object[] array = bea...

Using JavaScript to properly sign a string using HmacSHA256 -

in houndify api docs authentication, have following block of content: an example of authenticating request let's assume have following information: userid: ae06fcd3-6447-4356-afaa-813aa4f2ba41 requestid: 70aa7c25-c74f-48be-8ca8-cbf73627c05f timestamp: 1418068667 clientid: kfvh6rpy3tuiml-pcufppg== clientkey: kgmluq-k1ocuv5bztlkajf_mgo0t07jtogbi6apcqla114ccph3rlk4c0rkty30xleq49mz-c2bmyfovqo4pya== concatenate userid string, requestid string, , timestamp string in following format: {user_id};{request_id}{timestamp} with values example, expected output in case: ae06fcd3-6447-4356-afaa-813aa4f2ba41;70aa7c25-c74f-48be-8ca8-cbf73627c05f1418068667 sign message decoded clientkey. result 32-byte binary string (which can’t represent visually). after base-64 encoding, however, signature is: mywdefhj7av8op23v8pch1pill_gxh4udoaxmi06akk= the client generates 2 authentication headers hound-request-authentication , hound-client-authentication . the hound-reques...

Save numbered versions of excel files based on folder contents -

i need code saves incrementally numbered versions of file based on whether named files exist in specified folder. for example, check prescence of open file, named "inv_dec_2015.xlsx" in folder named "reports". if file exists, check "inv_dec_2015_v1.xlsx" in "reports". if file exists, check "inv_dec_2015_v2.xlsx" in "reports". if file exists, check "inv_dec_2015_v3.xlsx" in "reports". if file not exist, save open file "inv_dec_2015_v3.xlsx" and on till number of versions...... i found following 2 pieces of code on ron de bruin's website can used , modified bit purpose, don't know how use check pre-existing files. would appreciate this. sub rename_store_wbk() dim spath string ' enter path @ file stored spath = activesheet.range("k1").value & activesheet.range("k2").value & ".xlsx" ' check whether file exists call...

javascript - Konva Propagate events between layers -

i have transparent drag layer on top of shape layer. works great make interaction distinct can toggle dragging (between scrolling view or editing shape positions). however, unless turn off drag mode (by hiding intervening transparent rect), none of other mouseover events fire on shape layer beneath it. need propogate non-drag mouse events layer below it. there lot of shapes mouse on events. is there easy way propogate mouse on events layer beneath or need write custom handler fire events every shape? i managed solve without having propagate events between layers. put draggable surface behind shapes on shape layer if shape isn't clicked. cover if shape clicked, on shape dragstart event, if layerdraggable flag set, stopdrag() on shape , startdrag() on layer. allowed me toggle simple flag whether want whole layer dragging, or shape. i had clean little of shape position on dragend event, alternatively can dragbounds on shape. shape.on('dragstart', function...

c - Get a FILE* from a bluetooth COM port on Windows -

a c library use requires file* opened com port work it, have set port (connection speed, etc) before passing library. on windows, done using setcommstate(handle, dcb*) . transformation between handle , file* solved problem ( how make file* handle in winapi? , how file handle fopen file structure? ), but, surprisingly, fails in different ways when applied com ports obtained via bluetooth (rfcomm/spp). if first open handle , set com port parameters, _open_osfhandle fails me: handle qc9200_handle = createfile(t("\\\\.\\com9"), generic_read | generic_write, 0, null, open_existing, file_attribute_normal, null); /* returns valid value 0x30 */ setcommstate(qc9200_handle, &qc9200_dcb); /* succeeds */ int qc9200_fd = _open_osfhandle((intptr_t)qc9200_handle, _o_rdwr|_o_binary); /* returns -1 , sets errno=einval (22) */ i tried setting various combinations of flags _o_append (the 1 both mentioned in the docs , makes sense application) _o_rdwr|_o_binary (which thought s...

powershell - Start-BitsTransfer's Destination field is not mandatory -

i had bug in script i'd specified -description $dest instead of -destination $dest on call start-bitstransfer . didn't error / ran small file , took while large one. such think file copied machine; can't find copied to... question why isn't destination mandatory field? where files go default / when destination isn't specified? the snarky answer first part of question "because microsoft said so". since wasn't involved in decision making can't give definitive answer, example 7 of cmdlet documentation mentions the destination path cannot use wildcard characters. destination path supports relative directory, rooted path, or implicit directory (the current directory). so suspect parameter made optional allow transferring files "here" (to current working directory) without having explicitly specify destination, i.e. simplicity of use.

VB.net Passing value of Array 1, to Array 2 -

Image
so have code, , need pass value of array1 array2, value of array2 should array1 + (key mod 255) key put user private sub mod_btn_enc_click(sender object, e eventargs) handles mod_btn_enc.click dim counter integer = 0 if mod_tb_key.text = "" messagebox.show("pls input modulo key value", "error", messageboxbuttons.ok, messageboxicon.error) else modkey = mod_tb_key.text end if modmodulo = modkey mod 255 'formula mod_tb_mod.text = modmodulo 'i used show working 'modbyte = array 1 'modconverted = array2 each integer in modbyte counter += 1 modconverted(counter - 1) = modbyte(i - 1) + (modmodulo) 'formula used next mod_tb_enc.text = string.join(" ", modconverted) 'show array in textbox here interface i've managed way. for = 0 modbyte.getupperbound(0) counter += 1 redim preserve modconverted(counter - 1) modco...

python - How can I define .pdbrc on a Windows machine? -

how can define .pdbrc on windows machine? my .pdbrc file: alias sl s;;l alias nl n;;l alias cl c;;l after reading answer this question , tried putting in c:\users\<my_user> . starting pdb (using pdb.set_trace() ), tried aliases. weren't recognized. i'd know how set .pdbrc both globally, , virtual environment.

oracle - Call Application Process that saves/downloads as an attachement -

i have report link (inside of classic style apex report) calls application process. set on request attribute , follows: application_process=profile the application process calls procedure (name of procedure "profile") inside of package. application process follows: declare begin util_pck.profile(:id) end; the package generates text inside of webpage. instead of generating text, upon clicking link, need prompt user download or save attachment respect mime type (which believe .pro). think i'm missing key lines of code. procedure follows: procedure profile(profileid in number, debug in varchar2 default null) cursor svyc select p.profile_start_x, p.profile_start_y, p.surveying_org_full_name, p.survey_job_title, m.filename, m.vertical_accuracy_type, m.horizontal_datum, m.vertical_datum, m.epoch, m.projection_zone, m.units_of_measure, m.survey_job_number, m.survey_start_date survey_profiles_view p ...

pandas - Read Quandl API errors in Python -

i still relatively new python, , trying read/catch/handle errors when using quandl api. for example, if type in dataset not exist, "read" error returned call, newbie python, not sure how read errors. api document quandl api shows http errors , quandl errors able handle. here simple code sample fails, , trying read/catch/handle error. import pandas pd import quandl q df = q.get("cme/plz2016") the traceback gives lots of details error , has section @ end: during handling of above exception, exception occurred: traceback (most recent call last): file "d:\pyproj\quandl\workingsamplequandldownload.py", line 7, in <module> df = q.get(exchsymbol, trim_start=strstartdate) file "d:\python33\lib\quandl\quandl.py", line 124, in raise datasetnotfound(error) quandl.quandl.datasetnotfound: dataset not found. check quandl code: cme/plz2016 errors if use try/exception, get: dataset not found. check quandl code:...

angular - Can't bind to 'for' since it isn't a known native property angular2 -

i have create list of checkboxes dynamically have used *ngfor iterate array of objects working fine till iteration. problem occured when set value of for attribute in label tag. angular has throw error : can't bind 'for' since isn't known native property angular2 new error message unhandled promise rejection: template parse errors: can't bind 'for' since isn't known property of 'label'. <div *ngfor="#batch of batch_array"> <label for="{{batch.id}}"><input type="checkbox" [value]="batch.id" id="{{batch.id}}" (click)="batchselectedeevent(batch.id)" /> {{batch.batch_name}} </label> </div> here plnkr showing error : http://plnkr.co/edit/aaqfwvhc7h7ibuyzpito?p=preview whats wrong here in code ? update in angular2 final [for]="xxx" should work fine. added alias for htmlfor . original angular...

c - What does .byte mean in this asm line? -

i revisiting code wrote while ago math on large numbers. when wrote code, lab had few x86s split between 32 , 64 bits. work on ultrasparcs, , vaguely remember pulling line of code intel manual sure code being used on 64-bit cpu. unsigned long x[4]; x[0] = 0; x[1] = 0; x[2] = 0; x[3] = 0; asm volatile(".byte 15;.byte 162" : "=a"(x[0]),"=b"(x[1]),"=c"(x[3]),"=d"(x[2]) : "0"(0) ); if x[0] 0, , program started chugging away. can explain me line of code does? the bytes .byte 15 , .byte 162 represent cpuid instruction. when executes results in eax , ebx , ecx , , edx . these results stored in array elements: x[0] <- eax x[1] <- ebx x[2] <- edx x[3] <- ecx

php - preg_match/regex format needed -

i have below post fields submitted , trying value of each of numbers in form field quantity. can me regexp? trying each of numbers in variable. format quantity_{category}_{product}_{item} post fields submitted [submitted] => 1 [quantity_12038_16061_24960] => 1 [quantity_12037_16060_24959] => 2 [btnbuynow] => next step php code foreach ($_post $key => $value) { if (preg_match('/^quantity_(\d+)$/', $key, $matches)) { echo 'key:' . $key . '<br>'; echo 'matches:' . $matches . '<br>'; echo '<hr>'; } } use preg_match() docs purpose, , sample of how code like: $subject="quantity_12038_16061_24960"; $pattern='/quantity_(\d+)_(\d+)_(\d+)/'; preg_match($pattern, $subject, $matches); echo $matches[0]; //12038 {category} echo $matches[1]; //16061 {product} echo $matches[2]; //24960 {item} you can see how regex performing here .

java - mvn dependency:tree tries to get artifact from artifactory when it shouldn't -

i have moderate sized project many modules depending on each other. when run mvn compile or mvn package works, when try run mvn dependency:tree root directory fails complaining cannot artifact artifactory. true artifact not exist in artifactory. 1 of modules have written , dependency of module in project. why mvn dependency:tree searching module in artifactory when should recognize first-party module? mvn package not complain. please advise. maven error this [error] failed execute goal on project xxx: not resolve dependencies project xxx: not transfer artifact yyy from/to repo (zzz): failed transfer file: yyy. return code is: 503 , reasonphrase:error. -> [help 1] this settings.xml in case needed: <?xml version="1.0" encoding="utf-8"?> <settings xsi:schemalocation="http://maven.apache.org/settings/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd" xmlns="http://maven.apache.org/settings/1.1.0" xm...

lumen - Failed opening required file: server.php -

i having error shown below using lumen 5.1. failed opening required 'c:\xampp\htdocs\sample/server.php' (include_path='.;c:\xampp\php\pear') in unknown on line 0 i using bash command line , using php artisan serve . when running serve on git bash don't errors. when started type localhost:8000 in browser getting above error. what can solve this?

memory - Android MAT: activities being held by java.lang.ref.FinalizerReference -

i'm trying track down unexpectedly high memory usage. i've reduced complexity of app , have main activity button. pressing buttons starts new activity videoview plays video. when video finishes playing or it's dismissed close button, activity stopped , user returned main activity. now strangeness (well strange me). when app first launches sits @ 20mb memory usage. each time video activity started, closed , returned memory usage increases ~6mb. not leak continue increase 50mb or drop down ~30mb. grow , drop between 50mb , 30mb. i made dump mat , in histogram view saw there multiple video activities still around when expecting none or @ worse one. on subsequent dumps looks number of instances bounces between 1-5 (corresponding low , high mem values). i'm not sure next! i'm new mat , don't know how use track down whats happening. when merge_shortest_path excluding weak references points class java.lang.ref.finalizerreference 1 holding memory. googled arou...

.htaccess - redirect 301 some url apache + nginx -

please me problem, have problem url https://www.xxx.domain.com have many xxx words domain in https , wild cart, words after www. show message ssl not valid url www.yyy.domain.com use apache + nginx not have found 1 solution redirect 301 or 410 url www.word.domain.com please me, thnaks

css - Simple form give checkboxes a class -

Image
this code <%= simple_form_for [current_employee, @preference] |f|%> <%= f.association :jobterms, as: :check_boxes, label: false%> <% end %> it generates html <span class="checkbox"> <label for="preference_jobterm_ids_1"> <input class="check_boxes optional" type="checkbox" value="1" name="preference[jobterm_ids][]" id="preference_jobterm_ids_1"> "employee" </label> </span> is possible give "employee" generated text surrounding class? i'm trying make checkbox button , accessing text label affect styling of border.

reactjs - React scroll nav -

i looking similar "jquery 1 page nav" plugin. (here sidebar , menu items on activated when scrolling through content). is there similar plugin developed using react , not using jquery? trying find one, without success. found this: https://www.npmjs.com/package/react-scroll-nav code in library helped me implement want quite easily.

r - How can I remove outlines from location data -

i have location data of marine species. however, data fall on land , remove them without finding rows belong using ( ps2<-ps1[-c(1,2,3),] ) because have large data set. have search clue can't find good. thank you. here codes require(sp) library(maptools) require(raster) data(wrld_simpl) ps<-read.csv('test.csv') ps #----------------- lat lon 1 -32.98000 154.000000 2 36.94625 8.212916 3 -37.81430 -57.479584 4 -19.77236 -40.019028 5 -25.70459 -48.473195 6 -22.47125 -41.859027 7 -28.08153 -48.627082 8 10.56000 39.090000 9 50.50000 50.600000 10 52.50000 5.700000 ps1 <- subset(ps, !is.na(lon) & !is.na(lat)) plot(wrld_simpl, bg='azure2', col='khaki', border='#aaaaaa') #restore box around map box() #plot points points(ps1$lon, ps1$lat, col='orange', pch=20, cex=0.75) # plot p...

dependency injection - Global/Common Methods Constants Services throughout whole App angular2 -

after day of search found nothing looking ! i have methods (also can services) have written in separate file have use methods throughout whole angular2 app. know if import file @ time of bootstrap able use methods in whole app. question if have more 2 global files. should have import files in constructor of every component (in components service required)? or there other alternate ? for example have file named globalservice.ts. export clas xyz{ constructor(private base_path_service: globalservice){ //stuff... } } q1:- there alternate avoid initializing of globalservice every time in constructor ? q2:- whats benifit of use @injectable , @inject while service injection ? q3:- export clas xyz{ constructor(private base_path_service: globalservice){ //stuff... } } or class xyz{ constructor(@inject(globalservice) globalservice: globalservice) { //stuff.... } } which 1 best , why ? q1: there no sane alternative. q2: @injectable...

printing - Python print(foo, end = "") not working in terminal -

so code supposed print text, similar how pokemon does. purely fun. the problem "print(x, end = "")" not work when program run in terminal, works fine when run using idle. import time lorem = "lorem ipsum dolor sit amet, consectetur adipiscing elit. quisque id feugiat leo. quisque dictum, lectus dictum facilisis porttitor, diam dui sagittis nisl, et ultricies nisi dolor eget mauris. integer euismod aliquam imperdiet. nulla id orci elit. nulla quis viverra diam, in lobortis urna. integer lorem lectus, feugiat vel placerat et, ornare @ urna. praesent nec nisi venenatis, feugiat quam eget, tristique tellus. fusce in magna tincidunt, lacinia turpis eu, porta ex. phasellus ullamcorper, elit consectetur convallis imperdiet, nunc magna imperdiet nulla, quis porta dolor neque @ dolor. cras dolor nisl, tristique eget placerat vel, aliquet @ nisl. ut finibus interdum libero luctus." x in lorem: print(x, end = "") time.sleep(0.03) for rea...

sql server - Highcharts not rendering after post ajax request -

i have 2 asp pages, in first 1 have form inform parameter using ajax , send second asp page connect mssql database, run query using date parameter came first asp page , return query result asp variables , populates highcharts. graphics works fine passing variables throght querystrings, using ajax graphics wont draw,no error, simples returns blank graphic. teste.asp <!--#include virtual ="/bi/header.asp"--> <!--#include virtual ="/bi/sidebar.asp"--> <% %> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"> <script> function oncheckavailability() { if(window.xmlhttprequest) { orequest = new xmlhttprequest(); } else if(window.activexobject) { orequest = new activexobject("microsoft.xmlhttp...

Aurelia - Watch Dependency Value for Change -

suppose have class injecting class or component. there way watch changes on attributed of dependency injecting , act upon it? for example, have following app: app.html <template> <input type="text" value.bind="item"> <button click.trigger="addtolist()">add</button> <h3>modded</h3> <ul> <li repeat.for="it of modded">${it}</li> </ul> <h3>original</h3> <ul> <li repeat.for="it of dep.items">${it}</li> </ul> </template> app.js import {bindable, inject} 'aurelia-framework'; import {dep} './dep'; @inject(dep) export class app { constructor(dep) { this.dep = dep; } attached() { this.modifyitems(); } addtolist() { this.dep.additem(this.item); } modifyitems() { this.modded = []; (let item of this.dep.items) { this.modded.push(item.touppercase()); ...

r - Find unique set of strings in vector where vector elements can be multiple strings -

i have series of batch records labeled sequentially. batches overlap. x <- c("1","1","1/2","2","3","4","5/4","5") > data.frame(x) x 1 1 2 1 3 1/2 4 2 5 3 6 4 7 5/4 8 5 i want find set of batches not overlapping , label periods. batch "1/2" includes both "1" , "2" not unique. when batch = "3" not contained in previous batches, starts new period. i'm having difficulty dealing combined batches, otherwise straightforward. result of be: x period 1 1 1 2 1 1 3 1/2 1 4 2 1 5 3 2 6 4 3 7 5/4 3 8 5 3 my experience in more functional programming paradigms, know way did un-r. i'm looking way in r clean , simple. appreciated. here's un-r code works, super clunky , not extensible. x <- c("1","1","1/2","2","3","4...

pascalscript - Inno Setup Section [Run] with condition -

i need condition in [run] . if it's possible... need run command depends on condition. like this: if (userpage.values[0] = 'nc') filename: {sys}\inetsrv\appcmd.exe; parameters: "set......" or other way it. regards. you looking check parameter : [run] filename: "{sys}\inetsrv\appcmd.exe"; parameters: "set......"; check: shouldrun [code] function shouldrun: boolean; begin result := (userpage.values[0] = 'nc'); end;

Get Image from File Storage [Backendless] -

my users upload images filestorage @ backendless. upload sequence: backendless.files.android.upload(image1_scaled, bitmap.compressformat.png, 100, "profileimage", "images", new asynccallback<backendlessfile>() { @override public void handleresponse(backendlessfile response) { filemapping.profile_url = response.getfileurl(); backendless.data.of(filemapping.class).save(filemapping, new asynccallback<filemapping>() { @override public void handleresponse(filemapping response) { toast_error("image stored"); } @override public void handlefault(backendless...

javascript - Angular Restangular Local Storage Interceptor Issue -

i using restangularprovider set $http interceptor inject authentication header restangular requests. problem cannot inject services app.config(), cannot access angular local storage using store token after login server. angular.module('app').config(function(restangularprovider, localstorageservice) { restangularprovider.setbaseurl('/api/'); restangularprovider.setfullrequestinterceptor(function(element, operation, route, url, headers, params, httpconfig) { var authdata = localstorageservice.get('authorizationdata');//error:localstorageservice doesn't exist }; }); "authorizationdata" authentication token stored locally. can see, need able use restangular provider , local storage. appreciate workarounds. thank you! basically can't inject service angular configuration .config phase. providers/constant accessible config phase(providers meant configurable service) to solve problem, either transfor localsto...

ios - Segue from tableview to view preceded by navigation controller -

in project have slide menu 3 options in tableview. depending of selected option want segue viewcontroller1,viewcontroller2 or viewcontroller3 them preceded navigation controller. currently i'm using segue in storyboard prototype cell viewcontroller1 "segueid" identifier, options segue viewcontroller1. that's code in file.swift prepare segue: override func prepareforsegue(segue: uistoryboardsegue, sender: anyobject?) { if segue.identifier == "segueid"{ var destviewcontroller = segue.destinationviewcontroller as! uinavigationcontroller}} the problem comes when xcode allows me set 1 segue cell in storyboard can't point vc2 , vc3. is there way segue different views preceded navigation controller depending of selected row tableview? you should create segues between viewcontrollers. do not create segue cell viewcontrollers. then after select cell should decide segue invoke.

java - Regular expression in Drools -

i keep getting compile errors when try write rules. i trying translate condition drools if(model.type.series != null && model.type.series.name.mathes(".*fanr.*") || model.type.series.name.matches(".*sana.*")) //do something.... this have... rule "rule 01" salience 0 when m : model(type.series != null, type.series.name.matches(".*fanr.*") || type.series.name.matches(".*sana.*") : result(state == result.good ) a.setstate(result.bad); .... end what trying use regular expression match part of string 'name' string type. fair new drools don't see can cause problems, appreciated use correct drools syntax, according matches operator, described in drools manual. rule fanrorsana when $n: model($v: type.series.name matches ".*(fanr|sana).*") and can use powe...

gwt - Generate custom campaign parameters for your advertising URLs -

i have little problem, tried generate google custom campaign parameters advertising urls this google tool , url looks this: http://www.example.com/servis.php#!servis-xxx-yyy-zzz , tool doesnt consider url valid. can me how solve problem? thanks

How do you find a maximum value in a Swift dictionary? -

so, have dictionary looks this: var data : [float:float] = [0:0,1:1,2:1.414,3:2.732,4:2,5:5.236,6:3.469,7:2.693,8:5.828,9:3.201] how programmatically find highest value in dictionary? there "data.max" command or something? let maximum = data.reduce(0.0) { max($0, $1.1) } just quick way using reduce . or: data.values.maxelement() output: print(maximum) // 5.828

audio - How to use pocketsphinx (5prealpha) with gstreamer-1.0 in python? -

i trying create small python script receive audio stream on network, feed through pocketspinx translate speech text , run commands depending on output of pocketsphinx. i've installed sphinxbase , pocketsphinx (5prealpha) on ubuntu 15.10 vm , able process content of example audiofile (part of pocketsphinx installation) in python. i'm reasonably sure sphinx install working properly. unfortunately test python script cannot process continuous audio , uses native pocketsphinx api. according cmusphinx website should use gstreamer continuous translation. unfortunately information on how use pocketsphinx gstreamer in python rather limited. based on examples find pieced following script. import gi gi.require_version('gst', '1.0') gi.repository import gobject, gst gobject.threads_init() gst.init(none) def element_message( bus, msg ): msgtype = msg.get_structure().get_name() if msgtype != 'pocketsphinx': return ...