Posts

Showing posts from January, 2012

putty - Trying to access remote jupyter notebook via ssh tunnel -

i need accessing remote jupyter notebook instance normally, when trying access jupyter notebook running on remote server on mac, write following in terminal window create tunnel ssh -nl $local_port_number:localhost:$remote_port_number $my_username@$remote_server afterwards, can access jupyter server @ http://localhost:local_port_number how do in putty on windows? know there option in connection>>ssh>>tunnels this, cannot configuration work far. to access jupyter on ssh tunnel on windows need 1) initiate tunnel in putty , 2) configure web browser send traffic on tunnel. to initiate tunnel in putty: 1) navigate connection-->ssh-->tunnels 2) put in local address want forward traffic 3) click 'dynamic' radio button 4) click 'add' button 5) click 'open' button initiate connection for chrome , internet explorer 1) use start->run menu run inetcpl.cpl 2) in 'connections' tab click 'lan settings' 3) click on

php - Reverse Proxy Specific Request -

i have high load website, system runs out of memory in peak times. want split load read operations happens on specific urls move server. i using nginx , php-fpm, how redirect specific urls processed php-fpm on different server? this blue print of requirements. location /feed/generate { use php-fpm on different server } location / { #all other requests use existing php-fpm } setup php-fpm on second server listening on externally accessible ip (not 127.0.0.1) port 9000. ip address should private (not routed internet) and/or configured allow connections trusted hosts (firewall). upstream feed_php_fpm { server <other server ip>:9000; } upstream local_fpm { server 127.0.0.1:9000; } location /feed/generate { fastcgi_pass feed_php_fpm; include fastcgi.conf; } location / { fastcgi_pass local_fpm; include fastcgi.conf; } please understand doing , implications of php-fpm listening on network port vs file socket.

Parsing an HTML page in Wordpress and PHP, how do I select a specific table? -

parsing html page in wordpress , php, how select specific table? right now, request specific page, , able return "body" section code. however, i'd return "mytable" fragment.: <table id="mytable" class="display" table width="60%" border="1"> my code: $response = wp_remote_get( $request_url ); return $response['body']; html looks similar this: <html> … <body> <table id="mytable" class="display" table width="60%" border="1"> <thead> <tr> <th>number </th> <th>description</th> </tr> </thead> <tbody> <tr> <td>123456789101112</td> <td>foobar makes best foo ever barred!</td> </tr> </tbody> </table> </body> </html>

javascript - How can I avoid logging into SalesForce databases on every router in Express.js? -

i need log salesforce databases , pass query. passing lot of queries on many routers of express.js , real pain login in every router. please let me know if know how can avoid this. var conn = new jsforce.connection({ oauth2 : salesforce_credential.oauth2 }); var username = salesforce_credential.username; var password = salesforce_credential.password; // want avoid login on every router conn.login(username, password, function(err, userinfo) { if (err) { return console.error(err); } conn.query("select id sourcing__c id = 'req.session.ref'",function(err, result) { if (err) { return console.error(err); } if(result.records.length === 0){ req.session.ref = ""; } var body = { "auth__c": req.user.id, "stus__c": "pending - new hire", "record": "012lviac", "sourcing__c": req.session.ref }; conn.sobject("sfdc_employee__c

python - IPython not recognizing updated module -

this question has answer here: reloading submodules in ipython 8 answers i have function in script problem1.py: def normal_method(target): = np.array(np.arange(1,target)) divisible_numbers = a[(a%3==0)|(a%5==0)] sum_value = np.sum(divisible_numbers) print sum_value while calling function in ipython window using , import numpy np problem1 import normal_method %timeit normal_method(100) it gives me typeerror saying normal_method takes no arguments. when paste function ipython , call using same statement works. ideas why occurs? your problem interactive python not reloading module. take here. can try: import problem1 problem1 = reload(problem1) %timeit problem1.normal_method(10) or run command prompt shell: python test.py with test.py containing: import numpy np problem1 import normal_method %timeit normal_method(100) thi

wordpress - woocommerce - removing grid and list views -

Image
in woocommerce shop users able sort product categories default, list , grid view. this causing lot of duplicate content. i'm looking remove list , grid view functionality altogether, not hide display:none; themes support told me. try add functions.php file: remove_action( 'woocommerce_before_shop_loop', 'woocommerce_catalog_ordering', 30 );

javascript - Change the value of a variable on the fly depending on the selection of a Select -

i have following php code print html , have variable $price , $numofguests <?php echo '$' . $price ; $i = 1; //this print values of number of guest example: 1,2,3,4 echo 'select number of guests'; echo '<select name="numberofguests">'; while ($i <= $numofguests): echo $i; echo '<option value="' .$i. '">' .$i. '</option>'; $i++; endwhile; echo '</select>'; ?> how print out on fly total price depending on user selection? example: let's $price = $5 , number of guest options are: 1,2,3 so default num of guest going 1 , total price = $5 but if user select num of guest = 2 total price change $10 , if num of guest = 3 total price change $15 thank much try one. <div id="pricediv"></div> <?php $numofguests = 5; $i = 1; echo 'select number of guests'."</br>"; echo &#

python - Flask sqlalchemy using same model with different databases -

i found this article describes how use multiple databases in flask , sqlalchemy, problem each model associated different binding. is possible use same model on different databases?

unix - C Code: To connect a pty terminal to current process to execute commands -

in unix process, planning write code access terminal. so, can login process , run few commands. for example, can telnet 0:2000 terminal , there can dump commands dump process information. on research, saw can use /dev/pts or /dev/tty access terminal process. user can login terminal these not clear on how works. to create new pseudoterminal, tou need call following functions in order: posix_openpt (to new master) grantpt (to fix permissions new slave) unlockpt (to unlock slave) ptsname (to name of slave) open (to open slave) setsid (optional, enter new session , process group - typically after fork when running separate process on slave)

Using fread on binary file into a struct in C -

infile .bin file , ai_fileheader struct 3 ints , keep getting error error: expected expression before ‘ai_fileheader’ fread(ai_fileheader, sizeof(ai_fileheader) ,1 , infile); i've tried &. same error. fread(&ai_fileheader, sizeof(ai_fileheader), 1, infile); typedef struct { int file_size; int section_table_offset; int section_count; } ai_fileheader; solved ai_fileheader head; fread(&head, sizeof(ai_fileheader), 1,infile);

How to debug my c# application in visual studio? -

i have small c# application creates folders , want debug it.i have added debugger.break() inside code & not able attach process visual studio because click on exe start finishes operation.surely missing silly here.any solutions? you need set breakpoint in code. click on gray gutter running down left hand side of code editor window, there line of code. red dot should appear , breakpoint. may need try few different lines cannot break on lines of code. run app within visual studio clicking on green arrow (continue) button in toolbar. when execution hits breakpoint, should stop , able debug there within visual studio. i suggest read more info getting started debugging

jquery - scroll down then up 2 time when page is loaded -

hi guys i'm looking jquery make page scroll bottom of page top 2 time, ( down,up,down,up) !:) have works 1 time , dont know how make twice! <script> $(document).ready(function() { $('html, body').animate({ scrolltop: $(document).height() - $(window).height() }, 8000, function() { $(this).animate({ scrolltop: 0 }, 4000); }); }); </script> here go: demo var scrollcount=0; var scroll=function(direction){ if(scrollcount<4){ var scrollto= (direction==='down') ? $(document).height() - $(window).height() : 0; $('html, body').animate({ scrolltop: scrollto }, 800); settimeout(function(){ scrollcount++; direction=(direction==='down') ? 'up' : 'down'; scroll(direction); },850); } } scroll('down'); for reason callback on animation didn't work: failed demo

c# - reading each line of text is still performing each line despite my attempted condition -

i'm reading each line of text, , if contains text warn. down warningstextbox.text += , has new lines , bullet point, inserting newline/bullet points if conditions not met end bulleted/blank lines along warnings. figured put if ((bominputtextbox.text.contains(s4) && (bominputtextbox.text.contains(s5)))) it stop happening, doesn't. missing? using (filestream filestream = new filestream(@"t:\\designer\\customcheck", filemode.open, fileaccess.read, fileshare.readwrite)) { using (streamreader filereader = new streamreader(filestream)) { while ((lineoftext = filereader.readline()) != null) { regex regex4 = new regex("<ifcontainsand>(.*)</ifcontainsand>"); var v4 = regex4.match(lineoftext); string s4 = v4.groups[1].tostring().toupper(); regex regexcontainsand = new regex("<ifcontainsand2>(.*)</ifcontainsand2>"); var v5 = regexcontainsand.

allowing * character in textbox C# WPF -

i creating rs232 dial pad in wpf. problem running star character. don't know how ask question correctly because getting results "password characters only". ultimately i'm trying add "*" programmatically. not matter if used keyboard or virtual button. whenever character added program freezes. debugger isn't pointing , seems still waiting instruction. any ideas? im adding star textbox.text="*"; honestly not sure happened. started new wpf , worked. removed auto generated method , recreated it. works. entire method looked private void button_click(object sender, routedeventargs e) { textbox.text = "*"; } no clue works. thank replies

ruby on rails - Omniauth-facebook with Devise: "Missing passthru" errors -

i have devise authentication installed no problems. i'm trying add option log in facebook, using omniauth-facebook. i followed instructions in this guide , i'm getting errors missing "passthru" documentation, when visiting url localhost:3000/auth/facebook . here's first error got: unknown action action 'passthru' not found registrationscontroller i tried bandaid fix adding empty "passthru" action controller: def passthru end and resolved error, got different 1 in return: template missing missing template registrations/passthru, devise/registrations/passthru, devise/passthru, application/passthru {:locale=>[:en], :formats=>[:html], :handlers=>[:erb, :builder, :raw, :ruby, :jbuilder, :coffee]}. searched in: * "/home/user/project/app/views" * "/home/user/.rvm/gems/ruby-2.0.0-p648@railstutorial_rails_4_0/gems/devise-3.5.2/app/views" i tried creating "passthru.html.erb" in stated folders, erro

javascript - How to set boolean value true/false in to backbone model attribute -

i trying set boolean value model attribute follows : investadjustcollection.models[i].set({isuploaded:false}); this creates problem when send request server take action on modes data following exception @ client level uncaught syntaxerror: unexpected token < and @ server level post http://localhost:8080/api/trade/createinvestadjust 400 (bad request) if remove investadjustcollection.models[i].set({isuploaded:false}); server call made without issue. so how set boolean value true/false in bakcbone model. first guess unknown reasons (validation failed? bug in server code?), when send data, server throws exception , instead of responding valid json response, response body html error page error message, when backbone tries parse json, it's invalid. check server side logs. though saying bad request, suspect exception in server. however, sure, use developer tools examine headers , body of put request browser , make sure content-type correct , request body

javascript - How to get gridview column values which are visible false -

in grid-view setting template field , item template visible false.. but when running lop in java-script skipping column. please help i did below <asp:templatefield> <itemtemplate> <asp:label runat="server" id="lblwrdcd" style="display:block" text='<% #eval("wrdcd") %>'></asp:label> </itemtemplate> </asp:templatefield > <asp:templatefield> <itemtemplate> <asp:label runat="server" style="visibility:hidden" id="lblwingcd" text='<% #eval("wingcd") %>'></asp:label> </itemtemplate> </asp:templatefield> <asp:templatefield>

How to vertically align picture in line using python-docx -

Image
i adding picture (some latex converted png using matplotlib) text using following code: par = doc.add_paragraph() par.add_run().text = 'foo bar baz' par.add_run().add_picture('pic.png') par.add_run().text = 'blah blah blah' this works ok, except picture pic.png not vertically aligned in rest of text in document: i can alignment manually in ms word adding character style advanced vertical alignment property set "lowered 10pt": the problem have no idea how programatically using python-docx. conceptually steps compute size of image, create character style lowered half size minus half size of font , apply style run containing picture. how create raised or lowered font style in python-docx? for reference, here pic.png : your image has large (transparent) border around it. added single pixel border inside extents here make visible: i expect word aligning bottom of image baseline (as expected). 1 approach see if there way speci

php unidentified index error message -

this question has answer here: php: “notice: undefined variable”, “notice: undefined index”, , “notice: undefined offset” 22 answers since added $city=$_post['city']; i've been getting error message. undefined index: city in c:\wamp\www\assignment\html\img_upload.php on line 39. city select field in form. this code <?php require 'login.php'; $path = 'img/'; if (isset($_post['submit'])) { // grab image post array $fn=$_post['fname']; $ln=$_post['lname']; $sex=$_post['sex']; $city=$_post['city']; $em=$_post['email']; $pass=$_post['pword']; $confirm=$_post['cword']; //$gend = $_post['gender']; not using $pic = $_files['pic']['name'];

mysql - Multiplying SUM value from one table with a variable from another -

i have 2 tables: t_shipment , contains shipper_account, ship_value, , ship_date (among others, irrelevant t_customer , contains account_number , ship_fee (ship fee percentage charged each shipment, , number varies account) (likewise, table contains other fields well) note: shipper_account refers account_number (though it's not treated foreign key) i need calculate sum transactions done account in day t_shipment, multiply corresponding ship_fee in t_customer. then have tried this: select sum(ship_value * (ship_fee)) calculated_value t_shipment inner join t_customer on shipper_account = account_number ship_fee not null; but doesn't right. want make sure sum(cod_value * (cod_fee/100)) part indeed returns sum of each shipper's ship_value multiplied own ship_fee. (e.g., rather being sum of ship_value shippers multiplied sum of ship_fee. e.g. if had sets of data: __________________________________________ |shipper_account | ship_value | ship_date | |1000

Check if a string contains any element of an array in JavaScript -

how can check if string contains element of array? want filter array if element has string. please see below code. var arr = ['banana', 'monkey banana', 'apple', 'kiwi', 'orange']; function checker(value) { var prohibited = ['banana', 'apple']; (var = 0; < prohibited.length; i++) { if (value.indexof(prohibited[i]) == -1) { return true; } else { return false; } } } arr = arr.filter(checker); console.log(arr); the result [ 'apple', 'kiwi', 'orange' ] . 'apple' should removed, isn't. above code filtered 'banana', not 'apple'. have many keywords filter. there easier way? problem lies in loop, iterates once since return ends function, cutting off loop in process. so, can update code make function return once loop has been completed . var arr = ['banana', 'monkey banana', 'apple&#

swift - How do i calculate the distance from point A to point B in IOS google maps SDK? -

my goal calculate distance point point b using ios google maps sdk. i found out there api call distance matrix api. questions are do need make http request using alamofire ios use distance matrix api? do need run own server (etc node.js, django, rails) make request distance matrix? or in ios google maps sdk? 1 -> yes, need make http request. 2 -> no, not need run own server. need google api key make requests google servers. can api key creating google account , following instructions in below link:- https://developers.google.com/maps/documentation/distance-matrix/start 3 -> not need integrate full ios google sdk if need perform 1 of these tasks sdk. can hit api following instructions below doc distance matrix api doc:- https://developers.google.com/maps/documentation/distance-matrix/intro?hl=en#requestparameters

jsf - Java EE Container Based Security -

i attempting implement jdbc realm authentication wildfly. have used article reference: http://blog.eisele.net/2015/01/jdbc-realm-wildfly820-primefaces51.html as accompanying source code on github @ https://github.com/myfear/simplejdbcrealmwildfly/ i presented login form if try access 1 of protected areas of application after filling in username , password never seems authenticate(loginerror.xhtml). the difference between application , above example form specifies action="j_security_check" whereas githib example uses onsubmit="document.loginform.action = 'j_security_check';" in web.xml specify <security-role> <role-name>admin</role-name> </security-role> which matches specified user in role table..what still missing?

excel vba - Find date in a range -

Image
i have many dates in range a1: ww1 mean there 1 date in every cell. i need macro selects today's date between other dates. i assume have consistently filled data. if can use used range find out last row. please try code. colour cells having current data. have used limited range testing purposes think work on larger range also. sub highlight() dim rng range dim lastrow long, lngrow long dim strcolumn integer lastrow = activesheet.usedrange.rows(activesheet.usedrange.rows.count).row dim lastcolumn integer lastcolumn = activesheet.usedrange.columns(activesheet.usedrange.columns.count).column strcolumn = 1 lastcolumn activesheet lngrow = 2 lastrow ' assuming row 1 header row if isdate(.cells(lngrow, strcolumn).value) , cdate(.cells(lngrow, strcolumn).value) = date .cells(lngrow, strcolumn).interior.colorindex = 3 end if next lngrow end next end

bash - Ubuntu awk - Print filenames that contain anything other than digits -

i wish print filenames not "contain numbers": this code far: find . -type f | awk '!/[[:digit:]]/ {print}' this finds me every file not containing digit. my problem that, checks directories names too. newest code: find . -type f | awk '/.*\w.*/ {print}' i think works, checks directories name, care files if understand correctly: to print filenames not "contain numbers": find . -type f -printf '%f\n'| awk '/[^[:digit:]]/ {print}' no directories included. if want filenames not "contain numbers or letters": find . -type f -printf '%f\n'| awk '/[^[:alnum:]]/ {print}' but believe wise include dot . , space . characters used in filenames: find . -type f -printf '%f\n'| awk '/[^[:alnum:]. ]/ {print}' the (negated) shorthand character class \w include _ underscore, , less portable (is gnu extension). i not know if mean include or not.

jax rs - JAX-RS Client Filter to Modify Header Before Request is Dispatched to server -

in jax-rs (resteasy), want implement client filter modifies header before sending request don't manually every single call. currently i'm doing in receiving end intercept requests before arriving resource. @provider @priority(priorities.authentication) public class authenticationfilter implements containerrequestfilter { @override public void filter(containerrequestcontext requestcontext) throws ioexception { // read header } now know (correct me if i'm wrong): in receiving end, containerrequestfilter can used before request arrives resource , request. but want implement in client side, modify header before request ever sent server. can same server filter used or there similar client? you must register clientrequestfilter client client client = clientbuilder.newclient().register(myfilter.class); @provider public class myfilter implements clientrequestfilter { @override public void filter(clientrequestcontext ctx) th

After trying to start a Java Applet, (how) can I detect that a user declined it? -

is there way me detect (and give more user-friendly message dialog saying "blockedexception" or whatever) user denied applet permission run? set redirect in applet page, pointing 'friendly message'. write js function can cancel it. call js function applet once loading.

android - How can i see my current active users in my Firebase Analytics dashboard -

Image
this question has answer here: can't view real time users on firebase? 5 answers i connected android app new firebase analytics api , see information on analytics dashboard daily , weakly, monthly active users count. but can't see active current users (count) in dashboard in previous google analytics tool. how can show current active users in firebase analytics dashboard? -add firebase analysic app -after few hour can find app users analysic in firebase console on "analytics tab".

excel 2010 - MATCH returns #N/A But DO WORK right at evaluation (F9) -

i'm using match find row number index using multiple criteria, , wrote syntax: =match(1,($aw$2=data!$a:$a)*($aw$3=data!$b:$b)*($av6 =data!$c:$c),0) but i'm receive #n/a result, it's not true, because if evaluate manually f9, return right result wrong? should do? maybe program options in excel itself? go formulas menu > calculation options > select automatic . this shall calculate formula type them.

java - Convert input String to File Object -

i want convert input string nothing xml java object. using jaxb same. problem calling application going receive xml in form of string. jaxbunmarshaller.unmarshal(inputxml); expects file object in input. there way can convert input string file object without manually writing incoming content disk. following method snippet public void xmltoobject(string inputxml){ try{ jaxbcontext jaxbcontext = jaxbcontext.newinstance(lineitemsbeanlist.class); unmarshaller jaxbunmarshaller = jaxbcontext.createunmarshaller(); lineitemsbeanlist objreq= (lineitemsbeanlist) jaxbunmarshaller.unmarshal(inputxml); printlineitems(objreq.getlineitemsbean()); nba.processlineitems(objreq.getlineitemsbean()); nba.printfinalsetofrules(); } catch(exception e){ system.out.println(e); } } you don't need make file object solve problem. taken docs jaxb unmarshaller : unmars

java - How to delete mongodb document with two conditions one with $gt operator? -

i retrieve following information: delete database name = 'aaa' , age>20; but mongodb in java. essentially, should delete document contain word aaa , age greater 20 in them. know there $in operator in mongodb, how do same in java, using java driver? i've been trying everywhere getting nothing. i've tried: query = new basicdbobject("age", new basicdbobject("$gt", "20"), new basicdbobject("name", "aaa")); json want delete this. {"school" : "newschool" , "name" : "aaa" , "age" : "50"} what want find-term: { "name" : "aaa", "age" : { $gt : 20 } } construct basic db object, or use new 3.x filters create bson you. (as use 3.x, here's appropriate example): mongoclient client = ... mongodatabase db = client.getdatabase(...); mongocollection<document> coll = db.getcollection(...); coll.deletem

call - Easiest options of video chat for asp.net -

i'm looking way add video call web application in asp.net webforms. there opensource application available ? note: need peer peer connection! thanks in advance! i figured easiest way use webrtc makes easier.however, minor differences between browsers might cause concerns regarding compatibility. therefore, suggest if wants use webrtc in asp.net using c# (as did) can use xsockets webrtc api . there anouther option might cause little more trouble still worth trying easyrtc (might need time figure how work node.js or iisnode...)

c# - MongoCollection returns data sync but not async -

i've been trying convert sync logic async , realized async await pattern doesn't work. i've changed code: var filter = builders<smartagentproperty>.filter.where(smartagent => smartagent.usermail==usermail); var results = await smartagentscollection.findasync(filter); return results.tolist(); to this: var filter = builders<smartagentproperty>.filter.where(smartagent => smartagent.usermail == usermail); var results = smartagentscollection.find(smartagent => smartagent.usermail == usermail).toenumerable(); return task.fromresult(results); the sync version works perfectly. the async version hanging , doesn't throw exceptions. as sounds, extremely wierd bug. i thought might doing things wrong seems same pattern works in other places in code i'm reaching out help. so based on craig's comment, issue solved! a. using wrong ( task.fromresult instead of actual async implementation) b. missing configureawait(false

string - integer length in javascript -

stoopid question time! i know in javascript have convert integer string: var num = 1024; len = num.tostring().length; console.log(len); my question this: why there no length property integers in javascript? isn't used often? well, don't think providing length properties number helpful. point length of strings not change changing representation. for example can have string similar this: var b = "sometext"; and length property not change unless change string itself. but not case numbers. the same number can have these 2 representations: var = 23e-1; , var b = 2.3; so these 2 representation clear same number can have multiple representation , so, if have length property numbers have change representation of numb.er

error handling - How to convert FromStrRadixErr to ParseIntError? -

i'm trying build generic wrapper around std::<t>::from_str_radix . according documentation, from_str_radix returns result<t, parseinterror> . fn foo<t: num_traits::num>() -> result<t, std::num::parseinterror> { t::from_str_radix("4242", 10) } won't compile: error: mismatched types: expected core::result::result<t, core::num::parseinterror> , found core::result::result<t, <t num_traits::num>::fromstrradixerr> on other hand, this fn main() { let x: result<u8, std::num::parseinterror> = foo(); println!("{:?}", x); } fn foo<t: num_traits::num>() -> result<t, <t num_traits::num>::fromstrradixerr> { t::from_str_radix("4242", 10) } compiles fine , prints expected result err(parseinterror { kind: overflow }) to mind, both same situation, i'm wrong. can explain me difference , possibly show me solution? how convert f

ios - Native incoming call is killing my VOIP app's access to audio -

i'm developing voip app allows people make voip calls. whenever user in voip call , receives native call on phone audio of voip app stops working. i've read 1 must reinitialize audiosession , i'm doing block of code not working. suggestions? self.callcenter = [[ctcallcenter alloc] init]; [self handlecall]; - (void)handlecall { avaudiosession *session = [avaudiosession sharedinstance]; self.callcenter.calleventhandler = ^(ctcall *call){ if ([call.callstate isequaltostring: ctcallstateconnected]) { } else if ([call.callstate isequaltostring: ctcallstatedialing]) { } else if ([call.callstate isequaltostring: ctcallstatedisconnected]) { nslog(@"call ended"); dispatch_after(dispatch_time(dispatch_time_now, 2 * nsec_per_sec), dispatch_get_main_queue(), ^{ [session setactive:yes error:nil]; }); } else if ([call.callstate isequaltostring: ctcallstateincoming]) { nslog(@"

ios - Redraw Scenes Only When the Scene Data Changes -

i read page on tuning opengl es app : redraw scenes when scene data changes : app should wait until in scene changes before rendering new frame. core animation caches last image presented user , continues display until new frame presented. even when data changes, not necessary render frames @ speed hardware processes commands. slower fixed frame rate appears smoother user fast variable frame rate. fixed frame rate of 30 frames per second sufficient animation , helps reduce power consumption. from understand, there event loop keeps on running , re-rendering scene. override ondrawframe method , put our rendering code there. don't have control on when method gets called. how can " redraw scenes when scene data changes " ? in case, there change in scene when user interacts (click, pinch etc.). ideally not render when user not interacting scene, function getting called continuously. confused. at lowest exposed level, there opengl-containing typ

propertygrid - How to implement sub category elements in Property Grid using C# -

Image
is there way implement sub category elements in property grid , i have tried following code doesn't seem work public class test { private min2max range; [category("product")] public min2max range { { return range; } set { range = value; } } class min2max { private double min = 0.1; private double max = 99.9; public double min { { return min; } set { min = value; } } public double max { { return max; } set { max = value; } } } } any suggestions or appreciated, many thanks..:) what show in red in not kind of subcategory property has other child properties. problem min2max class , range property private, grid won't map them. if fix need attach 1 of them typeconverter "shows" properties. @ least, expandableobjectconverter can it. if need enable editing range (not sub-propertie

google play - Android published app doesn't ask for internt permission -

i made first small android app shows currency rates in widget. needs internet permission. added permission manifest <uses-sdk android:minsdkversion="14" android:targetsdkversion="20"/> <uses-permission android:name="android.permission.internet"/> application fired on emulator , on phone. when published on google market - doesn't ask permissions. "app doesn not require special permissions". , app doesn't work. think android blocks internet app. build.grade: android { compilesdkversion 21 buildtoolsversion "21.0.2" defaultconfig { applicationid "com.my_widget.myelsewidget" minsdkversion 14 targetsdkversion 21 versioncode 1 versionname "1.0" } buildtypes { release { runproguard false proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.pro' } } } what did wrong? thanx! upd: surprize. i found

eclipse - Android development on Fedora 19 64 bit -

Image
i have tried android sdk working on fedora 19 64 bit. still error r cannot resolved variable in image below have created new project. so far have tried sudo yum install libstdc++.i686 ncurses-libs.i686 zlib.i686 sudo yum install redhat-lsb.i686 yum install glibc.i686 glibc-devel.i686 libstdc++.i686 zlib-devel.i686 ncurses-devel.i686 libx11-devel.i686 libxrender.i686 libxrandr.i686 i think problem somewhere under eclipse preferences. should check if path of android_sdk correctly linked. however, control in project tree if folder res present.

javascript - Issue parsing JSON child elements -

Image
here json string "book_types": { "type": "1", "books": [ { "name": "default", "cover": null, "lastupdated": { "microsecond": 114250, "ctime": "fri aug 9 01:27:45 2013" }, "cat": 0, "other_thumbs": [], "book_type": 1, "thumbs": [], "id": "8001", "bk_follow_uids": [], "desc": "default", "bk_update_uids": [], "uid": 6001, "no": 1 } ] } } which valid. when call tojson(jsonstr) , returns object {book_types: object} book_types: object

Convert sql to doctrine symfony or DQL -

hello have 2 many 1 relation in database , use sql query ok can`t convert query mysql dql or querybuilder please me select * `resturant` left join `food` on `resturant`.`id` = `food`.`resturant_id` `food`.`name`like "%pizza%" group `resturant`.`name` assuming restaurant entity linked food entity through attribute $foods : $this->createquerybuilder('restaurant') ->leftjoin('restaurant.foods', 'food') ->where('food.name %pizza%') ->groupby('restaurant.name') ->getquery()->getresult();

python - Find and replace text in string -

this question has answer here: replace part of string in python? [duplicate] 2 answers how can https://onion-rip.de from https://onion-rip.de/data/images/9d5faef5c26f69546f8/68c8a2a5fe0a9c5c221a2bb.jpg and replace https://test.de . output should be: https://test.de/data/images/9d5faef5c26f69546f8/68c8a2a5fe0a9c5c221a2bb.jpg is special function in python this? you can use python's replace() method this: oldurl = 'https://onion-rip.de/data/images/9d5faef5c26f69546f8/68c8a2a5fe0a9c5c221a2bb.jpg' newurl = oldurl.replace('https://onion-rip.de', 'https://test.de') print(newurl)

linux - fftw compilation error for ARM cross-compile -

i trying cross-compiler fftw arm. configure command is, ./configure --with-slow-timer --host=arm-linux-gnueabi --enable-single --enable-neon "cc=arm-linux-gnueabi-gcc -march=armv7-a -mfloat-abi=softfp" i have tried simple ./configure command got same error as, checking bsd-compatible install... /usr/bin/install -c checking whether build environment sane... yes checking arm-linux-gnueabi-strip... arm-linux-gnueabi-strip checking thread-safe mkdir -p... /bin/mkdir -p checking gawk... no checking mawk... mawk checking whether make sets $(make)... yes checking whether make supports nested variables... yes checking whether enable maintainer-specific portions of makefiles... no checking build system type... x86_64-unknown-linux-gnu checking host system type... arm-unknown-linux-gnueabi checking arm-linux-gnueabi-gcc... arm-linux-gnueabi-gcc -march=armv7-a -mfloat-abi=softfp checking whether c compiler works... no configure: error: in `/home/junaids/downloads/fftw-3.3.4&#

Change PyCharm's settings directory -

i'm on ubuntu pycharm community edition 2016.1.3 , , i'de change default locations settings, caches, plugins , logs any environnement variable designed purpose ? in bin/ directory, there idea.properties file (text format): #--------------------------------------------------------------------- # uncomment option if want customize path ide config folder. make sure you're using forward slashes. #--------------------------------------------------------------------- # idea.config.path=${user.home}/.pycharm/config #--------------------------------------------------------------------- # uncomment option if want customize path ide system folder. make sure you're using forward slashes. #--------------------------------------------------------------------- # idea.system.path=${user.home}/.pycharm/system #--------------------------------------------------------------------- # uncomment option if want customize path user installed plugins folder. make sure you

c# - scaffold Many to Many Relation with nullable key -

i got table 3 1 many relations (one many many relation , third 1 many relation data), want scaffold relationships 1 side of many many relation. don't want linked other side of many many relationship, thinking of making nullable (with no surprises) can't primary key it. there workaround null 1 side of many- many relation? here sql source: create table [dbo].[connectionpointroutes] ( [connectionpointid] int not null, [routeid] int not null, [segmentid] int not null, [position] int not null, constraint [pk_dbo.connectionpointroutes] primary key clustered ([connectionpointid] asc, [routeid] asc, [segmentid] asc), constraint [fk_dbo.connectionpointroutes_dbo.connectionpoints_connectionpointid] foreign key ([connectionpointid]) references [dbo].[connectionpoints] ([connectionpointid]) on delete cascade, constraint [fk_dbo.connectionpointroutes_dbo.routes_routeid] foreign key ([routeid]) references [dbo].[routes] ([routeid]) on delete cascade, co

c# - How can I create Translate storyboard animation programmatically UWP? -

i create dynamic translate y animations grids, can't find how in uwp programmatically. i have code, says winrt information: cannot resolve targetproperty translatey on specified object. i have tried set property name y, says: winrt information: cannot resolve targetproperty y on specified object. sample: private void createstoryboardanimation(grid mygrid) { mygrid.rendertransform = new compositetransform(); storyboard storyboard = new storyboard(); doubleanimation translateyanimation = new doubleanimation(); translateyanimation.from = -500; translateyanimation.to = 1; translateyanimation.duration = new duration(timespan.frommilliseconds(500)); storyboard.settarget(translateyanimation, mygrid); storyboard.settargetproperty(translateyanimation, "translatey"); storyboard.children.add(translateyanimation); storyboard.begin(); } i have tried use translatetransform class... don't how use it. storyboard.settar

android - Why CordovaWebViewClient not working in Cordova 6 anymore -

i have written custom webviewclient class override onpagestarted, onpagefinished etc in cordova 3.7 working fine. in following code have hosted www directory web server , interacting cordova plugins there (barcodescanner, nfc, bluetooth etc). public class mainactivity extends cordovaactivity { private webview webview; @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); super.init(); loadurl("https://example.com"); } public class customcordovawebviewclient extends cordovawebviewclient { public customcordovawebviewclient(cordovainterface cordova, cordovawebview view) { super(cordova, view); } @override public void onpagestarted(webview view, string url, bitmap favicon) { super.onpagestarted(view, url, favicon); log.i("csp log", "onpagestarted: " + url); } @override

c# - Mocking UserManager -

i used post ( http://www.asp.net/web-api/overview/testing-and-debugging/mocking-entity-framework-when-unit-testing-aspnet-web-api-2 ) mocking db , able test. of classes has applicationuser foreign key. having trouble test them. can do? this interface: using system; using system.data.entity; namespace prac.models { public interface ipraccontext : idisposable { idbset<graduando> graduando { get; set; } idbset<funcionario> funcionario { get; set; } idbset<applicationuser> users { get; set; } int savechanges(); void markasmodified<t>(t i) t : class; } } identitymodels.cs (with applicatiouser class) using system.data.entity; using system.security.claims; using system.threading.tasks; using microsoft.aspnet.identity; using microsoft.aspnet.identity.entityframework; namespace prac.models { // can add profile data user adding more properties applicationuser class, please visit http://go.microsoft.com/fwlink

node.js - express-generator not getting installed -

referring http://expressjs.com guide, i'm trying install express-generator follows. npm install express-generator -g i've tried npm install -g express-generator nothing worked out. below error in cases. c:\sandbox\exp>npm install -g express-generator npm err! windows_nt 6.1.7601 npm err! argv "c:\\program files\\nodejs\\node.exe" "c:\\program files\\nodejs\\ node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "express-generator" npm err! node v6.1.0 npm err! npm v3.8.6 npm err! code e404 npm err! 404 not found: express-generator npm err! 404 npm err! 404 'express-generator' not in npm registry. npm err! 404 should bug author publish (or use name yourself!) npm err! 404 npm err! 404 note can install npm err! 404 tarball, folder, http url, or git url. npm err! please include following file support request: npm err! c:\sandbox\exp\npm-debug.log after couple of days of research, i've resol

c# - Mocking a cotroller context asp 4.5 -

i have mock controller context in order test methods authorized. problem although try this not work because when type: var mock = new mock<controllercontext>(); visual studio underlines controllercontext , says the type or namespace not found these usings have included in unit test class: using microsoft.visualstudio.testtools.unittesting; using system; using system.web; using system.collections.generic; using moq; using system.web.http.controllers; using data.contracts; using system.linq; using web.api.controllers; any ideas how include controllercontext in msdn documentation part of system.web not seem working. great if there way mock context without using this. i fixed reference intalling mvc package. receive following error when try this: var mock = new mock<controllercontext>(); mock.setupget(x => x.httpcontext.user.identity.name).returns("someuser"); mock.setupget(x =&g

serialization - How can I pass Selenium WebDriver objects between seperate Ruby processes? -

i want pass instance of object between 2 ruby processes. specifically, want pass instance of selenium webdriver 1 process process. reason want because takes lot of time ruby create object, want used other process. i've found related questions here , here seem point towards using drb, i've been unable find useful examples or sample code. is there tool other drb should using? have example similar copy from? it looks you're going have use drb, although documentation seems lacking. there interesting article here . might want consider purchasing druby book masatoshi seki better idea of how effectively. another option investigate if not looking @ simultaneous access, want send object 1 process another, serialize (that is, encode in way ruby can read) object yaml (for human readable file) or marshall (for binary encoded file) , send using pipe. mentioned in answer has since been deleted. note either of these solutions require modifying selenium code heavily

java - Spring: - How can we get Bean if context are loaded from web.xml? -

i learning spring being used in project.i found contextconfiglocation entry in web.xml /web-inf/context/*-context.xml classpath:/context/database-context.xml classpath:/context/database-service-context.xml classpath:/context/business-process-management-service-context.xml and listener <listener> <listener-class>org.springframework.web.context.contextloaderlistener</listener-class> </listener> in core project read below resource r=new classpathresource("applicationcontext.xml"); beanfactory factory=new xmlbeanfactory(r); employee s=(employee)factory.getbean("e"); but not figure out how things working , getbean() function called ? you can retrieve webcontext method: http://docs.spring.io/spring/docs/3.0.x/javadoc-api/org/springframework/web/context/support/webapplicationcontextutils.html#getwebapplicationcontext%28javax.servlet.servletcontext%29

html - Why are only some of my CSS selectors working? -

Image
i'm bit new html/css , i'm having hard time figuring out why of selectors aren't working. as stands right now, .tasklist , .totalleft seem in effect. i've tried changing them class selectors doesn't seem work either. think syntax correct, i've tried doing 1 @ time , work, it's when doesn't work. missing here...? thanks! html <body ng-app="app" ng-controller="democontroller"> <center><h1>todos angular.js</h1></center> <div> <input type="text" ng-model="input" placeholder="what needs done?"> <button type="submit" ng-click="add()">add task</button> </div> <input type="checkbox" ng-model="allchecked" ng-change="markall(allchecked)">mark complete<br> <ul class="tasklist" > <li ng-repeat="item in items">