Posts

Featured post

Function that returns a formatted array in VBA -

i have function prints excel data text file in array format following: [ ['id', 'label', 'longitude', 'latitude', 'country', 'region', 'ttl_wt_flw_thru', 'sum-of-bol-wt', 'count of wdr_ref', 'ratio'], ['aeauh', 'abu dhabi, united arab emirates', 54.3666667, 24.4666667, 'ae', 'eame', 66, 30, 8432, 281.066666666667], ['aedxb', 'dubai, united arab emirates', 55.307485, 25.271139, 'ae', 'eame', 682, 3, 8369, 2789.66666666667] ] my code writing array is: function fillsourcearray() dim long, j long, s string dim lastrow double dim s1 string 'opens file filepath = filepath & "dataarray" & ".txt" open filepath output #1 'read source data dataarray = sheets("nodes").cells(1).currentregion.value 'determine lastrow lastrow = sheets("nodes").range...

gwt - Using Gin to Inject Multiple Views -

i'm attempting put multi-project application, wherein 1 of sub-projects has multiple views single presenter. using gin inject views presenters. the sub-project contains presenter , 2 different views. have 2 separate gin modules, each binding 1 of views view interface. as per thomas broyer's suggestion on answer this post , ginjectors wrapped in "holder" class calls gwt.create on particular ginjector. appropriate holder configured in gwt.xml file using replace-with statement. when run project in dev mode, see alternate view appear expect to. however, when compile project, still default view. also, 6 permutations (i expect more on account of replace-with logic), , not view expect in different scenarios. here code illustrate. subproject.gwt.xml contains this: <replace-with class="com.example.ginjectordesktopholder"> <when-type-is class="com.example.ginjectorholder" /> </replace-with> <replace-wi...

android - Checking for getActivity() == null on user action -

whenever of our fragments asynchronous response network request, check whether getactivity() == null if have touch activity or use context . so our code flow looks this: protected void onnetworkresponse(string response) { if (getactivity() == null) return; getactivity().setprogressbarvisibility(false); // rest of processing here } this makes sense (please comment if we're doing wrong! :) ). however, check getactivity() == null on user feedback, in onclicklistener, if we're going reference activity. me seems we're being overly cautious, because definition if button on fragment clicked, had attached activity. being overly cautious?

javascript - Google Map Marker Missing On Custom Map -

i managed customize colors of google map through javascript, legend , marker won't appear. i'm not worried legend, i'm focusing on marker appearing. tried putting in custom-made marker. why doesn't marker appear? it's right size, png transparency. please! <script type="text/javascript"> window.onload = function () { } function initialize() { var mapoptions = { center: new google.maps.latlng(32.817323, -96.788059), zoom: 16, maptypeid: google.maps.maptypeid.map }; var map = new google.maps.map(document.getelementbyid("map"), mapoptions); var point = new google.maps.latlng(32.817323, -96.788059); var marker = new google.maps.marker({ position: point, map: map, title: "commercial ideas" }); } var latlng = new google.maps.latlng(32.817323, -96.788059); var styles = [ { featuretype: "landscap...

ruby - Does self ALWAYS refer to the current instance in an instance method definition? -

i understand question in instance method, self refers current instance of class. true no matter how many layers of methods or loops deep in within instance method definition? generally, yes, though there metaprogramming methods can strange things self - instance, object#instance_eval allows pass block evaluated in context of instance. in case, self within block of other instance, so: class foo end class bar def wacky puts self.class #"bar" foo.new.instance_eval puts self.class #"foo" end end end without careful reading, might tempted think self within block refers bar instance, not so. so see, purposes, can assume self self bound when entering method. although have ability pass blocks around different binding, self doesn't re-bound "by accident" in ruby. more interesting reading, might @ ruby binding class' documentation.

python - performance - finding all points within certain distance by lat/long -

i have csv file points tagged lat/long (~10k points). i'd search points within given distance of user/specified lat/long coordinate — say, example, centroid of manhattan. i'm pretty new programming , databases, may basic question. if so, apologize. performant search in pure python without using database? in, read csv memory , search python script? if performant, scale number of points increases? or infeasible in python, , need investigate using database supports geospatial queries? additionally, how go understanding performance of these types of calculations can develop intuition this? this possible in python without databases. recommend using numpy. following: read points csv numpy array calculate distance of each point given point sort distance or find 1 minimum distance using argmin because calculations vectorized, happen @ close c speed. with okay computer, i/o take 2-3 seconds , calculation take less 100-200 milliseconds. in terms of math, ca...

shell - /usr/bin/tidy is called before /usr/local/bin/tidy -

i installed newer version of tidy through homebrew, somehow still version within /usr/bin/tidy called. haven't noticed problems homebrew before , there no issues brew doctor can find. :) here get, when call echo $path (i removed ruby related stuff): /usr/local/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/x11/bin:/usr/local/macgpg2/bin and that's /etc/paths /usr/local/bin /usr/local/sbin /usr/bin /bin /usr/sbin /sbin thanks in advance! did execute old tidy , installed new version without restarting shell? if so, use hash -r clear shell's cache go through path again next time try execute it. if not, ensure can execute /usr/local/bin/tidy .