Posts

Java Double Currency Format to 3 Places -

this question has answer here: java currency number format 16 answers i have java android app deals tips. when take in double of bill amount , tip percent, parse them to strings display later. how can format doubles make currency more readable @ end? instead of looking $1.0 $1.00. the code have mentioned is: final edittext amt = (edittext) findviewbyid(r.id.bill_amt); final edittext tip = (edittext) findviewbyid(r.id.bill_percent); final textview result = (textview) findviewbyid(r.id.res); final textview total = (textview) findviewbyid(r.id.total); double amount = double.parsedouble(amt.gettext().tostring()); double tip_per = double.parsedouble(tip.gettext().tostring()); double tip_cal = (amount * tip_per) / 100; double totalcost = amount + tip_cal; result.settext("tip amount : " + " $ " + double.tostring(tip_cal)); total.s...

asp.net - Can I Create PowerBi report in C# or using macro -

can create power bi report(office 365) programmatically in c# or using macro. if yes, how? please help. excel sheet uses power query , power pivot create powerbi report.please provide me link support of answer can summarize, can done or not. using macros in excel manipulate power bi content not supported. lukasz

Excel PowerPivot DAX Calculated Field -

Image
i think i've got relatively easy problem here on hands, having trouble getting work. let me preface saying i'm new dax. consider following powerpivot data model : it consists of sales records table, joined date lookup table, "daily expenses" table. "daily expenses" table stores single value represents averaged cost of running specific trading location per day. it's extremely easy produce pivottable provides me total sales amount per store per [insert date period]. i'm after dax formulation calculate profit per store per day - ie. total sales minus dailyexpenses (operating cost): in theory, should pretty easy, i'm confused how utilise dax row context. failed attempts: profit:=calculate(sum(salesinformation[saleamount] - dailystoreexpenses[dailyexpense])) profit:=calculate(sum(salesinformation[saleamount] - dailystoreexpenses[dailyexpense]), dailystoreexpenses[storelocation]) profit:=sum(salesinformation[saleamount] - relate...

How to send only specific column values from jqgrid? -

i have jqrid multiple columns , rows loaded via json. on click of update button sending grid data server json below. $("#updatetradedetail").click(function () { var griddata = $("#tradedetailgrid").jqgrid('getgridparam', 'data'); $.ajax({ url : "${pagecontext.request.contextpath}" + "/xxxxxx/tools/updatetrades", type : "post", data: json.stringify(griddata), datatype: 'html', contenttype: "application/json; charset=utf-8", success : function(msg) { alert("response on update " + msg); }, error: function (xhr, ajaxoptions, thrownerror) { alert(xhr.status); alert("error" + thrownerror); } }); }); how send specific column values has multiple rows ser...

plot - I am trying to draw a stream function in matlab -

Image
i using code snap draw stream function [x,y]= meshgrid(linspace(0,80),linspace(-8,8)); [t]=meshgrid(linspace(0,100)); b=1+0.3*cos(0.9*t); k=2*phi/10; low=.1+k.^2.*b.^2.*sin(k.*(x-0.9.*t)).^2; psi=-tanh((y-b.*cos(k.*(x-0.9.*t)))./sqrt(low)); contour(x,y,psi,3); colormap cool i wanted picture. getting current(the sin shape lines) not vortex(the rectangular shape). i tried generate plot using parameters shown, but did not manage "vortex" shapes in contour plot . here implementation: len = 200; [x,y] = meshgrid(linspace(0,80,len), linspace(-8,8,len)); t = meshgrid(linspace(0,1,len)); = 1.2; c = 0.12; k = 2*pi/7.5; w = 0.4; e = 0.3; b = + e * cos(w*t); d = k * (x - c*t); psi = - tanh((y - b.*sin(d)) ./ sqrt(1 + (k * b.*cos(d)).^2)) + c*y; figure('position',[100 100 650 300]) movegui('center') subplot(211) contour(x, y, psi, 10), ylim([-4.5 4.5]) %colormap cool xlabel('kilometers'), ylabel('km'), title('mobility model'...

eclipse - Facebook HASH KEY for Android Signed APK -

i facing problem facebook integration in android application last couple of days might duplicate question please me out . have create android application facebook integration every thing ok , working fine when have launch application eclipse ide or unsigned apk when have used signed apk facebook not working showing dialog when click on dialog disable , nothing happen , have searched , found hash key issue form tell debug hash key , signed hash key different not able make signed hashkey please me . for facebook integration using simple facebook library i using windows os please use code, generate hash key debug or distributor(signing) keystore try { packageinfo info = getpackagemanager().getpackageinfo(getapplication().getpackagename(), packagemanager.get_signatures); for(signature signature : info.signatures) { messagedigest md = messagedigest.getinstance("sha"); md.update(signature.tobytearray()); ...

resize dynamically allocated memory C++ with ASSERT" _BLOCK_TYPE_IS_VALID(pHead->nBlockUse) " -

hi im writing code resize dynamically allocated memory. here part of code initializing: int size = 1; string *rev = new string[size]; resizing part: if (j >= size / 2){ size = size * 2; string *temp = rev; rev = new string[size]; memcpy(rev, temp, (size / 2)*sizeof(string)); delete[] temp; // <- here causes error! } when comment out "delete[] temp" code works fine memory leaks. so, how can handle error message "assert". please help! thanks! since pointed out assert caused other parts of code. here full version, print words out in reverse order in given sentence. void reversewords(string &sentence) { char *str = new char[sentence.size()+1]; int size = 1; string *rev = new string[size]; int j = 0; int n = 0; int m = 0; (unsigned int = 0; < sentence.size(); i++){ str[n] = sentence.at(i); n++; if (str[n-1] == ' '){ str[n-1] = '\0'; if (j >= size / 2){ ...