Posts

iphone - How can I create an array of UIButtons/(UIImageViews) that appear after the last one was pressed -

i wasn't sure how search answer question figured try luck on here. to put in short, have uiview , created uibutton programmatically along uiimageview added button subview , happens is, when press on button, allows me add image , gets stored on button. so question is: once completed, how can make button/imageview appear in view, next first button (or after fills screen right, appear in 2nd row, 1st column) etc thank in advanced! you can use uicollectionview pointed out @bernahard harrer or use following code. code adds 2 buttons. in case, need more buttons or array of buttons, implement following code , calculate size of added button, height/width of button1 calculated adding button2 : #import "viewcontroller.h" @interface viewcontroller () @end @implementation viewcontroller - (void)viewdidload { [super viewdidload]; // additional setup after loading view, typically nib. [self addbuttons]; } - (void)didreceivememorywarning { [super...

javascript - geolocation not working in chrome -

i have used following script in mozilla , chrome browser. in mozilla, asking whether share location. in chrome not displaying anything. <script> var x = document.getelementbyid("demo"); function getlocation() { if (navigator.geolocation) { navigator.geolocation.getcurrentposition(showposition); } else { x.innerhtml = "geolocation not supported browser."; } } function showposition(position) { x.innerhtml = "latitude: " + position.coords.latitude + "<br>longitude: " + position.coords.longitude; } </script> do use chrome50 ? removed geolocation support non https sites. https://developers.google.com/web/updates/2016/04/geolocation-on-secure-contexts-only

r - sorting columns from lowest to highest values (i.e. 1, 2, 3 etc, not 1, 10, 11...2, 20, 21... etc) -

i have dataset 50 thousand rows want sort according the values in 1 of columns. numbers in column go 1-30, , when following data=data[order(data$columnname),] it gets sorted order of columns this 1, 10, 11 12, 13, 14, 15, 16, 17, 18, 19, 2, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 3, 30, 4, 5, 6, 7, 8, 9 how sort this 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30 for me seems, format not numeric. try this: data$columnname<-as.numeric(data$columnname) data=data[order(data$columnname),]

How to use index to get the value from the result of map function by Python 3? -

i try this: def test(x): return x**2 = map(test,[1,2,3]) if value this: for in a: print(a) i 1,4,9 , works perfectly. but if this: a[0] . error raised. i know because result of map function map class: type(map(test,[1,2,3])) == <class 'map'> which not subsciptable. so how can use index value of result of map function? note: behavior specific python 3. convert map object list object: a = list(map(test,[1,2,3])) then can use list indices access individual elements.

c# - How to specify a "COM" class, when multiple "COM" class has same name in C++? -

i have defined com interface shown below(c#): using system.runtime.interopservices; namespace commoninterop.hello { [comvisible(true)] [guid("24484884-daae-4b24-b0bd-c7b9aeb3d70d")] public interface icominterop { int plus1(int x); } } and again same interface defined different namespace , guid : using system.runtime.interopservices; namespace commoninterop.world { [comvisible(true)] [guid("66664884-daae-4b24-b0bd-c7b9aeb34444")] public interface icominterop { int plus1(int x); } } usage in c++: in c++ pointer object show below if 1 of com class defined: icominteropptr m_interop; // , void setsome(icominteropptr); but have 2 "com" class has same class name. how can tell c++ use specific "com" class? im noob in c++, tell me explain further if question not specific enough.

django - Threading for sending Notifications and Emails -

i developing web application in django, on update call activity following things: call stored procedure update database. generating data notification. sending actual notification users. generating email data emails. sending actual emails users. the users can more one, tested 50 users giving slow response there processing in call. i planning implement thread run in background , steps 2,3,4 & 5 , call return response after step 1. i confused whether doing right or wrong. is there approach doing it? i never have used threads kind of stuff ... , may problematic depending on server running. (are running multiple instances? every instance start thread? servers uwsgi disable threading default) i use libraries django-q ( http://django-q.readthedocs.io/en/latest/ ) or celery ( http://www.celeryproject.org/ ) sending email , other stuff delay requests. if using uwsgi serving app, has simple feature stuff that: http://uwsgi-docs.readthedocs.io/en/latest/mules....

windows store certification kit - c++ library validation issues -

i'm trying port c++ library universal windows windows store app. using x86 developer command prompt in visual studio 2015 v14.0.24720.00 update 1 on windows 10. wondering i'm doing wrong - compiles , links fine following flags: cl /nologo /fobuild\obj\windows\release\[obj_file].obj /c /md /ox /w4 /ehsc /frbuild\obj\windows\release\ -ddefine_little_endian -ddefine_trace -d_crt_secure_no_warnings -ddefine_windows_universal /ai "c:\program files (x86)\microsoft visual studio 14.0\vc\lib\store\references" /wx /zw /d "winapi_family=2" -ibuild\include [source].cpp and: link /nologo /opt:ref /map ws2_32.lib /appcontainer /dll /out:build\obj\windows\release\mydll.dll [obj_file.obj]* getting whole bunch of unusual looking wack validation errors things surely should standard functions such malloc , std::bad_alloc etc. , furthermore, lot of these not supported apis seem exist in whitelist files though declared not supported. not sure i'm doing wrong ...