Posts

java - have a char reference an object in an array -

is possible have char point object in array? im trying have characters : +,-,*,/ point index in array. i aware section below not correct syntax. way of describing wish accomplish. public static void main(string[] args) { operations plus; operations minus; operations multiply; operations divide; /**********create jumptable*******************/ operations[] jumptable = new operations[255]; /**********add object jumptable************/ jumptable[0] = new addition(); jumptable[1] = new subtraction(); jumptable[2] = new multiplication(); jumptable[3] = new division(); /**********point index in table************/ plus = jumptable[0]; minus = jumptable[1]; multiply = jumptable[2]; divide = jumptable[3]; //this im trying do: //*************************************** char +; char -; '+' = ...

Javascript OOP - accessing the inherited property or function from a closure within a subclass -

i using javascript inheritance helper provided here: http://ejohn.org/blog/simple-javascript-inheritance/ i have following code, , have problem accessing inherited property or function closure within subclass illustrated below. new oop javascript code , appreciate advice. suppose within closure, context changes jquery (this variable) hence problem. appreciate comments. thanks, -a ps - using jquery 1.5 var users = class.extend({ init: function(names){this.names = names;} }); var homeusers = users.extend({ work:function(){ // alert(this.names.length); // prints // var names = this.names; // if make local alias works $.map([1,2,3],function(){ var newname = this.names.length; //error this.names not defined. alert(newname); }); } }); var users = new homeusers(["a...

Performance of running code in stani python editor vs IDLE/terminal/gvim -

am curious , wondering why takes longer python code execute when run inside stani python editor in comparison when run idle or terminal or inside gvim. spe has object explorer, , debugger. maybe these slow things down bit.

fonts - What is the MIME type for TTF files? -

i can't find correct mime type truetype fonts. need because i'm using file uploading class (codeigniter) upload files, , want allow ttf uploaded. tried this: 'ttf' => 'font/ttf' 'ttf' => 'font/truetype' with no success. any ideas ? ttf not have mime type assigned. you'll have use more general application/octet-stream , used indicate binary data no assigned mime type.

automation - Boostrapping new Eclipse machines with all the Plugins -

bootstrapping eclipse on new machines such time consuming process, wind asking whether need each plugin. there handy, , develop consistent habits. eclipse bootstrapping problems include: explaining / documenting needs happen the actual time pasting in right urls , downloading version compatibility , dependencies eclipse likes restart after each one the changeover eclipse marketplace means plugins , instructions find on web tend inconsistent, depending on when written. the licenses... on , on , over... yes, yes, yes... understand person installing needs aware of it, , have chance review them, there's got better way. it'd nice have "patch file" (either binary or meta) spells out want add on top of stock eclipse installation. i'd find (or create) 1 or 2 step process sets eclipse, plus favorite batch of plugins: subclipse m2eclipse jetty support runjettyrun android sdk , plugin (or @ least plugin) aspectj web objects / woliops python, other...

sql - Compare the date from other table -

using sql sever 2005 table1 id startdate enddate 001 02/23/2010 07/22/2010 002 05/03/2010 null 003 02/02/2011 null ... table2 date 02/24/2011 02/25/2011 ... ... condition if enddate not null startdate compare max(date) table2, if startdate > 6 month should display "expired" how make query above condition. need query help. select startdate, [status]=case when datediff(m,startdate,(select max(date) table2))>6 'expired' else 'valid' end table1 enddate not null

Running Facebook application on localhost -

i planning connect facebook chat localhost. need session key facebook. when give site url localhost:8080 or ip-address:8080 not work. i read setting 2 apps 2 different api keys 1 runs on dev m/c , other on localhost did not quite it. can explain how run facebook app on localhost? i wrote tutorial while ago. the important point "site url": site url: http://localhost/app_name/ where folder structure like: app_name ¦ index.php ¦ +---canvas ¦ ¦ index.php ¦ ¦ ¦ +---css ¦ main.css ¦ reset.css ¦ +---src facebook.php fb_ca_chain_bundle.crt edit: kavya : how fb server recognize localhost without ip or port?? i don't think has facebook, guess since iframe src parameter loaded client-side it'll treat local url if put directly on browser. for example have file on online server content (e.g. online.php ): <iframe src="http://localhost/test.php" width="100%" heigh...