Posts

exception - Xamarin.Android no stack trace in async method -

Image
anybody maybe found workaround bug: https://bugzilla.xamarin.com/show_bug.cgi?id=30513 ? it drives me crazy... screenshoot exception report got async method. here 1 solution worked me. add handler in application or main activity androidenvironment.unhandledexceptionraiser += delegate(object sender, raisethrowableeventargs args){ typeof (system.exception).getfield("stack_trace", bindingflags.nonpublic | bindingflags.instance) .setvalue(args.exception, null); throw args.exception; }; the explanation here in last post https://forums.xamarin.com/discussion/45219/stack-trace-not-captured-properly

javascript - Set multiple form values using jQuery Data attribute -

so let have form id #form has 2 input fields, namely title & price. i click on edit button somewhere in application has data attributes (e.g data-title="apple" data-price="10")that assigned #form upon clicking button. the obvious solution works $("#name").val($(this).data('name')); $("#price").val($(this).data('price')); this looks bad when have many fields. trying work $('#form').data($(this).data()); , more or less in single like have tried many ways no success any appreciated you create jquery plugin can call element contains data points , have apply data based on key elements within form of same name. example below $.fn.applydata = function(form) { $form = $(form); $.each($(this).data(), function(i, key) { $form.find('#' + i).val(key); }); }; jsfiddle: http://jsfiddle.net/lcm8s/43/

c - Why does `memmove` use `void *` as parameter instead of `char *`? -

the definition of c library function memmove following: void* memmove(void *s1, const void *s2, size_t n) { char *sc1; const char *sc2; sc1 = s1; sc2 = s2; ... } i'm wondering why need use void* , const void* parameters' type. why not directly char* , const char* ? update int test_case[] = {1, 2, 3, 4, 5, 6, 7, 8, 10}; memmove(test_case+4, test_case+2, sizeof(int)*4); output: test_case = {1, 2, 3, 4, 3, 4, 5, 6, 10} void * generic pointer type. memmove supposed manipulate memory regardless of type of objects in memory. similarly memcpy . compare strcpy uses char * parameters because it's supposed manipulate strings.

Using Census Bulk Geocoder with python requests library -

i experimenting census bulk geocode api (documentation: http://geocoding.geo.census.gov/geocoder/geocoding_services_api.pdf ) the following curl command works: curl --form addressfile=@addresses.csv --form benchmark=9 http://geocoding.geo.census.gov/geocoder/locations/addressbatch --output geocoderesult.csv but when attempt port python requests: url = 'http://geocoding.geo.census.gov/geocoder/geographies/addressbatch' payload = {'benchmark':9} files = {'addressfile': ('addresses.csv', open('addresses.csv', 'rb'), 'text/csv')} r = requests.post(url, files=files, data = payload) print r.text i apparently not sending formed request , receiving "there internal error" in response. idea doing wrong in forming request? got it! turns out geographies request type required parameters locations type did not. working solution: url = 'http://geocoding.geo.census.gov/geocoder/geographies/addressbatch' ...

c# - Differentiating between processes with the same name outside of my application? -

i creating wpf application in c# monitor processes running on machine. want able collect list of running processes , compare them list of processes want run. if process want run not yet running, application start it. i having problem getting processes name because have numerous processes running off of 1 parent application (they started different executable parameters,) have same process name. can't use process id because there no way me know pid of processes started outside of application. need way differentiate processes 1 both started in , outside of application can tell if running. appreciated, thanks. as suggested here , can query command-line parameters of process wmi , doing following, example if have processid: var wmiquery = string.format("select commandline win32_process processid='{0}'", processid); var searcher = new managementobjectsearcher(wmiquery); var retobjectcollection = searcher.get(); foreach (managementobject retobject in ret...

handlebars.js - Dynamic paths in handlebars -

i searched through lot of questions hasn't found answer. use handlebars templates , have data structure: { privileged_users: [ "user1", "user2" ], users: { user1: { name: "n1" }, user2: { name: "n2" }, user3: { name: "n3" } } } i wan't output privileged users template. this: <table> {{#each privileged_users}} <tr><td>{{../users.[this].name}}</td></tr> {{/each}} </table> is possible without additional helpers? if isn't how can write block helper changing context ../users.[this] ? register following helper: handlebars.registerhelper('lookupprop', function (obj, key, prop) { return obj[key] && obj[key][prop]; }); then modify template like: <table> {{#each privileged_users}} <tr><td>{{lookupprop ../users 'name'}}</td></tr> {{/each}} </table> here working fiddle . ...

cmake - Can CMakeLists.txt depend on a file parsed by a function? -

i rather new cmake, starting off first time larger project consisting of many subprojects. for particular reasons (described below curious) have set of include files contain info source files needed each cmake target (lib or exe) – and, now, prefer (re)use these files (reason described below) writing function parse these files , add content source files targets surprisingly easy task. but – problem: want have each targets cmakelists.txt depend on particular include file, generates list of source files, changes on include file detected if changes cmakelists.txt itself, can’t find references on how accomplish that. n.b.: found addfiledependencies adding dependencies on source files, not cmakelists.txt. however, cmake can figure out dependencies included .cmake file somehow, figured, should possible somehow. background curious: project (quite number of libraries used quite number of executable targets, organized subprojects) using qmake (without using qt itself) setting mak...