Posts

Showing posts from May, 2014

java - Why does setting SO_TIMEOUT cause final read of SocketInputStream to return immediately? -

i'm working on test harness writes bytes on socket server , reads response. had problem last read of socket's inputstream pause 20 seconds. fixed that, don't understand why worked. the following method given java.net.socketinputstream. call read(byte[], int, int) pausing 20 seconds on final read, 1 returns -1, indicating end-of-stream. private string getresponse(inputstream in) throws ioexception { stringbuffer buffer = new stringbuffer(); bytearrayoutputstream bout = new bytearrayoutputstream(); byte[] data = new byte[1024]; int bytesread = 0; while (bytesread >= 0) { bytesread = in.read(data, 0, 1024); // paused here on last read if (bytesread > 0) { bout.write(data, 0, bytesread); } buffer.append(new string(data)); } return buffer.tostring(); } i able make pause go away setting so_timeout on socket. doesn't seem matter set to. socket.setsotimeout(60000), problem read...

c# - WCF exception handling using IErrorHandler -

i implementing ierrorhandler interface catch kinds of exceptions wcf service , sending client implementing providefault method. i facing 1 critical issue however. of exceptions sent client faultexception disables client handle specific exceptions may have defined in service. consider: someexception has been defined , thrown in 1 of operationcontract implementations. when exception thrown, converted fault using following code: var faultexception = new faultexception(error.message); messagefault messagefault = faultexception.createmessagefault(); fault = message.createmessage(version, messagefault, faultexception.action); this send error string, client has catch general exception like: try{...} catch(exception e){...} and not: try{...} catch(someexception e){...} not custom exceptions someexception, system exceptions invalidoperationexception cannot caught using above process. any ideas how implement behavior? in wcf desirable use special exceptions de...

java - How can i convert a swing application into a executable one? -

this question has answer here: how can convert java program .exe file? [closed] 13 answers compiling java program executable [duplicate] 7 answers i want convert swing application executable one.i using neatbeans ide.is there plugin available? use launch4j it cross-platform java executable wrapper need.

efficient way to copy array with mask in c++ -

i have 2 arrays. 1 "x" factor size of second one. i need copy first (bigger) array second (smaller) array x element. meaning 0,x,2x. each array sits block in memory. array of simple values. doing using loop. is there faster smarter way this? maybe ostream ? thanks! you doing right? #include <cstddef> int main() { const std::size_t n = 20; const std::size_t x = 5; int input[n*x]; int output[n]; for(std::size_t = 0; < n; ++i) output[i] = input[i*x]; } well, don't know function can that, use loop. fast. edit: faster solution (to avoid multiplications)(c++03 version) int* inputit = input; int* outputit = output; int* outputend = output+n; while(outputit != outputend) { *outputit = *inputit; ++outputit; inputit+=x; }

sql - Alter table query in MS Access 2007 -

i want ms access query can add column current table. query should include not null constraint, default value '' i.e. 2 single quotes , data type. i tried query in access 2007 not working: alter table demo add column lname text not null default ('') alter table {tablename} add {columnname} {type} {null|not null} constraint {constraint_name} default {default_value} or try alter table testtable add newcol varchar(50) constraint df_testtable_newcol default '' not null go

linux - How to search </string> in vim? -

i want search in vim, /</string> but didn't work, how can match " </string> "? an alternative escaping slash ( \/ ) use backward-search: ?</string> (and navigating next matches n instead of n ).

WPF window maximize with fixed/limited width -

on wpf window, have set width="300" minwidth="300" maxwidth="300" when maximize window, docks left screen border fixed with, bottom part of window underneath windows 8 taskbar. i have tried public mainwindow() { ... this.maxheight = system.windows.systemparameters.workarea.height; } , results in few pixels of free space between taskbar , app. i'd have fixed width window dock right border on maximize not cover/go under taskbar in maximized state unfortunately, 3 requirements not seem achievable using minwidth, maxwidth , windowstate. but regardless, it's still possible achieve similar. need emulate maximized state of window. need move window correct position, right height, , make unmovable. first 2 parts easy, last 1 requires more advanced stuff. start out window have, width, maxwidth , minwidth set 300, , add event handler statechanged. width="300" minwidth="300" maxwidth="300...

javascript - How to get server public key (or certificate) from browser when using HTTPS -

we need access server public key (or certificate) browser on client side. when access https side, browser downloads server certificate. need certificate (or public key) use in our code on client side (javascript) , cryptographic operations. looking solution without plugin development browsers (ie, firefox, chrome). are there, example, browser specific extensions (javascript can detect used browser , call browser specific javascript methods accessing certificate), can read server certificate on client side? is link http://social.msdn.microsoft.com/forums/ie/en-us/b4ffc420-4a7e-450d-90fe-2df60fb25e8d/accessing-the-ssl-server-certificate-of-a-webpage can use in ie? if yes, how use it?

osx - How to access finder sidebar shared content in cocoa -

i want access shared content of left sidebar of finder in mac, can system list connected same network. can access favorite content, not succeeded access. i using code access favorite content of finder. uint32 seed; lssharedfilelistref sflref = lssharedfilelistcreate(null, klssharedfilelistfavoriteitems, null); cfarrayref items = lssharedfilelistcopysnapshot( sflref, &seed ); for( size_t = 0; < cfarraygetcount(items); i++ ) { lssharedfilelistitemref item = (lssharedfilelistitemref)cfarraygetvalueatindex(items, i); if( !item ) continue; cfurlref outurl = null; lssharedfilelistitemresolve( item, klssharedfilelistnouserinteraction, (cfurlref*) &outurl, null ); if( !outurl ) continue; //the actual path string of item cfstringref itempath = cfurlcopyfilesystempath(outurl,kcfurlposixpathstyle); // todo: whatever want path he...

In my android application following bitmap code shows exception -

in android application contact details contacts following code used able name , phone number bitmap code shows exception bitmap bitmap = null; string image_uri = ""; image_uri = cur.getstring(cur.getcolumnindex(contactscontract.commondatakinds.phone.photo_id)); if (image_uri != null) { system.out.println(uri.parse(image_uri)); log.d("image",image_uri); try { bitmap = mediastore.images.media.getbitmap( this.getcontentresolver(), uri.parse(image_uri)); // toast.maketext(getapplicationcontext(), ""+bitmap,toast.length_long).show(); bytearrayoutputstream stream = new bytearrayoutputstream(); bitmap.compress(bitmap.compressformat.png, 100, stream); bytearray = stream.tobytearray(); } catch (filenotfoundexception e) { // todo auto-generated catch block e.printstacktrace(); } catch (ioexception e) { // todo auto-generated catch bl...

php - How to change URL links that were made by WordPress? -

i have wordpress blog. post in convention: http://www.myblog.com/blog/?p=1442 now i'd change url of posts one: http://www.gomidjets.com/blog/this-is-my-post while it's quite easy apply changing blog settings, big problem links i've placed in many external website. can't change them, , i'd map old links new links somehow. know how - if that's possible @ all? have better solution? thank much wordpress map old url new one, in case if provided url in original shape, such http://example.com/?page_id=80 the answer is: don't need anything.

mod rewrite - .htaccess rules to separate page types -

i'm having problems rewriting urls following rules rewriteengine on rewriterule ^page/(.*)$ index.php?pag=cms&title=$1 [nc] rewriterule ^admin/(.*)$ admin/$1 [nc] rewriterule ^(.*)$ index.php?pag=$1 [nc,l] what i'm trying achieve check if url cms page or not , leave admin urls are. if remove last condition works have no rule not cms pages. ideally want have 1 rule every page (cms or not) can't figure out how check other using page/ in url. mod_rewrite keep looping through rules until uri stops changing (or reaches internal redirect limit, resuling in 500 error). need add few conditions last rule won't rewrite uri's that's been routed: rewriterule ^page/(.*)$ index.php?pag=cms&title=$1 [nc] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^(.*)$ index.php?pag=$1 [nc,l] additionally, second rule nothing except passthrough, can replace with rewriterule ^admin/(.*)$ - [nc,l]

data.table making a copy of table in R -

i doing this: myfun <- function(inputvar_vec){ # inputvar_vec input vector # # result = output vector return(result) } dt[, result := lapply(.sd, myfun), = byvar, .sdcols = inputvar] i getting following warning: warning message: `in `[.data.table`(df1, , `:=`(prop, lapply(.sd, propeventinlastk)), : invalid .internal.selfref detected , fixed taking copy of whole table, := can add new column reference. @ earlier point, data.table has been copied r (or been created manually using structure() or similar). (and more stuff) .... ` my guess because stacking result vectors (after operation), copy being made? can suggest method remove warning? have done using apply functions , thought should extendable here too. my other question is: can pass chunk of rows data frame (subsetted using statement), , call function myfun operate on that? adding example requested # generate data n = 10000 default=na value = 1 df = data.table(id = sample(1:5000, n, replace=true), ...

search - Searching a text file in java and Listing the results -

i've searched around ideas on how go this, , far nothing's turned up. i need search text file via keywords entered in jtextfield , present search results user in array of columns, how google it. text file has lot of content, 22,000 lines of text. want able sift through lines not containing words specified in jtextfield , present lines containing @ least 1 of words in jtextfield in rows of search results, each row being line text file. anyone has ideas on how go this? appreciate kind of help. thank in advance you can read file line line , search in every line keywords. if find one, store line in array. but first split text box string whitespaces , create array: string[] keywords = yourtextboxstring.split(" "); arraylist<string> results = new arraylist<string>(); reading file line line: void readfilelinebyline(file file) { bufferedreader br = new bufferedreader(new filereader(file)); string line; while...

connection - Jointly receive data through Wifi and Cell GSM in Android? -

i'm wondering if android allows applications jointly receive data through wifi , cell gsm. need develop application have receive internet data through gsm , local data through wifi while maintaining both network connectivity. possible ? while connected wi-fi, can ask system temporarily pass traffic specific host via cell connection. this done mode called "hipri" (high priority). the hipri uses cell radio, logically different connection type cell. means although communication done via cell, cell connection still unavailable other purposes. a example can found here (answer rainbowbreeze): how use 3g connection in android application instead of wi-fi? .

html - Disable auto-adding of <p> tag -

Image
i'm trying remove auto-adding of <p> tag in cq5(version 5.6.0.20130125). i've tried add these properties text component i'm using no effect.( source ) removesingleparagraphcontainer true singeparagraphcontainerreplacement (empty string) i've tried this solution . again, no effect. is possible disable auto-adding of <p> tag? thanks ideas edit i've tried this answer cq still adds <p> tags code. example, have html code <strong>headquarters:</strong> <p>my - company a.s.<br> random street 77<br> random city</p> and after submit it, code changes to <p><strong>headquarters:</strong></p> <p>my - company a.s.<br> random street 77<br> random city</p> my rte looks this <text jcr:primarytype="cq:widget" hidelabel="{boolean}true" name="./text" xtype="richtext"> <htmlrules jcr...

confusion with the Servlets -

i new servelts programming. , today, started learning it. , little bit confused concerning httpservletrequest . written in tutorial that, class doget() has methods such form "query" data, http request headers, , client’s hostname. as far understood, httpservletrequest protocol allows server receive request client side. question is, why client side interesting in knowing client’s host-name or http request headers. if found question silly please not vote question down, because not want lose account stack overflow. first of httpservletrequest interface implemented servlet container. httpservlet convenience class servlet can extend , hold of http specific methods. doget() 1 such method process get requests. httpservletrequest protocol allows server receive request client side http request-response protocol. container forms httpservletrequest object actual request received web server , forwards servlet's service() method. wh...

multithreading - Linux thread observation: Determine entry point of thread -

to check system performance issues, detect thread creations. can done, checking procfs, newly created "task" folders. however, beside of information thread created, i'd know thread was: meaning, want start address of function runs in own thread (the function name can obtain debug symbols...). so far, couldn't find information on in procfs. stack pointers different threads given, don't think can determine "thread function" based on information. therefore questions are: does have idea how determine thread entries information given in procfs? does know better way information? many in advance! best regards jean-pierre

Removing multiple whitespace, c# -

this question has answer here: how trim whitespace between characters 6 answers what i'm trying i'm trying reduce whitespace sizes 1 characters (removing unneeded whitespace. how should deal task ? ps.: no regex edit.: thanks, succeeded, split+join suggestion. unfortunately, can't upvote of responses frustrated teens have -repspammed me asking "a question simple website" edit2.: how make sure doesn't remove space in front of sentence, in case there 1 ? what about string.join(" ", mystring.split(new char[] { ' ' }, stringsplitoptions.removeemptyentries)) edit as extension public static string removewhitespaces(this string s) { return string.join(" ", s.split(new char[] { ' ' }, stringsplitoptions.removeemptyentries)); } mystring.removewhitespace...

regex - Regular expression illegal character in Java -

i've been looking through internet after big headache, cannon't find why regular expression wrong: "\"\w*&&[\p{punct}]\"["+sepchar+"]\"\w*&&[\p{punct}]\"" i'm trying read master data file following pattern (quotes included): "textvalue":"textvalue":"textvalue" and split each line regular expression above. so, example: "hello:john":"hello:world":"hello:mark" will splitted into: {"hello:john", "hello:world", "hello:mark"} the backwards slash escape character in java. need use 2 backslashes \\ include single backslash in regex. try: "\"\\w*&&[\\p{punct}]\"["+sepchar+"]\"\\w*&&[\\p{punct}]\""

Comparing nvarchar with bigint in sql server -

i investigating performance issue following sql statement: update tablea set columna1 = columnb1 tableb tablea.columna2 = tableb.columnb2 the problem tablea.columna2 of type nvarchar(50) while tableb.columnb2 of type bigint . question how sql server execute such query; cast bigint nvarchar , compare using nvarchar comparing operators or cast nvarchar bigint , compare bigint comparing operators. another thing: if had leave column types tablea.columna2 , tableb.columnb2 ' how can rewrite query enhance performance? note: query working on around 100,000 records, takes forever. thanks in advance, appreciate help. in comparison, nvarchar converted bigint , because bigint has higher precedence see http://msdn.microsoft.com/en-us/library/ms190309.aspx

c++ - DataBase Login screen in crystal reports viewer .NET -

i have run issue when testing crystal report viewer. when tring view report primary app(the viewer called app) promts login screen ,containing : server name : (field unavaible edit) darabase : (field unavaible edit) login id : (here shows login id) password : (editable field) if enter password , press finish report viewed wihtout problem. i have googled problem, results have read made me more confused. trigger of these screen ? not found in code part pop's screen.my viewer created in c++.net using sap dll's .net platform. i appreciate help. thanks. you need set report connection info programmatically otherwise ask screen seeing. can google "crystal reports connection info" find samples how that. here 1 c#: how set database login infos (connection info) crystal report?

post - Codeigniter ckeditor form problems -

i using combination of codeigniter's form helper , ckeditor attempt send html server, save database, , sent browser re-editing. to accomplish this, am: creating textarea using codeigniter's form_textarea() function. (optional)using ckeditor.replace turn textarea ckeditor field. pasting html field. submitting field post , retrieving using codeigniter's input->post(); inserting data database using codeigniter's db->insert() pulling data using ci's db->get() putting textarea using form_textarea() again. after performing cycle couple of times, html disappears during post operation. assuming being caused characters need escaped, @ loss why happening , how fix it. it happens after html pulled form database, put textarea, resubmitted. noticed if activate ckeditor each time page reloaded, problem not happen. if has faced problem before, please tell me how managed deal text loaded, submitted, saved , reloaded without problems. also, usef...

printing - hide userform to printer in VBA -

i have problem device i'm trying program: i needed add "print" button userform, have print screen image. managed build userform, add button , find built-in vba command print device screen shows. of course have no use userform show in prints, no matter can't hide printer. i tried: userform.hide userform.zoom = 10 userform.visible = false but none of these seem work. i had move userform outside screen using "move" command: userform.move right,down

regex - How can I make a regular expression for IP address with Subnetmask? -

Image
i have ip address list this: 180.183.0.0/16 180.210.216.0/22 180.214.192.0/19 182.52.0.0/15 ...(400 more) how can make regular expression ip address subnetmask? why want this. i have website load balancer(i can't change config in server), client wants deny access specific country access. use .htaccess this. setenvif x-forwarded-for "59\.(5[6-9]|6[0-1])\.[0-9]+\." denyip order allow,deny allow deny env=denyip given list of address in sample text these expressions match requested ranges using alternation match numeric ranges. unfortunately they'll need constructed individually because of how regular expression doesn't evaluate text. match 182.52 or 182.53 string you'd use regex contains desired sub-strings , 182.5[23] . 180.183.0.0/16 has range 180.183.0.1 - 180.183.255.254 ^180\.183\.(?:[0-9]{1,2}|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.(?:[1-9][0-9]?|1[0-9]{2}|2[0-4][0-9]|25[0-4])$ 180.210.216.0/22 has range 180.183.0.1 - 180.183.3....

c# - How to know the derived class in the base class -

i've searched everywhere on , can't find doing similar. i'm quite newbie @ c# having worked 15 years non-object orientated language, hope i'm not missing simple. i trying make standard winform get's inherited, don't need repeat code use every time (one of joys of .net on i've used years ability centralize things far more). my problem comes want implement ability either call derived classes 'single instance' or 'multiple instance' when launched mdi , after much searching i've achieved using 'generics'. i've got stuck how know class current form is, pass generic class close form. a simplified version of code understand problem. generic class designed launching , closing form. determines if instance t exists, depending on if launching single or multiple instance either shows that, or creates new instance of form. mdi passed in launch methods allow me attach new form that. public class formlaunch<t> t : mybasefor...

Logback config, puppet and application versions -

i busy testing new approach managing java application uses logback on puppet-managed host, , wondering if had advice on best approach this. stuck catch 22 situation. the java application deployed host automated system (ci). deployment writes application version number file (e.g. /etc/app.version may contain "0001") the logback config file (logback.xml) managed puppet. i trying configure application include it's version number in logging layout (e.g. <pattern>version: %version%</pattern> . however, not sure on approach, there isn't "include" function logback config file (to include file version number logback config). @ same time, don't see way puppet client-side template build, using host-side file (i've tried using template approach, template compiled on puppet server side). any idea's on how working? i write custom fact . facts executed on client. eg: logback/manifests/init.pp file { '/etc/logback.xml...

android - EOFException and FileNotFoundException in HttpURLConnection getInputStream() -

when trying connect http://ws.audioscrobbler.com/2.0/ post data using httpurlconnection , (randomly) eofexception or filenotfoundexception: http://ws.audioscrobbler.com/2.0/ on nexus 4 running android 4.2.2. anybody can help? edit i upgraded 4.3: same issue. public inputstream getdata(string url_str, list<namevaluepair> postdata) { map<string, object> response = new hashmap<string, object>(); inputstream = null; httpurlconnection conn = null; try { url url = new url(url_str); conn = (httpurlconnection) url.openconnection(); conn.setreadtimeout(connection_timeout); conn.setconnecttimeout(read_timeout); conn.setrequestmethod("post"); conn.setdoinput(true); if(postdata != null){ conn.setdooutput(true); outputstream os = conn.getoutputstream(); bufferedwriter writer = new bufferedwriter( new outputstreamwr...

php - $_SERVER['REMOTE_ADDR'] returns false IP -

i making anto-fload script site. cant use service handles fail2ban , like. question regarding $_server['remote_addr'] value. there way function return false ip? heared somewhere possible , want know how thats happening , can prevent it? thats script: $ip = $_server['remote_addr']; $query = "select * `banned_users` `ip`='".$ip."'"; if(mysql_num_rows(mysql_query($query))!=0)die("you have been banned site!"); if(isset($_session['views']) && isset($_session['time']) && $_session['time']>=time()-2)$_session['views']++; else { $_session['views']=1; $_session['time'] = time(); } if($_session['views']>=15){ $query = "insert `banned_users` values ('',".time().",'".$ip."') "; mysql_query($query); die(); } as can see, if user makes mo...

Android WebView failed to load a particular URL -

This summary is not available. Please click here to view the post.

iphone - Cropping UIImage like camscanner -

Image
i stuck in application feature. want cropping feature similar cam scanner cropping. screens of cam-scanner are: have created similar crop view. i have obtained cgpoint of 4 corners. how can obtained cropped image in slant. please provide me suggestions if possible. this perspective transform problem. in case plotting 3d projection in 2d plane. as, first image has selection corners in quadrilateral shape , when transform in rectangular shape, either need add more pixel information( interpolation ) or remove pixels. so actual problem add additional pixel information cropped image , project generate second image. can implemented in various ways: <> can implement own applying perspective tranformation matrix interpolation. <> can use opengl . <> can use opencv . .. , there many more ways implement it. i had solved problem using opencv. following functions in opencv achieve this. cvperspectivetransform cvwarpperspective first funct...

php - Escaping get parameters in smarty -

i have inherited code base php, mysql , smarty , i'm implementing menu system web application. i have url such: http://example.com/?url=some/page in database store string 'some/page' , map file 'some/path/dir/mypage.php' , when visiting url file included using include() in php script fetches url parameter. the code contains forms uses parameters post data , if i'm on page such http://example.com/?url=myform/add need include hidden input field name url value myform/add form can post results correct page. smarty has syntax {$smarty.get.url} that fetches url parameter , outputs it. leads hidden input field looking this: <input type="hidden" name="url" value="{$smarty.get.url}"> now, realise should clean url parameter before printing value i'm not sure how. using {$smarty.get.url|escape:'url'} escapes / character %2f resulting in: <input type="hidden" name="url" value=...

javascript - Knockout two-way bindings not working on checkbox -

i have form generates list options user, each option has check-box, label , input field. input field should shown whilst check-box ticked. options generated through json call. however, knockout doesn't seem doing have expected when using visible binding. when check row, text box correctly shown when uncheck it, text box stays shown. i suspect to-do observable "selected" being overridden or stuck ideas. here fiddle showing issue: http://jsfiddle.net/qccqs/2/ here html using in fiddle: <div data-bind="template: { name: 'reason-template', foreach: reasonlist }"></div> <script type="text/html" id="reason-template"> <div> <input type="checkbox" data-bind="value: selected" /> <span data-bind="text: name"></span> <input type="text" class="datepicker" data-bind="value: date, visible: selected"...

javascript - Bootstrap .popover('show'), .popover('hide') not working. Binding it to click works -

i have button has been binded popover. hide popover when clicks on 1 of smilies in popover. however, $("#smiley").popover('hide') not work. unfortunately haven't been able reproduce barebones code - happens on live site, https://coinchat.org relevant code: $("#smiley").popover({html: true, trigger: 'click', placement: 'top', content: smileycontent, title: 'smilies'}); later in function.. $("#smiley").popover('hide'); // not working in https://inputs.io/js/buttons.js jquery plugin jquery.fn.popover overwritten on load event of kind, $("#smiley").popover("hide") @ point no longer calling bootstrap plugin provided inputs.io . a snippet of code: inputsio.load = function(){ (function(){(function(e){return e.fn.popover=function(t) the usage of jquery plugin namespace application specific code extremely distasteful indeed. a temporary fix $("#smiley")....

php - How can I escape single quotes from get method in Javascript? -

i passing form values via method. here url parameters. "name='test'&exp=&level=&gender=&city=&sports=" while getting values method in javascript, single quote getting %27 . how can escape it? while alerting $_get("name") , gives %27test%27 . please help you should use php's urldecode on value. docs found @ http://php.net/manual/en/function.urldecode.php let me know if that's you're looking :)

asp.net mvc - How to create Kendo Context Menu? -

i need create context menu in kendo ui , need add functionality context menu. saw similar post in jqgrid, how create jqgrid context menu? . same need implement in kendo.its urgent.please me in this, thanks kendogrid <script type="text/javascript"> $(document).ready(function () { //bind initial data var people = [ { firstname: "hasibul", lastname: "haque", email: "hasibul2363@gmail.com" } , { firstname: "jane", lastname: "smith", email: "jane.smith@kendoui.com" } ]; $('#grid').kendogrid({ scrollable: true, sortable: true, pageable: true, selectable: "row",//""multiple row"", filterable: true , datasource: { data: people, pagesize: 10 } , columns: [ { field: ...

log4net closed appender error with config in code -

i got in trouble l4n configuration. working on big project, try configure logger(s) via code. app.config-content: <configsections> <section name="log4net" type="log4net.config.log4netconfigurationsectionhandler, log4net"/> </configsections> <log4net> <root> <level value="debug"/> </root> <logger name="nesseeservercorelogger"> <level value="info"/> </logger> </log4net> and following written in code, in case in ctor of 1 class: (only change: m_rfa member class member in productive code) log4net.filter.levelrangefilter lrf = new log4net.filter.levelrangefilter(); lrf.levelmin = log4net.core.level.info; lrf.levelmax = log4net.core.level.fatal; //create , configure rolling file appender log4net.appender.rollingfileappender m_rfa = new log4net.appender.rollingfileappender(); m_rfa.name = "nesseeservercore_rfa"; m_rfa.i...

webdriver - Unable to use until method -

i trying wait element in selenium webdriver , following happens i create wait: webdriverwait delay = new webdriverwait(driver, 5); and use it: delay.until(expectedconditions.visibilityofelementlocated(by.id("someid"))); but intellij idea keeps marking until() red , saying "cannot resolve method until()". need help, please. change wait.until(expectedconditions.visibilityofelementlocated(by.id("someid"))); to delay.until(expectedconditions.visibilityofelementlocated(by.id("someid"))); also refer selenium documentation, has example on explicit wait- http://docs.seleniumhq.org/docs/04_webdriver_advanced.jsp#explicit-and-implicit-waits

session - How to retain values in textboxes even after navigating to another page in a jquery mobile application -

there jquery mobile application working on targets android, ios, windows , blackberry platforms. using jquery mobile 1.3.1 jquery 1.9 wrapped in phonegap. the requirement :- have html page 2 input fields, number field , button. on "click" of button have navigate page "back" button in it. when page navigates first page, have retain values user entered on first page. what's happening when navigate back, values user entered not retained i.e "state" of page not retained. is there way possibly retain values/state of page without using session storage ? i think localstorage might solve problem you. heres nice tuorial

Guide for replacing Enterprise Lib 4.1 Caching with Azure Caching -

we have current implementation of caching uses enterprise library 4.1 caching block. website hosted on premise. but soon, web site hosted in azure doesn't support sticky session. result need refactor caching pattern , replace azure dedicated caching. i've not used azure caching before read few articles on msdn. i've not seen guide on how replace ent. lib caching azure caching. could please me steps needed replace enterprise lib caching azure dedicated caching.

matlab - Extracting the coordinates associated with voxels from a text file and store in a .mat file -

i have text file formatted follows: fileversion: 1 timepoint: 1 nrofrois: 3 roi: 1 nrofvoxels: 7 43 22 5 766 45 22 5 837 42 23 5 961 43 23 5 878 44 23 5 760 43 24 5 889 43 25 5 929 avgvalue: 860.000000 roi: 2 nrofvoxels: 7 20 21 5 668 22 21 5 727 23 21 5 748 24 21 5 727 23 22 5 810 23 23 5 868 24 23 5 764 avgvalue: 759.000000 i have extract coordinates (only first 3 columns) of voxels associated every roi , save them in different .mat file, respectively. example, after extracting coordinates of roi: 1, should have coordinates (first 3 colums) in .mat file (and roi 2 in different .mat file): 43 22 5 45 22 5 42 23 5 43 23 5 44 23 5 43 24 5 43 25 5 can please me achieve using matlab? open file , read line-by-line. here matlab code, read coordinates associated roi 1: filename = 'test.ert'; fid = fopen(filename); r_lines = 9; k = 1:r_l...

dojo - OnDemandGrid not Loading in IE -

i using ondemandgrid jsonrest store.when hitting xhtml page directly ie ,the grid not loading.i getting script error below line : 0 char : 0 error : script error code : 0 url : http://localhost:8080/sample/dgridsample.xhtml if use ctlr+f5 grid loading.below javascipt code require([ "dgrid/ondemandgrid", "dojo/store/jsonrest", "dojo/dom", "dojo/dom-style", "dojo/_base/declare", "dgrid/extensions/columnresizer" ], function (ondemandgrid,jsonrest,dom,domstyle,declare,columnresizer) { jsonstore = new jsonrest({target: url,idproperty: "srno"}); grid = new(declare([ondemandgrid,columnresizer]))({ store: jsonstore, columns: layout, minrowsperpage : 40, ...

caching - How to send cache-control: no-cache from mobile? -

we're using varnish caching our pages, , configured differentiate user-agent versions of pages. mobiles have different version of page desktop browser. from desktop browser, it's easy send "cache-control: no-cache" ctrl+f5 shortcut. enforce varnish refresh page in cache. but how same thing mobile, how not have ctrl key ?? many etienne as know, 3 options available on different browsers: slide down settings -> refresh settings -> privacy -> clear cache (all/for site only) if 1 , 2 doesn't make click clear cache manually update: ok check safari , chrome at site : seems cannot send pragma: no-cache , browser, programmatically via meta tags, there no way it

scala - Create an object with vals that represent fields names on a case class -

i'm getting familiar scala macros. how can following (or possible): case class foo(name:string) //'keys' macro implementation val fookeys = keys[foo] //returns object fookeys{ val name = "name" } println(fookeys.name) // "name" i don't mind if definition local - long type defined , available.

html - Datatables not rendering on my table in MVC project -

i want improve , feel of tables , jquery datatables looks great doing can not work out why not rendering on table. have registered plugin correctly on bundle config. followed tutorial , ensured in correct place, no effect. here generated code browser. have put alert in javascript calls datatable() , being called. the head , body of document in different file _layout.cshtml index page table is. not should effect anything. <!doctype html> <html lang="en"> <head> <meta charset="utf-8" /> <title></title> <link href="/favicon.ico" rel="shortcut icon" type="image/x-icon" /> <meta name="viewport" content="width=device-width" /> <link href="/content/site.css" rel="stylesheet"/> <script src="/scripts/modernizr-2.5.3.js"></script> <script src="/conten...

android - Save image to phone loaded from gallery -

i'm trying save image loaded gallery phone memory(local path). can guide me this? this how image gallery. imageview profilepicture; private uri imageuri; string picturepath; @override public void oncreate(bundle savedinstancestate) { profilepicture = (imageview) findviewbyid(r.id.profile_picture); profilepicture.setontouchlistener(new ontouchlistener() { @override public boolean ontouch(view arg0, motionevent arg1) { switch (arg1.getaction()) { case motionevent.action_down: { break; } case motionevent.action_up:{ uploadimage(); break; } } return true; } }); } uploadimage() intent galleryintent = new intent(intent.action_pick, android.provider.mediastore.images.media.external_content_uri); startactivityforresult(galleryintent, 1); @over...

android - Alternative to showCase library for app user-tutorials? -

background i've found nice library showing tutorial user specific items on screen, called " showcase view library " . the problem the library quite buggy , puts textural items outside screen (for example when device rotated) . the question is there alternative library, or way fix it? the similar library i've found " supertooltips " . give https://github.com/deano2390/materialshowcaseview try, original showcaseview library deprecated.

processing - What is the filename of last saved frame using saveFrame() -

in processing, can save frame using saveframe('output-####.png') . save frame, name output-0001.png , , place in sketch folder. filename different because follows sequence, replacing #### next number in sequence. however, saveframe returns void. wish returned string of filename, doesn't. how can find out name of frame saved saveframe(...) you can wrap function tell framecount @ point: void draw() { println(saveframeandgetfilename("output-####.png")); } string saveframeandgetfilename(string filename) { saveframe(filename); string [] parts = filename.split("####"); //getting pedantic here... return parts[0] + framecount + parts[1]; } or more simply: void draw() { saveframe("output-####.png"); println("output-" + framecount + ".png"); } edit: fixed give actual filename

kendo mobile - Background for all iOS listviews -

i have been trying change background color listview elements in kendo-ui mobile application without luck, have tried: .km-list>li { background: transparent; } .km-root .km-ios .km-list>li { background: transparent; } .km-root .km-ios .km-content .km-list>li { background: transparent; } i appreciate help! thanks! try using kendo ui mobile themebuilder , may help.

html - Define rule for set of child elements -

as example, want labels , input fields within class have similar rules. css .specialbox input, label{ background-color: green; } when use previous code, apply rules input field within specialbox , all labels because ruleset applies each of comma separated items: .specialbox input label i can modify selector clarify both items individually .specialbox input, .specialbox label{ background-color: green; } in case desired result, @ expense of being concise here's fiddle demonstrate is there way apply set of rules children of particular selector, or forced repeat parent element selector? i believe there way sass or less , i'd prefer straight css for input , label elements, have repeat selector. if want children, can use wildcard: .specialbox * apply style of children.

ibm mq - Read mq queue errors in .bat file -

i using amqsput write message queue in batch file. call "c:\folderdir\code\mqfile\amqsput" queue qmgr < file the code works fine. want capture errors , echo appropriate response message. ex - if queue full, mq return error code , message. want capture message , code , print on screen. errorlevel doesnt capture mq error codes. capture output using for /f loop. @echo off /f "delims=" %%a in ('call "c:\folderdir\code\mqfile\amqsput" queue qmgr ^< file 2^>^&1') echo(%%a pause 2>&1 redirecting stderr stdout , for /f loop capturing stdout. example / proof of concept test.bat @echo off /f "delims=" %%a in ('call test2.bat ^< test.txt 2^>^&1') echo(test = %%a pause exit /b 0 test2.bat @echo off set /p "test=" echo(%test% echo error 1>&2 exit /b 0 test.txt hello output c:\users\user\desktop>test.bat test = hello test = error press key continue ....

jquery - keyup not working on Chrome on Android -

i using bootstrap typeahead. it depends on jquery code work: el.on('keyup', dosomething() ) on chrome on windows works fine. on chrome on android doesn't. keyup event never fired. element bound has focus. this appears recent development. chrome 28.0.1500.64 android 4.1.2 sgp321 build/10.1.1.a.1.307 thanks --justin wyllie i came across same problem earlier today. how can android chrome not support these key events! assume you've found workaround now, here's fix came now. function newkeyupdown(originalfunction, eventtype) { return function() { if ("ontouchstart" in document.documentelement) { // if it's touch device, or test here android chrome var $element = $(this), $input = null; if (/input/i.test($element.prop('tagname'))) $input = $element; else if ($('input', $element).size() > 0) $input = $($('input', $element).ge...

java - How to tell main thread that part of thread job is done -

is true notify works after thread finished? in code below can't notification until comment while (true). how tell main thread part of thread job done? public class threadmain { public thread reader; private class serialreader implements runnable { public void run() { while (true) { try { thread.sleep(3000); synchronized(this) { system.out.println("notifying"); notify(); system.out.println("notifying done"); } } catch (exception e) { system.out.println(e); } } } } threadmain() { reader = new thread(new serialreader()); } public static void main(string [] args) { threadmain d= new threadmain(); d.reader.start(); sy...