Posts

Showing posts from April, 2013

html - Insert any element from script in an element Angular 2 -

i have problem insert element in element <my-app> (angular 2). need @ first element <div class="render"></div> jquery in <script> (look @ code html) need write in <div class="render"></div> information (for example <h1> hello </h1> (look @ html code) ). when app run code must write in <div class="render"></div> . not happen because on moment start <div class="render"></div> not exist. if set settimeout it's working (because <div class="render"></div> in time appear on page). please may decide problem? p.s. jquery , angular 2 in 1 app not correctly know me need decide problem. html code. <!doctype html> <html lang="en"> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"> </script> </head> <body> <my-app>loading...</my-app>...

ios - MPRemoteCommandCenter : UI disappears after I press the pause button -

i'm implementing mpremotecommandcenter radio streaming app. works far audio play screen locked , ui appears volume control , pause button visible. as press pause button audio stops , whole audio control ui disappears can not unpause audio playing pressing play button expect. the method pauseevent gets called on pressing pause button. see below. is able give me hints i've gone wrong? here code: - (id) init { if (self = [super init]) { _streaming = no; _rcc = [mpremotecommandcenter sharedcommandcenter]; mpremotecommand *pausecommand = [_rcc pausecommand]; [pausecommand setenabled:yes]; [pausecommand addtarget:self action:@selector(pauseevent)]; mpremotecommand *playcommand = [_rcc playcommand]; [playcommand setenabled:yes]; [playcommand addtarget:self action:@selector(playevent)]; } return self; } -(void) pauseevent { [_rcc.playcommand setenabled:yes]; [_rcc.pausecommand ...

c# - The buffer allocated is insufficient when encoding to Rgba16 UWP -

i encoding canvas control contains textblocks child using following code the buffer allocated insufficient my code using(inmemoryrandomaccessstream ras = new inmemoryrandomaccessstream()) { var displayinformation = displayinformation.getforcurrentview(); var rendertargetbitmap = new rendertargetbitmap(); await rendertargetbitmap.renderasync(textify.canvascontrol); var width = rendertargetbitmap.pixelwidth; var height = rendertargetbitmap.pixelheight; ibuffer textbuffer = await rendertargetbitmap.getpixelsasync(); byte[] pixels = textbuffer.toarray(); //encode text png var encoder = await bitmapencoder.createasync(bitmapencoder.pngencoderid, ras); encoder.setpixeldata(bitmappixelformat.rgba16, bitmapalphamode.premultiplied, (uint)width, (uint)height, displayinformation.logicaldpi, displayinformation.logicaldpi, ...

c# - The order of returning items in the resultant List when using List.Distinct() -

what items removed resultant list when distinct.tolist() applied in following illustration? first entry (i.e. first added list) among duplicates preserved in new list being returned? if not, there way make distinct.tolist() preserve first entry among duplicates in new list being returned? dim values list(of integer) = new list(of integer) values.add(1) values.add(5) values.add(2) values.add(3) values.add(2) values.add(3) values.add(4) values.add(2) values.add(2) values.add(3) values.add(3) values.add(3) dim items list(of integer) = values.distinct().tolist ' display result. each integer in items console.writeline(i) next expected output: 1 5 2 3 4 this msdn page says " the distinct(of tsource)(ienumerable(of tsource)) method returns unordered sequence contains no duplicate values ". there way around this? no can't use distinct work around that. happens works expect doc...

node.js - How to send a ejs file as HTML email from nodejs application as cronjob -

i have node.js app , want send html email application daily @ 8am few people. have dashboard.ejs file gets data database , shows them in bootstrap dashboard template. want send dashboard.ejs html email datas database , styling same when dashboard.ejs loaded application. i have cron job ready , mailer function ready. unable send dashboard.ejs file html via email.can done? if yes, appreciated. var mailer = require('express-mailer'); var cronjob = require('cron').cronjob; mailer.extend(app, { from: 'user@gmailcom', host: 'smtp.gmail.com', secureconnection: true; port: 465, // port secure smtp transportmethod: 'smtp', auth: { user: 'user@gmail.com', pass: 'password' } }); var job = new cronjob('00 49 * * * *', function() { console.log('this runs on 49th second of every min every hour every day every month every year') app.mailer.send('dashboards/d...

sql server - SQL pivot rows to columns -

Image
i have query returns 2 types agency "vente" , "recouv". want request displays 1 line sum of column "commission". here picture shows have , want: select codeagence,case when (typeoperation =0) 'vente' else 'recouvrement' end 'type', count(*) 'nb',sum(pxventeht ) 'c.a',sum(acompte) 'montant',sum(montantcommission ) 'commission' commission_archive group codeagence,typeoperation order codeagence i think might want, question lacks proper sample source data haven't tested it. select codeagence, count(case when (typeoperation = 0) 'vente' else null end) 'nb vente', sum(case when (typeoperation = 0) pxventeht else 0 end) 'c.a', count(case when (typeoperation <> 0) 'recouve' else null end) 'nb recouve', sum(case when (typeoperation <> 0) acompte else 0 end) 'montant recouve', sum(montantcommissi...

angularjs - In Angular facotry initialized value again initialize or not to the variable? -

in angular , not need code clear doubt if initialize value in factory , application refresh factory again initialize value or not ? when refresh page context lost , because stored in memory , it's destroyed.its better use localstorage same purpose.

AngularJS Unit Testing: Attaching Data from $q.resolve() to object -

i'm testing service uses service api calls, let's call data service. data service tested elsewhere, i've abstracted away simple implementation contains empty functions; i'm returning data via deferred object , jasmine's spyon syntax. the trouble i'm finding approach when data returned, it's not available on calling object, if used $httpbackend. aware use $httpbackend, i'd know if i've missed (simple or otherwise) in approach. example section of code i'm trying test: storethedata = dataservice.getsomedata(); storethedata.$promise.then(function(data) { /*this work*/ console.log(data); /*but not, when testing using $q*/ _.foreach(storethedata, function(storeddata) { /*do each object returned*/ }); }); as side note, don't think situation helped ...$promise.then on line, ideally wouldn't change code (i'm providing test coverage written while ago...) example of test: beforeeach( ... data...

ios - Push notification alert pop up is visible to user after opening application -

when received multiple push notification "alerts" style in settings. after clicking open on 1 of them other alerts visible upto 1 seconds after have cleared in didfinishlaunchingwithoptions function. how clear other notification once click on open?

jquery - How to remove decimal from Year, in google chart API? -

Image
i have implemented google chart api in admin panel. have worked, data loaded in jquery. here's code:- google.load("visualization", "1", { packages: ["corechart"] }); google.setonloadcallback(drawchart); function drawchart() { /*--------this code line chart ----------*/ var optionsline = { title: 'user enrollment statistics', curvetype: 'function', legend: { position: 'bottom' } }; $.ajax({ type: "post", url: "<?php echo base_url();?>ajax-graph-user-join", data: {'type':'yearwise','year':'','month':''}, datatype: "json", success: function (data) { var dataarr = []; for(var = 0; < data.length; i++) { var ar = [data[i].year, data[i].user]; dataarr.push(ar); } ...

android - Upgrading my SQLite db -

i quite new sqlite. how upgrade db? my previous database version had 7 questions in it. today added 13 new ones, making them 20 in total. added them using addquestion method. however, not work. i have been tinkering onupgrade. doing wrong. public class quizhelper extends sqliteopenhelper { private static final int database_version = 1; private static final string database_name = "creativequestion"; private static final string table_quest = "quest"; private static final string key_id = "qid"; private static final string key_quest = "question"; private sqlitedatabase dbase; public quizhelper(context context) { super( context, database_name, null, database_version ); } @override public void oncreate(sqlitedatabase db) { dbase = db; string sql = "create table if not exists " + table_quest + " ( " + key_id + " integer primary key autoincremen...

html - Can I put radial-gradient into a image -

Image
i have html code <div class="right"> <div class="img"> <img ng-src="{{ticket.thumbnail}}"> </div> </div> and scss .right{ width: 25vw; display: flex; justify-content: center; align-items: center; border-bottom-right-radius: 5px; border-top-right-radius: 5px; background-image: radial-gradient(circle @ 0% 0%, $mainbackground 9px, transparent 9px), radial-gradient(circle @ 0% 100%, $mainbackground 9px, $footer 9px); .img{ overflow: hidden; display: flex; justify-content: center; img{ height: 16.2vh; } } } the result of is: i want have both borders right one. know solid background, not image. 1 know is: thanks million edited i tried put image background of .right class: <div class="right" ng-style="{'background-image' : 'radial-gradient(circ...

mysql - Sqlite alias column give an error -

Image
this table create table if not exists `calls` ( `id` int(11) not null auto_increment, `date` timestamp not null, `type` int(11) not null, primary key (`id`) ) engine=innodb and there data on its now use query type data same day select user.name_first calls.date days, (select group_concat(type) calls day(date) = day(days) ) calls join user on user.user_id = calls.user_id calls.id in (select max(id) calls group day(calls.date)) as see calls.date days , try type data (select group_concat(type) calls day(date) = day(days) ) its work on mysql result in mysql but when try on sqlite no such column: days (code 1): , while compiling i read sqlite support alias

javascript - How to trigger the event manually once the ajax content's script is executed completely? -

i loading html page script section(render jquery ui) via ajax . html page contains more number widgets. in success function of ajax, accessing ui controls jquery ui class names. none of class names added i.e., script not executed. if access same after 100ms using settimeout working. please refer below code: var self = this; $.ajax({ url: url, datatype: "html", cache: true, success: function (str,sta,xhr) { $("#samplefile").html(str); settimeout(function() { self.reg($("#samplefile .ui-widgetui")); },100); } }); its working fine want access without settime out. can please suggest on this. it sounds perhaps trying access dom before initialized. have tried wrapping initialization of ajax request in jquery $(document).ready() call? makes sure dom in initialized state be...

android - Why is changing of ImageButton's image resource not changing the button's image? -

i'm writing memory game app android , calling setimageresource() method of imagebutton has no effect whatsoever. so idea have random number of hidden images on screen (in particular case have 4 buttons), implemented imagebuttons r.drawable.image_default image resource , when button "start" gets clicked game begins. when user clicks 1 button shows it's image. when user clicks one, shows image behind , after brief delay 1 of 2 things can happen: shown images same , disappear screen shown images different both buttons containing them revert images image_default the problem - when user clicks on first button, setimageresource() gets called , (the button) changes it's image supposed to, when user clicks second button (one of other 3 buttons facing down), setimageresource() gets called again image on button doesn't change . despite this, else works if change happened (meaning if (images) same, buttons disappear screen, if different, button images flip...

Haskell : convert a bytestring to [word8] -

my intent convert bytestring list of word8 in haskell in order access lsb each byte . any idea how achieve ? unpack :: bytestring -> [word8] http://hackage.haskell.org/package/bytestring-0.10.8.1/docs/data-bytestring.html#v:unpack also consider whether can skip intermediate list, , directly use foldl' or related fold.

c# - Linq for "List<Dictionary<string, KeyValuePair<string, object>>>" order the values by asc -

i order elements this way can iterate through it: list<dictionary<string, object>> valuelist = ((ienumerable<object>)y.value).select(x => (dictionary<string, object>)x).tolist(); foreach (dictionary<string, object> dict in valuelist) { foreach (keyvaluepair<string, object> item in dict) { } } i have huge problems forming linq-expression, order values specific key.(for example, have special key , value want reorder entire data source) valuelist.orderby(ya => (ya.values list<dictionary<string, keyvaluepair<string, object>>>).keys.first(key => key.equals("propertytosearchfor"))); i get: cannot convert type 'system.collections.generic.dictionary.valuecollection' 'system.collections.generic.list>>' via reference conversion, boxing conversion, unboxing conversion, wrapping conversion, or null type conversion what should instead ? updated 1 t...

c - Adding 2 doubles and print them -

iam new c , have problem adding , printing doubles in 09.3f format. code: #include <stdio.h> int main(int argc, char **argv) { double d, m, c; scanf("%1f", &d); scanf("%1f", &m); c = d + m; printf("%09.3f\n", c); } and have typed twice scanf yet can insert 1 number, why that? printf 00000.000 example: d = 5,125 , m = 1.256, want c be: 00006.381 here, might input buffer problems scanf . so, can add space in scanf . like, scanf("%lf", &d); scanf(" %lf", &m); also, use %lf in scanf instead of %1f .

What's the simplest way to print a Java array? -

in java, arrays don't override tostring() , if try print 1 directly, weird output including memory location: int[] intarray = new int[] {1, 2, 3, 4, 5}; system.out.println(intarray); // prints '[i@3343c8b3' but we'd want more [1, 2, 3, 4, 5] . what's simplest way of doing that? here example inputs , outputs: // array of primitives: int[] intarray = new int[] {1, 2, 3, 4, 5}; //output: [1, 2, 3, 4, 5] // array of object references: string[] strarray = new string[] {"john", "mary", "bob"}; //output: [john, mary, bob] since java 5 can use arrays.tostring(arr) or arrays.deeptostring(arr) arrays within arrays. note object[] version calls .tostring() on each object in array. output decorated in exact way you're asking. examples: simple array: string[] array = new string[] {"john", "mary", "bob"}; system.out.println(arrays.tostring(array)); output: [john, mary, bob] nest...

python - Theano assertion error -

when run theano , want train 2d convolutional network following error: error (theano.gof.opt): optimization failure due to: local_abstractconv_check error (theano.gof.opt): node: abstractconv2d{border_mode='half', subsample=(1, 1), filter_flip=true, imshp=(none, none, none, none), kshp=(32, 3, 3, 3), filter_dilation=(1, 1)}(convolution2d_input_1, convolution2d_1_w) error (theano.gof.opt): traceback: error (theano.gof.opt): traceback (most recent call last): file "c:\users\nicol\anaconda3\envs\py34\lib\site-packages\theano\gof\opt.py", line 1820, in process_node replacements = lopt.transform(node) file "c:\users\nicol\anaconda3\envs\py34\lib\site-packages\theano\tensor\nnet\opt.py", line 409, in local_abstractconv_check node.op.__class__.__name__) assertionerror: abstractconv2d theano optimization failed: there no implementation available supporting requested options. did exclude both "conv_dnn" , "conv_gemm" optimizer? i...

c# - WPF ListView won't update binded dictionary -

i bound dictionary listview in wpf. <listview x:name="listview" horizontalalignment="left" height="100" margin="30,324,0,0" verticalalignment="top" width="270" itemssource="{binding archivedatadb}"> <listview.view> <gridview> <gridviewcolumn header="archive name" displaymemberbinding="{binding key}" /> <gridviewcolumn header="data db amount" displaymemberbinding="{binding value}" /> </gridview> </listview.view> </listview> thats dictionary: public dictionary<string, int> archivedatadb { { if(_archivedatadb == null) { _archivedatadb = new dictionary<string, int>(); _archivedatadb.add("master data", 0); } return _archivedatadb; } set ...

.net - App wide Static Variable C# Console application -

i looking use variable config instantiated in program.cs able use in other classes have. understand, need use dependency injection, not sure how achieve. program.cs public class program { static iconfigurationroot config = null; public static void main(string[] args) { config = new configurationbuilder() .setbasepath(environment.currentdirectory) .addjsonfile("appsettings.json") .addenvironmentvariables() .build(); } } testclass.cs public class testclass { public void dosomething() { // need use instantiated config object here. } } you can either make config static public , can accessed anywhere in application, or, if want use dependency injection, make testclass constructor ask 1 iconfigurationroot : public testclass(iconfigurationroot config) { // need // save reference on local member, example } now every time instantiate new testclass , have pass ar...

sample time series datasets R and python -

since lazy don't want spend time downloading datasets, loading them , perform pre-processing test sample functions on different timeseries. sample timeseries datasets available r , python? (which can imported easily). eg: there iris dataset (which can loaded in environment using data(iris) ). in r , per @kabulan0lak's comment, can choose different "preloaded" datasets. 1 way see have available in system type: data() since you're looking time series data, suggest eustockmarkets dataset. can either load in space explicitly: data("eustockmarkets") or call directly, typing: eustockmarkets other datasets may interest include: lakehuron dataset single series of class ts . johnsonjohnson quarterly earnings of company johnson & johnson .

osx - How to open mail panel in Swift? Mac OS -

for past few days i've been strugling finding way send emails app. sample code using. think, using method, might unable handle situation of improper setting of mail accound of computer app running, thought using different method. wondering if there messageui equivalent mac os. there messageui equivalent mac os. ideas? there 2 ways that: applescript framework nssharingservice nssharingservice compose mail: let service = nssharingservice(named: nssharingservicenamecomposeemail) service?.recipients = ["test@gmail.com"] service?.subject = "test mail" service?.performwithitems(["test mail body"]) launch mail app if want open mail app, try below code: nsworkspace.sharedworkspace().launchapplication("mail") improper setting: if account not configured on system, code show configuration window mail when user try send mail it'll shown improper setting related error mail app need not bother it if want use othe...

c++ - How to order a set< pair< pair<int, int>, double > > for the second value "double"? -

i super new in c++ , struggling this: want organize second component of set: set< pair <pair<int, int>, double > > map int n_t = 10, n_r = 10; (unsigned int i_t = 0; i_t < n_t; i_t++ ) { for(unsigned int i_r = 0; i_r < n_r; i_r++ ) { double_t dr = i_t*i_r ; map.insert( make_pair(make_pair(i_r, i_t) ,dr)); } } and want organice second component. have try , dont know how to it: sort(map.begin(), map.end(), [](const pair<pair<int,int> &x, double>,const pair<pair<int,int>, double> &y) { return x.second < y.second; }); thanks!! if wish sort according .second element of pair, why not placing double in front of pair<int,int> ? sorting orders pairs first element second element, instead of set< pair <pair<int, int>, double > > map you use set< pair <double, pair<int, int> > > map also suggest not using keywords variable names ( map in-built data s...

php - How to get all combinations from multiple arrays? -

supposing have these 3 arrays $array1 = array(1,2); $array2 = array(4,5); $array3 = array(7,8); i need output 1 4 7 1 4 8 1 5 7 1 5 8 2 4 7 2 4 8 2 5 7 2 5 8 one of problems array myght vary 3 15 different arrays , each myght empty (i might add 0 not empty) or have many values. if have empty array need count valid column. these values used fill database in specific order. is there way can this? how many combinations there? so first question how many combinations there? , answer have multiply amount of every array each other. so (c = amount 1 ): c array 1 * c array 2 * ... * c array n and specific example: c array 1 * c array 2 * c array 3 = 2 * 2 * 2 = 8 *1 , if wonder why chose c amount, because of function count() in php getting combinations together how combinations amount of arrays, have? we loop through our combinations, have(starting off 1 combination, "empty combination" ( $combinations = [[]]; )), , each combinatio...

glkit - Comparing GLKMatrix4 -

how compare 2 glkmatrix4, or @ least check if on identity matrix? a cursory search of glkmatrix4.h shows no util function, , feeling silly checking every field manually this: static bool glkmatrix4equaltomatrix4(glkmatrix4 a, glkmatrix4 b) { return a.m00 == b.m00 && a.m01 == b.m01 && a.m02 == b.m02 && a.m03 == b.m03 && a.m10 == b.m10 && a.m11 == b.m11 && a.m12 == b.m12 && a.m13 == b.m13 && a.m20 == b.m20 && a.m21 == b.m21 && a.m22 == b.m22 && a.m23 == b.m23 && a.m30 == b.m30 && a.m31 == b.m31 && a.m32 == b.m32 && a.m33 == b.m33; } you can transform string , compare using function nsstringfromglkmatrix4

encoding - Unknown symbols displayed in czech words in javascript application -

i have unknown symbols displayed in javascript application try catch construction using czech language when use coding windows-1250. these symbols displayed question marks in diamond. html <!doctype html public "-//w3c//dtd html 4.01//en" "http://www.w3.org/tr/html4/strict.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=windows-1250"/> <title>konstrukce try/catch</title> <script type="text/javascript" src="number.js"></script> </head> <body> <form name="formular" id="formular" action="#"> <div id="cislodiv">zadejte číslo v rozsahu 1 až 100: <input id="cislo" name="cislo"> <span id="informace"> </span></div> <div><input id="odeslatformular" type="submit"></div> </form> <script ty...

Azure Mobile Service OAuth in Xamarin.iOS -

i creating xamarin native project ios , android. using microsoft azure backend , azure oauth authentication. added microsoft azure mobile client both ios , android project. in xamarin.android project, did authentication azure following code: mobileserviceclient client = new mobileserviceclient("my-azure-app-url"); var user = client.loginasync(this, mobileserviceauthenticationprovider.windowsazureactivedirectory); above code works fine , able authentication. same tried in xamain.ios can know initialisation of mobileserviceclient different in ios. mobileserviceclient client = new mobileserviceclient("my-azure-app-url", httpmessagehandler); i not able find httpmessagehandler. can 1 me solution an http message handler responsible actual communication going on between client , server. there default (managed) implementation used if not specify handler. go ahead , tell httpclient use native 1 on ios (as android). use modernhttpclient or use ...

FlashDevelop receives XML, Flash Pro receives JSON -

i'm getting data feed client's supplier. documention says can feed both in xml , in json, default xml. json have set header accept:application/json , remove accept:application/xml header. have not set nor removed headers in code. i'm using normal urlloader load feed. when navigate feed url in browser, xml . when run code in flashdevelop, xml . when run exact same code in flash pro, json . does have idea causing in flash pro? hidden setting can changed? urlrequest.method has no impact. debug mode or not has no impact. i'm stomped. ---------code tried------------ var header:urlrequestheader = new urlrequestheader("accept", "application/xml"); var headers:array = []; headers.push(header); urlreq.requestheaders = headers; urlreq.method = urlrequestmethod.post; --------- full load code ----------- _urlloader.addeventlistener(event.complete, validatefeedloaded); _urlloader.addeventlistener(ioerrorevent.io_error, handlefeedioerror)...

java - set boolean value to Realm database when checkbox is checked -

i have realm database model want display in arecyclerview, every row in database model have string name,int age , boolean favourite,when try save boolean value in recyclerviewadapter using interface g java.lang.nullpointerexception: attempt invoke virtual method 'void io.realm.realm.begintransaction()' on null object reference this model public class person extends realmobject implements{ @primarykey private string name; private string job; private boolean favourite; private string image; public authorinfo(string image, string job, string name, boolean favoutite) { this.image = image; this.job = job; this.name = name; this.favourite = favourite; } public authorinfo() { } public string getimage() { return image; } public void setimage(string image) { this.image = image; } public string getjob() { return job; } public void setjob(string job) { this.job = job; } public string getname() { return name; } public void setname(string ...

javascript - Duplicate a leaflet div (a div that contains also a heatmap) -

i having trouble duplicating div container of leaflet. used clone of jquery duplicate div on second one. works tailes, map has heatmap layer on it. , layer clone ignores completly! let me try put simple example, consider have 2 divs, 1 map , other empty! <button id="duplicatebtn">duplicate map</button> <div id="map" style="width: 100%; height: 200px"></div> <p>next</p> <div id="newtestmap" style="width: 100%; height: 200px"></div> <script> // treats duplicate button click $("#duplicatebtn").click(function(){ $('#map').clone().appendto('#newtestmap'); }); </script> you can find code @ codepen: http://codepen.io/danielcamara/pen/majaqy however, real problem want print map content specific page format. map, user can handle e.g. change heat map, add other layers etc... ho...

javascript - Send PHP Link data from ajax call to different page onclick -

Image
im busy learning ajax. have reservation page , checkout page. what want do user types renter name search box, matching names gets fetched db , displayed dynamically. like so: reservations.php when user clicks highlighted link, reservation id passed checkout page. thus, im looking way pass reservation id another/different page, can use data processing on checkout page. checkout.php code search / jquery $(document).ready(function () { $("#searchbox").on('keyup',function () { var key = $(this).val(); $.ajax({ url:'fetch.php', type:'get', data:'keyword='+key, beforesend:function () { $("#results").slideup('fast'); }, success:function (data) { $("#results").html(data); $("#results").slidedown('fa...

windows - How to get the icon path and index associated with a file type? -

given file type (e.g. .txt ) how can the: path index to file type's associated icon path , index, e.g.: i want convert .txt into: path : %systemroot%\system32\imageres.dll index : -102 with information can extract icon (e.g. using shdefextracticon ). background every type of file in windows registered in registry. when icon assocated file, specified path file contains icon, , index of icon resource (or resource id if index negative). using .txt file example, associated defaulticon is: %systemroot%\system32\imageres.dll,-102 extractassociatedicon first there win api function extractassociatedicon : retrieves handle indexed icon found in file or icon found in associated executable file. the idea pass path, , index, , go icon you: string iconpath = "%systemroot%\system32\imageres.dll"; word iicon = -102; hicon ico = extractassociatedicon(0, iconpath, iicon); that works when know path , index of icon want. fortunately, extra...

Android Video Upload without wait for Response -

i have created video upload activity asynctask function. tried send request sever upload video , server take more time upload , return response . there anyway send response server without wait server response ? need send request server, no need wait repsonse , transfer other page's . kindly explain how . thanks advance. public class uploadactivity extends appcompatactivity { private string videourl; private textview statusview; progressdialog uploading; private string questionid; private final int splash_display_length = 4500; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_upload); if (android.os.build.version.sdk_int > 9) { strictmode.threadpolicy policy = new strictmode.threadpolicy.builder().permitall().build(); strictmode.setthreadpolicy(policy); } statusview = (textview)findviewbyid(r.id.uploadstatus); bundle extras = getintent(...

cumulocity - Error loading "Event processing" page -

i have error trying open "event processing" page, i've got following error message: error creating bean name 'scopedtarget.epserviceproviderfactorybean' defined in invocation of init method failed; nested exception error initializing: home directory '/tmp/esperha-storage' not exist obtained environment property 'espertech.esperha.home' : error initializing: home directory '/tmp/esperha-storage' not exist obtained environment property 'espertech.esperha.home' is there can do? it because of cumulocity update, problem resolved.

php - Decode base64 image and save it on a webserver - retrieve the same and encode again -

i have image in form of base64 string api response. - saving string directly in database in mediumtext field. seems eating space. is there way save image flat file - store it's link in image field in database - , retrieve using query again ? i'm using php on server side - , aws. need i'm running out of db space. also - know save base64 string decoding image , saving on server - how can retrieve , encode same? take this, using pair functions base64_encode / base64_decode : $encoded = 'somebase64encodedstring'; $decoded = base64_decode($encoded); // $decoded binary content of image, save anywhere want. // example: file_put_content('/tmp/image.png', $decoded); // when want retrieve base64 encoded string again $decoded = file_get_contents('/tmp/image.png'); $encoded = base64_encode($decoded); // have $encoded, base64 encoded string. please it.

c# - Passing back a single object when using EditorFor(model[]) -

this has been thorn in side while. if use editorfor on array of objects , editor template has form in ex. public class foocontroller:controller{ pubic actionresult action(foo foo){ blah... } } index.cshtml @model ienumerable<foo> @html.editorfor(m=> m) editortemplate @model foo @using (html.beginform("action", "controller")) { @html.textboxfor(f=> f.a) @html.checkboxfor(f=> f.b) @html.labelfor(f=> f.b) } so i'll hit few problems. the checkbox label's doesn't bind correctly checkbox (this has label not receiving proper name of property ( [0].a opposed a ). i'm aware can rid of pre- text doing foreach on model in index screws ids , naming framework doesnt realize there multiples of same item , give them same names. for checkboxes i've been doing manually such. @html.checkboxfor(m => m.a, new {id= html.namefor(m => m.a)}) <label for="@html.namefor(m => m.a)"...