Posts

Showing posts from July, 2010

oop - Java Inheritance: Superclass being "overriden" by Subclass function with different signature -

i quite rusty on java , i'm having hard time following: public abstract class animal implements comparable<animal> { //enum stored elsewhere animaltype type = null; private specificcompare(animal a){ return 0; } @override public int compareto(animal a){ int comp = type.compareto(a.type); if (comp > 0) { return 1; } else if (comp < 0) { return -1; } else { return specificcompare(a); } } } public class mammal extends animal { private mammalstuff; public mammal(){ ... } public specificcompare(mammal m){ //do specific comparison } } so, understand why mammal's specificcompare isn't being called (incorrect type) i'm trying figure out clean way make work. want able extend animal , have correctly call specific comparison when needed. in addition actual answer, if has suggested documentation me read on ha

javascript - I want to get part of the class of a clicked element in jQuery -

so, have function this: $('a.tdt-btn-*').click(function() { var class = $(this + "[class^=tdt-btn-*]"); // need more here console.log(class); }); what want value of wildcard part @ end. how this? i'd suggest: $('a[class*=tdt-btn-]').click(function() { var elclasses = this.classname.split(/\s+/), elclasswildcard; (var = 0, len = elclasses.length; < len; i++){ if (elclasses[i].indexof('tdt-btn-') === 0) { elclasswildcard = elclasses[i].replace('tdt-btn-', ''); } } console.log(elclasswildcard); }); js fiddle demo . incidentally, class reserved word in javascript , should, or can , not used variable name (i believe error thrown if so). references: attribute contains ( attribute*=value ) selector . string.indexof() . string.split() .

javascript - bug in nested arrays in a url get string -

basically want query string ?foo%5b%5bbar%5d%5d=whizbang give me result looks this: { 'foo' : { '[bar]' : 'whizbang' } } i'm using rails @ moment, , instead of '[bar]' i'm getting 'bar' (ie [] stripped out). tried in php comparison, has '[bar' (rstripped of ]) seems wrong me also. i trying work out if bug need log rails. i'm using jquery.ajax send object looks rails. if you're trying formulate params in javascript , have access jquery, can use $.param : $.param({ 'foo' : { '[bar]' : 'whizbang' } }) // => foo%5b%5bbar%5d%5d=whizbang

asp.net - Cell Value in gridview -

i post several links articles of people asking same question, not on stack overflow, don't know why not work me. my code is: int rowindex = ((gridviewrow)(((checkbox)sender).parent.parent)).rowindex; label lbl = new label(); lbl.id = "test" + testing.tostring(); lbl.text = gvbatters.rows[rowindex].cells[1].value; upcompare.contenttemplatecontainer.controls.add(lbl); testing++; my problem on line: lbl.text = gvbatters.rows[rowindex].cells[1].value; the problem being value . not this, says i'm missing assembly reference system.web.ui.webcontrols.tablecell . in fact using system.web.ui.webcontrols when try line this: lbl.text = gvbatters.rows[rowindex].cells[1].tostring(); it shows in update panel label text as: system.web.ui.webcontrols.datacontrolfieldcell i close. google searches should have .value , visual studio says no. try .text. can't remember sure think text if it's bound field.

java - Why is EOFException used mainly by data input streams? -

from java api public class eofexception extends ioexception signals end of file or end of stream has been reached unexpectedly during input. this exception mainly used data input streams signal end of stream. note many other input operations return special value on end of stream rather throwing exception. so why data input streams different other input operations? why doesn't return special value other input operations signal end of stream? because think exception should used on exceptional cases. an out-of-band return value required signal eos. in-band values used when returning primitives, there no out-of-band values available, has exception. same applies objectinput.readobject() . null in-band value, can't used signal eos. this different inputstream.read() , returns either -1 or byte value -128..127. in case -1 out of band. one assumes readutf() throws eofexception symmetry other methods, although have returned null @ eo

xml - how to parse multiple elements for a particular value -

i receiving string of xml web service , parsing pick few values need save. putting string xmldocument , using xmlnodereader parse element name , grab value. this fine apart when value after named, such type, id or source in snippet: <webresult> <header> <type>success</type> <id>52347</id> </header> <source>global</source> <returnitems> <returnitem> <dataname>saleid</dataname> <datavalue>co12345</datavalue> </returnitem> <returnitem> <dataname>productid</dataname> <datavalue>xy000001</datavalue> </returnitem> </returnitems> </webresult> however, i'm not sure of best way pickup salesid's 'datavalue' value of co12345 in example. (the xml schema larger) i parse string saleid + x characters break if web service changed , relying on string positions. prefe

New PayPal Sandbox, Where to input IPN url in sandbox "Test Site" UI -

in post ( closed not real question ) op did poor job of asking question know answer to. can or can not specify ipn url within "test site" under new sandbox ui . in old sandbox (exactly live account) entered url desired ipn listener under " profile / selling tools ". in new sandbox however, there exist no such sub menus under profile menu , can't find mention of ipn in way shape or form, anywhere within new sandbox " test site " environment. meanwhile, paypal sandbox says can " import existing sandbox test accounts using email address , password used sandbox. " ( quite predictably ) epic fail too, email address , password ( which worked fine right roll out of exciting new paypal dev beta ) of course rejected unrecognized. grrrrrrrr finally found it! unlike live account (and old sandbox) there no submenu dropdown under profile link, nor there "my selling tools" submenu. instead... ipn settings link, click on

c++ - Pointers and Polymorphism -

this question has answer here: what weird colon-member (“ : ”) syntax in constructor? 12 answers i have problems understanding following c++ code. can please explain me meaning of line 3? ": lmp(ptr)" before constructer mean? i cannot make sense out of it class pointers { public: pointers(type* ptr) : lmp(ptr) {} virtual ~pointers() {} protected: type* lmp; }; } : lmp(ptr) is called constructor initialization list . initialize lmp ptr . see link understanding: what constructor initialization list , why should use it

css - How to vertically align HTML text as in a column -

i'd have html looks this: we know that: 2*1 = 2 2*2 = 4 2*3 = 6 (i.e., numbers aligned in column) i use table, or maybe text-indent. i'd know other options, , what, if any, "the right way". use <pre> tag. quote w3schools: text in <pre> element displayed in fixed-width font (usually courier), , preserves both spaces , line breaks. or if not option you, can use css set element preserve white space adding white-space: pre; .

performance - How can I get my CPU's branch target buffer(BTB) size? -

it's useful when execute routine when loops > btb_size, eg, from int n = 0; (int = 0; < loops; i++) n++; to int n = 0; int loops = loops / 2; for(int = 0; < loops; i+=2) n += 2; can reduce branch misses. btb ref: http://www-ee.eng.hawaii.edu/~tep/ee461/notes/ilp/buffer.html doesn't tell how btb size. any modern compiler worth salt should optimise code int n = loops; , in more complex example, compiler take care of such optimisation; see llvm's auto-vectorisation , instance, handles many kinds of loop unrolling. rather trying optimise code, find appropriate compiler flags compiler hard work.

Python/IronPython- how to return value of specific attribute of class when only class object referenced? -

ok, trying python, specifically, i'm using benefit of on-the-fly calculations within c# app calling ironpython engine. pass in ip list of c# objects of class c, , going bunch of calculations. there's legacy (sql) reference member of class, call currentamount. there other values of attributes referenced in calculations wondering if there's way automatically return value of currentamount if object referenced. c# class mynumbersclass public class mynumbersclass { decimal someval_a; decimal someval_b; decimal currentamount; } ... gather list called numberslist... ... instantiate ironpython engine e ... set scope s ... set ip list pnumbers c# list numberslist s.setvariable(pnumbers, numberslist) so now, simple calculation in ironpython(ip) calculate following: pnumbers[10].currentamount = pnumbers[0].someval_a * (pnumbers[2].someval_b / daysinweek) - pnumbers[5].currentamount how can re-write currentamount default attribute set , when none specified?

qt - Potential problems using OpenGL buffer object with multiple targets? -

i developing library qt extends it's opengl functionality support modern opengl (3+) features texture buffers, image load-store textures, shader storage buffers, atomic counter buffers, etc.. in order support features transform feedback, allow users bind buffer object different targets @ different times (regardless of data allocated buffer with). consider following scenario use transform feedback advance vertex data once, , bind separate program rendering (used rest of application run time) : // attach (previously allocated) buffer transform feedback target // can capture data advanced in shader program. glbindbuffer(gl_transform_feedback_buffer, somebufferid); // execute shader program... // , release buffer transform feedback target. glbindbuffer(gl_transform_feedback_buffer, 0); // then, bind same buffer containing data advanced via transform feedback // array buffer target use in separate shader program. glbindbuffer(gl_array_buffer, somebufferid); // then, render

php - A better way to check if a user were logged in and generate like dislike link -

i have script takes 500 rows table, , based on whether or not user logged in, generates link or dislike item. the way goes this: //select * table; //while(){ if($userlogged) { echo $row['columnname'].' - dislike'; }else{ echo $row['columnname']; } } this way, checks if user logged @ each , every row. $userlogged set in file that's included on page. better way instead of checking if user logged in inside loop each , every row? not getting question quiet think want prevent condition each time loop can check condition first , loop accordingly, example if($userlogged) { while(condition) { } } else { while(condition) { } } this way don't have check condition inside loop each time loops

css3 - Positioning of two inputs on the same line -

on http://www.southdevonaonb.org.uk/cordialemapping/ in of tabs under "wembury" have 2 inputs on same line - first check box , second image (blue information icon). i want both inputs float right of parent div vertically appear inline. this html: letterbox locations , results <input type="image" align="right" id="info-image" class="info-image" src="images/info.png" title="click more information layer" onclick="layer0()" value='info'/> <input type="checkbox" id="layer0" onclick="togglelayer(0)" unchecked><br /> and css: .info-image{ float:right !important; display:inline !important; } #info-image{ float:right !important; display:inline !important; } what have tried: i have given input image class , id , tried forcing float right trying display tag similar effect, no luck. how can achieve this? screenshot here of trying achieve: h

java - MySQL: Unknown system variable 'tx_read_only' -

i'm working on java swing-based application+ hibernate+mysql+spring. when test crud operations, don't have problems read, in insert statements system shows message: unknown system variable `tx_read_only` i have last version of mysql hibernate 4 java annotations can tell me problem solve now? just throwing rocks darkness, 1 possibility be: variable tx_read_only introduced in mysql 5.6.5. probably mysql version older that, connector/j tries use new variable anyway. according release notes , support variable came in connector/j 5.1.23. ==> maybe version older 5.1.23 work, or bug fixed in version newer that.

android - Non market apk update installer -

i newbie android development.i have existing non-market android project.now want create update apk new changes code,assets etc.below requirement. when install new updated apk ,i want existing configurations/data files deleted , fresh copy of apk installed.its uninstall followed install. adb install -r doesn't work in case retains configurations/data files.is there option in can achieve above mentioned expected apk behavior.what elements should change in androidmanifest.xml. kind of update apk ,i cannot change package name. any appreciated. do adb install without -r. delete files. explicitly adb uninstall packagename if want paranoid.

django - I keep getting "InterfaceError: Error binding parameter 0 - probably unsupported type." -

i trying work way through official django tutorial ( https://docs.djangoproject.com/en/1.5/intro/tutorial01/ ) i'm running problem when trying use shell. specifically, when try run python manage.py shell error "interfaceerror: error binding parameter 0 - unsupported type." i don't know means, , code i've written example code given in tutorial: from django.db import models class poll(models.model): question = models.charfield(max_length=200) pub_date = models.datetimefield('date published') def __unicode__self(): return self.question class choice(models.model): poll = models.foreignkey(poll) choice_text = models.charfield(max_length=200) votes = models.integerfield(default=0) def __unicode__(self): return choice_text i encountered problem "sqlite received naive datetime while time zone support active." used answer post ignore warning , don't think that's what's causing interf

java - how to parse a JSON string which is inside a array -

i have json of following format: { "result": { "question": "barack obama vs mitt romney?", "option": [ "barack obama", "mitt romney", "other" ], "percentage": [ 20, 40, 80 ] } } and using following code parse giving null pointer exception @ option array. jsonparser jparser = new jsonparser(); jsonobject json = jparser.getjsonobjectfromurl(url); log.e("json",json.tostring()); log.e("-------url-------", ""+url); string resultstr = json.getstring("result"); log.e("result string ",resultstr); jsonobject jsonobject2 = new jsonobject(resultstr);

javascript - return a value via function math result that is stored in a variable -

i trying result of browsers window width , trying put result of math , condition in variable , code var mywidth = 1900; var myheight = 900; var height = $(window).height(); var width = $(window).width(); var autow = function () { if ( (mywidth / width).tofixed(2) > 0.95 ) return 1; if ( (mywidth / width).tofixed(2) < 1.05 ) return 1; else return (mywidth / width).tofixed(2); }; alert(autow); the problem don't know right syntax or structure of function assigned variable what right way code ? alert(autow()); autow() returns value of function assigned variable. fiddle : http://jsfiddle.net/v2esf/

cordova - How to add customised page load events in jquery mobile -

i trigger page load event manually on specific areas in code.iam using jquery mobile,phonegap. for ex: function jsoncallback(){ // thing pageload('#page2'); } pageload(){ // trigger page2 load event } $(document).on("pageload", "#page2", function(e) { }); edit: iam using phonegap deviceready event database created document.addeventlistener( 'deviceready', ondeviceready, false ); function ondeviceready() { //code generate db //now need trigger page1 pageshow event fetch result database } any ideas ? thanks you can't trigger page events manually because don't work that. they trigger automatically under cases page initialization or in case when $.mobile.loadpage() function used. also don't think want trigger pageload event because, told earlier trigger after $.mobile.loadpage() function. function don't accept # page parameter, instead real html file must provided. or can initi

jsp - Using JSTL, if list is empty - display validation message -

i using jstl display values in list <tbody id="tbna" > <c:foreach items="${actionbean.excesslist.newactivecustomerexcessuilist}" var="customerexcess" varstatus="loop"> <c:set var="clientname" value="${customerexcess.clientname}" scope="page"></c:set> <c:set var="ultimateparent" value="${customerexcess.ultimateparent}" scope="page"></c:set> <c:set var="cif" value="${customerexcess.cif}" scope="page"></c:set> <c:foreach items="${customerexcess.excesslist}" var="excess"> <tr> <td><c:out value="${excess.excessid }"></c:out></td> <td><c:out value=&qu

how do i store prize bond numbers in mysql database -

i creating site in want add functionality checking prize bond numbers confused how store prize bond numbers in database way doing flows i created table named prizebond these fields id, prizebond_price, prizebond_date, prizebond_numbers now should insert prizebond numbers in prizebond_numbers row , mean there 200+ prize bond numbers right insert them in single row or there other way can you need normalize data like: table1 id, prizebond_price, prizebond_date table2 prizebond_id,prizebond_number ( prizebond_id points id field in table1)

Linking a textbox value to coinmill script for currency conversion -

i got currency exchange script coinmill. want modify work nice in page. newbie in html/javascript programming thats why asking on one, pls. <script src="http://coinmill.com/frame.js"></script> <script> var currency_round=true; var currency_decimalseparator='.'; var currency_thousandsseparator=','; var currency_thousandsseparatormin=3; </script> $199.00 (us) = <script>currency_show_conversion(199.00,"usd","gbp");</script> gbp<br> <small>currency data courtesy <a href="http://coinmill.com/">coinmill.com</a></small> this scripts works fine shows conversion default value in script. need replace value ($199.00) value textbox of id "edit_1". automatically after user inserts currency exchange, value show in page. thanks in advance. i stephen ostermiller, , run http://coinmill.com/ . can make work javascript currency api coinmill: put on onc

html - Style div like the submit button -

is possible in css style div looks submit button? of course it's easy 1 browser using css, i'm looking cross browser solution. <div class="submit">submit</div> //should same like: <input type="submit" value="submit"> the reason is, have different kinds of buttons , go xhtml strict forbidden use input fields outside formular. if use <button> different in each browser. with jquery easy make cross browser buttons: http://jqueryui.com/button/ to submit form bind click event. example: http://jsfiddle.net/aelms/ $(function() { $("a").button().click(function( event ) { event.preventdefault(); $(this).parent().submit(); }); }); <form action="#"> <a href="#">an anchor</a> </form>

haskell - How to querying the database inside the makeApplication function -

i'm attempting fork non-web service in yesod application, , needs interaction database. this post decided put service in makeapplication. service return value when things happen , store database. thus, i'm wondering whats best way this? how run rundb $ insert $ stuff (t.pack "stuff") inside makeapplication function? edit: suggested michael made following helper function inside application.hs rundbio conf foundation f = dbconf <- withyamlenvironment "config/postgresql.yml" (appenv conf) database.persist.loadconfig >>= database.persist.applyenv p <- database.persist.createpoolconfig (dbconf :: settings.persistconf) logger <- mklogger true stdout runloggingt (database.persist.runpool dbconf f p) (messageloggersource foundation logger) and in makeapplication used so: rundbio conf foundation $ dbid <- insert $ stuff (t.pack "some random stuff") string <- dbi

version control - Language agnostic way to remove sensitive information from files before committing to Git -

what recommended procedures automatically removing sensitive information files before committing git? for example, have following in file called code.rb : personal_stuff = "some personal stuff" how can automatically remove personal information code.rb before committing version control? solution should language-agnostic. using "clean filter" specific files way go. update example, demanded: add "clean" filter local repository configuration, consisting of 1 call sed . path shell script or program consumes data on standard input , writes processed data standard output: $ git config --add filter.classify.clean \ 'sed -e '\''s!\<\(personal_stuff\s\+=\s\+\)"[^"]\+"!\1"secret"!'\' now register our filter applied files names match *.rb : $ cat >.gitattributes *.rb filter=classify ^d create couple of test files: $ cat >test.rb aaa bbb personal_stuff = "

android - RecognitionListener onBeginningOfSpeech does not trigger sometimes -

i'm using recognitionlistener speech text app. have simple button has onclicklistener calls mrecognizer.startlistening(mintent); when user presses button. i notice if user presses button , speaks @ same time, onbegginingofspeech triggers after user stops speaking. sequence of event: user press button , speak @ same time. onreadyforspeech called. user pause/stop speaking. user speaks again. onbeginningofspeech called. user stops speaking. onresults called. i noticed data returned onresults includes message user spoke in 1. there way trigger onbeginningofspeech after step 2? edit: need onresults trigger after step 3 since user stops speaking. asked onbeginningofspeech trigger because think onresult can't triggered unless onbeginningofspeech triggered first.

javascript - Setting a cookie in jquery based on input box -

i ma new javascript using jquery , jquery cookie library. wondering how can put contents of input text box cookie. this code have tried hasn't worked: js $.cookie("location_input", "#lat"); html <input id="loc" placeholder="location" type="text"></input> is there else stopping working or have not done bit of code correctly? you need like: $.cookie("location_input", $("#lat").val()); at moment setting cookie string value #lat , not actual value of input. also think example has typo, #lat instead of #loc :)

java - Dynamic loading of rules in DROOLS -

i new drools. want understand how dynamically update rules @ run time. considering drools - ability define rules @ runtime? i wrote code: while(true){ session = fetchstatefulsession();//some method drools session system.out.println("enter text"); //some code read input session.fireallrules(); } now time give input have updated .drl rules file. after result same on, session.fireallrules(); as earlier. changes in rules not reflected. i not sure proper way use, dynamic loading of rules. please suggest me thanks chakri your code getting session still using same .drl file. code needs include loading .drl files well. knowledgebuilder.add(resourcefactory.newclasspathresource(rulesfile, yourclass.class), resourcetype.drl); but still doubt work or not because loading files @ run time prone error , difficult maintain.

java - How to read data from local XML file in Flex -

i have java web application contains flash part.currently .swf file reading xml file project src folder. want access xml file local file system(in c:/ drive ).how access xml data c:/ drive.currently java web application accessing same xml file c:/ drive.can pass xml data through javascript .swf file. best practice.which best practice accessing xml file local file system in flex. any appreciated. if swf in web application, can't access freely hard drive. there nevertheless 2 options: filereference with command filereference.browse() , can allow user choose file local system , load it, or upload it. if choose load it, you'll have access data bytearray . externalinterface externalinterface allows communicate via javascript browser. can set responder externalinterface.addcallback() . check reference example .

Overridden private method is causing exception in accessing subclass public method in Java -

the below program giving compilation error in line "obj.method()" inside main method. error "the method method() type superclass not visible". understanding should able access public method of subclass. can explain concept behind it? class superclass{ private void method(){ system.out.println("inside superclass method"); } } public class myclass extends superclass{ public void method(){ system.out.println("inside subclass method"); } public static void main(string s[]){ superclass obj = new myclass(); obj.method(); } } from understanding should able access public method of subclass. yes, when compile-time type of expression you're calling on subclass. so if change code to: myclass obj = new myclass(); then should fine. currently, compile-time type of obj superclass , doesn't have public method method. also note myclass.method not override superclass.met

html - IE JavaScript "Message From Webpage" Errors, "Checking If Value was Empty.." -

i've built internal webpage on firefox running fine no issues, on ie throwing load of "message webpage" errors. they follows: built headers:,0ms [object object] checking if value empty on row:0 (several times) column:0 parser:text column:1 parser:digit column:2 parser:digit column:3 parser:digit column:4 parser:digit building cache 5 rows:,0ms so, a) why these popping on ie , b) there way of stopping these popping on ie? the problem javascript. have tablesorter or similar? i had same problem. if have this: <script type="text/javascript"> $(function() { $("table").tablesorter({debug: true}); -> set value false }); </script> it worked me.

Simple sudoku puzzle solver python -

i'm trying write simple sudoku solver in python. basic concept sudoku puzzle partially filled in , unsolved cells indicated zeros. cell denoted 0 can solved @ stage of puzzle. if first cell 0, means values in row, column , 3x3 subgrid ensure there can 1 possible value cell. here code, seem stuck because output displays more 1 possibility. algorithm wrong? def solveone (array, posr, posc): possible = ['1','2','3','4','5','6','7','8','9'] col in range (9): if array[posr][col] in possible: possible.remove(array[posr][col]) row in range (9): if array[row][posc] in possible: possible.remove(array[row][posc]) row in range(posr, posr+3): col in range (posc, posc+3): if array[row::][col::] in possible: possible.remove(array[row][col]) print (possible) return possible grid = [["" _ in range(9)] _ in range(9)] #define 9x9 2-dimensional list row in ra

vba - Comparing excel rows across multiple tables and copying -

i've worked on week , i'm stuck. didn't see forms problem on here, y'all can help. i'm trying compare data sheet2 sheet1 , if value in column b same, paste data sheet2 in next blank cell in sheet1 i've included spreadsheet illustrates point better. =if(sheet2!b(some_number)=sheet1!b(some_number),fill_in_answer_you_want,0) you have input statement cell want. example, in cell c2 write: =if(sheet2!$b2 = $b2,sheet2!$b2,0) as way fill in next blank cell, have write vba script find cell place in , place above formula cell.

android - How to load a resource layout into the code -

i have linear layout, defined using xml. reuse it. thus, need load in code. have found getresoruces().getlayout(r.layout.my_layout) returns xmlresourceparser object. how can convert linear layout, please? have @ layoutinflator . should need.

jquery ui - Autocomplete in dynamically added textbox -

how add auto-complete in dynamically added textbox? have used way $('#se').autocomplete(); , not getting that. $(document).ready(function() { var counter = 2; $("#addbutton").click(function () { var newtextboxdiv = $(document.createelement('div')) .attr("id", 'textboxdiv' + counter); newtextboxdiv.after().html( '<input type="text" placeholder="role" name="role' + counter + '" id="textbox' + counter + '" value="" > <input type="text" placeholder="search" name="search' + counter + '" id="se" value="" > <input type="hidden" name="search' + counter + '" id="se' + counter + '" value="" >'); newtextboxdiv.appendto("#textboxesgroup"

php - <string> and 'string' difference in Kohana -

i'm new kohana , i've watched 1 video tutorial. , started read book "kohana 3.0, beginner's guide". in video tutorial tutor uses view::factory('template_name') but in book, author uses view::factory(<template_name>) this < template_name > php feature or kohana's? , what's difference between quoted , inequality-ated names? <template_name> convention meaning "insert template name here." not valid php code until insert template name string. for further information, check introduction of book: find list of conventions used author , explanation of each.

wordpress and the $_GET method -

i have updated plain html website music festival wordpress. fine , beautifulllllll(!), except 1 thing. people apply courses supposed pay deposit, , when should receive confirmation email includes url future payment of rest of course fee. old site, used have like: http://www.mysite.com/coursefee.php?amount=10&refno=1234&name=john the coursefee.php file used $_get method create form lead payment service (with right amount paid, correct reference number, aso). problem if use same configuration in wordpress.... well, things don't work. wordpress uses url parameters query parameters , don't know how go around issue. any ideas? thanks!!!!! did check path coursefee.php files in wordpress root directory ? this php file not part of wordpress core, if have standard .htaccess file, should access directly without initializing wordpress.

How to use maven exec to run asadmin deploy -

i'm using mac os 10.5.8 , maven 3.0.3. if run command command line, works: asadmin deploy --user admin --type ejb --libraries pedra-signon-ejb-1.0.jar target/my-ejb-1.0.jar but if try executing same command maven exec plugin ( mvn exec:exec ), these configurations: <plugin> <groupid>org.codehaus.mojo</groupid> <artifactid>exec-maven-plugin</artifactid> <version>1.2.1</version> <configuration> <executable>asadmin</executable> <arguments> <argument>deploy</argument> <argument>--user admin</argument> <argument>--type ejb</argument> <argument>--libraries pedra-signon-ejb-1.0.jar</argument> <argument>target/${project.build.finalname}.jar</argument> &l

Update with subquery get error: "The multi-part identifier could not be bound." (Sql Server 2008) -

i'm trying update set of records in table values set of records in same table. when run query, error: msg 4104, level 16, state 1, line 1 multi-part identifier "t.com" not bound. code: update tphase set t.com = t.com + b.com, t.direct = t.direct + b.direct, t.fee = t.fee + b.fee, t.fringe = t.fringe + b.fringe, t.fte = t.fte + b.fte, t.ganda = t.ganda + b.ganda, t.hours = t.hours + b.hours, t.overhead = t.overhead + b.overhead, t.fccmga = t.fccmga + b.fccmga, t.fccmoh = t.fccmoh + b.fccmoh, t.lbroh = t.lbroh + b.lbroh, t.ms = t.ms + b.ms tphase t inner join (select * tphase program = 'xenon' , class = 'earned' , df_date > '2013-05-03' ) b on t.program = b.program , t.cawpid = b.cawpid , t.class = b.class , t.cecode = b.cecode t.program = 'xenon' , t.class = 'earned' , t.df_date = '

exception - Calling functions on Entities from a Context in C# -

i have started model-first , generated database, , i've created partial classes entities can perform operations on them. my code in context getting long, redundant, , want able make calls, such as: using (var db = new context()) { ... db.myentity.computedistance(); ... } ***added*** public void computedistance() { int distance = 0; myentity curr = this; while (curr.parent != null) { distance++; curr = curr.parent; } this.distance = distance; } and can this, except whenever try navigate relational properties, run issues lazy loading hasn't populated variables, , few other types of exceptions. tried passing db functions, got bothersome want use function without using db. tried having db optional , create if didn't exist, still didn't work well. it seems i'm doing wrong, , haven't found examples of how it. how guys handle these situations, or, how avoid them? please let me know if need more detail, thanks!

database - PL/SQL value of a boolean after execution using SQL%NOTFOUND -

just started learning pl/sql , cursor attributes. confused how sql%notfound works. in below code should v_1 compile true @ times? declare v_1 boolean; v_2 number; begin select count(*) v_2 t1; v_1 := sql%notfound; end; in case v_1 should false . question being asked v_1 := sql%notfound "were there no records found query?", , answer "no" (or false ) because query return row - therefore, v_1 false . it's kind of "double-negative" situation, kind of. :-) share , enjoy.

MySql connection in C# -

i making simple windows application form, register people in database, made connection class there it: public void query_send(string cmd) { string config = "server=127.0.0.1;uid=root;database=bdcliente;"; mysqlconnection conn = new mysqlconnection(config); mysqlcommand comm = new mysqlcommand(cmd, conn); try { conn = new mysql.data.mysqlclient.mysqlconnection(); conn.connectionstring = config; conn.open(); } catch { messagebox.show("error when connecting database!"); } { conn.close(); } } and in button give informations mysql use this: private void button1_click(object sender, eventargs e) { query instance = new query(); instance.query_send("insert `tbcliente`(`codcliente`, `name`, `cpf`, `telephone`) values ([" + textbox1 + "],[" + textbox2 + &

c# - Save a Session to a Label then save back to a database -

i trying add session label in website save number saved in label database. session called customerid . i have been trying call session doing int vv = (int)session["customerid"] label7.text = vv; //i know doesn't work can't work out need make label display variable. i trying save database so newcarsrow.customerid = convert.toint32(label7.text.trim()); my question how label display int saved in customerid string vv = session["customerid"].tostring(); label7.text = vv; you can't make int equivalent text property of label.

iphone - how to access parents of view controller and properly dismiss self and self.parent? -

in myviewcontroller , ask user select person address book: (on button click) peoplepicker = [[abpeoplepickernavigationcontroller alloc] init]; peoplepicker.peoplepickerdelegate = self; [self presentviewcontroller:peoplepicker animated:yes completion:null]; if user selects person more 1 phone number, present new uitableviewcontroller allows user select 1 of phone numbers: - (bool)peoplepickernavigationcontroller:(abpeoplepickernavigationcontroller *)peoplepicker shouldcontinueafterselectingperson:(abrecordref)person { // ... next = [[choosepersonphoneviewcontroller alloc] initwithstyle:uitableviewstylegrouped personphoneinfoarray:personphoneinfos]; [peoplepicker pushviewcontroller:next animated:yes]; // ... } when user selects phone number, bring phone number original viewcontroller , close both abpeoplepickernavigationcontroller , choosepersonphoneviewcontroller . two questions: how close both view controllers within choosepersonphoneviewcontroller ?

sockets - Chatserver. what happens to read an write buffer when ..? -

a tcp chatserver uses polling method concurrent service. client sending huge amounts of data constantly. chatserver tries send data client client b , c. but, client b , c not reading read buffer. happens read , write buffer chatserver, client a, client b , client c. there 2 cases 1. chatserver has blocking sockets. 2. chatserver has non blocking sockets. if you're talking tcp, receiver's socket receive buffer fills up, sender's socket send buffer fills up, sender either blocked (in blocking mode) or returned -1 errno == eagain/ewouldblock in non-blocking mode. if you're talking udp datagrams dropped.

node.js - MeteorJS: Generating emails from templates server-side -

i need send emails meteorjs application , want generate them using html templates, not "html-in-js" stuff. i've tried do: 1) use template.emailtemplate(data) , template not defined server-side. 2) save email templates *.html files under <app>/server/email/templates directory, contents using fs.readsync() , compile/render using meteor's built-in handlebars package. works fine in development environment, fails in production using bundled app because of *.html files under server directory not bundled. besides, structure of directories changed during bundle process , relative paths templates become invalid. 3) proposals? =) currently, templates not supported server-side. functionality coming. in mean time, created package might find useful called handlebars-server allows use handlebars on server. can use package atmosphere or copying project directory packages folder. here example: example: my-email.handlebars hello, {{name}} serve

c++ - Qt QTreeView not updating when adding to model -

the source code relating question available on public git repository on bitbucket . i'm trying dynamically add items qtreeview model using following code in mainwindow.cpp : if(dlg->exec() == qdialog::accepted) { qlist<qvariant> qlist; qlist << item.name << "1111 0000" << "0x00"; hiddescriptortreeitem *item1 = new hiddescriptortreeitem(qlist, hiddescriptortreemodel->root()); hiddescriptortreemodel->root()->appendchild(item1); } this works when run within mainwindow constructor, after ui->setupui(this) , need run within event filter, same code doesn't qtreeview updating. when set breakpoint @ mainwindow.cpp:70 , step through next few lines, can see data being added model, need qtreeview refresh. i understand done emitting datachanged(), not sure how this. signal signature datachanged signal looks follows: void datachanged(const qmodelindex &topleft, const qmodelindex &bottomright, co

google maps api places autocomplete getPlace() not working -

i have problem google maps api places autocomplete. seems function getplaces() not working described in documentation: autocomplete returns details of place selected user if details retrieved. otherwise returns stub place object, name property set current value of input field. taking following code example: <html> <head> <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?v=3&sensor=false&libraries=places"></script> <script type="text/javascript"> initialize = function () { var input = document.getelementbyid('locationsearch'); var options = { types: ['(cities)'] }; autocomplete = new google.maps.places.autocomplete(input, options); } google.maps.event.adddomlistener(window, 'load', initialize); submitform = function () { searchplace = autocomplete.getplace(); console.lo

c# - Entering values for a Byte array in WCF Test client -

i'm trying use wcf test client debug web method , method expects 2 byte arrays part of input. for now, i've been using debugger , placing breakpoints right before passed values used, , setting them visual studio watch window. is there easy way set values each byte of byte array using wcf test client? i know can specify length of array typing "length=100" or similar, sets size of array. have click drop down , enter value each , every byte 1 one. does have experience entering values arrays when using wcf test client? what i've done creating static method accepts array , new value (i pass comma-separated string , split it, pass "params" arg, etc.). with this, can call method on debugger watch or immediate window. example, can call "setarrayone()" anytime need preset values, or can call "setarray(...)" , pass desired arguments: byte[] myclasslevelarray1 = new byte[10]; byte[] myclasslevelarray2 = new byte[10]; pu

php - want to see SQL error in report -

i have query insert table (id) values (5); the table has record such id. query fails. my mysqli class extension looks this: <?php class my_mysqli extends mysqli { function __construct($config) { $this->db = parent::__construct($config['host'], $config['user'], $config['pass'], $config['db']); } function exe($sql) { if ( ! $st = $this->db->prepare($sql)) { trigger_error($st->error); // 1 isn't triggered } if ( ! $st->execute()) { trigger_error($st->error); // 1 triggered } // ..then parse results , close } } right after $mysqli->execute() log $mysqli->error , get: *unknown prepared statement handler (0) given mysqld_stmt_execute* but see sql error instead: duplicate entry '5' key 'primary' there not sense in first block actually. you're doing: if ( ! $st = $this->db->prepare($s

c - How is the validity of pointer comparisons within an array ensured? -

the c standard guarantees validity of pointer comparison when both point elements of same array, how typically ensured in system? the compiler might let choose between signed , unsigned pointers. compiler generating assembly comparison. compiler not allocate memory. example, if compile signed pointers, how compiler know runtime won't allocate block array spans signed overflow break? the compiler might let choose between signed , unsigned pointers. compiler generating assembly comparison. compiler not allocate memory. example, if compile signed pointers, how compiler know runtime won't allocate block array spans signed overflow break? in other words, how typical implementation ensure no user data spans address 0x80000000 or 0x00000000 . well, on popular desktop operating systems, guarantee free, because 0x00000000 in kernel space (inaccessible userspace programs) , 0x80000000 is... well, don't know 32-bit machines anymore. on 64-bit machine, 0x8000

math - How to find the azimuth/elevation from a vehicle to a target? -

i trying find out how compute azimuth , elevation angles moving air-vehicle simulation point on ground. i have vehicle's position vector p , , orientation quaternion vehq . have target position t , , have built difference vector dpt subtracting p t . how go computing az/el angles target? can guess, not familiar 3d math, helpful explanation wonderful. thanks first, find relative position vector dpt vehicle target: worldspace target vector dpt = t - p since vehicle position p , target position t in world coordinates, resulting vector dpt represented in world coordinates. so, must use vehicle orientation quaternion rotate dpt world coordinates vehicle coordinates. correct way depends on conventions used whatever generated quaternion, math 1 of following: vehicle target vector u = vector_part( vehq * quaternion(0,dpt) * conjugate(vehq) ) or u = vector_part( conjugate(vehq) * quaternion(0,dpt) * vehq ) since h

reporting services - SSRS 2008 -- link to external website -

my company using ssrs 2008 reporting services , there 100's of different reports in it. after using ssrs 2008 charts decided to no use ssrs charting , decided use open source javascript library display charts. main reason have interactive charts! i have done few charts in open source library asp.net webapp , have deployed it. wondering there way add "links" ssrs 2008 when clicked user redirected charts application. main reason have 1 single area employees go reports , charts. i thinking of creating empty rdl file , on 'onload' event redirect have been unable find if these reports fire events! is there other way achieve it? right-click on field want direct charting system, click text box properties... , click action . want go url option, can use enter url redirect to. note can use expressions here assist in going right chart, example: ="http://mycharts/regionchart?id=" & fields!region.value

user interface - Different results when a function is evaluated in the REPL than in a program -

i have feeling answer question clojure's lazy evaluation (which still fuzzy on...) so have function: (defn fix-str-old [string] (let [words (->> string (clojure.string/split-lines) (map #(clojure.string/replace % #"\w" "")))] (apply str (interleave words (repeat " "))))) basically takes wacky sentence non-alphanumeric chars, chars, return characters, line feeds etc in place of space , turns regular sentence. reason if you're curious whenever try copy out of pdfs, puts line feeds , other mysterious characters in between words. here example: (fix-str "a  block  of  sql  statements  that  must  all  complete    before  returning  or  changing  anything ") ==> "a block of sql statements must complete before returning or changing anything" it works fine in repl when evaluated inside of little swing gui this: &quo

emacs - Symbol's value as variable is void: eclimd-port -

after following installation guidelines of emacs-eclim wanted start eclimd "start-eclimd" following error message pops in mini-buffer. symbol's value variable void: eclimd-port eclimd script works flawless when started in eclipse. running script in shell gives me following error: your jvm not support architecture required version of eclipse have installed: -d32 my java version: java version "1.7.0_21" openjdk runtime environment (icedtea 2.3.9) (7u21-2.3.9-1ubuntu1) openjdk 64-bit server vm (build 23.7-b01, mixed mode) is 64-bit issue? i want have control on daemon within emacs or @ least script. these lines relevant in .emacs: ;; eclim - eclipse interface emacs (require 'eclim) (global-eclim-mode) (require 'eclimd) full stack trace: debugger entered--lisp error: (void-variable eclimd-port) (let ((eclimd-start-regexp "eclim server started on\\(?: port\\|:\\) \\(?:\\(?:[0-9]+\\.\\)\\{3\\}[0-9]+:\\)?\\([0-

fonts - Firefox entity/special character text shown instead of Special Character glyph -

Image
i trying use icomoon font compiled , have run problem on firefox not displaying character instead showing stacked text of entity. say character &#xe004; can written many different ways such as: &#57348; &#xe004;  it display tiny print fit in single character: e0 04 here looks in chrome vs firefox: demo of trying use font on jsfiddle . custom checkbox demo. i realize demo doesn't work in ie because of cross-origin dumbness can't change htaccess or font stored @ moment. if knows of cdn demo's in jsfiddle, please comment. look in settings of firefox, clock on 'advanced' , select box allow sites select own fond.

Is speech recognition API available in windows store app? -

i working on windows store app, , intend add tts it. can tell me whether speech recognition api available in windows store app? bing speech recognition control has been released recently. please refer http://msdn.microsoft.com/en-us/library/dn434583.aspx

css - How do i make all my content centered in html -

i started making page web design class , ran problem. page has navigation bar , picture far. wanted center them both using css. display: block; margin-left: auto; margin-right: auto i used both nav bar , img. want nav bar above image if page gets resized. there anyway in css? margins center if element has width. css might like: img{ width:300px; margin: 0 auto; } nav{ width:600px; margin: 0 auto; } basic html: <nav> <ul> <li>something</li> <li>something else</li> </ul> </nav> <img src="../path-to-file.jpg" alt="image"> that center both elements. as making nav above image... mean overlapping it? or "above" way question above answer? i can update post if make clear.