Posts

xamarin - Detecting which item was clicked in a ListView with a DataTemplate -

i have listview simple datatemplate - image , text. list<menuitem> items = new list<menuitem> { new menuitem ("trade","menutradeiconbig.png"), new menuitem ("profile","menuprofileiconbig.png"), }; var listview = new listview (); var viewtemplate = new datatemplate(typeof(menucell)); //menucell contains grid listview.itemtemplate = viewtemplate; listview.itemssource = items; if listview filled strings, can this: listview.itemtapped += (sender, e) => { menuhandler(e.item.tostring()); //my function process item clicks }; but now, when use this, response converted tostring() "myprojectname.menuitem". how can clicked item? i figured out: listview.itemtapped += (sender, e) => { menuhandler((menuitem)e.item); }; public void menuhandler(menuitem item) { menuitem selec...

c# - My scrollview is not working in windows phone 8.1 -

my scrollview not working in windows phone 8.1. here code. please me. textblock see in bind database. fetch data database , show in scrollviewer. suggest me correct code. <phone:pivotitem header="market status"> <grid> <grid.rowdefinitions> <rowdefinition height="auto"/> <rowdefinition height="auto"/> <rowdefinition height="*"/> </grid.rowdefinitions> <button x:name="btnrefresh" grid.row="0" horizontalalignment="center" verticalalignment="bottom" width="80" height="80" borderbrush="transparent" click="btnrefresh_click"> <button.background> <imagebrush imagesource="/assets/icons/refresh2.png"/> </button.backgro...

java - running android studio project with google glass -

i trying run application built in android studio google glass. when run application google glass, starts application , blacks out start window again. on android studio following message: 08-07 19:04:19.842 16629-16629/? w/system.err: @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:786) 08-07 19:04:19.842 16629-16629/? w/system.err﹕ @ com.android.internal.os.zygoteinit.main(zygoteinit.java:602) 08-07 19:04:19.842 16629-16629/? w/system.err﹕ @ dalvik.system.nativestart.main(native method) 08-07 19:04:19.842 16629-16629/? i/process﹕ sending signal. pid: 16629 sig: 9 it shows; com.example.glasspitch(16629)[]dead

IIS 7.5 Detailed Error 500.0 - Internal Server Error occurred after enabling ServersideInclude with Windows 7 IIS 8 Express -

Image
i have serversideincludemodule enabled using "turn on/off windows features" control panel. on inetmgr's handlers-mapping suite, have mapped handle .html extension. however after has been done , tried browse default.html (which has <!--#include virtual="includes/navband.html"--> ) gave me above 500.0 - internal server error on url http://localhost/mydir/default.html !! if removed mapping, default page works again of course without include htmls. i have checked permission, users have read , script rights. however, same implementations work fine on windows server 2008 iis7.5 not on local workstation has iis installed on it. remarks: there file navband.html sitting inside .\includes dir. not issue.

VBA variable in SQL date query -

i'm trying query sql database lines date after date given through user input. i've run variety of errors "incorrect syntax near" when surround date "#" "arithmetic overflow error converting expression to". current code looks this: inputdate = inputbox("please enter starting date (mm/dd/yyyy)") debug.print inputdate querydate = "(dtg > " & format(inputdate, "mmddyyyy") & ")" select stationid, dtg, ceilingfeet surfaceob " & querydate & " , stationid = 'nzwd'" dtg column name date-time group in sql database. idea going wrong? i've tried every solution find on past few days without luck. thank in advance. the primary issue dates must enclosed in single-quotes. here complete working example (minus valid connection string) should explain how achieve objective. note want switch iso date format, in order year-month-day ( yyyy-mm-dd ). sub updaterecord...

performance - Hive: Is there a better way to percentile rank a column? -

currently, percentile rank column in hive, using following. trying rank items in column percentile fall under, assigning value form 0 1 each item. code below assigns value 0 9, saying item char_percentile_rank of 0 in bottom 10% of items, , value of 9 in top 10% of items. there better way of doing this? select item , characteristic , case when characteristic <= char_perc[0] 0 when characteristic <= char_perc[1] 1 when characteristic <= char_perc[2] 2 when characteristic <= char_perc[3] 3 when characteristic <= char_perc[4] 4 when characteristic <= char_perc[5] 5 when characteristic <= char_perc[6] 6 when characteristic <= char_perc[7] 7 when characteristic <= char_perc[8] 8 else 9 end char_percentile_rank ( select split(item_id,'-')[0] item , split(item_id,'-')[1] characteristic , char_perc ( select collect_set(concat...

memory - MemoryError in python with chunked uploading -

i writing server side chunked uploading files. got memoryerror , can`t understand doing wrong. here python code(with framework pyramid): @view_config(route_name='fileupload',renderer='../upload.mako') def upload_file(request): session = request.session if 'authorized' in session , session['authorized'] false: return httpforbidden() try: filename = request.params.get('filename') print request.params.get('chunkindex') datatmp = request.params.get('data') data64 = datatmp[13:] data = base64.b64decode(data64) f = open('/home/somedirectory/' + filename , 'ab') f.write(data) f.close() except exception e: print e return {} error traceback: 2015-07-24 17:57:36,630 error [waitress][dummy-5 340] exception when serving /upload traceback (most recent call last): file "/home/myusername/project25/local/lib/python2...