Posts

Showing posts from July, 2015

c# - Is there any way to configure Visual Studio's Intellisense to pick the instance variable instead of the class? -

c# - Is there any way to configure Visual Studio's Intellisense to pick the instance variable instead of the class? - every time utilize variable name that's same class name, visual studio's intellisense selects class name default: this quite annoying. i'd to, default, pick instance variable instead of class. possible configure visual studio 2010 this? i'm using resharper 5.1 if helps. it doesn't matter. selecting either 1 result in same text, can select class. c# visual-studio visual-studio-2010 resharper intellisense

jQuery's show animation -

jQuery's show animation - does know how invert show('slow') animation on jquery? want going backwards. thanks answers! have tried jquery's hide method ... .hide('slow') ? jquery

security - Is claim based authorization with wcf on winXP possible? -

security - Is claim based authorization with wcf on winXP possible? - i'm reading book wif. technology sounds , fitting our project, unfortunately have back upwards win xp... so question obvious, can utilize claim based authorization wcf without using wif? send claims security header should not problem, how can create own claim security token , verify valid , valid issuer? thanks fro hints , helps, eny yes can. don't need wif on client (event though convenient). need utilize right bindings (e.g. wshttpfederationbinding...) wcf security windows-xp claims

c# - How to reset a form to its default appearance, after interaction with user -

c# - How to reset a form to its default appearance, after interaction with user - i wanted default view of form after interaction user. in other words after changes has been implied user, command homecoming form initial pop appearance? have many controls, , calculations, dont want go on command 1 1 , set them null or default value. great, if initate form 1 time more, how. you seek clearing controls on form, calling initializecomponent() method. while (controls.count > 0) { controls[0].dispose(); } initializecomponent(); edit: another alternative wouldn't cause performance issues utilize info binding. create info object maps 1 1 of fields you'd reset, 1 time time reset form set info source of form new instance of info object. c# winforms

c# - How can I create a unit test that verifies that all fluent validators can be resolved by Windsor? -

c# - How can I create a unit test that verifies that all fluent validators can be resolved by Windsor? - i using fluentvalidation in application verify entities, have come little issue. validation mill setup resolve validation classes windsor attempting resolve ivalidator<entitytype> interface. i want create sure whenever validation class creating no 1 forgets register windsor. essentially want @ classes in assembly implement ivalidator<entitytype> interface , phone call windsorcontainer.resolve(typeof(ivalidator<entitytype>)) resolve type, entitytype can class in assembly. far, using reflection have been able pull out classes derived generic interface ivalidator<> can't figure out how proceed there. problem have find way pull out actual entity used in generic in order phone call windsor correctly, , @ loss of how that. is there easier way this? i want create sure whenever validation class creating no 1 forgets register wi...

DokuWiki with SVN: how and what should be under source control -

DokuWiki with SVN: how and what should be under source control - i want store documentation under svn source control. in dokuwiki settings there is directory saving info '.../apps/dokuwiki/data' dokuwiki stores info within text files under '.../apps/dokuwiki/data' folder. there many stuffs there including indexes caches etc. seems need 'pages' folder. how can move 'pages' folder within svn folders , configure docuwiki utilize pages there? $conf['datadir'] can used in conf/local.php set page directory independently rest of directories in data . want utilize $conf['mediadir] uploaded images , files , maybe $conf['metadir'] saving page metadata. dokuwiki

Using symfony2 routing component (outside of symfony2) -

Using symfony2 routing component (outside of symfony2) - i've been searching , haven't found much useful information. i'm looking utilize symfony2 routing component (and yaml component) own personal framework haven't found documentation on basic setup. documentation on symfony site job of explaining how utilize component not much in way of standalone setup. can recommend place start explain how setup individual symfony2 components? i ended looking @ documentation on symfony site, source code on github (route.php, routecollection.php, routecompiler.php) , came own basic router. just symfony, allow 4 arguments passed route class -> 1) pattern, 2) default controller/action, 3) regex requirements each variable in pattern, , 4) options - haven't coded yet it's not in requirements. my main/front controller (index.php) talks static router class has access other route classes in lib\route namespace. router::map compiles regex string (along defa...

android App not getting the message from C2DM server -

android App not getting the message from C2DM server - we implemented app utilize c2dm services, able registration id c2dm server app. having app server having auth key c2dm. sending message app server , getting id response c2dm, our application not receive message. we tried on android emulator , on android device (htc) wifi connection. please check auth update, might cases may using older auth token, hope have registered email here http://code.google.com/android/c2dm/signup.html also, can verify reply android c2dm getting (401) unauthorized android android-c2dm

c# - grid view selected row data -

c# - grid view selected row data - i getting info gridview on rowcommand event next code protected void gridview2_rowcommand(object sender, gridviewcommandeventargs e) { if (e.commandname == "editproject") { string rowindex = e.commandargument.tostring(); int index = int.parse(rowindex); gridviewrow row = gridview2.rows[index]; label6.text = row.cells[1].text; } } but give info of field visible in gridview row .how can field not visible bound gridview. you can't value set invisible because these not rendered @ client side , can't grabbed on server side. alternatively can store value in hidden field , can hidden field. c# .net asp.net visual-studio gridview

Parsing JSON response using PHP for Yelp API -

Parsing JSON response using PHP for Yelp API - i can't seem parse info sent yelp api. here's output: http://www.coroomer.com/apartments/yelp.php. here segment of code having problem with: // send yelp api phone call $ch = curl_init(); curl_setopt($ch, curlopt_url, $signed_url); curl_setopt($ch, curlopt_returntransfer, 1); curl_setopt($ch, curlopt_connecttimeout, 30); $response = curl_exec($ch); curl_close($ch); // handle yelp response info $obj = json_decode($response,true); // print debugging //print_r($obj); echo var_dump($obj); if (isset($bus)) { foreach($obj[businesses] $bus){ echo $bus[name]; echo $bus[reviews]; } } the problem can't correctly "formatted" output. formatted in looks review threads on yelp. help appreciated. it's not clear asking. however... 1. prepare warnings , notices first. not seek access arrays without single or double quotes around indexes, because php seek resolve them constants. lead to...

How To Add Second ProgressBar Android ProgressDialog -

How To Add Second ProgressBar Android ProgressDialog - friends; how set progressdialog sec progress bar below images. thanx. the screenshot show not progressdialog, dialog custom layout. need, in order show dialog 1 in image is: a custom layout defining 2 progressbars, 1 below other. create dialog , phone call yourdialog.setcontentview(r.id.yourcustomlayout) that's it, that's need i phone call attending fact can show sec progress in same progressbar first, using yourprogressbar.setsecondaryprogress(progressvalue). android progressdialog

java - ArrayList ThreadSafety Test Code fails -

java - ArrayList ThreadSafety Test Code fails - given, add method defination in arraylist follows :- public boolean add(e e) { ensurecapacity(size + 1); // increments modcount!! elementdata[size++] = e; homecoming true; } please find next programme check thread safety of arraylist. package pack4; import java.util.arraylist; public class demo { public static void main(string[] args) { arraylist<string> al = new arraylist<string>() ; new addfirstelementthread(al).start() ; new removefirstelementthread(al).start() ; } } class addfirstelementthread extends thread{ arraylist<string> list ; public addfirstelementthread(arraylist<string> l) { list = l ; } @override public void run() { while(true){ if(list.size() == 0){ list.add("first element") ; } } } } class removefirstelementthread extends thread{ arraylist...

LPT ports in C# -

LPT ports in C# - i'd send instructions while 1 of pins of lpt port on. i trying this: when lpt port 379 (889 dec) different dec 120 stop doing part of code. while ((portaccess.output(889,120)) i don't know how it. trying construction: while ((portaccess.equals()) but need compare 2 objects.. i suppose must simple solution problem.. :) i think need portaccess.input: while (portaccess.input(889) == 120) { // stuff } this assumes "portaccess" wrapper around native inpout32.dll such described in this tutorial. c# lpt

c# - What is the effect of IsPostBack Condition? -

c# - What is the effect of IsPostBack Condition? - i have aspx page using ajax. <asp:updatepanel runat="server" id="uppanelddlprogram"> <contenttemplate> <asp:dropdownlist id="ddlprogram" runat="server" width="194px" height="18px" onselectedindexchanged="onddlprogramchanged" autopostback="true"> </asp:dropdownlist> </contenttemplate> </asp:updatepanel> and code behind like protected void page_load(object sender, eventargs e) { //if (!ispostback) //{ // bindprogramddl(); //} bindprogramddl(); } protected void bindprogramddl() { list<ccprogramentity> programentities = formsalesubmit_bao.getallprograms(); ddlprogram.datasource = programentities; ddlprogram.datatextfield = "shortname"; ddlprogram.datavaluefield = "id"; d...

jquery - CSS max-width: 100% for IE 6 with expression? -

jquery - CSS max-width: 100% for IE 6 with expression? - i have css: .container img { max-width: 100% !important; height: auto; } now need working ie 6. i know can do: width: expression(this.width > xxx ? xx : true); but xxx needs number, not percentage believe. i'm doing max-width: 100% width of image not exceed width of .container any ideas? thanks. without having tested it, guess need compare elements (client) width parent's. like: width: expression(this.clientwidth > this.parentnode.clientwidth ? this.parentnode.clientwidth + "px" : this.clientwidth + "px"); jquery internet-explorer-6 css

android - Check if geo-location has been spoofed -

android - Check if geo-location has been spoofed - i want create sure location received locationlistener "real" 1 , doesn't come spoofed source (i.e application location spoofer). don't care "but user want spoof location" - it's app doesnt distributed on android market. application not need location accurate - has "real". do think there way check if location has been spoofed?what think way prevent location spoofing?is there maybe android-method gives me real location nevertheless?is there maybe android-method determine if location has been spoofed? thoughts had: check on blacklist if location-spoofing app installed enable/disable different location providers , check against returned locations run background service watching location (in passive way) , check sudden location changes please give me thoughts , input issue. from provider name: 'gps' or 'network' proper most spoofers forget send gps status updat...

SSRS Export to Excel Hide/Unhide Issue -

SSRS Export to Excel Hide/Unhide Issue - i have ssrs 2008 study in have hide columns & export excel , after exporting excel, requirement says columns should unhidden in excel. please suggest way heard can't dont @ all. thanks in advance!! it can done, believe when deployed ssrs 2008 r2 server. how using now. way utilize conditional "hidden" property on columns set following: edit: switched true false around not hidden in excel =iif(globals!renderformat.name = "excel",false,true) that hide column unless outputting in excel. you access columns if using vs2008 selecting advanced mode on top right drop downwards of grouping explorer near bottom of interface. columns list top bottom representing left right representation of columns. set "hidden" property 1 of selected. ssrs-2008

python - Any way to make dict passed to URL express in regexp in GAE? -

python - Any way to make dict passed to URL express in regexp in GAE? - say, have dict urls = {'admin' : '/admin/(.*)'} and if so application = ([ (r(urls['admin']), adminpage) ], debug=true) google app engine raise error nameerror: name 'r' not defined i really need pass dictionary described in regexp url map making code more module. what should create work? thank help! the 'r' string prefix escape sequences regular expression. not function. http://docs.python.org/reference/lexical_analysis.html#string-literals urls = {'admin' : r'/admin/(.*)'} application = webapp.wsgiapplication([ (urls['admin'], adminpage) ], debug=true) the "webapp.wsgiapplication" compile these strings regex itself. python google-app-engine

php - What's the difference between $_SERVER['PHP_SELF'] and $_SERVER['SCRIPT_NAME']? -

php - What's the difference between $_SERVER['PHP_SELF'] and $_SERVER['SCRIPT_NAME']? - i have php framework , used $_server['script_name'] optimize portability. way don't need manually configure path anymore. $this->base_url = str_replace('index.php', '', 'http://'.$_server['server_name'].$_server['script_name']); but noticed $_server['script_name'] , $_server['php_self'] returns exact same string. so, what's difference? how should take between them? difference http://sandbox.phpcode.eu/g/3e38d.php/test script name absolute path file. php_self script you're in (along "path" after .php ) it's $_server['server_name'] , $_server['http_host'] http://sandbox.phpcode.eu./g/f5093.php http://sandbox.phpcode.eu/g/f5093.php spot 1 difference php apache

c# - DLLimport unable to load dll -

c# - DLLimport unable to load dll - i using unmanaged dll in cpp phone call from c# web project. works fine on localhost not work on shared hosting, winhost. happens when seek utilize 1 of function in dll. the error message getting is: "unable load dll 'dlltest.dll': application has failed start because side-by-side configuration incorrect. please see application event log or utilize command-line sxstrace.exe tool more detail. (exception hresult: 0x800736b1)","errors":[{"name":"dllnotfoundexception","message":"unable load dll 'dlltest.dll': application has failed start because side-by-side configuration incorrect. please see application event log or utilize command-line sxstrace.exe tool more detail. (exception hresult: 0x800736b1)"}]} i suspecting path issue. dll in question, dlltest.dll placed in bin folder. not sure searching dll there way can specify path search of dll. c...

Write in file .properties in android -

Write in file .properties in android - i doing application android 2.2, created file config.properties in assets folder, trying modify properties next code: assetmanager = this.getresources().getassets(); properties pp = new properties(); inputstream isconfig = am.open("config.properties",context.mode_private); pp.load(isconfig); pp.setproperty("shop_url", "new_shop_url");//this key exists seek { pp.store(new fileoutputstream("config.properties"), null); } grab (filenotfoundexception e) { e.printstacktrace(); }catch (ioexception e) { e.printstacktrace(); } when run application,throw error: java.io.filenofoundexception: read-only file system. i trying adding permissions solve error,but dont know add. thanks help the problem here file path. seek using try { pp.store(getassets().openfd("config.properties").createoutputstream(), null); } grab (filenotfoundexception e) { e.print...

javascript - Dynamic table not working in Internet Explorer -

javascript - Dynamic table not working in Internet Explorer - i have dynamic table works in firefox 4+ , chrome not display table contents in net explorer. problem? here demo firefox result internet explorer 8 result please help somebody. 2nd time posting question. thanks it's problem regard xml mplungjan quoted gets 0 in ie so seek var xml=$.parsexml(dummy1); the demo javascript jquery html internet-explorer cross-browser

objective c - UILabel in app delegate, add to new class -

objective c - UILabel in app delegate, add to new class - i making test app, right have timer in application did finish launching, here code, -(bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions { timelabel = [[uilabel alloc] initwithframe:cgrectmake(20, 80, 280, 120)]; [self.view addsubview:timelabel]; [timelabel.text isequaltostring:@"0"]; time = [nstimer scheduledtimerwithtimeinterval:1.0 target:self selector:@selector(timervoid) userinfo:nil repeats:yes]; } -(void)timervoid { int now; = [timelabel.text intvalue]; int after; after = + 1; timelabel.text = [nsstring stringwithformat:@"%i", after]; } i need timer go on through classes thats why set in app delegate application did finish launching, how can add together classes view? objective-c xcode uilabel nstimer

javascript - Why does typeof NaN return 'number'? -

javascript - Why does typeof NaN return 'number'? - just out of curiosity. it doesn't seem logical typeof nan number. nan === nan or nan == nan returning false, way. 1 of peculiarities of javascript, or there reason this? edit: answers. it's not easy thing ones head around though. reading answers , wiki understood more, still, sentence a comparing nan returns unordered result when comparing itself. comparing predicates either signaling or non-signaling, signaling versions signal invalid exception such comparisons. equality , inequality predicates non-signaling x = x returning false can used test if x quiet nan. just keeps head spinning. if can translate in human (as opposed to, say, mathematician) readable language, gratefull. it means not number. not peculiarity of javascript mutual computer science principle. from http://en.wikipedia.org/wiki/nan: there 3 kinds of operation homecoming nan: operations nan @ to the lowest d...

c++ - Template specialization fails on linking -

c++ - Template specialization fails on linking - i have issue template specialization understand. i'm working visual c++ 10.0 (2010). have class this: class variablemanager { public: template<typename vart> vart get(std::string const& name) const { // code... } // method supposed evaluated, linkable method. template<> std::string get<std::string>(std::string const& name) const; private: std::map<std::string, boost::any> mvariables; }; in theory, because specialized "get" method, linker should able pick object file. instead, unresolved reference error linker if place method in source file: template<> std::string variablemanager::get<std::string>(std::string const& name) const { // doing something... } if place method in header file inline, build goes fine. understand template functions thi...

perl - AppConfig::File retrieving values -

perl - AppConfig::File retrieving values - i trying utilize appconfig::file handling config file. however, getting empty value object. next code: my $state = appconfig::state->new( { create=>1, } ); $cfgfile = appconfig::file->new($state); $cfgfile->parse('sample.cfg'); $temp = $cfgfile->{foo}; print "foo value: $temp\n"; this in sample.cfg: ## comment foo = me what did wrong? in advance. the solution include argcount setting in definition of variable. not sure how dynamically file. use warnings; utilize strict; utilize appconfig ':argcount'; utilize appconfig::file; $state = appconfig::state->new( { create=>1, } ); $state->define('foo', { argcount => argcount_one }); $cfgfile = appconfig::file->new($state); $cfgfile->parse('sample.cfg'); print "state value: '", $state->foo(), "'\n"; perl configuration app-config

php - Sort a list without refreshing the page -

php - Sort a list without refreshing the page - i have next code: <table border="0" width="100%"><tbody> <tr> <th style="text-align: center;"><?php echo $text['players']; ?></th> </tr> <tr> <td> <select name="order" size="1" onchange="sortplayers(this)"> <option value="name"><?php echo $text['name']; ?></option> <option value="age"><?php echo $text['age']; ?></option> <option value="ss"><?php echo $text['ss']; ?></option> <option value="experience"><?php echo $text['experience']; ?></option> <option value="leadership"><?php echo $text['leadership']; ?></option> ...

process - Deleted Tomcat without executing shutdown.sh -

process - Deleted Tomcat without executing shutdown.sh - i deleted tomcat 5.5.30 error without shutting down. if no tomcat running localhost:8080 shows tomcat default page if refresh goes off. running different tomcat 5.5.30 (with different port number - 8090) not running on port. can't find tomcat process using command ps -ef | grep tomcat. restarting scheme doesn't help. how kill invisible process. using mac snow leopard. use netstat -plan | grep :8080 (or different options, don't know mac os) find out process holds port. oh, , tomcat processes not called tomcat , rather java ... bootstrap ... . should seek jps -v . tomcat process tomcat5.5

objective c - Dismiss a number pad-style keyboard without adding Done key -

objective c - Dismiss a number pad-style keyboard without adding Done key - there no done button on number pad-type keyboard. don't want add together custom done button, how dismiss keyboard? you add together uinavigationbar/uitoolbar done button(a uibarbuttonitem), , create textfield/textview resignfirstresponder on done button's action. you can add together uinavigationbar/uitoolbar inputaccessoryview of textfield/textview. textfield.inputaccessoryview = anavbarwithdonebutton; edit: availability ios (3.2 , later) objective-c ios cocoa-touch uikeyboard

php - One CSS class overlapping another CSS class (image attached) -

php - One CSS class overlapping another CSS class (image attached) - i creating e-commerce website. while showing discount box, image of item shifted left (image below). want discount box (blue color) on top of item class. can help me this? css file div.item { margin-top:0px; padding-top:20px; text-align:center; width:160px; float:left; border:1px solid red; } div.discount { width:30px; height:30px; border:1px solid blue; float:right; margin-right:30px; margin-top:10px; } html file <div class="item"> <img src="items/1/s/a.jpg"/> <div class="discount"> 50% discount </div> </div> my illustration -- bluish box not overlapping image. instead displaces image. i want this: in discount box overlaps image/css class you utilize z-index , absolute positioning on top div. like: div.discount { width:30px;...

javascript - Div to open after scrolling to bottom of page -

javascript - Div to open after scrolling to bottom of page - i hidden div open 1 time reader has reached bottom of page. found one illustration uses asp , mysql. there more simple way javascript , div toggle? well, post you're referring has js code necessary reacting on user scrolling bottom - only, instead of showing hidden, create phone call server fetch more info display, , that's when asp , mysql come play. you need do $(window).scroll(function(){ if ($(window).scrolltop() == $(document).height() - $(window).height()){ $('#idofyourhiddendiv').show(); } }); or (assuming have jquery available) javascript html scroll hidden

objective c - iPhone dev - Having problems adding text to cells of a UITableView -

objective c - iPhone dev - Having problems adding text to cells of a UITableView - i trying create app display bunch of different people's names , address in different cells of uitableview. first i'm trying hand of adding text cells, , it's not working. have next code, mytableviewcontroller subclass of uitableviewcontroller loads in view nib (without drastic customizations): mytableviewcontroller * tvc = [[mytableviewcontroller alloc] initwithstyle:uitableviewstyleplain]; nsindexpath *path1 =[nsindexpath indexpathforrow:0 insection:0]; nsindexpath *path2 =[nsindexpath indexpathforrow:1 insection:0]; [self presentmodalviewcontroller:tvc animated:yes]; uitableviewcell * cell1 = [tvc.tableview cellforrowatindexpath:path1]; uitableviewcell * cell2 = [tvc.tableview cellforrowatindexpath:path2]; cell1.textlabel.text = @"test"; cell2.textlabel.text = @"test2"; i expecting see tableview animate onto screen, follow...

clojure - Expressing that a specific subset of X's have property Y in core.logic -

clojure - Expressing that a specific subset of X's have property Y in core.logic - i want to: describe fact subset of class of objects. declare object has property consists of other properties. take next example: red robotic birds composed of buttons, cheese, , wire. i want express class of birds, birds reddish , robotic, have property. property composed of buttons, cheese, , wire. there no restrictions on type of wire cheese or buttons. result, should deducible there no reddish robotic birds composed of paper. also, these birds can composed of subset of items buttons, cheese, , wire. in clojure/core.logic.prelude, there relations , facts using defrel , fact . however, can't come combination explain fact. in prolog there no distinction between facts , goals there in minikanren. might address in future. btw, i'm not sure answers question - helpful hear types of queries wish run. this tested code (for clojure 1.3.0-beta1) since i'm using ^...

sql - mysql group by php concat -

sql - mysql group by php concat - i have table of fixtures in db: hometeam, awayteam, date, time i using mysql_fetch_array , getting following: hometeam awayteam date time -------------------------------------------- blackburn wolves 13/08/2011 3:00pm arsenal liverpool 13/08/2011 3:00pm etc i want return: 13/08/2011 --------------------------- blackburn, wolves, 3:00pm arsenal, liverpool, 3:00pm etc i have tried grouping date, returns 1 fixture date rubbish. i have tried group_concat , problem need modify items in group, such changing time format server time readable time above. you can sort date , check in php when date changes between 2 rows. this: function h($s) { homecoming htmlspecialchars($s); } $conn = mysqli_connect(…); $result = mysqli_query($conn, 'select * fixtures order date'); $lastdate = null; while(($row = mysqli_fetch_assoc($result)) !== false) { if($lastdate != $row['date']) { // ou...

javascript - How to create a cookie with a variable value -

javascript - How to create a cookie with a variable value - i need create javascript cookie in order php (to exactly, need viewport height of browser, store in javascript cookie in order value within php). problem have no javascript experience, , dont't understand google's explanation. i'd have value ( var viewportheight = $(window).height(); ) within cookie. how? (google gives examples static value). try this: var viewportheight = $(window).height(); document.cookie = "viewportheight=" + viewportheight + ";"; javascript jquery cookies

java - Reading wrong value from serial port -

java - Reading wrong value from serial port - i have read 12-digit tag number rfid reader , print console. when utilize programme read tag weird spacing in between. e.g. tag number 4400e6ef1a57. when maintain scanning tag, console window shows following: 4400e6ef1 a57 4400e 6ef1a57 4400e6ef1a57 4400e6ef1 a57 4400e6ef1a57 4400 e6ef1a57 4 400e6ef1a57 4400e6ef1a 57 4 400e6ef1a57 4400e6ef1a5 7 4400e6ef1a57 4400e6ef1 a57 4400e6ef1a57 4400e 6ef1a57 4400 e6ef1a57 4400e6ef1a57 4400e6ef1a57 4400e6ef 1a57 4400e 6ef1a57 it appears there long string of 0's , 1's gets read in , few of actual tag ids. don't know in order reading these 0's , 1's. here code: (some sql , jdbc stuff incorporated, can ignore) import java.io.*; import java.util.*; import gnu.io.*; import java.sql.*; public class trying5 implements runnable, serialporteventlistener { static enumeration portlist; static commportidentifier portid; seri...

algorithm - What is the problem name for Traveling salesman problem(TSP) without considering going back to starting point? -

algorithm - What is the problem name for Traveling salesman problem(TSP) without considering going back to starting point? - i know problem name tsp w/o considering way of going starting point , algorithm solve this. i looked shortest path problem not looking for, problem find shortest path 2 assigned points. looking problem give n points , inputting 1 starting point. then, find shortest path traveling points once. (end point can point.) i looked hamiltonian path problem seems not solve defined problem rather find whether there hamiltonian path or not. please suggest me, give thanks you! i've found reply question in this book. same computer wiring problem occurs repeatedly in design of computers , other digital systems. purpose minimize total wire length. so, indeed minimum length hamiltonian path. what book suggests create dummy point distances every other points 0. therefore, problem becomes (n+1)-city symmetric tsp. after solving, delete dummy point , minim...

objective c - EXC_BAD_ACCESS in didSelectRowAtIndexPath -

objective c - EXC_BAD_ACCESS in didSelectRowAtIndexPath - i have overwritten uitableviewcontroller didselectrowatindexpath method next way: - (void)tableview:(uitableview *)tableview didselectrowatindexpath:(nsindexpath *)indexpath { photolistviewcontroller *photosviewcontroller = [[photolistviewcontroller alloc] initwithstyle:uitableviewstyleplain]; nslog(@"let's see got %d", [[fetchedresultscontroller fetchedobjects] count]); person *person = [fetchedresultscontroller objectatindexpath:indexpath]; photosviewcontroller.person = person; photosviewcontroller.title = [person.name stringbyappendingstring:@"'s photos"]; [self.navigationcontroller pushviewcontroller:photosviewcontroller animated:yes]; [photosviewcontroller release]; } whenever seek access fetchedresultscontroller crash, set here: - (id)initwithstyle:(uitableviewstyle)style { self = [super initwithstyle:style]; if (self) { nspredic...

capistrano - replace git submodule protocol from git to http -

capistrano - replace git submodule protocol from git to http - i add together submodule git@... url, able develop in it. want deploy app , replace url git://... one, doesn't need authentication submodule's repo capistrano. editing url in .gitmodules totally plenty accomplish this? editing .gitmodules file (then committing, , pushing it) adequate new clones. additionally, when submodule initialized (e.g. git submodule init … , git submodule update --init … , or git clone --recursive … , etc.) url copied .gitmodules file repository’s .git/config file. so, if have existing “deployment clones” (the ones want access submodules through git://… urls), have update url in .git/config . can utilize git submodule sync automatically re-create submodule urls current .gitmodules file .git/config file (i.e. 1 time have pulled commit updates .gitmodules file). the submodule urls in .git/config not automatically updated because there cases want override url in ...

How to find the time taken by an SQL script to execute completely using java code? -

How to find the time taken by an SQL script to execute completely using java code? - i trying time taken sql script excute using java code.i having jdbc connection code me.but not have logic time taken sql script execute.can please send me code print time taken sql script execute? expected result: after executing java code should result as:the time taken query :__ you don't need utilize calendar instance. here's simpler solution: long millisstart = system.currenttimemillis(); // run query here long millisend = system.currenttimemillis(); system.out.println(millisend - millisstart); java

wpf controls - listbox wraps properly when parented in a vertical orientation stackpanel, but fails for horizontal -

wpf controls - listbox wraps properly when parented in a vertical orientation stackpanel, but fails for horizontal - the next xaml explains trying do. listbox wraps want when parents orientation set vertical, want popout on left, , listbox wrapping behaves unexpectedly. i've seen other posts binding parent's size, using value converters etc math, not convinced. why would/should changing container 2 parents above break listboxes logic? <window x:class="wpfapplication1.mainwindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:system="clr-namespace:system;assembly=mscorlib" title="mainwindow" height="421" width="602"> <window.resources> <objectdataprovider x:key="orientationenum" methodname="getvalues" objecttype="{x:type system:enum}"> <...

c# - how to delete cookies in asp.net website -

c# - how to delete cookies in asp.net website - in website when user clicks on logout button. logout.aspx page loads code session.clear() ; in asp.net/c# clear cookies? or there other code added remove cookies of website? try that: if (request.cookies["userid"] != null) { response.cookies["userid"].expires = datetime.now.adddays(-1); } but makes sense utilize session.abandon(); besides in many scenarios. c# asp.net session cookies session-cookies

Drupal login/logout button -

Drupal login/logout button - i'm trying add together simple login/logout button block footer: <?php global $user; if ($user->uid) { print t("<div class='gts_footer_logout'><a href='/gts_management/user/logout'>log out</a></div>", array('@name' => $user->name));} else { print t("<div class='gts_footer_login'><a href='/gts_management/user/'>log in</a></div>"); } ?> everything works, don't url hardcoded, how can alter this? use l() function: l(t('logout'), 'user/logout') l(t('login'), 'user') edit: way, shouldn't set html strings in t() function, not translatable in drupal's administration drupal drupal-7

graphing - Plotting in R; cannot be coerced to double error -

graphing - Plotting in R; cannot be coerced to double error - i trying plot , b, each consisting of 7500 info points. when tried plot(x,y), got next error: > plot(a[11],b[11]) error in xy.coords(x, y, xlabel, ylabel, log) : (list) object cannot coerced type 'double' which strange,because values whole numbers. can do? thank you. it looks you're trying plot vector list. seek subseting using $ or [[]] instead. here's problem: a <- as.list(data.frame("x"=1:5,"y"=5:1)) b <- as.list(data.frame("x"=1:5,"y"=5:1)) plot(a[2],b[2]) ## recreates error here's solution: plot(a$y, b$y) ## plots expected subsetting $ alternatively, if you'd prefer stick numbers: plot(a[[2]],b[[2]]) i recommend read help page associated this: ?'[' r graphing

css - Flexible div blocks -

css - Flexible div blocks - i need 3 column block such that, if more content in center (middle column) - side blocks increased. now have http://s2.ipicture.ru/uploads/20110714/nq6znrsb.png html: <div id="spoiler"> <div class="left">1</div> <div class="middle"> 2<br /> aaaaaaaaaaaaaaaaaaaaaaaaaa<br /> hhhhhhhhhhhhhhhhhhhhhhhhh<br /> aaaaaaaaaaaaaaaaaaaaaaaaaa<br /> aaaaaaaaaaaaaaaaaaaaaaaaaa<br /> </div> <div class="right">3</div> </div> css: #spoiler { width:500px; } .left, .middle, .right { background:#ffdac0; height: auto !important; height: 100%; /* ie6 */ } .left { float:left; width:100px; } .middle { float:left; width:300px; } .right { flo...

c - Segmentation fault using OpenMp and SSE -

c - Segmentation fault using OpenMp and SSE - i'm getting started experimenting adding openmp sse code. my first test programme crashes in _mm_set_ps, works when set if (0). it looks simple must missing obvious. i'm compiling gcc -fopenmp -g -march=core2 -pthreads #include <stdio.h> #include <stdlib.h> #include <immintrin.h> int main() { #pragma omp parallel if (1) { #pragma omp sections { #pragma omp section { __m128 x1 = _mm_set_ps ( 1.1f, 2.1f, 3.1f, 4.1f ); } #pragma omp section { __m128 x2 = _mm_set_ps ( 1.2f, 2.2f, 3.2f, 4.2f ); } } // end omp sections } //end omp parallel homecoming 0; } this bug in openmp implementation. having same problem in gcc on windows (mingw). -mstackrealign command line alternative solved problem. adds instruction prolog of every function realign stack @ 16-byte boundary. didn't notice...

c# - System.AccessViaolation while executing Bulk Insert (Oracle.DataAccess) -

c# - System.AccessViaolation while executing Bulk Insert (Oracle.DataAccess) - i facing severe problem concerning winforms application. inserting via oracle mass insert (arraybinding) table. while executing command cmd.executenonquery() i next error: system.accessviolationexception @ oracle.dataaccess.client.opserr.freectx(intptr& opserrctx) @ oracle.dataaccess.client.oracleexception.getopoerrctx(intptr opserrctx, oposqlvalctx* poposqlvalctx, intptr opsconctx, string datasrc, string procedure) @ oracle.dataaccess.client.oracleexception..ctor(intptr opserrctx, oposqlvalctx* poposqlvalctx, intptr opsconctx, string datasrc, string procedure) @ oracle.dataaccess.client.oracleexception.handleerrorhelper(int32 errcode, oracleconnection conn, intptr opserrctx, oposqlvalctx* poposqlvalctx, object src, string procedure) @ oracle.dataaccess.client.oracleexception.handleerror(int32 errcode, oracleconnection conn, string procedure, intptr opserrctx, oposqlvalctx* po...

php - file_get_contents dont work? -

php - file_get_contents dont work? - server: php 5.3 the line in question: file_get_contents(http://subdomain.domain.com/api/id); in http://subdomain.domain.com/api/id have this: $newfeeds = new newsfeeds(); $newfeeds->function($newsfeedparsefile); //insertamos memcachedb and here doesn't work $redis = cachefactory::get('redis'); $redis->addtolist("info_{1_2_fs}", "inforedis"); i don't error, doesn't add together queue. the wear things when re-create address http://subdomain.domain.com/api/id , paste in address bar response want! verify in php.ini if "allow_url_fopen" on, if isn't alter on. php queue redis file-get-contents

optimization - Struggling to optimize N+1 query in Hibernate -

optimization - Struggling to optimize N+1 query in Hibernate - i’m struggling improve n+1 query on project i’m working on. utilize hibernate model shown below, , want express query retrieve items related portfolio, including lastly 2 prices on each item (price on given date , previous price). example api: list<items> items = finditemswithlatesttwoprices(portfolio, latestpricedate); currently utilize 1 query extract items related portfolio, , iterate on items query 2 latest prices on given item (so n+1). i tried expressing in native sql using correlated subquery , performance terrible. , fact there new prices every day (so query getting slower) has lead me think need different model, i’m struggling come model reasonably effective , constant on time number of prices increase. i’ve been thinking different solutions including representing prices linked lists, or using sort of tree believe there improve alternatives. missing obvious? has working on similar probl...

android - tabs: custom bg color and text position -

android - tabs: custom bg color and text position - simple question (i guess). have default google tutorial code tabs: intent = new intent().setclass(this, about.class); spec = tabhost.newtabspec("albums").setindicator("about") .setcontent(intent); tabhost.addtab(spec); (int = 0; < tabhost.gettabwidget().gettabcount(); i++) { tabhost.gettabwidget().getchildat(i).getlayoutparams().height = 50; } and wondering - possible alter text position , (or) background adding lines of code existing piece, not starting on again? thanks! so yeah: text position , custom background (html color). how do it? thanks! p.s please don't start droping links other tutorials, it's kinda hard me understand those. :/ i found code looking for. here's total code of tabs.java activity: package com.xjcdi.name; import com.xjcdi.exploringvilnius.r; public class tabs extends tabactivity implements ontabchangeli...

Adding Item to SharePoint Search index manually -

Adding Item to SharePoint Search index manually - i looking way add together document search index using api, , when document gets added document library. i can add together eventhandler , write code phone call api. need know if api supports such interface. sample helpful. thanks. i think sharepoint (2007 , 2010) have passive indexing, meaning out of command beyond scheduling indexing service run @ frequency. beingness case, there occasions when search cache out of sync, such when first delete item. however, believe can programmatically prime index service. it possible have sharepoint non-sharepoint content, such unc path, via central admin. sharepoint search sharepoint-2010 indexing

entity framework - Exception from .net windows executable file -

entity framework - Exception from .net windows executable file - i have create .net windows application in vs2010 entity. have added mydatabase.mdf file in application store data. working fine when executed in visual studio. have created setup project , added mydatabase.mdf file after selecting primary output. when installed on computer got error "system.data.entityexception" stack: at system.data.entityclient.entityconnection.openstoreconnectionif(boolean, system.data.common.dbconnection, system.data.common.dbconnection, system.string, system.string, boolean byref) @ system.data.entityclient.entityconnection.open() @ system.data.objects.objectcontext.ensureconnection() @ system.data.objects.objectquery`1[[system.__canon, mscorlib, version=4.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089]].getresults(system.nullable`1<system.data.objects.mergeoption>) @ system.data.objects.objectquery`1[[system.__canon, mscorlib, version=4.0.0.0, culture=neutral, publi...

c# - Good approach to interface with database through gridview -

c# - Good approach to interface with database through gridview - what doing create stored procedures each table select/insert/update, (if select) fill datatable rows , pass objectdatasource bound gridview. or bad technique? techniques (using bo, bl, dal) update/remove/insert records in database through gridviews? thanks! i info model layer encapsulates info want exposed main application. have buisiness logic layer connects model layer info access layer. info access layer of magic happens. in here, utilize system.data, system.data.sqlclient or mysql.data.mysqlclient (or whatever use--it has .net connector) namespaces phone call stored procedures , set info data model or vice versa. here illustration of 1 have done explained, mine little different. info model expose access methods, helps organization of data. also, utilize system.data.datatable binding info gridview. works wonderfully , allows store primary key , foreign key information. manage passing ...

ruby on rails - Multiple References From Single Table -

ruby on rails - Multiple References From Single Table - i've seen issue referenced few times, nil complete. i'm having problem using bring together table single model. example, suppose have users , highfives. highfives bring together table 2 users highfiving. have this: class highfive < activerecord::base belongs_to :user1, :class_name => "user" belongs_to :user2, :class_name => "user" end class user < activerecord::base has_many :highfives end however, this, unable user.find(1).highfives since generates query like: select "highfives".* "highfives" "highfives"."user_id" = 1 really, should getting query like: select "highfives".* "highfives" "highfives"."user1_id" = 1 or "highfives"."user2_id" = 1 i imagine i'll need modify user model in way. missing? thanks. you need specify f...

Drupal WSOD on admin pages only, whenever any non-core module is enabled -

Drupal WSOD on admin pages only, whenever any non-core module is enabled - i have new installation of drupal 6.22 , 1 of first things did install cck. enabling module gave me wsod on whole site, deleted module directory sites/all/modules. got rid of wsod whenever enable non-core module, front-end of site continues work admin screen give me wsod. have read drupal docs on , installed dtools. dtools on, can see i'm getting error error: callback: system_main_admin_page() doesn't exist! i guessing deleting cck files without disabling module (cck) may part of problem. how programmatically disable modules? other ideas on fixing this? thanks, if have fresh install, wouldn't hard reinstall drupal should solve problem. if don't wish that, can disable modules in database through phpmyadmin, db query etc. if in phpmyadmin, go system table, find module(s) want disable , alter status 1 0 . drupal drupal-6 wsod

c++ - empty a specific element of a vector -

c++ - empty a specific element of a vector - i want set element @ specific position of vector null, can following: vector<ixmldomnodeptr> vec1;// filled somehow vec1[i] = nullptr;// specific position ps. want maintain entry nulled, acts place holder, think maybe vec[i] = 0 do? may erase() help, e.g. vec1.erase(vec1.begin() + i); when iterate through next, entry not there... now know want do, ought work.. vector<boost::optional<ixmldomnodeptr> > vec1; // populate // erase vec1[i] = boost::none; // null. this without knowing ixmldomnodeptr (if name implies pointer), setting 0 ought work. vec1[i] = 0; note: if dynamically allocated object, setting 0 not clear memory setting null in java - in c++ have explicitly clean first, i.e. delete vec1[i]; vec1[i] = 0; c++ stdvector

objective c - iPhone: How to add rows in tableview after tabelview already loaded? -

objective c - iPhone: How to add rows in tableview after tabelview already loaded? - i have implemented "add favourites" functionality iphone application. works fine except adding cells favourite table view during runtime. example, have given next methods. - (void)viewwillappear:(bool)animated { [super viewwillappear:animated]; tableview.hidden = yes; warninglabel.hidden = yes; // load alter in favourites nsuserdefaults *defaults = [nsuserdefaults standarduserdefaults]; nsdata *data = [defaults objectforkey:kfavouriteitemskey]; self.favourites = [nskeyedunarchiver unarchiveobjectwithdata:data]; if([self.favourites count] > 0) tableview.hidden = no; else warninglabel.hidden = no; } - (nsinteger)numberofsectionsintableview:(uitableview *)tableview { homecoming 1; } - (nsinteger)tableview:(uitableview *)tableview numberofrowsinsection:(nsinteger)section { homecoming [self.favourites count]; // f...

javascript - How can I say this in jQuery? -

javascript - How can I say this in jQuery? - i want append text after 2 closing divs sector element. <a href="" class="thingiclicked">click me</a> </div> </div> // want append text my code appends text after link. how can "append after 2nd closing div"? $('a.thingiclicked').click(function() { $(this).append('hello'); }); there's more elegant solution, how about: $('a.thingiclicked').click(function() { $(this).parent().parent().after('hello'); }); edit: @zack right (and should reply credit one) - original code have added text into sec enclosing div , rather after it. i've edited code above accordingly. javascript jquery

sql - Android, Ormlite, DB location -

sql - Android, Ormlite, DB location - i'm using ormlite persist of info android app (running on motorola xoom). default, sql database saved /data/data/[package name]/databases/[dbname].db. problem is, xoom not rooted , hence users not have access directory db saved (can't copy/backup/edit content of db). i have added code 1 of classes re-create db /data sd card, works fine, realistically think should possible set path db stored. missing something, or not possible ormlite? thanks in advance, c you can create database on sdcard if utilize like public class databasehelper extends ormlitesqliteopenhelper { [...] public databasehelper(final context context) { super(context, environment.getexternalstoragedirectory().getabsolutepath() + file.separator + database_name, null, database_version); } this creates db file in e.g. /mnt/sdcard/android/data/com.your.app/files/mydata.sqlite pro: saves internal memory con: db not accessible when sdcard not avai...

yahoo - YQL Losing HTML Element Attributes? -

yahoo - YQL Losing HTML Element Attributes? - yql console link query: select * html url='http://www.cbs.com/shows/big_brother/video/' , xpath='//div[@id="cbs-video-metadata-wrapper"]/div[@class="cbs-video-share"]/a' returns: <?xml version="1.0" encoding="utf-8"?> <query xmlns:yahoo="http://www.yahooapis.com/v1/base.rng" yahoo:count="1" yahoo:created="2011-07-09t23:14:02z" yahoo:lang="en-us"> <diagnostics> <publiclycallable>true</publiclycallable> <url execution-time="146" proxy="default"><![cdata[http://www.cbs.com/shows/big_brother/video/]]></url> <user-time>163</user-time> <service-time>146</service-time> <build-version>19262</build-version> </diagnostics> <results> <a class="twitter-shar...

javascript - Mouse disappers when screenshot of a webpage is clicked -

javascript - Mouse disappers when screenshot of a webpage is clicked - i have developed chrome extension takes screenshots of webpages. have noticed when take screenshots of pages, mouse in screenshot disappears. hence not able know place did click occur later. how resolved ? you need draw mouse cursor yourself. here illustration of making screenshot on mouse click , drawing reddish circle cursor was: content_script.js: window.addeventlistener("click", function(event) { chrome.extension.sendrequest({x: event.x, y: event.y}); }); background.html: <html> <head> <script> chrome.extension.onrequest.addlistener(function(request, sender, sendresponse) { chrome.tabs.capturevisibletab(null, {format:"png"}, function(dataurl){ var img = new image(); img.onload = function(){ var canvas = document.getelementbyid("canvas"); canvas.width = img.width; canvas.height ...

C parse content of a file -

C parse content of a file - i have parse content of file: string given input , have search each letter in string content of file. first tought was while (readbytes = read(fd, buffer, sizeof(char)) > 0); but how create sure access each char file? plenty using for (i = 0; < size; i++) { parsechar(buffer[i]); } what if content of file greater size ? don't read whole file if don't have to. read info read , phone call parsechar every character read. repeat until reach end of file. while (readbytes = read(fd, buffer, buffer_length) > 0) { (i = 0; < readbytes; i++) { parsechar(buffer[i]); } } c file

c# - Convert List<List> to List -

c# - Convert List<List<string>> to List<string> - possible duplicate: linq: list of lists long list i have convert using linq. list<list<string>> list<string>. if leaves overlap one. must in 1 line. input.selectmany(l => l).distinct().tolist(); c# linq

ruby - Rails Commands don't work ( ie: rails server ) - On a forked rails application -

ruby - Rails Commands don't work ( ie: rails server ) - On a forked rails application - i running rails 3.0.9 , ruby 1.9.2- problem when fork repository github, adds folder/app files directory, when seek run command such "rails server", gives me rails options help message ( listing of commands , "usage: rails new app_path options" ) when switch app create manually, illustration : test_app default rails setup, rails server command runs expected.. missing when cloning git repository? thanks ruby-on-rails ruby ruby-on-rails-3 github

java - Android: Best way to backup data to the internet? -

java - Android: Best way to backup data to the internet? - what best way backup info external location ie web server? ive looked in sql , emailing , file upload none of these seem work using android sdk? (i may wrong) im trying sms messages preferably database somewhere on net can maybe suggest way of doing this? far can see jdbc isn't accessible on android? thanks in advance. heres error when adding jdbc: unexpected top-level exception: com.android.dx.util.exceptionwithcontext [2011-07-12 17:17:46 - sms] dx @ com.android.dx.util.exceptionwithcontext.withcontext(exceptionwithcontext.java:46) [2011-07-12 17:17:46 - sms] dx @ com.android.dx.dex.cf.cftranslator.processmethods(cftranslator.java:340) [2011-07-12 17:17:46 - sms] dx @ com.android.dx.dex.cf.cftranslator.translate0(cftranslator.java:131) [2011-07-12 17:17:46 - sms] dx @ com.android.dx.dex.cf.cftranslator.translate(cftranslator.java:85) [2011-07-12 17:17:46 - sms] dx @ com.android.dx.command.dexer...