Posts

Featured post

javascript - Create websocket without connecting -

is there way create websocket without connecting right away? far think var ws = new websocket("ws://ws.my.url.com"); creates , connects right away. i'd create socket, define callbacks, , connect once user clicks connect button. thanks no. creating websocket means you've created connection server (or started process of connecting). there no such thing creating websocket isn't connecting yet. you create object store configuration parameters , tell object connect when wanted to, though i'm not sure why that's better creating actual websocket when connect made. or create function setup work , call function later when user clicks connect button.

how to do line continuation in perl debugger for entering raw multi-line text (EOT)? -

i learning perl. trying in debugger define variable, here-document. not know how enter same code in perl script, in debugger. due new lines present inside eot, makes hard in interactive debugger. here small example. have script: >cat ex1.perl #!/usr/bin/perl -w $s =<<'eot'; first line second line eot print $s now run , gives expected output: >perl ex1.perl first line second line now want same in debugger. tried this: >perl -de0 loading db routines perl5db.pl version 1.39_10 db<1> $s =<<'eot';\ cont: first line\ cont: second line\ cont: eot can't find string terminator "eot" anywhere before eof @ (eval 6) [/usr/share/perl/5.18/perl5db.pl:732] line 2. @ (eval 6)[/usr/share/perl/5.18/perl5db.pl:732] line 2. eval 'no strict; ($@, $!, $^e, $,, $/, $\\, $^w) = @db::saved;package main; $^d = $^d | $db::db_stop; $s =<<\'eot\'; first line second line eot; ' called @ /usr/share/perl

Android SDK Manager freezes after installation of OSX 10.11 El Capitan public Beta -

i've installed public beta of el capitan os x (10.11). the issue i'm having after upgrade installation yosemite android sdk manager. when launch android sdk manager within android studio 1.2.2 checks , parses via network call. after clicking on of individual modules, sdk manager freezes , colourful wheel of death. way force close application. i've tried restarting macbook pro , force quitting , relaunching sdk manager , still issue persists. sdk manager working without issues prior upgrade of 10.11 edit: i've noticed none of emulators work el capitan cpu acceleration status: hax not installed on machine (/dev/hax missing). i've tried using genymotion , doesn't work either. i in trouble same thing, too. workaround fix, use no-ui option: $ android update sdk --no-ui other option available here: http://tools.android.com/recent/updatingsdkfromcommand-line

android - Linear layout children not scrolling -

i'm trying add image views linear layout @ runtime. <linearlayout android:id="@+id/llfolderlayout" android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight=".65" android:orientation="horizontal" android:scrollbars="horizontal" > </linearlayout> linearlayout llfoldertabs = (linearlayout) myfolder.findviewbyid(r.id.llfolderlayout); imageview imgtab = new imageview(activity); imgtab.setid(i); imgtab.settag(i); imgtab.setimagedrawable( mcontext.getresources().getdrawable(r.drawable.icon_folder_inactive)); if (i == 0) { imgtab.setimagedrawable( mcontext.getresources().getdrawable(r.drawable.icon_folder_active)); // imgtab.setpadding(10, 0, 4, 0); linearlayout.layoutparams lp = new linearlayout.layoutparams( 74, layoutparams.match_parent); lp.setmargins(15, 0, 0, 0); imgtab.setlayoutparams(lp); } else { // imgtab.

Image not being inserted into mysql database from php -

i trying insert image mysql database php. using following code so. $file= file_get_contents($_files['file']['tmp_name']); $id=$_session['id']; $sql="update mainadmin set photo='$file' id='$id'"; mysql_query($sql); $_session['photo']=$file; but image not being inserted mysql database. being stored in session variable , shown properly. when going image database saw previous image still stored , no update taken place in database. can me find mistake i found solution problem. here updated code. using addslashes() method solved problem $file= file_get_contents($_files['file']['tmp_name']); $filei=addslashes($file) ; $id=$_session['id']; $sql="update mainadmin set photo='$filei' id='$id'"; mysql_query($sql); $_session['photo']=$file;

sharepoint - Accessing files across a shared directory using a Windows service -

i trying access files on shared directory (sharepoint): \\sitename\sites\path_to_doc\doc.csv so have custom application looks @ files on shared drive , when launch application going folder it's installed - c:\myapp.exe, the application can access them . when corresponding service launched services.msc same user launched executable in previous step, doesn't find files on shared directory. i guess, question is: what general differences launching application interactively double clicking versus launching executable using service , of respect windows permissions , remote shared folders?

Quickblox API Session Creation With User & Signature Error -

quickblox rest api create session function running without user information not working when added user information. signature string:success string signaturestr=string.format("application_id={0}&auth_key={1}&nonce={2}&timestamp={3}", this.application_id, this.auth_key, this.nonce, this.timestamp); signature string:error string signaturestr=string.format("application_id={0}&auth_key={1}&nonce={2}&timestamp={3}&user[login]={4}&user[password]={5}", this.application_id, this.auth_key, this.nonce, this.timestamp,this.user.login,this.user.password); generate signature function public string generatehmacsha1(string key, string body) { system.text.encoding encoding = system.text.encoding.utf8; byte[] keybyte = encoding.getbytes(key); hmacsha1 hmacsha1 = new hmacsha1(keybyte); byte[] messagebytes = encoding.getbytes(body); byte[] hashmessage = hmacsha1.computehash(messagebytes