Posts

java - Comparing two Integer Wrapper classes -

why program printing false in first print statement , true in print statement.? , i1 2 different objects first statement must print "true", expected, second print statement prints "false" creates confusion. public static void main(string[] args) { integer = new integer(10); integer i1 = new integer(10); system.out.println(i == i1); //printing false i++; i1++; system.out.println(i == i1);//printing true } using new keyword always creates 2 different instances. following true: new integer(10) != new integer(10) hence first line printing "false". then: i++; hides unboxing , boxing. equivalent to: i = integer.valueof(i.intvalue() + 1); as described in the javadoc of integer.valueof , values -128 127 (at least) cached: getting cached instance of integer.valueof(11) both i++ , i1++ , hence second line printing "true".

sql like - orientdb select does not return all vertices -

Image
i'm using orientdb studio creating vertices type (nodetype1). created 29 vertices using orientdb studio , when run: select count(*) nodetype1 i 29 records. however, when run: select * nodetype1 i list of 20 records. has encountered before? you see 20 records because orientdb shows 20 default. if want see more, can write: select * nodetype1 limit -1 this way, can see records. here can set number of visible records query:

c# - ArgumentException not working -

is there reason why argumentexception might not work? when moved our solutions .net 4.0, cannot use argumentexception. string nodata = '--no data--' try { instanceid = microsoft.xlangs.core.service.rootservice.instanceid.tostring(); } catch (argumentexception) { instanceid = nodata; } when use exception class instead of argumentexception, can pass variable nodata instanceid. catch (exception e) { instanceid = nodata; } the error encountering when object reference not set instance object. the problem doing in code catching argumentexception s whereas before caught exceptions - exceptions derive exception fit old catch criteria. if want catch specific exception ( nullreference ) need catch correct 1 (not argumentexception ). change following: catch (nullreferenceexception) { instanceid = nodata; } but if don't have specific behavior nullreferenceexception i'd keep it: catch (exception) { instanceid = nodata; ...

Multilayer CSV to filtered excel -

[enter image description here][1]i have following format csv hierarchy data (up 12 layers) , trying fill in excel can @ end create pivot of data. each file (over 1000) different, have been trying code macros unable remove bugs. first aproach create table , use above cell on blanks, because of layers not correct end of table any idea on how approach using macros? level 1,level 2,level 3,level 4,level 5,level 6,level 7,level 8,level 9,level 10,level 11,level 12 test ,,,,,components ,,,,,,default logic ,,,,,,,z04 - z05 ,,,,,,,,z04 () ,,,,,,,,,%pwr_pg_u_backlight% () components ,c ,,c802 - c842 ,,,c802 ,,,,1 (1) ,,,,2 (2) [this got| http://i.stack.imgur.com/bj2qg.png] [this need pivot| http://i.stack.imgur.com/7q6jq.png] to 'text columns' in vba row_count = 13 = 1 row_count strarray = split(cells(i, 1).value, ",") count = lbound(strarray) ubound(strarray) cells(i, count + 1).value = strarray(count) next next

Removing delivery step from checkout skips shipping address also in spree + rails -

Image
when write remove_checkout_step :delivery in order_decorator.rb removes shipping address info checkout/address page in spree3-1 stable branch. requirement skip checkout step 3 page i.e given in image please guide me how overcome issue. add following code rails/spree app: in app/models/spree/order_decorator.rb spree::order.class_eval remove_checkout_step :delivery end

android - Want to know the history of item purchased -

initially had implemented code 1 time purchase only. iabhelper.oniabpurchasefinishedlistener mpurchasefinishedlistener = new iabhelper.oniabpurchasefinishedlistener() { public void oniabpurchasefinished(iabresult result, purchase purchase) { log.d(tag, "purchase finished: " + result + ", purchase: " + purchase); // if disposed of in meantime, quit. if (mhelper == null) return; if (result.isfailure()) { log.e(tag,"error purchasing: " + result); return; } if (!verifydeveloperpayload(purchase)) { log.e(tag,"error purchasing. authenticity verification failed."); return; } log.d(tag, "purchase successful."); if (purchase.getsku().equals(item_sku)) { // bought 1/4 tank of gas. consume it. log.d(tag, "purchase ga...

dojo - Vertical Text in dijit TabContainer Tabs -

dijit/layout/tabcontainer may have tab buttons/texts displayed on top, right, bottom , left. i'd tabs on right (using tabposition: "right-h"), if tabs on right, texts still displayed horizontally. "right-h" sounds if there plans "right-v", have texts displayed vertically, too, seems not implemented yet. how can achieve vertical display of tab texts in 1 of tabcontainers in use in page (others shall have tabs on top horizontally rendered texts). thanks! one way can imagine split title of tabs accros multiple lines. like this: require([ "dojo/dom-attr", "dojo/query", "dijit/layout/tabcontainer", "dijit/layout/contentpane", "dojo/domready!" ], function(attr, query, tabcontainer, contentpane){ query(".tc1cp").foreach(function(n){ new contentpane({ // pass title: attribute, this, we're stealing node title: attr.g...