Posts

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 .

Can a SilverLight component instantiate a registration-free COM-visible .NET object -

we trying load in silverlight 5.0 component running in ie com-visible .net object registration-free using activation context api. http://msdn.microsoft.com/en-us/library/ms973913.aspx the silverlight component runnning trusted application in browser described in http://msdn.microsoft.com/en-us/library/gg192793(v=vs.95).aspx . the object can loaded in stand-alone test application using activation context api manifest formed. in siverlight running inside browser, component loader dll (loaded appdata/locallow) creates , activates activation context fails load com-visible .net object dll appdata/locallow. result "the file not found". does have experience silverlight/com in similar setup? tia i filed ticket microsoft , suggested solution workaround actual activation context bug. //create own activation context pointing manifest actctx actctx; ulong_ptr pctxcookie; //initialize actctx manifest name , path .... handle hactctx = createactctx(&actctx);...

browser - Why would HTML show up in view:source but not be displayed or rendered on the page? -

what cause html table , form (viewable in view:source ) not render or appear on page? it not appear in chrome's developer tools console or firebug console. i have been trying figure out day , searching not helping. any changes raw html see in view source rendered dom in browser caused javascript. there must code on page removing table. can please provide code examples of scripts on page , including?

internet explorer - Joomla 2.5.4 administration screen loading white page on a single computer -

i have case joomla administrator page not load on single computer. other computers on network can access admin page. the browser ie 10: - cleared cache , history in browser - rebooted pc - , complete norton anti-virus scan completed i can main site. from computer went administrator page cleared cache. the computer having problem laptop take home work. login admin in joomla , go template manager. select template. if displays normal or better in web browser platform using, template might not compatible version of web browser. if it's commercial template, go vendor , updates work web browser having issues with.

android - Making gps calls faster and more efficient -

i've been working on simple speed calculations application i'm working on, code have takes far long retrieve location, , know questions have been asked before, none of answers seem retrieve results i'm looking for. so, how can make code have gps fixes within matter of seconds, , possible? locationlistener: package me.dylan.acf; import java.text.decimalformat; import java.util.arraylist; import android.app.notificationmanager; import android.location.location; import android.location.locationlistener; import android.os.bundle; import android.text.format.time; import android.widget.textview; public class gpsmanager implements locationlistener { arraylist<double> avgspeeds = new arraylist<double>(); textview debug; notificationmanager mngr; double avgspeed; long lasttime = 0; graphview view; location lastloc; int earthradius = 6371; long delaytime = 30; arraylist<double> allspeeds = new arraylist<double>...

mfc - cannot convert parameter 1 from 'const char [6]' to 'const wchar_t * -

i'm new mfc , don't know error. error error c2664: 'void atl::cstringt::format(const wchar_t *,...)' : cannot convert parameter 1 'const char [6]' 'const wchar_t *' heres line: m_echo1.format("%d %",state.dwmemoryload); by default windows app set use 16-bit characters, not 8-bit characters. change quoted string l"%d %" specify string of 16-bit characters.

mongodb - Showing newest values in subdocument when finding a document -

given following document structure: { _id: "abc123", name: "some name", properties: [ { definition: "temp", values: [ { created: 1376061128, value: 82 }, { created: 1376062368, value: 85 }, { created: 1376062627, value: 88 } ] }, { definition: "alert", values: [ { created: 1376061128, value: 0 }, { created: 1376062368, value: 1 }, { created: 1376062627, value: 0 } ] } ] } i want able return document "newest" (based on created) values each property so: { _id: "abc123", name: "some name", properties: [ { definition: "temp", values: [ created: 1376062627, value: 88 ] }, { ...

sql server - xquery to order with header values in the way -

can partially order xml data types using xquery when logical columns aren't consistent (such when there headers in first row(s))? edit had bad example, mislead answers away original question. how order typ column values, leaving th headers @ top? or vice versa, ordering integer column rts instead? say have xml stored in mssql xml field ( select thexml xmldata returns 1 row containing following): <table cellpadding="2" cellspacing="3" border="1"> <tr> <th>typ</th> <th>rts</th> </tr> <tr> <td>abc</td> <td>26</td> </tr> <tr> <td>dcc</td> <td>21</td> </tr> <tr> <td>dbb</td> <td>4</td> </tr> <tr> <td>xbq</td> <td>152</td> </tr> <tr> <td>ahi</td> <td>349</td> ...

ruby on rails - How do i set a parent_id using s3_direct_upload gem? -

newbie on rails 3.2.14, testing on heroku, uploading image files s3 s3_direct_upload gem. i've got gem working fine. drag , drop, progress bars , direct upload s3 work great. upload tied attachment model. new record created on upload. fine far. the issue i'm having want set parent_id field of new record don't know how pass in. gem doesn't use conventional form submit upload, it's handled via javascript: <%= s3_uploader_form callback_url: attachments_url, callback_param: "attachment[attachment_url]", id: "mys3uploader" %> <%= file_field_tag :file, multiple: true %> <% end %> the create action in attachments_controller.rb : def create @attachment = attachment.create(params[:attachment]) end calls javascript view create.js.erb : <% if @attachment.new_record? %> alert("failed upload attachment: <%= j @attachment.errors.full_messages.join(', ').html_safe %>"); <% else %> ...

opencv - 3D Reconstruction upto real scale -

i working on project detect 3d location of object. have 2 cameras set @ 2 corners of room , have obtained fundamental matrix between them. these cameras internally calibrated. images 2592 x 1944 k = [1228 0 3267 0 1221 538 0 0 1 ] f = [-1.098e-7 3.50715e-7 -0.000313 2.312e-7 2.72256e-7 4.629e-5 0.000234 -0.00129250 1 ] now, how proceed given 3d point in space, should able points on image correspond same object in room. if can obtain right projection matrices (with correct scale) can use them later inputs opencv's traingulatepoints function obtain location of object. i have been stuck @ since long time. so, please me. thanks. sorry not coming in size of comment.. @user2167617 reply comment. pretty much. few pointers, though: singular values should (s,s,0), (1.3, 1.05, 0) pretty guess. r: technically, right, however, ignoring signs. might rotation matrix not satisfy constraint deteminant(r) = 1 ...

How to work with Interlization concept in javascript or jQuery -

in project using interlization using spring mvc it's working fine .but want show alret() message end user according selected language .how 1 me.i using hidden fields in view layer performance issue occur way read properties file data using javascript or jquery you can use nested objects. example: // init dictionary var messages = { en : {}, es : {} }; // populate messages.en['welcome'] = 'welcome'; messages.es['welcome'] = 'bienvenido'; // test var lang = 'es'; alert(messages[lang]['welcome']);

php - Link an image on the front page to post, but when the post is open link to the image. (WordPress) -

i have wordpress blog: http://technosting.com/ on homepage each post has image before it, image linked post. when post opened same image still linked post url. use fancybox plugin makes gallery of photo linked self. example @ of other images inside post, excluding first image of coarse. on front page image linked blog post when blog post opened, image link self fancybox can used view image. looked hours online not able find solution this. how can make work? thanks in advance, what want here, is_single() . add in functions.php function enqueue_fancybox(){ wp_enqueue_script('my_custom_js', '/path/to/my/custom.js', array('jquery', 'fancybox')); } if(is_single(){ add_action('wp_head', 'enqueue_fancybox'); } where custom.js calls code required create fancybox. code indicates has dependency on enqueued scripts jquery , fancybox this ensure it's not fired on front page, it's pulling list of multi...

android - ActionBar overflowing on pre-ICS devices -

Image
i'm developing application needs compatible android 2.2+ it's using actionbarsherlock customize actionbar on pre-ics devices. i'm facing problem on 2.2 , 2.3 devices makes content of actionbar overflow though content fits device screen. this: i've tested (on emulator) device screen size (mdpi on 320x480) runnning android 4.0 , works fine, believe problem related actionbarsherlock. i'm tried drastically reducing icon files, though images smaller, content still overflowing. here styles.xml file: <style name="appbasetheme" parent="theme.sherlock.light.darkactionbar"> </style> <style name="apptheme" parent="appbasetheme"> <item name="actionbarstyle">@style/appbasetheme.actionbarstyle</item> <item name="actionbartabstyle">@style/appbasetheme.actionbartabstyle</item> <item name="actionbartabbarstyle">@style/appbasetheme.actionb...

How to benchmark disk IO in PHP? with MySQL? -

are there benchmark test written in php can test disk io, preferably involving mysql? if write one, how should write one? basic fwrite() of random data inserting large number of entry mysql , avg() or max() without index? zipping file if there opensource scripts these great. thanks! no not know, best tools native linux programs iostat , htop you want make analist tool can analyse why query slow or not??