Posts

Showing posts from March, 2014

My Postsharp tracer attribute logs some classes/methods but not others -

background i'm using postsharp version 3.0.42.9 , have created custom tracer attribute ( onmethodboundaryaspect ). have applied @ assembly level of webforms project this: [assembly: mylogging.tracer(attributepriority = 1)] [assembly: mylogging.tracer(attributeexclude = true, attributetargetmembers = "regex:^get_|^set_", attributepriority = 2)] the tracer logs entry method arguments , exit return value. i'm using nlog write log entries database table. i have following 2 classes in separate files in same folder of same project in solution , in same namespace: public class classa : iclassa { public operationresult performoperation(ienumerable<somedto> parameters) { var classb = new classb(); return classb.anotheroperation(parameters); } } //in different file public class classb { public operationresult anotheroperation(ienumerable<somedto> parameters) { //do stuff return operationresul

Unable to access DIV element in Bootstrap Popover / Jquery autocomplete -

i have link opens bootstrap popver. inside of popover, have text field want use jquery autocomplete. problem is, unsure how access div id text box in popover -- using conventional methods don't work. autocomplete works fine on standalone page, not on popover. please help! <a href="#" id="add_game" data-toggle="add_game" data-content='<div class="input-group">text: <input type="text" id="add_game_search"/></div>'>popover</a> $(document).ready(function () { $('[data-toggle="add_game"]').popover({ 'trigger': 'click', 'html': 'true', 'placement': 'bottom' }); }); $(document).ready(function () { $('.add_game_search').autocomplete({ source: function (request, response) { $.ajax({ global: false, url: "htt

api - How to find Open Office installation path programmatically in Java -

i exporting uml diagrams in open office draw using java uno runtime reference api in open office. tried connect open office using bootstrap.bootstrap() method resulted in "no office executable found exception". according post no office executable found exception while connecting openoffice through java , downloaded bootstrapconnector.jar , worked fine me. in case user has provide path of of open office installation , requirement connect open office instance programmatically finding installation path. 1 method know means of working winregistry in case think registry key may change underlying os. therefore great if can suggest me other method of achieving this.

node.js - SimpleWebRTC Signalling server - server.js not working -

i try simplewebrtc demo screensharing. signalling server, used server.js file at: https://github.com/andyet/signalmaster/blob/master/server.js however, when run file on ubuntu server, , browse port specified, error message: {"code":0,"message":"transport unknown"} without server.js , using simplewebrtc.com/latest.js signalling channel, able video chat, not screenshare, since signalling server on http. any appreciated.

Wx Python : Status Bar Does Not Show Menu Messages -

i starting out wx python , can't status bar display text menu items.i read statusbar messages can set setstatustext() want texts displayed. using ubuntu 14.04/wxpython 2.8/python 2.7.6. please help. in advance. import wx class test(wx.frame): def __init__(self,parent,id): wx.frame.__init__(self,parent,id,"frame aka window",size = (300,200)) panel = wx.panel(self) self.status=self.createstatusbar() #self.status.setstatustext("something") menubar=wx.menubar() first=wx.menu() second=wx.menu() first.append(wx.newid(),"new window","this new window") first.append(wx.newid(),"open...","open new window") menubar.append(first,"file") menubar.append(second,"edit") self.setmenubar(menubar) if __name__=='__main__': app=wx.pysimpleapp() frame=test(none,id=-1) frame.show()

c - How to change a pointed value and increment the pointer at the same time -

char foo[] = "something"; char *p = foo; is there way change value pointed , increment pointer next element using 1 ;? i mean, make effect of these 2 lines below in single statement? *p = 's'; p++; i think want *p++ = 's'; // --> *(p++) = 's'; sample run .

linux - Moved a file by mistake with certain time stamp want to restore files with same time satmp -

by mistake moved file want them same time stamp mv dr * /filespath/to/bkp/ is there way recover them same time stamp if understand question (and know original timestamp) move them back, , use touch give them old time stamp. excerpted man touch on gnu/linux, -a change access time -m change modification time -t stamp use [[cc]yy]mmddhhmm[.ss] instead of current time

c# - Cookie null in Form authentication -

hi developing web application using mvc4 , used form authentication. every thing works fine noticed strange behavior quite few days. cookie in global.asax null though authentication done in login page due user not able login. below code. login page. userdata = new javascriptserializer().serialize(userdata); formsauthenticationticket authticket = new formsauthenticationticket( 1, userdetails.userid, datetime.now, datetime.now.addminutes(90), false, userdata); string encticket = formsauthentication.encrypt(authticket); httpcookie facookie = new httpcookie(formsauthentication.formscookiename, encticket); response.cookies.add(facookie); global.asax protected void application_postauthenticaterequest(object sender, eventargs e) { httpcookie authcookie

sql - How to export serialized data from Wordpress -

i use advanced custom fields , acf repeater field plugins wordpress, , i'm having problems getting serialized data in sql , excel. i build base of children russian medical institutions. planned worker institution can add child database , add services child got there. these checkboxes services . key function me repeater field, allows create new amount of services. close problem. in database saved serialized, this . export posts , meta excel using sql query , serialized data there too. query: select distinct post_title ,(select meta_value kr_postmeta kr_postmeta.meta_key = 'birth_day' , kr_postmeta.post_id = kr_posts.id) "birth_day" kr_posts post_type = 'post' group post_title order post_title desc and can’t expect see solution, of them seem impracticable. might be: changing way of writing multiple data in acf, don't serialized data. enhance export unserialized data. unserialize data in csv file.

asp.net - Select from dropdownlist, chosen value create another same value? -

Image
i have create dropdown list, controller: string tmpuser = system.web.httpcontext.current.user.identity.name; var kdoseprijavlja = (from dllist in dbcontext.userstables dllist.username == tmpuser select dllist.userid).firstordefault(); var seznam = dbcontext.customertables.where(m => m.userid == kdoseprijavlja).select(m => m.customer); var seznam2 = dbcontext.customtypes.where(m => seznam.contains(m.id_newcustomertype)).select(m => m.customertype); list<string> result = new list<string>(); foreach (var customer in seznam2) { result.add(customer); } viewbag.droplist = new selectlist(result); viewbag.destination = parameters.destination; and in view index have create this: @html.dropdownlist("destination", ((selectlist)viewbag.droplist).select(t => new selectlistitem() { text = t.text, value = t.text, selected = (t.text == viewbag.destination) }), "--select--", model.search.destinati

ios - Creating a UICollectionView within a subview -

i have view controller (that sits in tab bar controller), need add collection view controller. see lots of tutorials on google seem point creating uicollectionviewcontroller , starting in viewdidload . how do in subview? i have view controller.m file so: - (void) createview // called viewdidload { uiscrollview *scrollview = [[uiscrollview alloc] initwithframe:cgrectmake(0.0, 64.0, screenwidth, screenheight)]; [scrollview.layer addgradient]; acollectionview *theview = [[acollectionview alloc] init]; [self.view addsubview:theview]; } next started uicollectionview subclass called acollectionview.h @interface acollectionview : uicollectionview @end and .m file this: #import "acollectionview.h" @implementation bestcollectionview - (id)initwithframe:(cgrect)frame { self = [super initwithframe:frame]; if (self) { // initialization code } return self; } where start collection view, in initwithframe ? i trying fol

asp.net web api - Sitecore and caching control -

Image
i working on sitecore project , using webapi perform service calls. methods decorated cacheoutput information this: [httpget] [cacheoutput(clienttimespan = 3600, servertimespan = 3600)] i testing these calls using dhc app on google chrome. sure clienttimespan set correctly response headers getting not expecting. expect cache-control have max-age of 1hour set clienttimespan attribute instead set private. have been debugging possible , t turns out sitecore may intercepting response , setting header value private. have added service url sitecore ignored url preffixes configuration no . anyone has idea how can make sitecore not change cache-control headers? this default mvc behaviour , not directly related sitecore / web api. can create custom attribute sets cache-control header: public class cachecontrol : system.web.http.filters.actionfilterattribute { public int maxage { get; set; } public cachecontrol() { maxage = 3600; } public o

symfony repository memory leak -

this code in trollservice.php (symfony 2.3): public function trolling() { $repository = $this->entitymanager->getrepository('trollbundle:troll'); $trolls = $repository->findall(); //memory leak return memory_get_usage(); } ... //somewhere: while(1) { $result = $trollservice->trolling(); } the $result n iteration > n-1 iteration. how possible? not $trolls variable local variable, should automatically delete after return function? o.o so, how can clear memory before next iteration? doctrine keeps in memory fetched objects: method avoid db interrogation. this mechanism known identity map this called “identity map” pattern, means doctrine keeps map of each entity , ids have been retrieved per php request , keeps returning same instances. remember default logging of sql connection set value of kernel.debug , if have idebug set true every sql command stored in memory each iteration. (from doctrine2 documentatio

Google Calendar Events wordpress plugin previous / next month buttons not working -

i know question should better addressed author of plugin, since doesn't respond thought might try luck here. i've installed google calendar events plugin on wordpress website , , reason, after click next month button first time, previous / next month buttons don't work anymore, nothing happens when click it. see i'm talking go website link, click "next month" button , try clicking previous or next month button – not respond. any ideas might wrong? thanks in advance!

java - Server to handle time delayed events -

i'm searching materials/ideas/designs solve architecture problem: i'll have several agents handle processing, result can generate state clients expire after time. let's client sent presence state expire after 1h. wondering how write service keep track of expiration time of scheduled events. 1) create sorted collection timestamps , process executor 2) put db , perform cyclic check using sorted query any suggestions appreciated. if using spring framework, can use spring cron http://docs.spring.io/spring/docs/3.0.x/spring-framework-reference/html/scheduling.html

CSS media queries in lotus notes client -

so, well, have xpage application works on browsers including internal notes browser. since, our target audience both desktop/mobile users have designed responsive layout using css media queries works on browsers, however, found out when runs notes application, doesn't respect media queries. works if there no media queries (for eg. mobile specific items shown on desktop). suggestions here working? far way through , removing media queries kind of last alternative. any appreciated. thanks! i think reason notes browser rendering ie. ie doesn't support media queries through ie 8. ie default, try changing internal browser firefox. see link instructions. http://www-01.ibm.com/support/docview.wss?uid=swg21268588

PHP isset variable than jquery and javascript should work -

i want know if php variable not exists, want execute javascript. for example- <?php if(!isset($_request['myvar'])){ ?> <script> alert('variable not exist'); </script> <?php } ?> is right way use javascript code in php extension file do , work: if (!isset($_request['myvar'])) { echo "<script>alert('variable not exist');</script>"; }

Save file internal storage android works just with the terminal -

i trying save file internal storage. have seen these link: how read/write string file in android saving file in internal storage android they both work when run app terminal! run ddms , see file saved. when try galaxy nexus or lg optimus 2 file not saved. thanks in order see file saved internal storage have root phone.

c - getting input in gui programming -

i'm somehow aware of c programming , need program in gui c language in codeblock. project in:(win32 gui project). can make windows ok, cancel key, want input user in form of char (from keyboard). want save it's input , on (for example password , check if it's true or not) can't find how , it's function? kind of windows has bar getting input of user , save input in buffer, have ok key go next window. don't use library. include windows.h , stdio.h , noting else. create edit window , use retrieve input user.

sql - Must pass parameter number 4 and subsequent parameter as '@name =value' -

i've got following stored procedure runs in ssms. create store proc mytt select max(tablename) tablename, aco_code,acc_code, ctr_id,cte_id,usr_code, -- convert(datetime,convert(varchar,current_timestamp,112),112) cast(datepart(hour,current_timestamp) varchar(3))+':'+ cast(datepart(minute,current_timestamp) varchar(3))as [time] #ab ( select 'tm_aco_account_comment'as tablename, a.aco_code, a.acc_code, a.ctr_id, a.cte_id, a.usr_code tm_aco_account_comment with(nolock) union select 'tm_aco_account_comment'as tablename, b.aco_code, b.acc_code, b.ctr_id, b.cte_id, b.usr_code [172.17.14.77].[is_nd_blake].[dbo].[tm_aco_account_comment] b with(nolock) )zzz group aco_code, acc_code, ctr_id, cte_id, usr_code having count(*) = 1 order aco_code select * #ab

javascript - JS Not firing on click -

i trying load function call_ajax_add_to_quotelist via button following code: $cartlink .= '<a class="add_to_cart button alt" href="javascript:void(0);" onclick="call_ajax_add_to_quotelist(add_to_quotelist_ajax_url,'.$product->id.');" '.$style.'>'.$label.'</a>'; the code above loading fine on view source when clicked showing dead no console error have loaded js file in function (it belongs plugin hacking wp plugin same actions of plugin) script load: $quotepluginjsurl = site_url().'/wp-content/plugins/dvin-wcql/js/dvin_wcql.js'; ?> <script src="<?php echo $quotepluginjsurl; ?>"></script> <?php i t first check, if call_ajax_add_to_quotelist function in javascript console, , if add_to_quotelist_ajax_url correct value. also, recommended not use onclick . recommend using jquery event binder .on() . expl.: <?php $cartlink .= "&

ios - Error when getting plist data after writing value to it -

i trying make plist file share data between skscene , settings view controller. since allow user access settings time during game, if user made changes, data plist file b4 starting game. func startgame() { gamestarted = true; plistpath = nsbundle.mainbundle().pathforresource("settings", oftype: "plist"); dict = nsmutabledictionary(contentsoffile: plistpath); let speed: cgfloat = dict.valueforkey("speed") cgfloat; } if user not go settings change settings @ all, can run function no interruptions , errors. once change speed value in settings view controller, , once function called, plistpath = nsbundle.mainbundle().pathforresource("settings", oftype: "plist"); throws exc_bad_instruction error. and how change value plist let plistpath = nsbundle.mainbundle().pathforresource("settings", oftype: "plist"); var dict: nsmutabledictionary = nsmutabledictionary(contentsoffile: plistpath); di

Error in installing the blackberry enterprise service 10 trial version -

i trying install bes 10(blackberry enterprise service 10) in windows 7 os . stuck in srp configuration. caught stuck in finalize initialization following error. idea resolve them. **<#01>[10000] (07/02 13:54:19.638):{0xdf8} cwebrequestwrapper::submitdata: winhttpqueryheaders failing. error code: 0. status code: 405. <#01>[10000] (07/02 13:54:19.638):{0xdf8} crestapiwrapper::setcertificateattributes error sending data, result [486003] <#01>[10000] (07/02 13:54:19.638):{0xdf8} cdatacontainer::doapplyimpl: ubitexxcoredatacon failed apply. result: 486023. <#01>[10000] (07/02 13:54:19.638):{0xdf8} [cubitexxcoredatacon::apply]: failed apply 'configuration.core.url.primary1' parameter. <#02>[20000] (07/02 13:54:19.638):{0xdf8} cinstallstepseq::preapplyprocess: errors encountered while applying core module. core module may not operational.**

ruby - How to solve error message "Cannot find module 'abbrev' -

my question similar how resolve "cannot find module" error using node.js? cannot solve problem using information provided in answer given. i try run uncss grunt plugin, when try install ( npm install grunt-uncss --save-dev ), following error: $ npm install grunt-uncss --save-dev module.js:340 throw err; ^ error: cannot find module 'abbrev' @ function.module._resolvefilename (module.js:338:15) @ function.module._load (module.js:280:25) @ module.require (module.js:364:17) @ require (module.js:380:17) @ object.<anonymous> (/usr/local/cellar/node/0.10.20/lib/node_modules/npm/node_modules/nopt/lib/nopt.js:10:14) @ module._compile (module.js:456:26) @ object.module._extensions..js (module.js:474:10) @ module.load (module.js:356:32) @ function.module._load (module.js:312:12) @ module.require (module.js:364:17) based on answer mentioned above, tried installing 'abbrev' module, both in project fold

javascript - Target last visible div after js action? -

is possible target last visible div/container after js function has worked, in case mixitup plugin. click filter results, adds display: none or display: inline-block appropriate containers. using code another stack question $(function () { var $items = $($(".partners_list.container article.mix").get().reverse()); $items.each(function () { if ($(this).css("display") != "none") { $(this).addclass("red"); return false; } }); }); it works when page first loads, after active mixitup , filter results doesn’t add class red last ‘visible’ container assume because loaded , done job.. the mix function follows.. $(function(){ var $filterselect = $('#filterselect'), $container = $('#partner_container'); $container.mixitup({ animation: { enable: false } }); $filterselect.on('change', function(){ $contai

android - Ask for additional facebook permission -

i'm having trouble while trying retrieve additional permission "publish_action". i assume user has logged in via facebook basic permissions granted. have code (from fragment): list<string> permissionsrequested = arrays.aslist("publish_actions"); list<string> permissionsactual = session.getpermissions(); if (!issubsetof(permissionsrequested, permissionsactual)) { pendingpublishreauthorization = true; session.newpermissionsrequest newpermissionsrequest = new session .newpermissionsrequest(this, permissionsrequested); session.requestnewpublishpermissions(newpermissionsrequest); return; } seeing debug, after user grants permission, control goes onactivityresult, where, according facebook docs, have super.onactivityresult(requestcode, resultcode, data); facebookuihelper.onactivityresult(requestcode, resultcode, data); uihelper (acording docs) used in onresume&ondestroy methods. in oncreate have super.oncreate

powershell - How to replace multiple strings in a text file and generate the logfile simultaneously? -

there multiple text files in folder , there multiple affected ids in each text file. need replace them new ids. also, want generate text log file listing filename,oldid,newid . log file required crosschecking , validation. have csv file creating array idlist. have listed part of code replacing string below. foreach ($f in gci -r -include "*.txt") { set-variable -name filename -value ($f.name) for( $i=0; $i -le $elementcount; $i++) { write-host $i $oldstring= $idlist[$i].old_id+','+$idlist[$i].old_id_type $newstring= $idlist[$i].new_id+','+$idlist[$i].new_id_type gc $f.fullname|foreach-object {if($_.contains($oldstring)){ "$filename,$oldstring,$newstring" >> $logfile; $_ -replace $oldstring,$newstring}}| sc $f.fullname } } i getting error : set-content : process cannot access file 'u:\testscript\rapg6785.txt' because being used process. @ line:22 char:152 + gc $f.fullname|foreach-object {if($_.contains($oldstrin

sql server - SQL FOR XML use values as column names -

the xml command uses column names create xml nodes. need nodes named after values i'm getting database. far know can't such select key section section | key | value ----------------------------------------------------------- pageaddproduct | errordateformat | incorrect value pageaddproduct | errornotselected | please select value widgetlogin | title | connexion widgetlogin | maillabel | mail this desired xml output <resources> <widgetlogin> <title>connexion</title> <maillabel>mail</maillabel> </widgetlogin> </resources> not sure if can xml. appreciated. you can build xml string , cast xml. this sample code work in sql server 2012 since using concat function can rewritten use + instead. select cast(concat('<resources>', ( select concat('<',t1.section,'>',

tweepy 2.3 doesn't work with a script for older version - python twitter -

i have python script parse twitter work old tweepy version: consumer_key = '+++' consumer_secret = '+++' access_key = '+++' access_secret = ''+++' auth = tweepy.oauthhandler(consumer_key, consumer_secret) auth.set_access_token(access_key, access_secret) api = tweepy.api(auth) json_user_timeline = tweepy.binder.bind_api( path = '/statuses/user_timeline.json', payload_type = 'json', payload_list = true, allowed_param = ['id', 'user_id', 'screen_name', 'since_id', 'max_id', 'count', 'page', 'include_rts']) d={} a=[] h = htmlparser.htmlparser() tweet in tweepy.cursor(json_user_timeline, api, screen_name='++user_name++', count=200, include_rts=true).items(200): ......... ......... now have upgraded tweepy 2.3 , error: allowed_param = ['id', 'user_id', 'screen_name', 'since_id', 'max_id', '

php - Wordpress - wp_query inside of a foreach loop -

i using acf build product catalogue. need create list that: +category name  -list  -of  -products  -in  -that  -category +another category name  -list  -of  -...  -in matching category of categories. categories names terms of 'product_categories' taxonomy. products belong custom post type 'products'. i've build loop displays links of categories names , images: $terms = get_terms("product_categories", array('hide_empty' => false)); if ( !empty( $terms ) && !is_wp_error( $terms ) ){ foreach ( $terms $term ) { echo '<a href="'.get_term_link($term).'">'; echo '<p>'.$term->name.'</p>'; echo '<img src="'.get_field('image-field-name', $term).'"></a></div>'; } } it works fine. rebuild

python - How to set correct indendation when using formatprg=autopep8? -

with following option set: setlocal formatprg=autopep8\ -aa\ - when select single line in visual mode , press gq , autopep8 makes modification line alters indentation of line: defaults indent of 4 spaces, no matter current indentation level of line(s). want assume lines indented correctly , leave them alone. similarly, if set --indent-size 8 switch autopep8 push lines indent level of 8 spaces. note if visual selection large enough encompass top-level indentation (i.e. there's no indentation), indented correctly. tend visual select smaller blocks before making commits. you need give --indent-size 0 . .vimrc has line: " use gq clean code " indent 0 because otherwise pushes selected lines given " indent-size, no matter current indent level of line. au filetype python setlocal formatprg=autopep8\ -aa\ --indent-size\ 0\ -

c# - Async/Await with RestSharp in Windows Phone 8 -

i did search on internet, there solutions windows phone 7 don't work windows phone 8 please me out i'm doing wrong. i'm writing wp8 app consumes api mashape. i'm using restsharp nuget package. here extension methods restsharp packages await. public static class restclientextensions { public static task<irestresponse> executetaskasync(this restclient @this, restrequest request) { if (@this == null) throw new nullreferenceexception(); var tcs = new taskcompletionsource<irestresponse>(); @this.executeasync(request, (response) => { if (response.errorexception != null) tcs.trysetexception(response.errorexception); else tcs.trysetresult(response); }); return tcs.task; } public static task<t> executetaskasync<t>(this restclient @this, restrequest request) t : new() { if (@this == null) t

java - JavaFX WebView importNode -

i use webview display svg image , i'd add svg image child of 1 of nodes of original svg (similar described here using batik: how superimpose 1 svg image onto using apache batik? ). classcastexception. here use base svg image: final string svg = "background.svg"; final uri = paths.get(svg).toabsolutepath().touri(); webview root = new webview(); root.getengine().load(uri.tostring()); the svg dislays correctly. have piece of code, executed when user press button, tries add image parent svg: file anotherfile = new file("over.svg"); documentbuilderfactory dbfactory = documentbuilderfactory.newinstance(); documentbuilder dbuilder = dbuilder = dbfactory.newdocumentbuilder(); document doc = dbuilder.parse(anotherfile); node e = root.getengine().getdocument().importnode(doc.getdocumentelement(), true); root.getengine().getdocument().appendchild(e); the following exception occurs when trying use importnode: java.lang.classcastexception: com.sun.org.apache

git - Keep file encoding in eclipse for each file (different encodings for different files) -

i'm working git repository of files encoded in latin-1 , of them in utf-8. i'm using eclipse cdt work them, , it's configured use utf-8 default encoding. the thing is, when open latin-1 encoded files, of characters not shown , , despite i've tried luna version, came out 2 days ago, problem persists (it's supposed latin-1 , latin-2 supported now, according review information ). furthermore, , here comes real trouble, when modify , save latin-1 encoded files, being saved utf-8 (as configured in eclipse), if push these changes repository, quite lot of conflicts emerge, messing entire commit. is there way of telling eclipse keep original encoding each file? thank you.

adt bundle cannot launch after uninstall android developer tools accidently -

when update android development tools 23 have errors this: update eclipse android development tools v. 23 and adt 23.0 downloaded through browser on official site. uninstall pulgins manually accidently uninstall android developer tools, can't start adt bundle again :( , have ideal me? i recommend install adt installation part freshly. remove adt first: open install new software under help click available software sites click android location click remove install adt freshly: open install new software under help click add name: type android location: copy this: https://dl-ssl.google.com/android/eclipse/ click ok click box near developer tools click next click next again accept agreement , click next this install adt again!!! hope helps!!

java - Using Expression language under javascript? -

i have below checkbox in jsp file <input type="checkbox" name="vehicle" value="bike" onclick="javascript:selectcustomers(${sessionscope.custid});"> getting following error: org.apache.jasper.jasperexception: customer.jsp(1419,33) according tld or attribute directive in tag file,         attribute onclick not accept expressions can not use expression language in javascript (in case under onclick() event)? when jsp page called, following happens, in order: server checks see if .jsp has been compiled , whether or not has changed since last compiled. server runs jsp through jasper compiler, interprets jsp java code, not java (css, html, javascript, etc) placed in string. the java code compiled , executed. the results placed in response , sent user. so, statement: ${sessionscope.custid} executed before the html sent user, , input of selectcustomers() function set before calling it. for more info ha

swing - How to update the label box every 2 seconds in java fx? -

i'm trying simulate basic thermostat in application gui. i want update label box value every 2 secs new temperature value. for example, intial temperature displayed 68 degrees , updated 69, 70, etc. till 75 every 2 seconds. this piece of code wrote in java fx. controlpanel object of te form label box present. updates final value 75. doesnt update every 2 secs. have written method pause cause 2 secs delay. labels updated final values not updated every 2 secs. when debug, can see values increased 1 every 2 secs. code written in button onclick event private void jbutton1actionperformed(java.awt.event.actionevent evt) { int i=0; timer asd = new timer(1000,null); asd.setdelay(1000); while(i < 10) { jtextfield1.settext(integer.tostring(i)); i++; asd.start(); } } to solve task using timer need implement timertask code , use timer#scheduleatfixedrate method run co

java - With a DrawerLayout, how can I close the app on pressing Back no matter which screen is active? -

Image
i'm using drawerlayout navigation of app: taking menu example: i'd home button launch homeactivity , on. clearing activity stack, is: if press people, photos, locations , button, app should close. i'm trying intent flags when launching activities same behaviour: people->photos->location->back goes photos instead closing app how can achieve that? as per said "if press people, photos, locations , button, app should close". for achieve should user fragment home,people,location , photos etc. , when press button of device can clear fragment stack , finish activity.

class - C++ instantiation via pointer -

here code : #include <iostream> using namespace std; class form{ public: form(int c ){ code = c; } int code; }; void createform(form* f,int c){ f = new form(c); } int main(){ form* f1; form* f2; createform(f1,1111); createform(f2,2222); cout<<f1->code<<endl; cout<<f2->code<<endl; return 0; } as result,i didn't see printed out. know f1 & f2 not created actually. i'm wondering if can instantiate class this? if yes, how ? void createform(form* f,int c){ f = new form(c); } will create object , assign address local f - copy of original f1 , f2 withing function's scope. the original pointers left unchanged, following cout<< statements lead undefined behavior. what you're trying achieve can accomplished passing pointer reference: createform(form*& f,int c) you forgot call delete , have memory leak. even better - don't use pointers @ a

ReSharper formatting of complex object literals -

when have complex object literals, resharper insists on formatting them liberal use of newlines. instance, example below formatted example code; note how angle brackets , parenthesis placed on lines of own. var myresultitem = new resultitem { investigation = new list<investigation> { new investigation { id = new list < cv > { myenum .myvalue .ascv ( ) } } }, item = new textresult { textresultvalue = "some text" } }; i have tried various r# options,

java - Wicket Bookmarkable link -

i have created new link in welcome.java following private link<void> drawlink; drawlink = new bookmarkablepagelink<void>("drawsome", drawsomething.class); add(drawlink); the following goes in webpage.html <li> <a href="#" wicket:id="drawsome">draw</a> </li> there 2 issues want fix. i url localhost/project-name/wicket/bookmarkable/package-name.drawsomething?0 but wanted link as localhost/project-name/drawsomething?0 as drawsomething new page added project, welcome page having drawsomethign.properties file page.icon , page.title. page.title=d3 vis page.icon=images/home_page.png the drawsomething page loads page title throws error image not resolve images folder. but have images folder in src/main/webapp/images/home_page.png can please me resolve both issues. do during application initailization: @override protected void initialize() { mountpage("drawsomethin

asn.1 - ASN1 Macro Value "is referenced, but is not defined." -

we try make macro in asn1 compiler throws following error: line 6 (bigintmacro): a0256w: 'bigintvalue' referenced, not defined. this our code: bigintmacro definitions ::= begin bigint macro ::= begin type notation ::= <type ::= integer> value notation ::= value (value bigintvalue) bigintvalue ::= int1 int2 int1 ::= number int2 ::= number end end is there particular reason still using asn.1 macro notation removed asn.1 in 1994 (20 years ago) , replaced information object classes , parameterization? better off using modern asn.1 rather banging head against wall asn.1 macro notation. i notice using either oss nokalva asn.1 compiler or online asn.1 compiler @ http://asn1-playground.oss.com . should ask oss support department assist sending mail support@oss.com. although oss asn.1 compiler still supports asn.1 macro notation, support department can convert macro notation modern asn.1. macro notation removed asn.1 20 years

html - The transitions are bugged in Safari -

i found strange bug. need make transition width/height on box, need box absolute , inline-block. works fine browsers except safari. here exemple: http://jsfiddle.net/575fe/ html: <div id="block"> text </div> css: #block { height: 200px; width: 200px; background-color: yellow; -moz-transition: 0.6s all; -webkit-transition: 0.6s all; -o-transition: 0.6s all; transition: 0.6s all; display: inline-block; } #block:hover { height: 400px; width: 400px; background-color: blue; position: absolute; } combination of inline-block + absolute make transition not working in safari. know how fix ? thanks. remove position:absolute #block:hover updated demo #block:hover { height: 400px; width: 400px; background-color: blue; }

Plotting JMeter test results dynamically in HTML chart -

i want able run jmeter test thousands of users , plot results dynamically using jquery based charting library highcharts i.e. response every virtual user must plotted in near real time show stock ticker chart gets updated dynamically. ok running test in non-gui mode. i have tried following, - run jmeter test in non-gui mode , write response file. notice results written file in buffered manner means if have program monitoring file new records, wont in real time. i looking suggestions on how can achieved 1. need write custom jmeter plugin? in case how work? 2. there listener can give me desired data 3. can done via post processor? i have seen real time reporting being done on cloud based load testing websites use jmeter, i'm sure can done, how? there buffering when writing file, shouldn't more few seconds worth of data. i'd go route of reading log file statsd using logstash.net , there can find existing solution pushes chart.

java - Why sleep mode coonections are not reused by c3p0? -

i develop web application using spring mvc + mysql. manage jdbc connection used c3p0 connection pooling. if using c3p0, suppose if, 5 connections open in pool , 5 connections in sleep mode , if request getconnection() java 1 of them should returned connection . correct? if yes consider following load testing scenario getting exception connections not acquired underlying database! . using jmeter started load test 250 users in 15 seconds. m continuously observing db connections using shoe full processlist first minutes going 250 users thrown web server connections count reached 500 our maxpoolsize . after getting connections not acquired underlying database! . at point if execute shoe full processlist can see 500 connections in sleep mode if correct in above statement open connection in sleep mode returned c3p0. why getting exception.? here c3p0 properties minpoolsize=10 acquireincrement=1 maxpoolsize=500 initialpoolsize=10 numberhelperthread=100 maxidletime=10 maxstat

javascript - How to Scale Fibers's object use XTK API -

there problem, fibers object can not automatic alignment volume , mesh. files come same source (one subject's dicom file) should can match in default. if show fibers object, can put in center of view. if show 3 object together, fibers object shift!!! so try use xtk api fix problem, i've tried x.fibers.transform, there no method can achieve it, tried x.fibers.scalars , x.fibers.points still not work. in x.fibers.points i've tried change points value can't save value, there method get() can allow me point value(vertex coordinates), there no way can "set()" value when have changed it. please tell me how scale fibers!~ there no way feasible xtk api? and here source code: http://goo.gl/ttzc84 demo web: http://goo.gl/np2euo

Customizing Foundation Top-Bar (jQuery) -

when looking solution change 'back'-text on mobile top-bar of foundation, came across solution: $(document).foundation('topbar', { index : 0, stickyclass : 'sticky', custom_back_text: true, back_text: 'custom_text', init : true }); it it's supposed do, breaks other parts, eg orbit slideshow isn't working anymore. can tell me, problem , solution might be? html looks this: <div class="contain-to-grid sticky"> <nav class="top-bar" data-topbar> <ul class="title-area"> <li class="name show-for-touch"><img src="img/logo-top-bar.svg"></li> <li class="toggle-topbar menu-icon"><a href="#"><span>menü</span></a></li> </ul> <section class="top-bar-section"> <ul class="left"> <li class="active"><

ASP.NET Windows Authentication not accepting correct credentials -

i running same issue posted here: windows authentication of intranet asp.net website , reappearing windows login box but appears never recieved answer. my application has networkservice selected process identity did not fix issue. regarding appreciated. note using iis 6.1 , enable integrated windows authentication enabled in ie. (primary browser ie9)

javascript - How to prevent blob + guid in browser title -

Image
basically, doing generating pdf file on server , showing in browser via javascript this: file = new window.blob([data], { type: 'application/pdf' }); var fileurl = url.createobjecturl(file); var wnd = window.open(fileurl, "_blank", "location=no, fullscreen=yes, scrollbars=auto, width=" + screen.width + ",height=" + screen.height); all works fine every browser showing ugly subtitle (something this): blob:2da57927-311e-4b3d-a261-d2679074802c is there way rid of subtitle or replace meaningful? edited: here screen capture of improved code (after applying vision's suggestion): as mentioned in comments, 1 possible way make <iframe> in popup window, displays current blob data, , style popup wish: var win = open('', 'name', 'height=300, width=300'), iframe = document.createelement('iframe'), title = document.createelement('title'), file = new blob([data], { type

Facebook login without using facebook login button on Android with native dialog -

in application, have requirement login facebook without using login button. have tried following code snippet session s = new session(activity); session.setactivesession(s); session.openrequest request = new session.openrequest(activity); request.setloginbehavior(sessionloginbehavior.suppress_sso); request.setcallback( new session.statuscallback() { @override public void call(session session, sessionstate state, exception exception) { if (exception != null) { toast.maketext(activity, "facebook" + exception.getmessage(), toast.length_short).show(); closetask = true; } else if(session.getstate().isopened()){} } }); but opening web dialog. requirement open native dialog if facebook app installed. if facebook app not installed open web dialog. thanks, manish garg you should remove line: request.setloginbehavior(sessionloginbehavior.suppress_sso)

Logstash 1.4.2 multiline codec -

part of log i'm trying use: 2014-06-27 14:47:48 error: fatal error (4): syntax error, unexpected 'cakelog' (t_string) in [/public_html/config/log.php, line 5] 2014-06-27 14:47:48 error: [fatalerrorexception] syntax error, unexpected 'cakelog' (t_string) stack trace: #0 lib/cake/error/errorhandler.php(204): errorhandler::handlefatalerror(4, 'syntax error, u...', '/home/...', 5) #1 [internal function]: errorhandler::handleerror(4, 'syntax error, u...', '/home/do...', 5, array) #2 /home/shared_user/cakephp-git/lib/cake/core/app.php(929): call_user_func('errorhandler::h...', 4, 'syntax error, u...', '/home/...', 5, array) #3 /lib/cake/core/app.php(902): app::_checkfatalerror() #4 [internal function]: app::shutdown() #5 {main} my logstash 1.4.2 config (using alsmost exact same codec described here http://logstash.net/docs/1.4.2/codecs/multiline ): input { file { type => "cake-error"

objective c - Switching between iOS versions in Xcode 6 -

Image
in xcode 5 switch between ios versions inside toolbar: but in xcode 6 feature missing: any solution that? i'm not sure if change beta issue or new design decision apple can still switch between ios versions. apple added new devices menu xcode can rename or delete existing simulators or add new ones. open devices menu window->devices , give appropriate names simulators "iphone 5 (7.0)".

c# - How to select a ListBoxItem which is already selected OR to highlight previous selected ListBoxItem after setting SelectedIndex to -1? -

i'm programming simple listbox in windows phone 7. listbox has items , when click of items app navigates new page. from beginning here, good. but want end-user can select item again causes navigate next page again. listbox is, doesn't allow me select selected item again. i tried allowing select item again. private void listbox_selectionchanged(object sender, selectionchangedeventargs e) { if(listbox.selectedindex != -1 ) { navigationservice.navigate(uri); listbox.selectedindex = -1; } } i have alreadhy edited listboxitemtemplate highlight selected item, when use above code, cannot highlight selected item, because changes selectedindex fast. so how can allow user select selected item or how can highlight previous selected item. suggestions or tips? edit: when using normal listbox , can use : listboxitem1.background = new solidcolorbrush(color.blue);` but when edit template of listbox item throw exception, cannot still this.

Missing nuget packages error while using msbuild from command line -

i working on silverlight app. using nuget packages dont check in packages , packages should restored while building. solution compiles in visual studio. trying add compile task in command line using msbuild exec { c:\windows\microsoft.net\framework\v4.0.30319\msbuild.exe $slnfile /p:outputpath=$outputpath /p:configuration=release /p:solutiondir=$rootdir\source\ /verbosity:minimal /nologo /m:4 } "build failed before doing step, i'm doing nuget restore explicitly. exec { c:\project\nuget.exe restore $solutionfile} "restore failed" this step passes message "all packages listed in packages.config" installed. but when actual build step happens build fails message this project references nuget package(s) missing on computer. enable nuget package restore download them. more information, see http://go.microsoft.com/fwlink/?linkid=322105 . missing file \source\.nuget\nuget.targets. i doing nuget restore explicitly , have enabled &

java - Generating username with given information from the user -

hi im can me program ? professor ask program information user , generate 6 letter username lastname , firstname of user. first 3 letters of user name first 3 letters of firstname , other 3 last 3 letters of lastname of user. , need test log-in module test if username , password match on generated username , user inputted password as far im doing cant find answer on , our professor didn't teach this , im struggling right now. this program right now>>> public static inputstreamreader r = new inputstreamreader(system.in); public static bufferedreader = new bufferedreader(r); public static void main(string[]args) throws exception{ string lname,fname,mi; int age,bday; float pass; system.out.print("enter last name: "); lname=i.readline(); system.out.print("enter first name: "); fname=i.readline(); system.out.print("enter middle name: "); mi=i.readline(); system.out.print("age: "); a

How to install windows updates on multiple clients using YUM on CentOS server -

i need installation of windows updates (os , microsoft security essentials) on multiple clients using cent-os server. i'm not familiar linux systems , cant find appropriate tutorial on internet. give opsi try, opensource deployment solution works on centos: http://www.opsi.org/ this integrated system deploy full installation simple updates or rollouts.

php - Regex group include if condition -

i have try use regex /^(\s+)(?:\?$|$)/ with yolo , yolo? works both on second string ( yolo? ) ? include on capturing group (\s+) . it's bug of regex or have made mistake? edit: don't want '?' included on capturing group. sry bad english. you can use if want capture can't have ? in it, use negated character class [^...] (see demo here ): ^([^\s?]+)\??$ if want capture can have ? in (for example, yolo?yolo? , want yolo?yolo ), need make quantifier + lazy adding ? (see demo here ): ^(\s+?)\??$ there btw no need capturing group here, can use look ahead (?=...) instead , @ whole match (see demo here ): ^[^\s?]+(?=\??$) what happening the rules are: quantifiers (like + ) greedy default, , regex engine return first match finds. considers means here: \s+ first match in yolo? , engine try match (?:\?$|$) . \?$ fails (we're @ end of string, try match empty string , there's no ? left), $ matches. the regex

javascript - Cross-origin-requests in Angular.js -

i got angular.js app has run on client-only , needs fetch data different json files. i tried different solutions enable cors, without success. app.js var myapp = angular.module('myapp', [ 'ngroute', 'mycontrollers' ]); myapp.config(function($httpprovider) { //enable cross domain calls $httpprovider.defaults.usexdomain = true; //remove header used identify ajax call prevent cors working delete $httpprovider.defaults.headers.common['x-requested-with']; }); controllers.js /* controllers */ var mycontrollers = angular.module('mycontrollers', []); mycontrollers.controller('navigationcontroller', ['$scope', '$http', function ($scope, $http) { $http.get('json/data.json').success(function(data) { $scope.data = data; }); }]); ... error in console xmlhttprequest cannot load file:///.../json/data.json. cross origin requests supported http. any appreciated,

Is there a reason why CSS doesn't support ids and classes, starting from numbers? -

i noticed css properties aren't applied if id or class starts number. example, none of following work: .1ww{ /* properties here */ } and .1{ /* properties here */ } and #1{ /* properties here */ } and #1ww{ /* properties here */ } why doesn't css support ids or class names, starting numbers? (javascript, example, works numeric ids , classes) in fact, specification states classes starting number interpreted dimension [ 1 ]: css2 parses number followed identifier dimension token (i.e., unknown unit), css1 parsed number , identifier. means in css1, declaration 'font: 10pt/1.2serif' correct, 'font: 10pt/12pt serif'; in css2, space required before "serif". (some uas accepted first example, not second.) and since don't know dimensions introduced in future, dimensions not exist in css parsed unknown dimensions: in css1, class name start digit (".55ft"), unless dimension (".55in"

wix - How to check an installed version of a product from MSI -

after review lot of posts in site decide put mine. preparing msi file wix. need check if particular version of enterprise product installed, before install system. have guid of product (which same versions), need check if 1.10.0 version installed. idea, please. in advance. pd: newbie in wix, @ moment using wxs file created default setup project. clarifying: don't want upgrade software installing, need check program , version installer depends. to properly, want use custom action. inside custom action, use msigetproductinfo function: http://msdn.microsoft.com/en-us/library/aa370130%28v=vs.85%29.aspx a way of doing in pure-wix modify example found here: how compare registry versions in wix? first create registrysearch element: <property id="productversion"> <registrysearch id="productversionsearch" root="hklm" key="software\microsoft\windows\current version\uninstall\[productcode]" name="displayversion&q

jquery - array from select children span text separated by commas [resolved] -

i need generate array in jquery: one,two,three,four selecting text multiple <span> children: <div id="group"> <div><input value="somevalue"/><span>one</span></div> <div><input value="somevalue"/><span>two</span></div> <div><input value="somevalue"/><span>three</span></div> <div><input value="somevalue"/><span>four</span></div> </div> i've tried this: $('html').find('#group span').text(); but joins text no spaces: onetwothreefour need separate text commas many generous :) working demo try use .map() along .get() collect values in array, afterwards .join() array character want. var text = $('#group span').map(function(){ return $(this).text(); }).get().join(); demo side note: default .join() join text usi

excel - apply vlookup formula for variable no.of rows -

Image
i have excel sheet in first 3 columns pivot table , whenever refresh it, no. of rows may change. columns e,f,g,h,i use vlookup formula based on columns a,b,c. since no. of rows changing, how can make sure vlookup formula automatically adjusts columns e,f,g,h,i based on no. of rows of a,b,c ? attached image in can see formula didn't apply last 3 rows , have manually drag cells if work. somewhat brute force like ' refreshed pivot table ' ' assumes variable ws refers worksheet ' assumes formulas start on row 2 ws.range("e2:i2").copy ws.range("e3:e" & ws.usedrange.rows.count) then put if statement around formula in column e (and similar if statements on other columns): =if(c2="","",vlookup(...)) you can more robust way determine how many rows on left versus right. or step through like: for = 1 ws.usedrange.rows.count if(ws.cells(i,3).value = "") ws.range("e" & &am