Posts

Showing posts from July, 2013

html - PHP ReadFile Outputs an Indent? -

i'm using php code import text file html document. reason because i'm having page refresh every often, text new. here code: <!doctype html> <head> <meta http-equiv="refresh" content="5"> </head> <body> <xmp> <?php $date = date("y-m-d"); $file = "..\\chat logs\\$date.txt"; readfile($file); ?> </xmp> </body> </html> the $date.txt file has no special spacing. no indents. problem first line has output: [ 00:57:45 ] : <overlord> enemy spotted [ 01:00:51 ] : <shadowlordgamin> hi [ 01:00:58 ] : <shadowlordgamin> got game today :d [ 01:06:42 ] : <brazdnt> d: is there way remove initial indentation? appreciated. thanks. first off, <xmp> deprecated , badly supported. should use <pre> instead , escape text using htmlspecialchars() (which requires read text file_get_con...

php - PhantomJS with Wordpress -

i know sounds basic i'd appreciate help/guidence on how use phantomjs on wordpress project. i'm using windows 8.1 , local host xampp now. i've downloaded phantomjs , tested via command prompt , got result (pdf) want. i'd use on wp project not sure how started. i've tried copy phantomjs folder wp-content/plugins folder , run exec command no results @ all. i know there're lots of examples out there on how run phantomjs couldn't find wp.

java - how to avoid gson tojson recursion -

i have simple class: myobject: - string index; - myobject parent; - list<myobject> childs; i want print stored information json. use tojson function of gson library. due every child has link parent object face infinite loop recursion. there way define gson shall print parent index every child instead of dumping full information? you need use @expose annotation. public class myobject{ @expose string index; myobject parent; @expose list<myobject> children; } then generate json using gson gson = new gsonbuilder().excludefieldswithoutexposeannotation().create(); jsonstring = gson.tojson(data); edit: can dfs parse when convert object. make method like: public void setparents(myobj patent){ this.parent=parent; for(myobj o:children){ o.setparent(this); } } and call root object.

jvm - How to fix java.lang.UnsupportedClassVersionError: Unsupported major.minor version -

i trying use notepad++ all-in-one tool edit, run, compile, etc. i have jre installed, , have setup path variable .../bin directory. when run "hello world" in notepad++, message: java.lang.unsupportedclassversionerror: test_hello_world : unsupported major.minor version 51.0 @ java.lang.classloader.defineclass1(native method) @ java.lang.classloader.defineclasscond(unknown source) ......................................... i think problem here versions; version of java may old or new. how fix it? should install jdk, , setup path variable jdk instead of jre? what difference between path variable in jre or jdk? the version number shown describes version of jre class file compatible with. the reported major numbers are: java se 9 = 53, java se 8 = 52, java se 7 = 51, java se 6.0 = 50, java se 5.0 = 49, jdk 1.4 = 48, jdk 1.3 = 47, jdk 1.2 = 46, jdk 1.1 = 45 (source: wikipedia ) to fix actual problem should try either run java cod...

php - Docker - Application source code updates -

i know source code of application should copied using add live inside of docker container. this seems idea, if want able update application source code - twice day, or more often? most viable solution keep source code outside of application. can keep machine running , update source code using git. machine created this: docker run -p 80:80 -v /home/adam/projects/docker-test/src:/var/www/html webserver this means though if controlling machine onprem server, infrastructure on ec2, each time website opened files pulled on internet. what best solution issue? able keep redeploying container updated source code no downtime? actually, should copied copy , not add , in order limit cache invalidation. most viable solution keep source code outside of application. yes, instead of referring through remote source (a git server), have webhook (like github one ) which, on each push git server, pull said repo , keep up-to-date copy of source locally. then mount loca...

asynchronous - objective c, notify other threads -

my task download content, parse it, save in database , update ui after completion (or notify user error). used in different parts of application, want extract code separate class , use asynchronous facade. use nsurlconnection handle network tasks. nsurlconnection calls callbacks in separate thread. ui code should run in main thread. store set of blocks call , invoke them main thread dispatch_async, means main thread hardcoded. looks me want reinvent wheel , there should mechanism used in objective c communicate between threads, can't find it. want: receivers subscribe receive messages given identifier , specifying thread notifications should dispatched. sender sends message identifier , attached data. all subscribed receivers message in threads specified. or there pattern appropriate task? you can use nsnotificationcenter communicate between objects running on different thread.and post notification different thread. see apple nsnotificationcenter documentati...

javascript - Cannot read HTML5 video from local cache after using video.load() -

i want play list of mp4 videos local cache save network traffic. pretty sure videos in cache because when manually switch file 1.mp4,2.mp4,3.mp4,4.mp4 on video source, "network" panel of chrome development tools shows file served cache returns http 206. when try use javascript video playlist, after new video loaded, chrome start miss cache , try video internet , hence cost network traffic. video.load(); is there way make chrome load video cache? browser: chrome ver.50 html: <div id="video"> <video id="video-ads" autoplay preload="none"> <source id="video-source" src="https://foo.bar.net/video/1.mp4"> </video> </div> javascript: var cdn = "https://foo.bar.net"; var playlist = new array( cdn + "/video/1.mp4", cdn + "/video/2.mp4", cdn + "/video/3.mp4" ); var videocount = playlist.length; var = 0; video = doc...

Convert date (c#) -

good day! faced problem. need convert date. in database stored in format: 1332622254 1332622368 1332622467 1332622551 i format never encountered. format, not know. format in vfeueshu. in advance. it's time in seconds since midnight 1-1-1970: var epoch = new datetime(1970,1,1); var ts = timespan.fromseconds(1332622254); var date = epoch.add(ts); date 24-3-2012 20:50:54 edit or simpler, marcinjuraszek rightly stated: var epoch = new datetime(1970,1,1); var date = epoch.addseconds(1332622254); note might date/time in utc, maybe have adjust timezone.

Reading in dates from Excel into R -

i have multiple csv files need read r. first column of files contain dates , times, converting posixlt when have loaded data frame. each of csv files have dates , times formatted in same way in excel, however, files read in differently. for example, my file looks once imported: date value 1 2011/01/01 00:00:00 39 2 2011/01/01 00:15:00 35 3 2011/01/01 00:30:00 38 4 2011/01/01 00:45:00 39 5 2011/01/01 01:00:00 38 6 2011/01/01 01:15:00 38 therefore, code use amend format is: data$date <- as.posixlt(data$date,format="%y/%m/%d %h:%m:%s") however, files being read in as: date value 1 01/01/2011 00:00 39 2 01/01/2011 00:15 35 3 01/01/2011 00:30 38 4 01/01/2011 00:45 39 5 01/01/2011 01:00 38 6 01/01/2011 01:15 38 which means format section of code not work , gives error. therefore, there anyway automatically detect format date column in? or, there way of knowing how read, since format of column in excel same on both. ...

java - ByteBuffer.wrap came out unexpectedly -

i used bytearray create new string, results came out unexpectedly. here code void foo(byte[] data, ...) { bytebuffer bytebuf = bytebuffer.wrap(data, 0, 15); string msg = new string(bytebuf.array()); log.i("foo", string.format("bytearraysize=%d\t\tmsglen=%d,%d", data.length, bytebuf.array().length, msg.length())); } the length of byte array 518400. log info shows: bytearraysize=518400 msglen=518400,518400 rather than bytearraysize=518400 msglen=15,15 what wrong? that expected result. according javadoc bytebuffer.wrap() : wraps byte array buffer. the new buffer backed given byte array; is, modifications buffer cause array modified , vice versa. and bytebuffer.array() : returns byte array backs buffer (optional operation). modifications buffer's content cause returned array's content modified, , vice versa. that means bytebuffer.array() return same array wrapped bytebuffer.wrap() .

c# - Pass object at runtime using a string -

there loads of stuff on here reflection can't seem head around specific problem. my classes: public class box { public string name { get; set; } public int size { get; set; } } public class pallet { public box b1 = new box(); public box b2 = new box(); } the code creating object: pallet p = new pallet(); p.b1.size = 5; p.b2.size = 10; the code display size of chosen box: messagebox.show(p.b1.size.tostring()); i select box @ runtime using string. i.e. string boxid = "b1"; object myobj = p. + boxid; messagebox.show(myobj.size.tostring()); obviously code not work. correct way value of chosen box in case 5 ? since b1 , b2 fields, can them using getfield . on fieldinfo , call getvalue providing instance of pallet specific field for. box box = (box)typeof(pallet).getfield(boxid).getvalue(pallet);

android studio - Error: Current working directory is not a Cordova-based project -

when running code error cordova plugin add cordova-plugin-customurlscheme --variable url_scheme=ptw in cmd ,i getting error "error: current working directory not cordova-based project." why error coming.i unable fix it.here http://i.stack.imgur.com/nmb0w.png please suggest me.thank in advance. you have in project before launch has .cordova directory, config.json inside. has www directory, config.xml inside. has platforms directory. if update cordova npm install -g cordova hopes !

android - How to use layout_below in RelativeLayout? -

Image
here code(not code,i have deleted some): <relativelayout android:id="@+id/info_in_my" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@id/head_in_my" android:layout_margintop="@dimen/spacing_size_36dp"> <imageview android:id="@+id/pic_in_my" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginstart="@dimen/spacing_size_36dp" android:layout_alignparentstart="true" android:src="@mipmap/icon_policeman" /> <textview android:id="@+id/name_in_my" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="aaaaaa" android:lay...

android - Google play snapshot sync between devices strategy -

we're using google play saved games services (snapshot api) store savegames our game in cloud. besides backing savegames of course 1 of biggest reasons being able sync state of game between devices. now seems these snapshots coming on-device cache , not cloud. we're reloading state in intervals , when game has been running while there no way ensure date version of snapshot. this crucial when playing on device same google play account shortly after having played on other devices. any best practice advice best strategy here? if ' forcereload ' set ' true ', call clear locally cached data , attemp fetch latest data server. commonly used user-initiated refresh. normally, should set false gain advantages of data caching. link below useful documentation google apis android - snapshots: https://developers.google.com/android/reference/com/google/android/gms/games/snapshot/snapshots

ios - Accessing Swift variables added by Folder reference -

Image
actually spend around 3 hours in simple problem , googled lot no way. question simple. want add directory "folder reference" swift xcode project. no way access them. i don't need add using group reference, suggestions? update: if using folder references, there no way import them , must reference them using full directory path. ex: let image = uiimage(named: "images/icons/gopago") that way. depending on project requires, suggest using groupings below. the problem using folders , not grouping. there no import needed. need take in folder , "group" through xcode. able access in code. should yellow folder when group in there. so: and should this: if copying on directory, want make sure select create groups follows. :

java - Multiple servlets with different context in one Spring application -

i have spring application, has have 2 servlets ( dispatchermain , dispatchercatalog ) working different databases via hibernate ( finance , finances_global ). first , in web.xml define: parent context config location ( application-config.xml ) servlets , own: context config locations ( dispatchermain-servlet.xml , dispatchercatalog-servlet.xml ) hibernate datasources config files ( databaseconfigmain.xml , databaseconfigcatalog.xml ). second , in each of servlets' config file, create bean mainconfig reads resource bundle - separate each servlet ( mainservlet.properties , catalogservlet.properties ). but turns out that configuration files never read, deployment failes. in log file, have lots of java.lang.runtimeexception: can't read property "server.redis" , caused by: java.lang.nullpointerexception @ klab.backend.utils.mainconfig.get(mainconfig.java:351) . what doing wrong? here configs. web.xml : <?xml version="1.0" encod...

Meteor autoform-file not working -

i'm trying autoform-file working ( https://github.com/yogiben/meteor-autoform-file ), doesn't seem doing @ all. as per quick start, i've done following: 1) defined collection right permissions: images = new fs.collection("images", { stores: [new fs.store.filesystem("images", {path: "~/meteor_uploads"})] }); images.allow({ insert: function (userid, doc) { return true; }, download: function (userid) { return true; } }); 2) published collection: meteor.publish('images', function () { meteor.images.find({}); }); 3) updated router wait subscription: router.route('/test', { waiton: function () { meteor.subscribe('images'); }, action: function () { this.render('test', {to: 'main'}); } }); 4) defined schema: test.attachschema(new simpleschema({ username: { type: string, label: "title", max: 10...

jsp (jstl 1.2) - set a variable from a java list -

(i using jstl version 1.2 , java 6) i working legacy code has logic in jsp pages, aside need loop on list of data, match on , set variable list value (arraylist in case). reason need loop on list found later on in jsp file. here snippet of code have far, not work: <c:set var="listofchilddata" value="${[]}" scope="page"/> <c:foreach items="${otherlistofdata}" var="data"> <c:if test="${data.id == datatomatchon.id}"> <c:catch var="exception">${data.children}</c:catch> <c:if test="${empty exception}"> <c:set var="listofchilddata" value="${data.children.toarray()}" scope="page"/> </c:if> </c:if> </c:foreach> do need manually go through each item in list , add listofchilddata ? reading around, examples found of creating array variable scratch , not variable. if com...

android - Floating Action Button from support library custom animation (pre lollipop) -

i add rotate animation simulate circular progress bar time consuming operations started fab. working nicely on lollipop, animation not start on kitkat. glue? thanks. compilesdkversion 23 buildtoolsversion '23.0.2' minsdkversion 16 compile 'com.android.support:design:23.1.1 compile 'com.android.support:support-v4:23.1.1' layout.xml <android.support.design.widget.floatingactionbutton android:id="@+id/review_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparentbottom="true" android:layout_alignparentright="true" android:layout_gravity="center" android:layout_margin="@dimen/fab_margin_right" android:src="@drawable/ic_send_white_24dp" android:visibility="invisible" app:elevation="@dimen/elevation_high" tools:visibility="visible" /> myfra...

ios - Does launchOptions 'UIApplicationLaunchOptionsLocalNotificationKey' contain NSDictionary or UILocalNotification -

ok, i've read various articles on how check local notifications in didfinishlaunchingwith options. example nshipster article claims remote , local keys both contain nsdictionary. http://nshipster.com/launch-options/ however, tested , contains uilocalnotification, , other articles says well. so, i've looked around not found definitive answer. os version issue? different versions contain different objects, or what? pointers appreciated. edit: from nshipster article: "a local notification populates launch options on uiapplicationlaunchoptionslocalnotificationkey, contains payload same structure remote notification: uiapplicationlaunchoptionslocalnotificationkey: indicates local notification available app process. value of key nsdictionary containing payload of local notification." according apple documentation , uiapplicationlaunchoptionslocalnotificationkey give uilocalnotification object. if default action button tapped (on device runni...

php - Decoding Plesk passwords -

first time question. i have customer panel shows plesk 12.5 password. put in manually when generate password. customers change password, forget , fails. use plesk api receive password, encrypted. $5$cngpmnfxtsfrswhh$nntntlj0klkheidk.xvwgbyv9hcae8yv/fog0c6ag17 i found out key found in /etc/psa/private/secret_key . i tried: $res_non = mcrypt_decrypt(mcrypt_rijndael_128, $key, $hash, 'ecb'); $decrypted = $res_non; $dec_s2 = strlen($decrypted); $padding = ord($decrypted[$dec_s2-1]); $decrypted = substr($decrypted, 0, -$padding); but doesn't return password correctly. any appreciated, thanks! this appears sha256crypt hash, without storing number of rounds (which means it's hard-coded). if so, this isn't encrypted . hashing not encryption. hashing subtopic of cryptography, wholly separate encryption. hashing: one-way transformation of infinite set of possible values value in large finite set of possible outputs. keyless. encryption: rever...

Convert a Base64 into an image in javascript -

<script type="text/javascript"> window.onload = function() { var options = { imagebox: '.imagebox', thumbbox: '.thumbbox', spinner: '.spinner', imgsrc: 'avatar.png' } var cropper = new cropbox(options); document.queryselector('#file').addeventlistener('change', function(){ var reader = new filereader(); reader.onload = function(e) { options.imgsrc = e.target.result; cropper = new cropbox(options); } reader.readasdataurl(this.files[0]); this.files = []; }) document.queryselector('#btncrop').addeventlistener('click', function(){ var img = cropper.getdataurl(); document.queryselector('.cropped').innerhtml += '<img src="'+img+'">'; ...

cordova - Phonegap android apk splash not working -

phonegap android apk splash not working. we have added splash image inside these folders: platform/android/res/drawable-port-hdpi/ platform/android/res/drawable-port-ldpi/ platform/android/res/drawable-port-mdpi/ platform/android/res/drawable-port-xhdpi/ screen.png,splash.png

visual studio 2012 - Nuget manager not visible -

i getting following error once run project in visual studio 2012. warning 1 nuget packages installed using target framework different current target framework , may need reinstalled. visit http://docs.nuget.org/docs/workflows/reinstalling-packages more information. packages affected: microsoft.web.infrastructure, signalr.hosting.aspnet, signalr.server reinstalling packages seem pretty straightforward. but, can tricky since following may affect or affected it: project retargeting or project upgrade target framework of project gets changed package dependencies , versionsdependent packages , versions. suggest should read document. https://docs.nuget.org/consume/reinstalling-packages read when reinstall packages , watch for section.

tsql - Stopping T-SQL converting Hex to ASCII -

i'm trying trimmed hex value int. converting int hex no troubles using; convert(varbinary(1),43) --this creating 0x2b result i want show value 2b when sort of conversion varchar(), cast or right() hex converted ascii character , can't it. does know way of preserving hex value while removing leading 0x? if value in range 0 255 can use brute force: -- 1 value. declare @vb varbinary(1) = 43; select @vb [varbinary], substring( '0123456789abcdef', ascii( @vb ) / 16 + 1, 1 ) + substring( '0123456789abcdef', ascii( @vb ) & 15 + 1, 1 ) [hex]; -- test range 0 255. numbers ( select 0 number union select number + 1 numbers number < 255 ), numberswithvarbinary ( select number, cast( number varbinary(1) ) vb numbers ) select vb [varbinary], substring( '0123456789abcdef', ascii( vb ) / 16 + 1, 1 ) + substring( '0123456789abcdef', ascii( vb ) & 15 + 1, 1 ) [hex] numberswithvarbinary option ( m...

ssl - Relation between QT_NO_SSL and QSslSocket::supportsSsl() -

there define qt_no_ssl , defined if there no ssl library found. there method qsslsocket::supportsssl() . but how these 2 related, equivalent? qt_no_ssl <=> qsslsocket::supportsssl() returns false hold or possible qt_no_ssl not defined, qsslsocket::supportsssl() returns false? qt (at least openssl backend) can compiled: with no ssl support -- qt_no_ssl defined, ssl classes not available compilation; with ssl support loaded @ runtime => openssl headers must present @ compile time, qtnetwork won't link libssl / libcrypto /...; instead, dlopen libraries @ runtime looking functions needs; with ssl support linked qtnetwork. the reason has fact linking qtnetwork cryptographic library opens legal problems in terms of redistribution from/to us. #3 must have ssl libraries around or application won't start, if don't need ssl @ all; , qt installers can't "easily" ship ssl libraries. instead qt gets compiled in configuration #2 , you ...

r - Sort a dataframe column by the frequency of occurrence -

i have dataframe in called df, there 3 column lets say, region id salary 1 a1 100 1 a2 1001 1 a3 2000 1 a4 2431 1 a5 1001 .............. .............. 2 a6 1002 2 a7 1002 2 a8 1002 3 a9 3001 3 a10 3001 3 a11 4001 now want sort column salary occurrence of them region, using frequency table or something, probability of occurrence per region , sort them. please assume dataset large enough (1000 rows) p.s: can suggest method some. please use column name in answers since real table has column in middle thanks in advance **edit 1** i think not clear enough, replied, sincerely apologise not being clear: with current dataset need create frequency table say: region salary(bin) count 1 1k 6 1 5k 3 1 2k 2 1 15k 2 1 0.5k 2 ...

python 2.7 - Obtain progress in reading large text file -

i have large text file (several gb in size) need read python , process line line. one approach call data=f.readlines() , process content. approach know total number of lines , can measure progress of processing. not ideal approach given file size. the alternative (and think better) option say: line in f: just not sure how measure progress anymore. there option not add huge overhead? (one reson why may want know progress 1 have rough indicator of remaining time, lines in file have similar sizes, , ascertain whether script still doing or has gotten stuck somewhere.) if using linux os there way out seems. a = os.popen("wc -l some.txt") f = a.read() on reading number of lines name of file

visual studio - Trouble with Expression in SSIS Derived Column Transform Editor -

this question has answer here: ssis how part of string separator using derived column 3 answers i need split 1 column 2 columns. data in column split dash (see below) , has parenthesis between text. example of column: (data1) - (data2) i have query used against database works, having trouble creating expression in ssis. here queries have used in ssms generate new columns without dash , parenthesis: to data on left side of column new column: select substring(replace(replace(replace(column_name,'(',''),')',''),' ',''),0,charindex('-', replace(replace(replace(column_name,'(',''),')',''),' ',''))) new_column_name table to data on right of column new column: select substring(replace(replace(replace(column_name,'(',''),')','...

jquery - django: bootstrap menu doesn't collapse on mobile device -

for project have use bootstrap. having default fixed navbar bootstrap examples included in base.html , trying out on mobile devices menu when tapped doesn't opened nor when desktop browser shrinked. here's bootstrap code i'm utilizing: <!-- fixed navbar --> <nav class="navbar navbar-default navbar-fixed-top"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar"> <span class="sr-only">toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> </b><a class="navbar-brand" href={% u...

java - Launch process (file) within from a .jar script -

i'm trying figure out how example run file/app located on desktop. in case, test everything, created batch file called test.bat , inside there command: @echo msg * hello which pop-up message box. this should launched within netbeans jbutton, have: private void jbutton1actionperformed(java.awt.event.actionevent evt) { // todo add handling code here: runtime rt = runtime.getruntime(); process pr = rt.exec("msg * hello"); } however every time hit button, nothing happens. in addition, read several posts here on stackoverflow, still cant figure out i'm doing wrong, since error message adding lines runtime rt = runtime.getruntime(); process pr = rt.exec("start test.bat"); for line: process pr = rt.exec("start test.bat"); which says: unreported exception ioexception; must caught or declared thrown how can launch (maybe oth...

javascript - Circular Dependencies with RxJS. Modeling spores -

i try model game rxjs. found troubles circular dependencies. so, simplified game simple simulation(i left 'move' action). can find code below(i omitted parts, can find the repo here ) const rx = require('rx') const math = require('mathjs') const _ = require('underscore') const field_size = 10 const ctx = require('axel'); let getinitialstate = () => { return { size: field_size, people: [ { x: 0, y: 0 }, { x: 9, y: 9 }, { x: 5, y: 5 } ] } } var drawworld = ({size, people}) => { // draw world logic } let getmove = (index)=> { let [xoffset, yoffset] = [[0,1], [1,0]][math.pickrandom([0, 1])] let direction = math.pickrandom([-1, 1]) return (state) => { let {people} = state let p = people[index] people[index] = { x: math.max( 0, math.min(p.x + xoffset * direction, field_size-1)), y: math.max( 0, math.min(p.y + yoffset * direc...

Eclipse - pydev - Fatal Python error: Py_Initialize: Unable to get the locale encoding -

i have python 3 script invoking python 2.7.x script, using subprocess.popen. myproc = subprocess.popen( "/path/to/my/python/3/script", stdout=subprocess.pipe, stderr=subprocess.pipe, cwd=mypwd, shell=true) when debug script using eclipse , print out stderr see following issue: fatal python error: py_initialize: unable locale encoding the issue not seen when execute same code in script outside eclipse. any solve appreciated! same problem subprocess.check_call i've solved mine passing env subprocess.check_call(cmd,env={'path': '/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games', 'lang': 'it_it.utf-8', }) i think pydev changes environment magic. not sure both path , lang needed.

caching - SQL Server 2008 - cached sa password? -

something odd has happened earlier week @ work, , after researching , googling answer, still none wiser! so hoping shed light on might have occurred. i after company's database , on monday - logged check on things , ok. the next day, job failed run, on step updates database using 'sa' account - had login failure. so after checking sql server logs, can see 20 minutes after had logged off, 'sa' had began fail every 6 minutes. so after speaking company said changed 'sa' accounts password last friday, , had half expected job fail on weekend, had taken until following tuesday fail. this doesn't make sense me - sounds sa credentials had been cached, , when opened , closed management studio on monday, had purged cached credentials? does perhaps know why behaviour has occurred, explanation absolutely awesome. seems strange me right now! the credentials, or connections. changing sa password not invalidate open connections. , if have ...

Custom data from paypal JS button into webhook -

the javascript paypal button, http://paypal.github.io/javascriptbuttons/ allows custom data sent in data-custom field. when using ipn, these data visible , usable. however, don't find mention of custom data in webhook documentation; expect "sale completed" event receive custom data. so question twofold: has managed data , knows field contains them? is there way simulate this, given webhook simulator not allow field entered? webhooks not support custom data simulator. simulator provides sample of payload event. not allow other data field except url/eventtype. if want use custom data may use them , don't want use live account testing, can try sandbox account , go through flow webhook event type want send custom data. also sample payment.sale.completed reference: { "id": "wh-2wr32451hc0233532-67976317fl4543714", "create_time": "2014-10-23t17:23:52z", "resource_type": "sale", ...

Create video at 1 fps -

i have sequence of files names img-001.png , img-002.png etc. want assemble them video 1 image per second (fps=1). how can avconv ? have tried using avconv -i img-%03d.png -r 1 a.avi avconv -i img-%03d.png -framerate 1 a.avi avconv -i img-%03d.png -framerate 1 -r 1 a.avi neither of these work properly. seems video produced @ fps=24 , takes img-001.png , img-025.png ... , skips every image in between. try avconv -framerate 1 -i img-%03d.png -r 1 a.avi (this syntax works ffmpeg; should work here too)

Laravel Elixir wrong paths -

this gulpfile.js var elixir = require('laravel-elixir'); elixir(function(mix) { mix.less([ 'style.less' ], 'public/css/style.css') .styles([ 'reset.css', 'font-awesome.min.css', 'style.css' ], 'public/css/app.css', 'public/css') .scripts(['jquery-1.12.0.min.js', 'main.js'], 'public/js/app.js', 'resources/assets/scripts') .version(['css/app.css', 'js/app.js']); }); as result files public/build/app-2a14246111.css public/build/app-7790e07dfb.js public/build/rev-manifest.json but when try add css , js files layout <link rel="stylesheet" href="{{ elixir("css/app.css") }}"> <script src="{{ elixir("js/app.js") }}"></script> i <link rel="stylesheet" href="/build/css/app-2a14246111.css"> <script src=...

c++ - How to write your own input tool software for windows for my language? -

my language kachhi has no official unicode support have developed own fonts in ttf, otf , svg etc format. run website using same fonts. i want users able write or input in language using fonts (preferably on platforms if not on windows) so how can develop input tool software windows? input custom fonts designed language can pointing out how build own windows ime. link tutorial or books or anything? i apologise if misunderstood question - think may consider using unicode private use area the idea of part of unicode allow situation ( i remember used fictional klingon language @ 1 point ). you can use these zones of unicode-tables, provide input/output mechanisms though traditional unicode methods. obviously enough, without custom font (such 1 you've developed), these sections of table have no meaning.

javascript - Detached radio inputs dont synchronize checkedness? -

is bug or missing something? i create radio inputs detached document, , check them both. expect second stay checked, both stay checked: var container = document.createelement('div'); container.innerhtml = '<input type="radio" name="tiny" value="elephants">' + '<input type="radio" name="tiny" value="robots">'; var radios = container.queryselectorall('[name=tiny]'); // select one, other while detached radios[0].checked = true; radios[1].checked = true; console.log(radios[0].checked); // true console.log(radios[1].checked); // true if attached same container document, exclusive checkedness enforced: document.body.appendchild(container); radios[0].checked = true; radios[1].checked = true; console.log(radios[0].checked); // false console.log(radios[1].checked); // true seems me these radios meet the spec 's definition of single radio button group . if sw...

json - passing userid and password in xml request -

i have potential client wants pull data website via vba. new xml , json. i found link somewhere provides following code uses msxml return data single item particular website. public function getitemsaleprice(item string) double dim dblitem long createobject("msxml2.xmlhttp") .open "get", "http://www.gw2spidy.com/api/v0.9/json/item/" & item, false .send dblitem = split(split(.responsetext, "min_sale_unit_price"":")(1), ",")(0) getitemsaleprice = dblitem / 100 end end function however, data client wants return comes in pages of 500 records @ time. indicates wants pass in date ranges, , page number, similar following. https://api.appfigures.com/v2/reviews?client_key=xxxxxxxf&start=2015-01-01&end=2016-01-21&page=1 but because https site, wants userid , password. can reformat string include userid , password? or there method or property of msxml object can set authentication? the...

c# - Change routeconfig -

in routeconfig-file see : routes.maproute( name: "default", url: "{controller}/{action}/{id}", defaults: new { controller = "home", action = "index", id = urlparameter.optional } ); which maps in controller public person get(int id) { return _personservice.getpersoonbyinsznumber("11111111111"); } now change maps following : public person get(string insznumber) { return _personservice.getpersoonbyinsznumber(insznumber); } how can this? it can done using attrubute routing : [route("persons/get/{id:int}")] public person get(int id) { .... } [route("persons/get/{insznumber}")] public person get(string insznumber) { .... } just add appropriate attributes (here i'm supposing controller name personscontroller . in other case change appropriately) actions. also make sure have line of code in registerroutes method before default route declaration: routes.mapmv...

c++ - std::bind() error: cannot determine which instance of overloaded function "boost::asio::io_service::run" is intended -

while trying compile in visual c++ 2015 auto worker = std::bind(&boost::asio::io_service::run, &(this->service)); i'm getting errors: error c2783: 'std::_binder<_ret,_fx,_types...> std::bind(_fx &&,_types &&...)': not deduce template argument '_ret' note: see declaration of 'std::bind' error c2783: 'std::_binder<_ret,_fx,_types...> std::bind(_fx &&,_types &&...)': not deduce template argument '_fx' note: see declaration of 'std::bind' error c2783: 'std::_binder<std::_unforced,_fx,_types...> std::bind(_fx &&,_types &&...)': not deduce template argument '_fx' note: see declaration of 'std::bind' additionally, intellisense complains with: cannot determine instance of overloaded function "boost::asio::io_service::run" intended i see there 2 overloads of boost::asio::io_service::run . how can specify 1 use? w...

jquery - Download File from Bytes in JavaScript -

i want download file coming in form of bytes ajax response. i tried way of bolb : var blob=new blob([resultbyte], {type: "application/pdf"}); var link=document.createelement('a'); link.href=window.url.createobjecturl(blob); link.download="myfilename.pdf"; link.click(); it in fact downloading pdf file file corrupted. how can accomplish this? i asked question long time age, might wrong in details. blob turned out needs array buffers. that's why base64 bytes need converted array buffers first. here function that: function base64toarraybuffer(base64) { var binarystring = window.atob(base64); var binarylen = binarystring.length; var bytes = new uint8array(binarylen); (var = 0; < binarylen; i++) { var ascii = binarystring.charcodeat(i); bytes[i] = ascii; } return bytes; } here function save pdf file: function savebytearray(reportname, byte) { var blob = new blob([byte]); var link...

How to install dependent role on specific host with ansible -

i have following role/meta/main.yml script: --- dependencies: - role: common - role: nginx - role: postgres - role: my_db and need install my_db role on specific host, lets 1.2.3.4 , example. if want install 1 roll, should create playbook applies role host. - hosts: - 1.2.3.4 roles: - my_db

linux - how to list remote exported NFSv4 volumes? -

with nfsv3,i can use showmount command list volumes. name showmount - show mount information nfs server synopsis /usr/sbin/showmount [ -adehv ] [ --all ] [ --directories ] [ --exports ] [ --help ] [ --version ] [ host ] description showmount queries mount daemon on remote host information state of nfs server on machine. no options showmount lists set of clients mounting host. output showmount designed appear though processed through ''sort -u''. but seems nfsv4 volumes not list. how can nfsv4 volumes remote host? pure nfsv4 doesn't provide way list of exports. nevertheless, of nfs servers export nfsv4 , nfsv3 @ same time. makes possible discover v4 exports. in general, nfsv4 builds pseudo file system list of exports , exports pseudo '/'.

robot - Turning Motor on Lego NXT returns error 0002EA Type 2 -

i writing program using robotc lego nxt imitate behaviour of puppy. section of code supposed rotate head connected motor port 3 , read value on ultra sonic sensor. if while head turned, dog called, turn in direction facing. following function called when ultrasonic sensor reads value (meaning robot has come close wall): visible void sonarsensor() { int sensorvalleft; int sensorvalright; bool alreadyturned = false; int i,j; = 0; j = 0; motor[1] = 0; motor[2] = 0; motor[3] = -speed/2; wait10msec(15); motor[3] = 0; sensorvalleft = sensorvalue[3]; while(i<100) { if(sensorvalue[4] > 40)//calibrate sound sensor { //turn left motor[1]=speed; motor[2] = -speed; wait10msec(25); = 1000; j = 1000; alreadyturned = true; } else { i++; wait1msec(5); } } motor[3] = speed/2; wait10msec(30); motor[3] = 0; sensorvalright = sensorvalue[3]; while(j<100) { if(sensorvalue[3] > 1)/...

java - Is there an Annotation for member/method to be used by reflection? -

i have method invoked same class using reflection. i'd make method private, warning ide method not being used. well, being used - using reflection. what annotations there indicate member/method being used reflection?

authentication - How to stop page content load until authenticated using Firebase and Polymer -

i starting polymer , firebase , have implemented google oauth authentication. i have notice page loads before authentication , if click can page without authorization, albeit not able use firebase api , therefore page not usable. my issue not want javascript loaded until authenticated. how done. many thanks it depends if using firebase or polymer wrapper, polymerfire. create document imports want conditionally loaded // user-scripts-lazy.html <link rel="import" href="user-script-one.html"> <script src="script.js"></script> // etc using polymerfire in element hosts <firebase-auth> create observer , you'll expose variables firebase-auth. <firebase-auth user="{{user}}" status-known="{{statusknown}}"></firebase-auth> in observer, watch user element , status known statusknown: when true, login status can determined checking user property user: cur...

mysql - Distinct outside group in sql -

i have table called order_status_log, logs changed order statuses. simplified table , query below: order_id user_id status time 1 1 1 2016-01-27 19:35:44 2 2 2 2016-01-27 19:36:45 4 3 2 2016-01-27 19:37:43 2 1 5 2016-01-27 19:38:41 i have sql counts changes each user: select count(*) count, user_id order_status_log status = 1 group user_id order count now want improve query count first status changes in order. in other words need unique order_id older time. how can change query that? something this? select * order_status_log o not exists ( select 'x' order_status_log o2 o2.user_id = o.user_id , o2.time < o.time )

ios - NSLocalNotification's repeating. Dismissing. Proper way -

i want create daily notification @ 10am different content every day. func createnotification() { let datecomp:nsdatecomponents = nsdatecomponents() datecomp.hour = 10; // supposed run each day @ 10am var mycalendar:nscalendar = nscalendar(calendaridentifier: nscalendaridentifiergregorian)! var date:nsdate = mycalendar.datefromcomponents(datecomp)! let localnotification = uilocalnotification() localnotification.firedate = date localnotification.alertbody = getcontentstringfornotification() // method returns different string each date localnotification.repeatinterval = .day // repeats every day localnotification.timezone = nstimezone.defaulttimezone() uiapplication.sharedapplication().schedulelocalnotification(localnotification) } it duplicates notifications. keep repeating , returning yesterdays notifications. searched through stack community questions, did not find proper way dismiss them. as understand: the app terminated , scheduled , act independent of app. repeate...