Posts

Showing posts from August, 2015

How to compare two folders that has names as the date. in batch file -

i have made backup folder per date on backup taken. want delete backup more 20 days old. don't know how initiate ? please guide using batch programming to delete files older 20 days can this forfiles -p "c:\yourbackupfolder" -s -m *.* -d 20 -c "cmd /c del @file"

angularjs - Creating an animation showing API calls -

long time lurker, first time poster here. i need insight here. our final year university project, have created server/service integrates fluidsurveys , d3 create in 1 package collect surveys , return results in realtime. here's question: our openhouse, want interesting. want create live animation shows sort of visualization everytime there's api call server (sort of illustrate flow of data). our server's made mean stack. hoping make sort of html5 or svg animation can sent signal shows animated arrow of sorts when server receives api call or along lines. i have no idea start have no experience in area. any insight? thanks!

c# - How to retrieve encrypted data from database irrespective of case? -

i want retrieve encrypted data database sql, irrespective of case inserted in database.i have data in database in encrypted form when retrieve data using different case gives me wrong or no data. for ex: i have inserted abc in database salt created value different abc . now user wants search abc these values same have different salt. abc has different encrypted value, abc has different in database. how can value irrespective of salt created without problem of case sensitive. i have no option available check case @ time of insertion in database. note: salt created in application using c#. is possible,if not is/are options? should standardize field @ time of insertion toupper() or to lower() ?

c# - How to immediately get id token from google play services Unity Plugin -

i'm using https://github.com/playgameservices/play-games-plugin-for-unity plugin sign in user google account , , want id token , send server , register account user in own database.this code id token : playgamesplatform.instance.authenticate(success => { if (success) { debug.log("id token :"); debug.logformat("{0}", playgamesplatform.instance.getidtoken()); debug.log("end of id token"); } }); the problem first time prints empty string , when call second time (or moment later) prints token. want token immediately or callback make sure token recieved . how make sure token recieved? there callback this? thanks they changed plugin in new version , playgamesplatform.instance.getidtoken(callback) has callback function.

indexing - Error : Index was outside the bounds of the array in c# -

this question has answer here: system.indexoutofrangeexception: index out of bounds 2 answers i'm trying write small program using c# interface concept area of circle & square.while giving specific condition if (args[0] == "s") there error indexoutofrangeexception : if (args[0]=="s") fig = new square(); if (args[0]=="c") fig = new circle(); that happen if args empty. can't ask first element of empty array, because there isn't one. should check length first: if (args.length == 0) { // maybe exit? valid not specify arguments? } // either use "else" here, or if you've quit in "if" block // don't need because know there's @ least // 1 argument

java - Adding behaviour to DTO object -

this design question confuses me. as know, object consist of attributes , behaviours. in web programming, have implemented several protocol objects dto. these like: abstract abstractrequest{ public abstract abstractresponse apply(); ... } mathlessonrequest extends abstractrequest{ public abstractresponse apply(){ ..do based on request } ... } historylessonrequest extends abstractrequest{ public abstractresponse apply(){ ..do based on request } } and want , in controller want this: @restcontroller class schoolrequestcontroller{ @requestmapping(value="/",method = requestmethod.post, produces = "application/json") @responsestatus(httpstatus.ok) @responsebody public abstractresponse query(abstractrequest request){ return request.apply(); } } so , can see, want give request classes responsibility execute asked for. my question , design? right give dto objects responsibilities exec...

python 2.7 - How do I capture text from ListItemButton click in listadapter? -

how capture text value listitembutton in listview , store text value in objectproperty can use listitembutton text value in different function? error getting: attributeerror: 'nonetype' object has no attribute 'adapter' references: https://groups.google.com/forum/#!msg/kivy-users/4opq2wszeks/xm9f1psj8juj screenshot: 1 trying accomplish in python: from kivy.app import app kivy.uix.gridlayout import gridlayout kivy.uix.label import label kivy.lang import builder kivy.properties import * random import randint import cx_oracle import os class mygrid(gridlayout): data = [] team_list = listproperty() search_input = objectproperty() cols = numericproperty() lv11 = objectproperty() lv22 = objectproperty() team1 = objectproperty() team2 = objectproperty() list_adapter = lv11.adapter def __init__(self, **kwargs): super(mygrid, self).__init__(**kwargs) self.fetch_team_list() self.list_adapter = self...

javascript - Change all links of a particular class on page load -

on this site, links inside inventory class need changed this link. can't find file edit , change link using javascript it. have written following code doesn't work. <script type="text/javascript"> document.getelementbyclass("inventory").href="http://www.inspuratesystems.com/mandviwalla-motors/contact/"; </script> correct syntax: document.getelementsbyclassname("inventory") if there's 1 such link on webpage try accessing first element above method returns array of dom objects document.getelementsbyclassname("inventory")[0].href

symfony - Preparing options for updating hierarchical categories using the Doctrine extension Tree -

i'm using doctrine extension tree managing categories in hierarchical way in symfony project. still, haven't found out how manage add/edit part in twig : can display html tree structure childrenhierarchy() method, go further , have : root - cat 1 (+) -- cat 1-1 (+) -- cat 1-2 (+) - cat 2 (+) the (+) open modal displaying (category) textfield, allowing branch element on selected parent. i haven't seen in doc, (and don't if it's possible) use method childrenhierarchy() options allowing html, ajax call. my entity basic : <?php namespace cpasimusante\simupollbundle\entity; use doctrine\orm\mapping orm; use doctrine\common\collections\arraycollection; use claroline\corebundle\entity\user; use gedmo\mapping\annotation gedmo; /** * simupoll categories * * @orm\entity(repositoryclass="gedmo\tree\entity\repository\nestedtreerepository") * @orm\table( * name="cpasimusante__simupoll_category", * uniqueconstraints...

python - How to delete ndb ComputedProperty -

i can't del on computedproperty. if remove property in model, then, when result can see last value. dbexamcorrection(key=key('dbexamcorrection', 4519216128458752), aid=6744627663077376, c=0, ca=0, correct=5, created=datetime.datetime(2016, 1, 26, 11, 40, 10, 35968), dm=0, feedback=none, ga=0, gv=0, ic=0, l=0, o=0, p=0, percent1=83.33333333333333, percent2=0.0, percent3=0.0, percent=none, questions=6, score=none, sum2=0l, sum=0l, tid=0, updated=datetime.datetime(2016, 1, 27, 7, 43, 47, 951561)) but if access value, raises: 'dbexamcorrection' object has no attribute 'percent1' i don't want store obsolete information in model. thanks in advance. one approach outlined here - migrating data when changing ndb field's property type basically fetch underlying entity (without using ndb) - dictionary , delete key/value , save entity. if have less 50,000 entities it's easier doing via remote api, means can without deploying new ...

mysql - SQL Integrity constraint violation: 1062 Duplicate entry -

when i'm updating products in magento-store externally accounting software i'm receiving following error in logs: sqlstate[23000]: integrity constraint violation: 1062 duplicate entry '727-0-4-0' key 'cc12c83765b562314470a24f2bdd0f36', query was: insert `catalog_product_entity_group_price` (`entity_id`, `all_groups`, `customer_group_id`, `value`, `website_id`) values (?, ?, ?, ?, ?) how fix this? whenever there issue related "sql integrity constraint" , have tried doing below , has worked me well: each time, plan update products using magento admin panel or source in magento. magento enterprise edition navigate system > configuration > advanced > index management > index options > set options "update when scheduled" magento community edition navigate system > index management > select > actions > change index mode > manual update > save these settings avoid sql integrity co...

scala - Tutorial to start with program and datatype refinement -

i read code generation isabelle/hol theories manual. however, still feel bit lost. need things linorder ? how can use e.g., red-black trees make things faster? how locale used in context of program refinement? ... is there tutorial started refinement? if not, there short, self contained, correct example? can develop example? let's assume have a :: 'a set , know finite a . how proceed generate example efficient code a ∈ a ? how express our knowledge of finite a . how can keep mathematical theory ( a ∈ a ) separate code generation , optimization? okay, i'll try best answer question. please feel free comment , edit improve it. if want karma, can copy answer , repost (if answer better, i'll delete answer). this user-guide helped me started. okay, let's assume have our theory in locale mylocale . locale mylocale = fixes :: "'a set" begin definition isina :: "'a => bool" "isina ⟷ ∈ a...

ios - Highlighting the correct answer in a quiz app -

i'm new ios development , have been working through online courses. in 1 of these develop quiz app , i'd improve skills improving app beyond covered in course. the app uses .json file 'database' of questions , answers. .json file looks follows... { "id" : "1", "question": "earth a:", "answers": [ "planet", "meteor", "star", "asteroid" ], "difficulty": "1" } ...and keeps going on 500 questions. at present, app presents user question 4 possible answers. in .json file, first answer correct answer, app coded shuffle answers correct answer not listed first. the app coded 4 buttons (i use 4 different coloured images buttons) displaying answers disabled , dimmed in appearance after user makes selection, except button selected not dimmed choice highlighted. what change button correct answer...

css - Replacing whole div in Internet Explorer -

i have got <div id="head"> placed logo made in css. problem doesn't work in internet explorer. i'd ask if there way replace whole div div if it's opened in internet explorer. want open <div id="headie"> image of logo in internet explorer instead of using css doesnt work in it. thank you. example, opened in google chrome <div id="head"><h1>logo</h1></div> but if it's going opened in internet explorer it's not going open <div id="head"><h1>logo</h1></div> open this. <div id="headie"><h1>logo</h1></div> you can use conditional comments so: <!--[if ie]> <div id="headie"><h1>logo</h1></div> <![endif]--> <!--[if !ie]><!--> <div id="head"><h1>logo</h1></div> <!--<![endif]--> but better if try write css works...

c++ - Armadillo: matrix.i(true) vs matrix.i()—one is a logic error, the other isn't? -

the input matrix looks this: [ 1 2 4 ] [ 4 5 6 ] [ 7 8 9 ] (mat1) wolfram alpha confirms has inverse. using matrix.i() (which means uses fast invert) yields approximately correct result of [ 1.0000 -4.6667 2.6667 ] [ -1.0000 6.3333 -3.3333 ] [ 1.0000 -2.0000 1.0000 ] (mat2) but turning slow mode on writing matrix.i(true) causes throw logic_error . any reason that? reason tried turn on multiplying inverted matrix vector of [ 15 ] [ 24 ] [ 35 ] (mat3) yields incorrect answer of [ -3.6667 ] [ 20.3333 ] [ 2.0000 ] (mat4) when should this , or [ -3.6667 ] [ 5.3333 ] [ 2.0000 ] (mat5) checking before multiplication confirmed input (mat3) correct, leading me believe fast inverse created incorrect matrix output (mat4 instead of mat5) . ... think of it, fast inverse correct , there no reason not correct... quandary. the main question is, written above, any reason matrix.i(true) causes logic error while matrix.i() doesn't?

Camel Mock test using file as input -

i want create mock test camel route uses input file: <route id="myroute"> <from uri="file:/var/file.log&amp;noop=true" /> . . . </route> so far have been able include "direct:start" element @ beginning of route , include manually file body:: context.createproducertemplate().sendbody("direct:start", "data1-data2-data3"); i guess there must better way doing it, without changing original spring xml file. ? you can either use property in from-statement , replace property in test, or can use camel-test's weaving support modify route test. here's example of latter: import org.apache.camel.endpoint; import org.apache.camel.endpointinject; import org.apache.camel.builder.advicewithroutebuilder; import org.apache.camel.builder.routebuilder; import org.apache.camel.component.mock.mockendpoint; import org.apache.camel.test.junit4.cameltestsupport; import org.apache.commons.io.fileut...

hybrid - How to route or proxy a link from a WAS Liberty Core running MFP 7.0 -

i have mfp 7.0 running liberty core. hybird mobile app accessing context root, https://hostname:10080/appname . want route or proxy internal api returns image. path protected basic authentication can access in same port, 10080. ex. https://hostname:10080/appname/imageapi/image/name_of_employee image api >> http://hostname:10002/internalapi/image/ want route here when accessing link above. how configure on was's server.xml? edit: added sample link image api service. there no configuration-only mechanism in liberty act reverse proxy origin server. you'd need create resource via servlet or webservices endpoint makes outbound http request in way or , uses response fulfill frontend request. this range finding open-source reverse proxy servlet or writing own webservices client, apache httpclient, or httpurlconnection quick , dirty proof of concept.

command - Trying to make this CMD line work -

so created context menu in registry hkey_classes_root > * > shell > copy > commmand > cmd /c dir "%1" /b /a:-d /o:n | clip this copies file name when right click on file, yet want add copy text before file name. so db.yetteh.co.uk/%1 %1 being filename. cmd /c echo db.yetteh.co.uk & dir "%1" /b /a:-d /o:n | clip any ideas? cmd /c (echo db.yetteh.co.uk&dir /b /a:-d /o:n "%~1")|clip should work you.

python - Get duration of each word in an audio file -

is possible approximate duration of each word in audio file? closest thing (for audio files youtube videos) download captions file srt . srt have duration each sentence in video. i wondering if possible somehow duration each word in sentence. maybe not accurate around ?

how to get a specific word out of string in php -

i working on wordpress plugin. want url of website , page name out of www.example.com/pagename in case want pagename . used native php function $_server['request_uri'] url of website. stored in $url variable shown below. $url= $_server['request_uri']; i when echo url var /ifar/wellington/ $name= "wellington"; /* want */ how can wellington out string , store in $name . actually should use router, https://github.com/auraphp/aura.router or other. simple , quick answer $parts = explode('/', trim($url, '/')); $name = $parts[1]; if want 2nd uri segment.

objective c - Getting app version is crash -

i having code app version , save nsdictionary : nsstring *version=[nsstring stringwithformat:@"%@",[[nsbundle mainbundle] objectforinfodictionarykey:@"cfbundleversion"]]; nslog(@"version%@",version); //prints right thing nsmutabledictionary *dic; [dic setvalue:version forkey:@"version"]; //crash [dic setvalue:errors forkey:@"errors"]; //work the error on crash : setvalue:forundefinedkey:]: class not key value coding-compliant key version can identify error ? thanks lot . i had allocate dictionary : nsmutabledictionary *dic=[[nsmutabledictionary alloc]init];

security - Whitelist my desktop application in user's machine -

Image
i have desktop application built installjammer. application not problem when installed on user's machine, anti-virus on user's machine stops services created application , stops communicating server. need whitelisted won't treated risk machine , anti-virus won't stop it. what i've known far is adding 'publisher' application may treated not risky process has steps of authenticating application certificate. (though don't know if correct. i've refereed this link) googling found anti-viruses site asking me register application there. my questions: adding 'publisher' serve purpose? if yes, how whitelist application? if above option doesn't work, need whitelisted each , every anti-virus software product? answer after achieved wanted this. tl;dr; for people directly reading answer: i had installer windows(built using installjammer) creates windows services on user's machine, got blacklisted anti-virus progra...

javascript - How can I download Jnlp file embeded in Internet Explorer -

i wondering if possible download these interactive models. please have these files. http://expeditionworkshed.org/workshed/push-me-pull-me/ i forward prompt reply. many thanks, leo the solution... you can it, can illegal. simply @ source code of html page. line 103: <object classid="java:sketch_04.class" type="application/x-java-applet" archive="sketch_04.jar,point2line.jar,batikfont.jar,geomerative.jar,controlp5.jar,core.jar" width="1200" height="765" standby="loading pushmepullme software..." style="z-index:2;"> so need download these files: sketch_04.jar,point2line.jar,batikfont.jar,geomerative.jar,controlp5.jar,core.jar they located local, call expeditionworkshed.org/applets/beams/sketch_04/sketch_04.jar and on. but... be aware might not work on local machine , might illegal in right. i give answer show how stuff ou...

databus - How to assign the data bus with data more than the width in verilog -

i have data bus of width [127:0] 128 bits. i have data of [4095:0] 32769 bits . i want send continuously 4kb data through data bus. how can this? i think can split data 128 bits , send it. in case need ever clock can store fifo take huge chunk of data. split , send. take chunk.

android - How to set proxy settings not in project's gradle.properties? -

i need set proxy settings android studio (v1.5.1) project (on ubuntu). every time need (e.g. when downloading external library), android studio proposes write them gradle.properties , no other option. since file version-controlled on git repository, need set them somewhere else. any suggestion? you can use /home/user/.gradle/gradle.properties file. this file not under version control , used projects in machine. file used gradle without setting, , can use store reserved data example. the configuration applied in following order (if option configured in multiple locations last 1 wins): from gradle.properties in project build dir . from gradle.properties in gradle user home .

php - entering a number into a query -

i've been stuck @ while , i'm sure simple fix can't find answer it. i'm trying remove row in table variable i'm putting query isn't being recognized. in $remove query below, if enter number corresponds row query works fine, when use variable won't. if (isset($_post['remove'])) { $remove = $_post['remove']; //echo $remove; print number entered $query ="delete dogid regdogs dogid = $remove "; if($query_run = mysql_query($query)){ $query_num_rows = mysql_num_rows($query_run); if($query_num_rows==1) echo 'entry removed '; else echo 'not removed '; } thanks $query ="delete regdogs dogid = $remove "; try this. syntax error. again, please move mysqli_ methods. mysql_ methods deprecated.

Display Last Modified Date of web page using Apache modules and Javascript/jQuery -

how last modified date of file using html dom lastmodified property. @ present, code have returns present date. reading other posts see because either: a)the document indeed being modified on-load due js dom manipulation etc and/or b) need adjust apache server configs return information in header document.lastmodified can use display last-mod date instead of current date. how use mod_expires or other module this? -or- can somehow use ssi directive: <!--#flastmod virtual="$document_uri" --> to retrieve info , capture via javascript use somewhere else in page. i not want have place in every location want show it, rather use in globally included footer or header , use javascript/jquery dynamically render last modified date in various other html elements. here code using now, hope helps show how plan implement in in html: $(function() { var x = new date(document.lastmodified); var frmt_options = { weekday: "long", year: "numeric...

postgresql - How to use operands for json in postgres -

i using postgres 9.4. how use regular operands such < , > <= etc json postgres key numeric, , value text till limit of key numeric value reached? this table: create table foo ( id numeric, x json ); the values json follows: id | x ----+-------------------- 1 | '{"1":"a","2":"b"}' 2 | '{"3":"c","4":"a"}' 3 | '{"5":"b","6":"c"}' so on randomly till key 100 i trying id, keys, values of json key key <= 20. i have tried: select * foo x->>'key' <='5'; the above query ran, , should have given me 20 rows of output, instead gave me 0. below query ran, , gave me 20 rows took on 30 mins! select id , key::bigint key , value::text value foo , jsonb_each(x::jsonb) key::numeric <= 100; is there way use loop or do-while loop until x = 20 json? there way run time reduced? a...

c# - How to solve the subquery -

i have data this sr_no/ accessionno / roll_no / price --------------------------------------- 1 / 101 / 45 / 1000 2 / 102 / 46 / 2000 3 / 101 / 43 / 500 i have written query select * circulation max(sr_no) in (select * circulation accessionno = @accessionno) i want values accession no given textbox , should the maximum value of sr_no , info sr_no auto incremented. my query not working i student , started c# quite few months ago sorry bad english i got error an aggregate may not appear in where clause unless in subquery contained in having clause or select list, , column being aggregated outer reference. 1 expression can specified in select list when subquery not introduced exists. i want when type 101 accession no. return info 3 / 101 / 43 / 500 you wanted this: select * circulation sr_no = (select max...

How does Rust deal with structs as function parameters and return values? -

i have experience in c, i'm new rust. happens under hood when pass struct function , return struct function? seems doesn't "copy" struct, if isn't copied, struct created? in stack of outer function? struct point { x: i32, y: i32, } // know it's better pass in reference here, // want clarify point. fn copy_struct(p: point) { // return value created in outer stack // won't cleaned while exiting function? point {.. p} } fn test() { let p1 = point { x: 1, y: 2 }; // p1 copied or copy_struct // use reference of 1 created on outer stack? let p2 = copy_struct(p1); } as long time c programmer playing rust recently, understand you're coming from. me important thing understand in rust value vs reference ownership, , compiler can adjust calling conventions optimize around move semantics. so can pass value without making copy on stack, moves ownership called function. it's still in calling function...

python 2.7 - Keeping duplicates and deleting rest from pandas dataframe -

i have 3 different pandas dataframe, have concatenated. keep rows appear in 3 columns , delete rest. instance column1 column2 column3 0 john sam 1 sam b rob 2 daniel c john 3 varys d ella i want keep rows in column1 , appear in both column1 , column2 . in above example row -- 0 & 1. desired output column1 column2 0 john 1 sam b filter df pass series 'column3' arg isin test membership: in [42]: df[df['column1'].isin(df['column3'])] out[42]: column1 column2 column3 0 john sam 1 sam b rob

uialertview - Put a gap in between two views in Swift Alert -

i created alert view 2 text field user enter details. alert view generated programmatically shown below. there way put gap in between 2 text field?. let alertcontroller = uialertcontroller(title: "register", message: "", preferredstyle: .alert) alertcontroller.addaction(okaction) alertcontroller.addtextfieldwithconfigurationhandler { (textfield) in textfield.placeholder = "name" textfield.keyboardtype = .emailaddress } alertcontroller.addtextfieldwithconfigurationhandler { (textfield) in textfield.placeholder = "email" textfield.securetextentry = false } alertcontroller.addtextfieldwithconfigurationhandler { (textfield) in textfield.placeholder = "company" textfield.securetextentry = false } self.presentviewcontroller(alertcontroller, animated: true) { // ... } here screenshot i can suggest better way. create custom xib file , use present view controller create ...

xmpp - How to auto join on a group/conference on login -

i using smack xmpp client library, want implement whatsapp group functionality. once in group, in there until leave group or admin removes me. but while implementing this, able join group, disconnected need rejoin manually in group. as have read(correct me if wrong), if add conference in bookmark autojoin=true , automatically joined on login. doing programatically this. bookmarkmanager bookmarkmanager = bookmarkmanager.getbookmarkmanager(connection); bookmarkmanager.addbookmarkedconference(mucname, conferencename, true, nickname, null); even if sending autojoin value true, still not able auto joining in group. using ejabberd server. can help...

.htaccess - How to set rewrite cond apache by Ip range -

i have rewrite cond in .htaccess rewritecond %{remote_addr} !^195.16.40.50 how set rewritecond ip range 192.168.0.0 192.168.32.255 this condition should match ip range: rewritecond %{remote_addr} ^195\.168\.([0-9]|[1-2][0-9]|3[0-2])\.[0-9]+$

php - Use form button to submit GET value -

i have following code submit values: <form method="get"> <input type="hidden" name="price" value="asc" /> <input type="submit" value="price low high" /> </form> <form method="get"> <input type="hidden" name="price" value="desc" /> <input type="submit" value="price high low" /> </form> <form method="get"> <input type="hidden" name="price" value="" /> <input type="submit" value="default" /> </form> which working fine. not repeating myself 3 forms, there way have single form, , define values submitted buttons? still need have same information visible user e.g. button submits desc needs display price high low use code: <form method="get"> <input type="submit" name="price...

debugging jasmine test cases run by gulp in visual studio code? -

Image
i'm trying debug jasmine test cases in visual studio code debug console. below launch.json , gulpfile.js configuration : in gulp task tried using 'gulp-jasmine' run test cases , "gulp-karma" ( commented below jasmine ) alternatively. using either 1 can excute test cases through command line ( gulp "task name" ) or through task.json file in vs code. however, want debug jasmine test cases( spec/stockspec.js ) itself. on running debug (f5), debugger pauses on entry point in gulpfile.js below : from here on i'm not able navigate jasmine test cases no matter scenario choose: scenario 1 : on clicking step on (f10) --it skips next gulp task scenario 2 : on clicking step in/out (f11 / shift +f11) --it jumps internal module.js , index.js etc files. how should proceed further? this runs through gulpfile.js , doesn't trigger gulp task itself. startup program needs gulp.js gulp task argument. can set breakpoint in unit test. t...

How to understand the "Densely Connected Layer" section in tensorflow tutorial -

Image
in densely connected layer section of tensorflow tutorial, says image size 7 x 7 , after been processed. tried code, , seem these parameters works. but not know how 7 x 7 dimension. understand that: the original image 28 x 28, in 1st conv layer, max_pool_2x2 function reduce both of image dimension factor of 4, after first pooling operation, image size 7 x 7 here's not understand in 2nd conv layer, there max_pool_2x2 function call, think image size should reduce factor of 4 again . did not. which step got wrong? you need know stride of max pool , convolution. def conv2d(x, w): return tf.nn.conv2d(x, w, strides=[1, 1, 1, 1], padding='same') def max_pool_2x2(x): return tf.nn.max_pool(x, ksize=[1, 2, 2, 1], strides=[1, 2, 2, 1], padding='same') here, can see convolution has stride of 1 , max pool has stride of 2. how can @ max pool, takes 2x2 box, , slides on image, each time taking maximum value on 4 pixels....

javascript - $.getJSON - unable to catch response when using parameters in url -

i have been struggling since yesterday following piece of code. function findlocation(){ alert(1); $.getjson( "http://www.omc4web.com/geoip/geoip.php", {ip: "127.0.0.1", callingurl: "www.thissite.com" }, function( result ){ alert(2); $.each(result, function(i, field) { alert(i); if(i=="country") { country_code = field; } }); }) } it not seem want beyond calling of php script. returned data {"country":"us","store":"us"} function not seem want process , never alert(2). have placed monitors in php script , can see indeed called correct parameters , return data expected. if call http://www.omc4web.com/geoip/geoip.php?ip=127.0.0.1&callingurl=www.thissite.com browser see data returned. the same piece of code calling url no parameters behaves correctly, not above setup. my few remaining hairs apprecia...

Algolia style API documentation -

i way algolia has approached multi-programming language api documentation, e.g. https://www.algolia.com/doc/javascript . does know chance technologies use generate it? the documentation generator we're using internal tool. might open-source @ point, require work time don't have. it's markdown file syntax to: handle multiple languages code blocks (it automatically selects one) handle conditions depending on current language handle callouts handle buttons the rendering hand-made of bootstrap.

mysql - Delet just one record of duplicate -

i trying delete e-mail duplicates table nlt_user query showing correctly records having duplicates: select [e-mail], count([e-mail]) nlt_user group [e-mail] having count([e-mail]) > 1 now how can delete records having duplicate one? thank you try : delete n1 nlt_user n1 inner join nlt_user n2 on n1.e-mail=n2.e-mail , n1.id>n2.id; this keep record minimum id value of duplicates , deletes remaining duplicate records

javascript - Selectize.js update option label from ajax -

i have drop down select field rendered server, , contains selected option only, value no text. <select name="countrycode"> <option value="us" selected="selected"></option> </select> later, initialize selectize $('[name=countrycode]').selectize({ load: function(query, callback) { $.ajax({ url: `countrycode.php?q=${query}` }).done((data, textstatus, jqxhr) => callback(data.countrycodes)); } }); where countrycode.php returns following json { countrycodes: [{ text: 'united states', value: 'us' }, ... } is there way update text label of rendered option?

iis - Edit file from inetpub folder in wix custom action -

i have reffered this question need edit file during wix installation not xml file. deploying web site through wix , need make changes in 1 file according user input. below custom actions <customaction id="customactionid_data" property="custactionid" value="fileid=[#filbefef0f677712d0020c7ed04cb29c3bd];myprop=[myprop];"/> <customaction id="custactionid" execute="deferred" impersonate="no" return="ignore" binarykey="customactions.dll" dllentry="editfile" /> and below code in custom action. string prop= session.customactiondata["myprop"]; string path = session.customactiondata["fileid"]; streamreader f = file.opentext(path); string data = f.readtoend(); data = regex.replace(data, "replacethistext", prop); file.writealltext(path, data); // throws exception. as under iiss intetpub folder action throws error fil...

android - Excluding jar file duplicate from build -

first of all, got this: * went wrong: execution failed task ':app:transformclasseswithjarmergingfordebug'. > com.android.build.api.transform.transformexception: java.util.zip.zipexception: duplicate entry: com/nostra13/universalimageloader/cache/disc/diskcache.class i use universalimageloader jar in app project, have library module uses exact same jar. i tried add app build.gradle file: compile (project(':imagesubsampling')){ exclude group: 'com.nostra13.universalimageloader', module: 'com.nostra13.universalimageloader' } or compile (project(':imagesubsampling')){ exclude group: 'com.nostra13', module: 'universalimageloader' } or compile (project(':imagesubsampling')){ exclude group: 'com.nostra13.universalimageloader' } nothing works. therefore, question is: compile (project(':imagesubsampling')){ <what write here exclude jar fil...

Swift metatype (Type, self) -

i trying understand : " self, dynamictype, type ". have code : class someclass {} let cls : someclass.type = someclass.self let cls2 : someclass = someclass() are cls , cls2 same thing ? can give detail differences ? no, cls , cls2 different things. easiest way understand difference extend example this: class someclass { class func doit() { print("i'm class method. belong type.") } func doitonlyifinstanceofthistype() { print("i'm instance method. belong type instance.") } } and let's take cls : let cls : someclass.type = someclass.self cls.doit() that print i'm class method. belong type. . cannot invoke this: cls.doitonlyifinstanceofthistype() // causes compilation error, pro tip: can use method func property, i'll add explanation later let's take cls2 . visible method of doitonlyifinstanceofthistype because it's instance method (of type). let cls2 : somecla...

Solr-5.4.0 not accepting json input -

i trying use solr-5.4.0. need implement, search functionality using solr json files.i have started solr in command prompt.now using cygwin update json.but showing following html error.i didn't got clear idea work in solr.please solve this. $ curl http://localhost:8983/solr/update -h 'content-type:application/json' -d ' [ { "id" : "testdoc1", "title" : {"set":"test1"}, "revision" : {"inc":3}, "publisher" : {"add":"testpublisher"} "_version_" : {12345} } ]' <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <title>error 404 not found</title> </head> <body><h2>http error 404</h2> <p>problem accessing /solr/update. reason: <pre> not found</pre></p><hr><i><small>powered jetty://<...

jquery - How do you make an ASP.Net 3.5 WebService accept AJAX PUT requests? -

i not able webservice in asp.net 3.5 project accept put requests. here ajax call: var url = '/myservice.asmx/updateobject'; var options = { datatype: "json", contenttype: "application/json", cache: false, type: "put", data: data ? ko.tojson(data) : null }; $.ajax(url, options); in myservice.asmx, have following: [webmethod(enablesession = true)] [system.web.script.services.scriptmethod(responseformat = system.web.script.services.responseformat.json, usehttpget=true)] public butdto updateobject(objectdto myobject) { //do stuff here return myobject; } however, getting following error message: an attempt made call method updateobject using post request, not allowed. if remove ", usehttpget=true" web service declaration , perform same ajax call, getting following error message: an attempt made call method updateobject using request, not allowed. so bit baffled here. update ...

jquery - Send post data to iframe and reload the iframe -

i tried something using jquery, failed. $.ajax({ type: "post", url: "myphphere.php", data: { command: $('#command').var() } }); i thought refreshing page using onclick attribute of button submit form. why use target attribute in form? <form action="..." target="an_iframe" type="post"> <input type="text" name="cmd" placeholder="type command here..." /> <input type="submit" value="run!" /> </form> <iframe id="an_iframe"></iframe> hope solved problem.

excel - Calculating Clustering Coefficient -

i have data in form such as: ------------------------------------------------------------------------------- author_id year coauthor_count high medium low deviant paper_count ------------------------------------------------------------------------------- 677 2005 1 1.00 0.00 0.00 0.00 3 677 2007 3 0.66 0.00 0.33 0.00 1 677 2009 1 0.00 1.00 0.00 0.00 1 677 2011 5 0.60 0.00 0.40 0.00 1 677 2012 2 1.00 0.00 0.00 0.00 1 677 2013 5 0.60 0.40 0.00 0.00 2 1359 2005 11 0.00 0.00 0.81 0.18 11 1359 2006 27 0.00 0.14 0.70 0.14 20 1359 2007 29 0.00 0.06 0.62 0.31 12 1359 2008 29 0.00 0.10 0.55 0.34 13 1359 2009 2...

onclick - Jquery click function not doing anything -

i'm trying click event working, when user hits button alert displayed. end result, once button working should expand width of div. however, whenever click button nothing happens. won't display alert, print - nothing. ideas? <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script> <script> $(document).ready(function(){ $("button").click(function(){ alert("hello"); }); }); </script> the way have it, "button" effect <button> tags. add id button: , add # sign: $("#button").click. if doesn't work have solution...

Glassfish installation cacerts.jks vs cert8.db -

i have old glassfish v2 installation uses cert8.db truststore. ve set new installation of glassfish v3 import old one. found out tha v3 uses jks trustore (cacerts.jks). is neccesery change trustore *.db files ? if yes how? thank in advance

paypal - App submission phase for web site -

i've been implementing several adaptive api calls php-powered web site. in going live application there're several mentions "submitting app approval" mandatory step application id , allowed use production environment. i know web sites allowed use api because documents explictly guide seems assume you're writing app mobile device. how work when talking web site? supposed zip , upload complete web site sources assets , all, or enough send php class handles paypal part? 1. yes, we've asked paypal several days ago never got answer. 2. on-topic per faq : «software tools commonly used programmers [...] practical, answerable problems unique programming profession» when submit application asked provide url website , test user/password if applicable, person reviewing application test functionality if needed. don't need upload actual php code. regarding "yes, we've asked paypal several days ago never got answer", how did contact ...

Automatically follow latest console output in Intellij -

i have multiple console outputs in development environment, e.g. 1 deployment log, 1 server.log. switched eclipse, liked feature after calling deploy task console showed stuff , "build successful" , afterwards automatically switched server log console showing "deploying my.war" . now have switch latest output manually. there option follow recent tab of console? update : clarify, problem don't want have click on server.log-tab , scroll end, after redeploy, see successful deployment. plz help.

python - isnull: Dataframe altered when saving and reloading as csv? (v17.1) -

i'm working large dataframe , appears after saving csv altered. when reload csv it's fine, if don't, behaviour different. visible when doing empty_rows = df['columnname'].isnull() to clarify: saving dataframe csv , reloading (via df.to_csv , pd.read_csv) appears altering (fixing) dataframe. how possible?

python - Handle multiple values in column -

consider example data.table package in r: dt = data.table(id = c("b","b","b","a","a","c"), = 1:6, b = 7:12, c=13:18) dt = dt[, .(a=list(a), b=list(b), c=list(c)), by=id] dt id b c 1: b 1,2,3 7,8,9 13,14,15 2: 4,5 10,11 16,17 3: c 6 12 18 after want write file in order share structure. however, prohibits writing such things write.csv because of list type. solution found convert columns string . however, how can read file? there unified format can read in (almost) language without effort? you can create tab-seperated file follows: dt2 <- dt[, .(a=tostring(a), b=tostring(b), c=tostring(c)), by=id] write.table(dt2, "dt2.txt", sep="\t", row.names = false) which should readable languages. when want preserve lists, transforming json suggested @tigerhawkt3 best option: dt3 <- dt[, .(a=list(a), b=list(b), c=list(c)), by=id] library(jsonlite) to...

javascript - Jquery draggable collision detection bug -

there bug in jquery-draggable-collision library collision detection. divs overlapping though function collision detection called. can not solve it, if can me, grateful. example of bug here: http://jsfiddle.net/q3x8w03y/10/ $("#dragme1").draggable({ snap: ".bnh", obstacle: ".bnh", preventcollision: true, containment: "#moveinhere", start: function(event, ui) { $(this).removeclass('bnh'); }, stop: function(event, ui) { $(this).addclass('bnh'); } }); $("#dragme2").draggable({ snap: ".bnh", obstacle: ".bnh", preventcollision: true, containment: "#moveinhere", start: function(event, ui) { $(this).removeclass('bnh'); }, stop: function(event, ui) { $(this).addclass('bnh'); } }); this isn't bug. in fact, in fiddle, collision code working fine. problem that, after drag event ends, collider snapped obs...

multithreading - Why c++ threads are movable but not copiable? -

as title of question says, why c++ threads ( std::thread , pthread ) movable not copiable? consequences there, if make copiable? regarding copying, consider following snippet: void foo(); std::thread first (foo); std::thread second = first; // (*) when line marked (*) takes place, presumably of foo executed. expected behavior be, then? execute foo start? halt thread, copy registers , state, , rerun there? in particular, given function objects part of standard, it's easy launch thread performs same operation earlier thread, reusing function object. there's not motivation begin this, therefore. regarding moves, though, consider following: std::vector<std::thread> threads; without move semantics, problematic: when vector needs internally resize, how move elements buffer? see more on here .