Posts

java - What is a NullPointerException, and how do I fix it? -

what null pointer exceptions ( java.lang.nullpointerexception ) , causes them? what methods/tools can used determine cause stop exception causing program terminate prematurely? when declare reference variable (i.e. object) creating pointer object. consider following code declare variable of primitive type int : int x; x = 10; in example variable x int , java initialize 0 you. when assign 10 in second line value 10 written memory location pointed x. but, when try declare reference type different happens. take following code: integer num; num = new integer(10); the first line declares variable named num , but, not contain primitive value. instead contains pointer (because type integer reference type). since did not yet point java sets null, meaning "i pointing @ nothing". in second line, new keyword used instantiate (or create) object of type integer , pointer variable num assigned object. can reference object using dereferencing operator . (a dot...

c# - Windows Phone 8.1 Application Deployment Error -

i added sql database windows phone 8.1 application , cant deploy app lumia 520 or windows devices, need help! following error:- error 1 processor architecture of project being built "any cpu" not supported referenced sdk "microsoft.vclibs, version=12.0". please consider changing targeted processor architecture of project (in visual studio can done through configuration manager) 1 of architectures supported sdk: "x86, arm". myproject.windowsphone did try when put arm gives me following error and when change config arm:- error 1- there mismatch between processor architecture of project being built "arm" , processor architecture, "x86", of implementation file "c:\users\john\documents\visual studio 2013\projects\thebeat\packages\sqlite-winrt.3.8.7.1\lib\wpa81\sqlitewinrt.dll" "c:\users\john\documents\visual studio 2013\projects\thebeat\packages\sqlite-winrt.3.8.7.1\lib\wpa81\sqlitewinrt.winmd". mismatch may...

html - Div container doesn't fit content -

div container doesn't fit content made version of page principal components share , try resolve problem. well, problem when expand horizontally page images cutted in bottom. want leave page that, therefore without visual changes. ps: i'm using bootstrap .image-container{ height: 100%; width: 100%; position:absolute; } https://jsfiddle.net/power96/q15oo62d/ i added inherit images .image-container img{ height:inherit; width:100%; } https://jsfiddle.net/q15oo62d/12/

Why integer division in c# returns an integer but not a float? -

does know why integer division in c# returns integer not float? idea behind (is legacy of c/c++)? in c#: float x = 13 / 4; //imagine used have overridden == operator here use epsilon compare if (x == 3.0) print 'hello world'; result of code be: 'hello world' strictly speaking, there no such thing integer division (division definition operation produces rational number, integers small subset of which.) while common new programmer make mistake of performing integer division when meant use floating point division, in actual practice integer division common operation. if assuming people use it, , every time division you'll need remember cast floating points, mistaken. first off, integer division quite bit faster, if need whole number result, 1 want use more efficient algorithm. secondly, there number of algorithms use integer division, , if result of division floating point number forced round result every time. 1 example off of top of...

Inverse 0 and 255 of a matrice in Java OpenCv -

next topic ( getperspectivetransform on non entire quadrangle ), i'm finding way track little dots white on edges table in of cases. if use binary threshold, works if choose arbitrarily threshold. problem edges color table influenced light. decided convert image on hsv , use inrange function keeps pixels between values program determines (i adapt theses values based on mean value of edge table (brown in of cases...)). function returns matrice pixels between range set 255, else 0. i want inverse matrice, mean switch pixels val=0 255 , pixel val=255 0. here simple code (it doesn't work, nothing) : for (int i=0; i<mat.rows(); i++){ (int j=0; j<mat.cols(); j++){ if (mat.get(i,j).get(0)[0] == 0){ mat.put(i,j,255); } else { mat.put(i,j,0); } } } if know how in java , nice.

Weird looking Javascript for loop -

i have never seen javascript loop such for( ; i-- ; ) , used in code: uid: function (len) { var str = ''; var src = 'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz0123456789'; var src_len = src.length; var = len; (; i--;) { str += src.charat(this.ran_no(0, src_len - 1)); } return str; } i understand behavior, if share insights type of loop. this syntax of for-loop construction: for ([ initialization ]; [ condition ]; [ final-expression ])       statement in case for (; i--;) { : no variables initialized, because var = len; inintialized earlier, it's not needed. condition part truthy until i becomes 0 loop terminate. i-- executed on before each iteration, , due -- operator become 0 , it's falsy, , loop stop. since i decremented in condition part of loop, final-expression not needed too. way put it: since i not used inside loop, not matter whether decrement before each loop itera...

javascript - how to get the coordinates of google maps marker and store it in textbox or label using asp.net c# -

i'm trying marker's coordinates , store latitude , longitude of marker 2 separate labels. there possible way of getting coordinates , setting labels display them? thank you. here's code tried use doesn't post coordinates <asp:label id="lbllongitude" runat="server" text="longitude: "></asp:label> <asp:label id="lbllong" runat="server" text="label"></asp:label> <asp:label id="lbllatitude" runat="server" text="latitude: "></asp:label> <asp:label id="lbllat" runat="server" text="label"></asp:label> <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=aizasybxs9w71w5ggrizwme0rlz7xs69_dezp6i"></script> <script type="text/javascript"> function updatelatposition(latlng) { var lat = document.getelementbyid('hiddenla...