Posts

Showing posts from March, 2011

concurrency - c++ future call local variable -

when using c++ future call function, if define 2 future objects a,b , call same function foo = async(launch::async,foo); b = async(launch::async,foo); is same running function twice? foo() foo() i.e. a , b each running private copy of foo ? they use same function example shows. void foo() { static int counter=0; cout<<counter++<<endl; return; } int main() { std::future<void> resulta(async(launch::async,foo)); resulta.get(); std::future<void> resultb(async(launch::async,foo)); resultb.get(); return 0; } output: 0 1 this shows same static counter variable used bcz output not 0,0 0, 1 (incremented goes foo) hope helps,

jquery - How do you close the Iris colour picker when you click away from color picker? -

how close iris colour picker when click away color picker? used below code jquery(document).ready(function($) { $('.my-color-picker').iris({ palettes: true, target: false }); }); try this:- jquery(document).ready(function ($) { $('.my-color-picker').iris(); $(document).click(function (e) { if (!$(e.target).is(".my-color-picker, .iris-picker, .iris-picker-inner")) { $('.my-color-picker').iris('hide'); return false; } }); $('.my-color-picker').click(function (event) { $('.my-color-picker').iris('hide'); $(this).iris('show'); return false; }); }); demo

utf 8 - special character breaking my json -

in application creating, user entered name saved database. name contained letter e accent on it. when app retrieved value , output using json, json invalid. how can avoid this? i've solved similar problem using php's utf8_encode() function. depends on environment. you should checked encoding in database , encoding app producing. make sure translate encodings if differ. it helpful further specify system.

asp.net mvc - Logging out of Webforms Authentication dos not remove the authentication on the server -

i use out of box webforms authentication. after request "logout" , using: formsauthentication.signout(); the user logged out removing cookie ".aspxauth" client browser. this works expected. our site got security audited , auditor claimed authentication token not deleted server when user logs out. i can reproduce behaviour using fiddler. i log in site , copy cookie ".aspxauth" i log out: cookie deleted on client , dont have access secured pages anymore i send request site using fiddler composer using prevously copied cookie "aspxauth". can access secured pages cookie. the expected result if log out can not access secured pages providing old aspxauth cookie. is there way invalidate old aspxauth cookie on server? i solved storing salt value in auth-cookie gets saved in database user when loggs in. on each request there check if salt in auth cookie same 1 database. if not user gets logged out. if user loggs o...

web services - THTTPRIO SSL using Client Certificate doesn't work as it should -

i have soap webserver developed in delphi xe2 exposes methods , uses ssl. built client in delphi xe2, , use thttprio connect webserver. question related use of ssl certificatest thttprio. if call webservice works without having certificate installed, think shouldn't. second scenario :i have self signed certificate installed , after made call webservice works also. when inspected events: httprioafterexecute , httpriobeforeexecute, converted soaprequest , soapresponse string tstream , seems isn't encrypted in both cases. found on forum same question no response. i searched info soap ssl clients delphi couldn't find new info. of guys give me advices regarding issue? if call webservice works without having certificate installed, think shouldn't. not many web services require client certificates (with exceptions banking , other high risk environments). more common clients want verify server identity, , done server certificates. so web service wo...

Null Pointer Exception with arrays and classes - Java -

ok, have global array part of class "temp". want edit array anywhere in program. working fine. however, when try use values set values in "cords" class, null exception error. have commented in code. idea why? import java.util.scanner; public class solution { public static void main(string[] args) { scanner inp = new scanner(system.in); int n = 0; for(int k = 0; k<4; k++){ temp.tempvalues[k] = 0; } boolean checknums = false; string coords = ""; while(n<1 || n>2000){ system.out.println("enter number of lines"); n = inp.nextint(); } cords[] lines = new cords[n]; int proceed = 0; inp.nextline(); for(int = 0; i<n; i++){ proceed = 0; checknums = false; while((proceed != 3) || (checknums == false)){ system.out.println("en...

ios - when request post jsondata requested URL show blank field only dictionary key are viewd -

nsdictionary *dictionary =[nsjsonserialization jsonobjectwithdata: [@"{\"id\":\"7\",\"user\":\"alok7@gmail.com\",\"name\":\"ashok\",\"gender\":\"male\",\"price\":\"898989\",\"place\":\"disa\",\"time\":\"2014-10-22\",\"given_taken\":\"given by\"}" datausingencoding:nsutf8stringencoding]options: nsjsonreadingmutablecontainers error: nil]; nsstring *jsonrequest = [nsstring stringwithformat:@"%@",dictionary];// jsondict]; nslog(@"jsonrequest %@", jsonrequest); nsmutableurlrequest *request = [nsmutableurlrequest requestwithurl:url1]; [request sethttpmethod:@"post"]; [request sethttpbody:[jsonrequest datausingencoding:nsutf8stringencoding]]; [request setvalue:@"application/json" forhttpheaderfield:@"accept"]; [request setvalue:@"application/json" forhttphe...

c# - DataContext accessed after Dispose in render pages/controls -

i'm randomly getting "datacontext accessed after dispose" errors on aspx , ascx pages/controls. there general rule shouldn't calling methods inline on pages use datacontexts? i'm presuming time page renders , calls method datacontext has been disposed? e.g. on default.aspx <%= currentcontent.gettext("intro") %> currentcontent database object referred in default.aspx.cs assuming using this using (mydbcontext ctx = new mydbcontext()) { return r in ctx.table select r; } deferred execution happening you. query not execute right , there, , running when returned enumerator used - in case, after using block disposes of context. if want sure doesn't happen, either change query pattern using (mydbcontext ctx = new mydbcontext()) { return (from r in ctx.table select r).tolist(); } or change disposal methods. tend tying lifetime of context enclosing object, in case asp.net page object. make context member variable...

android - How to change notification of other apps programatically (with root or not) -

is possible change posted notification of other app (replace on notification app). know in android 4.3 exist feature of reading notifications ( https://developer.android.com/reference/android/service/notification/notificationlistenerservice.html ) need replace existance notification on notif app.

multithreading - Julia and Lapack: pstrf multithreaded but trtrs not -

my program written in julia not yield expected computational performance. program first computes cholesky decomposition of large matrix a using cholfact! , a = l ' l . solves lx = b different b using backslash operator. this results in straight calls lapack. function cholfact! implemented pstrf! , backslash operator uses trtrs! . these correct lapack functions use. while function pstrf! executed in parallel, function trtrs! not. profiler tells me of runtime spent on trtrs! . lines of code in program are f = cholfact!(a, :l, pivot = true) # precomputation, executed once and x = f[:l]\b[f.piv] # inside loop, b computed x every step why there difference between 2 lapack functions? how can parallel execution of pstrf! ?

php - Yii1: How to use concat function in mysq like query -

i want use mysql concat function in like expression . want merge firstname , lastname fullname , matched results according fullname . have tried in yii1. below code: $criteria = new cdbcriteria(); $criteria->select = "*"; $criteria->select = 'concat(firstname , "" , lastname) fullname'; $criteria->addcondition('fullname :match'); $criteria->params = array(':match' => $query); $models = user::model()->findall($criteria); below generated error message: cdbcommand failed execute sql statement: sqlstate[42s22]: column not found: 1054 unknown column 'fullname' in 'where clause' (error 500) cdbcommand::fetchcolumn() failed: sqlstate[42s22]: column not found: 1054 unknown column 'fullname' in 'where clause'. sql statement executed was: select count(*) `members` `t` fullname :match. thanks in advance if don't need fullname afterwards, can use...

How to assign to a bash variable the first result of locate? -

i can allocate path variable bash: var1=/home/alvas/something i can find automatically: $ cd $ locate -b "something" . /home/alvas/something /home/alvas/someotherpath/something but how assign first result locate variable's value? i tried following doesn't work: alvas@ubi:~$ locate -b 'mosesdecoder' . | var1= alvas@ubi:~$ var1 var1: command not found you need assign output of locate command variable: var1=$(locate -b 'mosesdecoder' . | head -n 1) (use head top n lines). the construct $(...) called command substitution , can read in command substitution section of bash reference manual or of posix shell specification .

javascript - Why this keyword is not referring to window in a stand alone JS function -

i trying scoping , keyword in js, while writing below code got confused expecting console.log(a) after calling f() 5 , instead gave me 10 . my question : isn't this keyword in standalone function refers window ? if yes, isn't code inside function same window.a = 5 , value of a should updated 5 ? if no, why console.log(this) results in window, value of a (which global) isn't updated ? js fiddle var = 10; function f(){ this.a = 5; console.log(a); } console.log(a); f(); console.log(a); if code run in global scope, produce result expect. problem jsfiddle not run in global scope. hence var a; creates local variable a , while this.a refers global variable a . here code run in global scope: http://jsfiddle.net/grayoork/ (note "no wrap - ...") setting. reference: mdn - this . so both var a; , this.a refer same variable iff: the code runs in global scope this inside f refers global object, case if f execute...

database - ORA-01008: not all variables bound -

when execute line in oracle database xe 11.2 insert student1 values('&sno','&name',&m1,&m2,&m3); shows error ora-01008: not variables bound it working in previous versions. please me out in solving this.

java - How do I escape the ',' character in System.out.format? -

i want output 2 numbers separated comma using system.out.format . tried escape %, didn't help. target output should in form of (0.92,0.91) system.out.format("(%.2f% %.2f)%n", x, fx); ^--- want add ',' character here you don't have escape comma in format. place comma in format, without percent sign next it. system.out.format("(%.2f,%.2f)%n", x, fx);

Integration of PHP into JavaScript to take value from Backend -

so trying take input value backend(cms wordpress, mine custom developed cms) , display value in javascript code. taking values backend code: <?php $effects_array=array( "slicedown","slicedownleft", "sliceup", "sliceupleft","sliceupdown","sliceupdownleft", "fold","fade","random","slideinright", "slideinleft","boxrandom","boxrain","boxrainreverse", "boxraingrow","boxraingrowreverse"); foreach ($effects_array $effects_key => $effect_value) { ?> <label class="inline"><input type="radio" value="<?php echo $effect_value ?>" class="input-xxlarge" name="theme_options[effects_select]" <?php if (isset($site['tmp']['datalist']->effec...

php - Rain Framework on Ubuntu server on Amazon -

i'm trying install rain framework on ubuntu server on amazon mobile application api. runs fine on windows pc xampp server, when put main server shows following error: fatal error: uncaught exception 'raintpl_exception' message 'cache directory cache/doesn't have write permission. set write permission or set raintpl_check_template_update false. more details on http://www.raintpl.com/documentation/documentation-for-php-developers/configuration/ ' in /var/www/html/pidentity/api/system/library/view/rain.tpl.class.php:312 stack trace: #0./var/www/html/pidentity/api/system/library/view/rain.tpl.class.php(266): raintpl->compilefile('content', 'content/', 'app/views/conte...', 'cache/', 'cache/content.9...') #1./var/www/html/pidentity/api/system/library/view/rain.tpl.class.php(154): raintpl->check_template('content/content') #2./var/www/html/pidentity/api/system/library/view/raintpl_view.php(30): rain...

javascript - AngularJS - handle click events on existing DOM elements -

Image
i'm trying capture click event on selection of existing dom items using angular: here's code: <!-- html template (section) - it's django template, kept django template syntax original, using '{{' , '}}', , angularjs templating's system '{$' , '$}' --> <fieldset class="module aligned"> <h2>document's sections</h2> <div class="form-row document-nodes" ng-app="documentnodesapp"> <div style="width: 100%; min-height: 450px;" ng-controller="nodecontroller" on-node-click="getnodetitle($event)"> <form id="changelist-form" action="" method="post" novalidate>{% csrf_token %} <div id="tree" data-url="{{ tree_json_url }}" data-save_state="{{ app_label }}_documentnode" ...

c# - Visual Studio addin - override all existing commands? -

i had idea other day build visual studio extension on github teach people how use hotkeys. have dump of hotkeys available (thanks mads kristensen , shortcutexplorter project ). the way work (if possible) go through every command there in visual studio, , override command myself. then, when invoke it, run run original command, pop semi-transparent dialog saying hotkey use instead. for instance, if pressing "comment" button comment out lines in visual studio, commenting, , pop dialog saying "this action can invoked via ctrl + k, c instead". so. possible me override existing commands in visual studio somehow or context menus? not sure if every event available lot available using envdte namespace. e.g. (in vb but) findevents interface (provides events find-in-files operations.) ... <system.contextstaticattribute()> public withevents findevents envdte.findevents public sub findevents_finddone(byval result envdte.vsfindresult, byval cancell...

ubuntu - PHP: strftime ignoring setlocale when time is formatted -

i trying output date time value in current locale, while playing around , trying en_us locale example, seems still using 24 hours time format , not 5:13:17 pm. for example code: setlocale(lc_time, 'en_us'); echo strftime("%c"); echo strftime("%x %x %p"); outputs: wed nov 12 17:23:17 2014 11/12/14 17:23:17 pm i thought may ubuntu server config issue, locale -a returns(amongst others): en_ng.utf8 en_nz.utf8 en_ph.utf8 en_sg.utf8 en_us en_us.iso88591 en_us.utf8 any ideas? thanks update from command line on ubuntu 12.04lts server: >date --date='2014-11-13 16:21:42' +%x 04:21:42 pm >locale lang=en_us.utf-8 language=en_us:en lc_ctype="en_us.utf-8" lc_numeric="en_us.utf-8" lc_time="en_us.utf-8" lc_collate="en_us.utf-8" lc_monetary="en_us.utf-8" lc_messages="en_us.utf-8" lc_paper="en_us.utf-8" lc_name="en_us.utf-8" lc_address="en_us.utf-8...

javascript - Website Fading Effect not Working in Internet Explorer -

for reason, website's fading & positioning work , great in chrome & firefox internet explorer not showing fading effect @ , alignment messed up. here's coding: /* fade slider */ .slides { height:600px; margin:0px auto; overflow:hidden; position:relative; width:900px; } .slides ul { list-style:none; position:relative; } /* keyframes #anim_slides */ @-webkit-keyframes anim_slides { 0% { opacity:0; } 6% { opacity:1; } 24% { opacity:1; } 30% { opacity:0; } 100% { opacity:0; } } @-moz-keyframes anim_slides { 0% { opacity:0; } 6% { opacity:1; } 24% { opacity:1; } 30% { opacity:0; } 100% { opacity:0; } } @keyframes anim_slides { 0% { opacity:0; } 6% { opacity:1; } 24% { opacity:1; } 30% { opacity:0; } 100% { ...

php - Laravel - Query just one row in a pivot table and return all data within the relationship -

Image
currently, criteria belongstomany alerts , viceversa. related through pivot table: criteria_id , alert_id . i getting criteria associated alerts belongs authenticated user, such: public function getmatches() { $matches = criteria::whereuserid( auth::id() ) ->has('alerts') ->get(); } this returns associated results, whereas now, if user picks result, want able show that. have far: controller public function getmatchdetails($alert_id, $criteria_id) { $matches = alert::find($alert_id) ->has('criterias') ->where('criteria_id', $criteria_id) ->get(); } which bringing on correct variables, however, getting mysql error: column not found: 1054 unknown column 'criteria_id' in 'where clause' select * `alerts` `alerts`.`deleted_at` null , (select count(*) `criterias` inner join `alert_criteria` on `criterias`.`id` = `alert_criteria`.`criteria_id` `alert_criteria`.`al...

html - Lateral shake on div hover(CSS3 only) -

still embarking on css3 adventure! i'm trying shake div left , right on hover subtly. believe have of markup , styles correct it's not firing. love insight this. appreciated. code follows. <div class="brief-boxes"> <div class="details-box"> <div class="stats"> <p class="number">1</p> <p class="stat-title">title</p> </div> </div> <div class="details-box"> <div class="stats"> <p class="number">2</p> <p class="stat-title">title</p> </div> </div> <div class="details-box"> <div class="stats"> <p class="number">3</p> <p class="stat-...

javascript - Contact form using e.preventDefault(); not working live -

update - contact form found @ url . i trying following contact form function, using tutorial . i manage work expected on computer using apache webserver. after uploading files online website, ajax function not kick in. seems e.preventdefault(); stops working after upload, , form redirected new site,and not being processed on site without reload. i have been trying use return false; instead of e.preventdefault(); without success. her code: .html <form method="post" action='mail/mail.php'> <label>name</label> <input name="name" id="name" placeholder="name.." required="true" class="input-field"> <label>mail</label> <input type="email" name="email" placeholder="mail.." required="true" class="input-field"> <label>msg</label> <textarea name="message" id="mes...

c# - Migrating lock to TPL -

in normal c# write int dosomething(){/*...*/)}; lock(mutex) { return dosomething(); } to ensure in cases mutex released. but if signature of dosomething changed to task<int> dosomethingasync(){/*...*/}; does following code return task.factory.startnew(() => { monitor.enter(mutex); return dosomethingasync(); }).unwrap().continuewith(t => { monitor.exit(mutex); return t; }).unwrap(); do similar things? guaranteed release mutex whenever entered? there simpler way so? (i not able use async keyword keep thinking in tpl only) you can't use monitor in way because monitor thread-affine , in case task , continuation may run on different threads. the appropriate synchronization mechanism use semaphoreslim (which isn't thread-affine) set 1: public semaphoreslim _semaphore = new semaphoreslim(1,1); _semaphore.wait(); return dosomethingasync().continuewith(t => { _semaphore.release(); return t.result; }); a...

java - How can you print multiple ArrayLists next to each other -

i have arraylist of object called process , each process has arraylist of integers allocation, max , need, each process has 3 arraylists it. trying make table looks this allocation max need process 1 1 2 3 4 1 2 3 4 1 2 3 4 process 2 5 7 8 9 5 7 8 9 5 7 8 9 process 3 1 2 3 4 1 2 3 4 1 2 3 4 process 4 5 7 8 9 5 7 8 9 5 7 8 9 etc each number it's own slot size of of arrays of 4. code trying public string tostring() { string temp = ""; string tempallo = ""; string tempmax = ""; string tempneed = ""; (int j = 0; j < allocation.size(); j++) { tempallo = allocation.get(j).tostring() + " "; tempmax = max.get(j).tostring() + " "; tempneed = need.get(j).tostring() + " "; } temp = id + "\t" + tempallo + "\t" + tempmax + "\t" +...

visual studio - Code coverage by developer -

in discussion colleagues in company, try find out way have code coverage developer. know code coverage works project want more granularity on this. there way achieve that? you have @ commit histories. this might interest you: http://stef.thewalter.net/git-coverage-useful-code-coverage.html not sure if tfsvc tfs-git this might option well: http://blogs.msdn.com/b/visualstudioalm/archive/2014/11/12/code-lens-for-git-quot-team-activity-view-quot.aspx

c# - How do I create a Dictionary of classes, so that I can use a key to determine which new class I want to initialize? -

as per question, how create dictionary in c# key say, integer, values classes can call constructor using value in dictionary? each of classes derived abstract class, , take same parameters, feel should able store resulting reference new class object in variable of abstract class type. that being said, dictionary's value set filled references objects, not types themselves. quick example, here's i'm trying do: abstract class baseobject { int someint; } class objecta : baseobject { objecta (int number) { someint = number; } } class objectb : baseobject { objectb (int number) { someint = number; } } and want able following: dictionary<int, ???????> objecttypes = new dictionary<int, ???????>(); objecttypes.add(0, objecta); objecttypes.add(1, objectb); so can eventually: baseobject newobjecta, newobjectb; newobjecta = new objecttypes[0](1000); newobjectb = new objecttypes[1](2000); the syntax quite differe...

java - Eclipse WindowBuilder Glitch in Text -

Image
i'm getting strange results in eclipse windowbuilder whenever try run gui, top left area has glitchy text (i don't know else call problem). i've tried searching everywhere apparently no 1 else getting problem. problems image: display being displayed displa, 'search' scrambled. problem image: i've tried creating new project, tried reinstalling eclipse, deleting eclipse metafiles, redownloading windowbuilder, uninstalled java jdk , java computer , reinstalled it. i'm running windows 7 ultimate service pack 1 64bit. java 8 update 25 (64-bit). java se development kit update 25 (64-bit). eclipse ide java developers version: luna service release 1 (4.4.1) build id: 20140925-1800 here using windowbuilder process give guys insight, maybe doing wrong: create new project, creating new application window under windowbuilder. go design, add jtabbedpane in center, , add jpanel(s), apply gridbaglayout under of tabs , add regardless of element put, first ...

xml - Jasper Report - Count nodes with particular value -

i have jasper report multiple subreports, using xml datasource. i doing visual enhancements , stuck sub totals (column footer) on 1 sub report. parent report has group keeping linked records together. there sub report in detail band has individual records. now comes tricky part, want sub total display on sub report, if group on parent report contains more 1 record. i have tried using group count variable, problem count increments each record processed. count still 1 when 1st subreport generated. i have tried using xpath count() function, have not got right. have got following in field on parent report (passing parameter subreport) count(//currentnode[targetnode = '$f{targetnode}']) i have tried various things, seems cannot use parameter or field value in xpath of count() function. if explicitly set value instead of $f{targetnode}, correct count of nodes, need count change based on current group. is there way count records in group, before generating 1st subrep...

jquery - Access the interactive backlash/Werkzeug debugger in a failed AJAX request against a TurboGears server -

turbogears features backlash , great interactive debugger in browser, based on werkzeug debugger . when debugging turned on in server configuration, if request fails, server responds interactive web page can watch python traceback can inspected interactively. however, when developing client-side applications in jquery or angularjs , how can access interactive debugger when ajax request fails? when ajax requests fail on server, can replace current document contents debug/error document servers response. example, can following: $.ajax({ url: 'failing_controller/', type: 'post' }) .fail(function _handlefailure(jqxhr, textstatus, errorthrown) { document.open(); document.write(jqxhr.responsetext); document.close(); }) .success(function _handlesuccess(data, textstatus, jqxhr) { // ... handle data ... }); you want replace failure handler more proper in production environment.

c++ getline() looping when used in file with a read in int array? -

so posted other day not enough information , never got answer once added information asked, can't loop work question is, reading file has large text of strings on each line, has ints on next line strings need read questionarrays() , ints answersarrays. currently loop goes round once , loops doesn't further in file on next getline() did have working without reading of ints part assume breaks it. file ordered in order of string int string int , on, if there way of splitting these read in accepted answer. ifstream questionfile; int = 0; switch (x){ case 1: questionfile.open("topic1 questions.txt", ios::app); break; case 2: questionfile.open("topic2 questions.txt", ios::app); break; case 3: questionfile.open("topic3 questions.txt", ios::app); break; case 4: questionfile.open("topic4 questions.txt", ios::app); break; } if (!questionfile) { cout << "cannot load file" << endl; } e...

reporting services - SSRS - Tablix inside tablix - not able to freeze the header row -

Image
i’m facing problem in report has tablix inside one. want green band(that displays me years) should freezes @ top when scroll down vertically. i want attach report don't know how go it.

css - z-index on IE, can't get div's text behind button -

i have problem in ie. have button , on button have div text shows text. text comes , changes javascript. .ui-dp generated in js. need click on button when text on it. used z-index , solved problem everywhere except in ie. tried many variants found here , google, nothing.. can please help? html looks this: <div class="calendar"> <button class="ui-dp"></button> <div class="js-timeperiod timeperiod"></div> </div> css looks this: .calendar { display: inline-block; float: center; height: 28px; width: 200px; } .ui-dp { position: relative; z-index: 2; height: 28px; background-color: transparent; padding: 0px; border: 0; outline: 0; cursor: pointer; width: 200px; text-align: left; top: 0; left: 0; } .timeperiod { position: relative; z-index: 1; top: -30px; left: 32px; padding: 2px; text-align: center; height: 28px; width: 150px; float: center; } i have specify...

javascript - How to get url dynamically in HTML page using DOJO -

for example, have 2 url's: supposed enter in .jsp page, when enter these url's, browser internally navigate index.html page(this index.html should not displayed) , should read url dynamically , should redirect corresponding .jsp page based on server name. www.server01/demo/../com www.server02/demo/../com something below should work, replace values server1 , server2 relevant server names <head> <script type="text/javascript"> var hostname = window.location.hostname; if( hostname == "server1" ) { window.location="server1/page1.jsp"; } else if ( hostname == "server2") { window.location = "server2/page2.jsp"; } else { alert('page not found'); } </script> </head>

angularjs - learn angular 1.3 or wait for 2.0 -

i found out angular j.s 2.0. have been studying 1.3 past 3 weeks , considering switching framework hear 2.0 different (fearing studying useless in year). curious take more experienced programmer take? have been programming in js 6 months. from experience, angular 1.3 seems bit unstable , buggy , prove frustrating sometimes. recommend starting 1.2.26. solid experience built on 1 should transferred newer version :) what more, tutorials can find on internet compatible aforementioned version. please refer "learn" section on angular website. starters, recommend learning through codeschool examples :) angularjs approach mvc, two-way data binging, testing , more isn't forgotten or change - these reasons enough in opinion start older one.

c# - PlacementTarget of Contextmenu is not getting set -

this question has answer here: setting wpf contextmenu's placementtarget property in xaml? 2 answers my wpf application having button opens contextmenu upon clicking on it. using mvvm pattern , here xaml code. in buttonclick() in viewmodel, isopenmenu set true. unable context menu correctly up. <button content="click me" grid.column="1" name="btnview1" height="25" width="75" command="{binding buttonclick}" contextmenuservice.isenabled="false"> <button.contextmenu> <contextmenu isenabled="true" isopen="{binding isopenmenu}" placementtarget="{binding elementname=btnview1}" placement="bottom" > <menuitem header="menu 1" ischeckable="true"/> <menuitem header="menu 1...

service - Android WearableListenerService has to be called twice to receive Message -

i'm sending message wear service handheld. first time i'm clicking button on handheld calling oncreate method of service, second time service receives message. can't figure out problem. here wear part: @override public void onclick(view v) { final pendingresult<nodeapi.getconnectednodesresult> nodes1 = wearable.nodeapi.getconnectednodes(mapiclient); nodes1.setresultcallback(new resultcallback<nodeapi.getconnectednodesresult>() { @override public void onresult(nodeapi.getconnectednodesresult result) { (int = 0; < result.getnodes().size(); i++) { node node = result.getnodes().get(i); pendingresult<messageapi.sendmessageresult> messageresult = wearable.messageapi.sendmessage(mapiclient, node.getid(), "/open;" + cnt, null); messageresult.setresultcal...

ruby on rails - How to leave a method in pry -

i'm using binding.pry in ruby code , can't figure out how out of long method don't want in. i know n next line , c continue, can't out of method. don't want exit want out of current method. according documentation command looking f : finish : execute until current stack frame returns. and shortcuts if defined?(prydebugger) pry.commands.alias_command 'c', 'continue' pry.commands.alias_command 's', 'step' pry.commands.alias_command 'n', 'next' pry.commands.alias_command 'f', 'finish' end

Setting default date on jQuery datepicker -

i working on project 2 datepicker inputs. when user selects date first datepicker input trying second datepicker input show month of first datepicker input when datepicker pops up. for example user select date in input 1, lets 3/13/2014. when user clicks on input 2 datepicker default goes current month. when user clicks on input 2 datepicker shows month selected in input 1. does know how can accomplish this? my jsfiddle demo so far have tried this: //this noting can tell var defaultdate = $( "#date1" ).datepicker( "option", "defaultdate" ); $( "#date2" ).datepicker( "option", defaultdate ); //this takes value of input 1 , inserts input 2 var date1 = $.datepicker.parsedate('mm/dd/yy', $('#date1').val()); $("#date2").datepicker( "setdate" , date1 ); in order set value of option , need 3 parameters: .datepicker("option", "[name of option]", newvalue); ...

tfs - Visual Studio Team Services, 403 forbidden, you do not have licensing rights to access this feature, Overnight lost majority of rights? -

last night bunch of windows updates occurred work pc. now when login visual studio team services , attempt access code or receive error. 403 forbidden. tf400409: not have licensing rights access feature: administer account we use free visual studio team services , have 4 users. other users can still navigate account , view code , user settings. still present user , able login have access 2 tabs (overview , load test). i noticed msdn license had lapsed earlier month, unsure if issue. hoping else has run issue can't code. i have entered ticket microsoft , post findings here if able fix account. got reply microsoft. visual studio team services membership descriptions basically, need @ least basic membership perform admin functions or msdn subscription. i had had subscription had never seen issue before. long story short, if use , subscription runs dry luck getting code. (although microsoft support helpful in determining issue)

c++ - capybara-webkit on yosemite g++: error: unrecognized command line option '-Xarch_x86_64' -

im having problem installing on osx 10.10 yosemite, running gcc4.9.2, qt 4.8.6 install via brew gem install capybara-webkit building native extensions. take while... error: error installing capybara-webkit: error: failed build gem native extension. /usr/local/var/rbenv/versions/2.1.4/bin/ruby extconf.rb cd src/ && /usr/local/bin/qmake /usr/local/rbenv/gem/gems/capybara-webkit-1.3.1/src/webkit_server.pro -spec /usr/local/cellar/qt/4.8.6/mkspecs/macx-g++ -o makefile.webkit_server cd src/ && /applications/xcode.app/contents/developer/usr/bin/make -f makefile.webkit_server g++ -pipe -o2 -arch x86_64 -xarch_x86_64 -mmacosx-version-min=10.5 -wall -w -dqt_no_debug -dqt_webkit_lib -dqt_gui_lib -dqt_network_lib -dqt_core_lib -dqt_shared -i/usr/local/cellar/qt/4.8.6/mkspecs/macx-g++ -i. -i/usr/local/cellar/qt/4.8.6/lib/qtcore.framework/versions/4/headers -i/usr/local/cellar/qt/4.8.6/lib/qtcore.framework/versions/4/headers -i/usr/local/cellar/qt/4.8.6/lib/qtnetwork.frame...

windows runtime - How to update ThemeResource on DependencyObject? -

i have following viewmodel object: public class imagecontent : dependencyobject { public static readonly dependencyproperty imageproperty = dependencyproperty.register("image", typeof(imagesource), typeof(imagecontent), new propertymetadata(null, imagepropertychanged)); private static void imagepropertychanged(dependencyobject d, dependencypropertychangedeventargs e) { } public imagesource image { { return (imagesource)getvalue(imageproperty); } set { setvalue(imageproperty, value); } } } in xaml use content button this: <button style="{staticresource calloptionbuttonstyle}"> <viewmodel:imagecontent image="{themeresource imgkeypad}"/> </button> i noticed when change theme on windows phone 8.1 image on button not changed. imagepropertychanged not fired. but if inherit object (for example) button, make same property , change theme imageproperty...

ruby - mongo get first data after sorting by descending -

how first data on mongo after sorting data desc. example : i'm using tutorial in app : mongo ruby i'm typing in console : client = mongo::client.new db = client['example-db'] coll = db['example-collection'] collect_data = coll.sort("desc created") result collect_data.count = 11 how first data collect_data ? need help, master try collect_data[0] or collect_data.to_a[0]

.htaccess - set a subdomain with redirect to the index page -

i have domain abdefg.it. i have set subdomain sub.abcdefg.it pointing in directory contain: index.php foldera .htaccess the problem if type url sub.abcdefg.it error appear, if type sub.abcdefg.it/index.php goes well. that contained in .htaccess file rewriteengine on rewritecond %{http_host} ^sub\.abcdefg\.it$ [or] rewritecond %{http_host} ^www\.sub\.abcdefg\.it$ rewriterule ^/?$ "http\:\/\/www\.abcdefg\.it\/sub\/index\.php" [r=301,l] what doing wrong? thanks you. you can that: rewriteengine on rewritecond %{http_host} ^(?:www\.)?sub\.abcdefg\.it$ rewriterule .* http://www.abcdefg.it/sub/index.php [r=301,l] now, redirect http_host. before work well, use [r=302,l] tests, without cache.

javascript - Dojo syntax for Eclipse Aptana plugin -

using aptana plugin eclipse version 3.7. working on dojo-powered project. aptana mark every line has dojo tags (e.g. data-dojo-type) incorrect syntax. workaround stop eclipse marking tags syntax errors? is there way @ least add dojo-tags exceptions? this valid solution problem: in preferences > aptana studio > validation > html tidy validator > attributes >> proprietary attributes --> ignore

Determine Quadrant using Circular Package R -

Image
can explain me how 1 can determine quadrant mean lies in when circular stats function used? example below > mean(df3[[1]]) circular data: type = angles units = degrees template = geographics modulo = asis 0 = 1.570796 rotation = clock [1] 152.6511 usually quadrant determined mathematically. not sure how apply mathematical understanding (below) circular function in r determining quadrant sin +, cos + : mean angle computed directly. sin +, cos - : mean angle = 180 – θr sin -, cos - : mean angle = 180 + θr sin -, cos + : mean angle = 360 - θr basically question this, when follow rules above when number circular package? i took example ?mean.circular , ran code. since that's not reproducible example, posted dput output below image: > findinterval( mean(x) , seq(0, 2*pi, by=pi/2) ) [1] 1 > plot(mean(x)) > x <- circular::circular(runif(50, circular(0), pi)) > mean.circular(x) circular data: type = angles units = radians te...

javascript - Basic d3js max returning multiple values -

i'm trying 1 value d3's max function it's returning entire array. here example: var data = { "jim" : [ { "value" : [10,11,12] } ] } var mymax = d3.max(data.jim, function(d){ var maxval = d["value"]; return maxval; }) console.log(mymax + "max") it returns 10,11,12max. should return 12. you're trying find maximum of array data.jim has 1 element = {"value" : [10,11,12]} d3 promptly returns maximum using given accessor function. try changing code following: var mymax = d3.max(data.jim, function(d){ var maxval = d3.max(d["value"]); return maxval; })

ruby on rails 3.2 - Thinking sphinx not accessing deployment recipe -

the thinking sphinx manual alludes capistrano recipe assume following. however deployment interrupted motive nomethoderror: undefined method `instance' capistrano::configuration:class and complains line require 'thinking_sphinx/capistrano' does require particular step when installing ts ?

objective c - Is it possible to control the amount of vibrancy of the translucent/blurry background in Yosemite? -

Image
i know whether possible control amount of translucency in so-called vibrancy effect introduced yosemite, can implemented in objective-c app employing nsvisualeffectview class. here example more specific. consider translucent effect shown yosemite os x when volume level changed: the vibrancy stronger 1 obtains using simple nsvisualeffectview (shown in following image) if compare 2 images — please, ignore different form of speakers focus on background — see amount of vibrancy (the strength in gaussian blurring effect) stronger in yosemite os x volume window instead of app using nsvisualeffectview . how can 1 obtain that? in os x yosemite apple introduced new materials can applied nsvisualeffectview. from appkit release notes os x v10.11: nsvisualeffectview has additional materials available, , organized in 2 types of categories. first, there abstract system defined materials defined how should used: nsvisualeffectmaterialappearancebased, nsvisualeffectma...

wordpress - Prevent PHP variable from automatically displaying on the page -

i'm having strange occurrence haven't seen before. have created following variable: $post_type = the_field('select_post_type'); so can use variable in other code (using wordpress advanced custom fields). however, @ point write line of code, outputs value onto page. query working correctly, reading variable otherwise. haven't seen variable before... ideas why or how can fix it? here full code context: <?php $post_type = the_field('select_post_type'); // variable outputting onto page right here $args = array( 'post_type' => $post_type, 'posts_per_page' => '-1', ); $query = new wp_query( $args ); ?> i've used variables in wordpress queries before , haven't had happen, i'm not sure why happening? the_field automatically echo's use get_field instead

linux - Are there any examples of programs that generate text text files as output in NASM? -

i need make program outputs text file extension of .dna, don't know if can that, , if text file compatible need compare afterwards. anyway, i'm not sure how this. tried examples nasm, didn't find much. have idea of i'd need do, don't know call generate file. afterwards i'd need write stuff it, i'm not sure on how go on that. point me examples or something? need see required write own thing. here's example using system calls. basically, open file, write data it, close , exit: ; nasm -f elf file.asm ; ld -m elf_i386 file.o bits 32 section .data ; don't forget 0 terminator if akes c string! filename: db 'test.txt', 0 ; error message printed write(). function doesn't ; use c string no need 0 here, need length. error_message: db 'something went wrong.', 10 ; 10 == \n ; next line means current location minus error_message location ; works out message length. ...