Posts

Showing posts from 2010

python - Why does scipy linear interpolation run faster than nearest neighbor interpolation? -

Image
i've written routine interpolates point data onto regular grid. however, find scipy 's implementation of nearest neighbor interpolation performs twice slow radial basis function i'm using linear interpolation ( scipy.interpolate.rbf ) relevant code includes how interpolators constructed if interpolation_mode == 'linear': interpolator = scipy.interpolate.rbf( point_array[:, 0], point_array[:, 1], value_array, function='linear', smooth=.01) elif interpolation_mode == 'nearest': interpolator = scipy.interpolate.nearestndinterpolator( point_array, value_array) and when interpolation called result = interpolator(col_coords.ravel(), row_coords.ravel()) the sample i'm running on has 27 input interpolant value points , i'm interpolating across 20000 x 20000 grid. (i'm doing in memory block sizes i'm not exploding computer btw.) below result of 2 cprofile s i've run on relevant code. note ...

angularjs - How can I extend the $http service in angular? -

unfortunately, we're stuck running 1.2.26 (will upgrade 1.2.28 when it's gemified). in meantime, how can patch (heh) $http short-hand patch method available? i'm pretty new whole service/factory/module thing. i've done hours of searching , can't seem figure out. myapp.factory('patchedhttp', function($http, basicservice) { // $http['patch'] = function(url, data, config) { // return $http(angular.extend(config || {}, { // method: 'patch', // url: url, // data: data // })); // }; var extended = angular.extend(basicservice, {}); extended.createshortmethodswithdata('patch'); return extended; }); above best i've got... , doesn't xd the module.decorator has been added module api in version 1.4. that's why not working in 1.2.x. please find below working demo or here @ jsfiddle . it took me while implement patch method because i've missed return promise of $http . sho...

perforce - How to integrate 2 branches programatically -

i have 2 branches in depot. //depot/project/mainline/... //depot/project/staging/... i using in-house tool manages build of project, , create build step automatically promotes files mainline staging. have been trying write using p4.net api, following following example . able run powershell commands build tool. plan write c# console application, compile using tool, , execute build step. unfortunately getting example. able create client, create branch spec , sync files down, life of me cant figure out how submit integrate. feel trying over-engineer solution thought. should easy do. attaching broken code below. if dose not make sense, because using trial , error figure stuff out , didn't make final pass through yet. said, if don't need use p4 api, better. requirement there no user input required run commands. if there merge conflict, want automatically accept source. thanks string uri = "server"; string user = "user"; str...

c++ - Vector of shared_ptr gives seg fault when instances in vector accessed -

i have vector of shared_ptr<someclass> named allparts . the code below: void function thisiswhereitstarts(){ vector<shared_ptr<someclass> > allparts; for(i=0;i<n;i++){ allparts.push_back(function_which_returns_shared_ptr_someclass()); } // use vector below: for(vector<shared_ptr<someclass> >::iterator = allparts.begin(); it!=allparts.end(); it++){ (*it)->function_of_someclass() ; // gives segmentation fault } } i've used vector of pointers number of times before, first time i'm using shared_ptr . the function returns shared_ptr this: shared_ptr<someclass> function_which_returns_shared_ptr_someclass(){ shared_ptr<someclass> part(new someclass); if(part->some_function(some_parameter)){ return part; }else{ return shared_ptr<someclass>(); } } you push_back empty shared_ptr . dereference every shared_ptr in vector. derefe...

Vagrant/Otto Malformed version: 1.7.4/lib/vagrant/pre-rubygems.rb:31 -

this errors happened me on mac environment when using command otto dev otto (successor of vagrant, nothing android), think error happen people using vagrant. the error: $ otto dev error building dev environment: malformed version: 1.7.4/lib/vagrant/pre-rubygems.rb:31 not sure, otto or ruby may not show complete error message, complete error message warning found using command bellow: $vagrant --version /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/pre-rubygems.rb:31: warning: insecure world writable dir /usr/local/bin in path, mode 040777 vagrant 1.7.4 attention on part dir: writable dir /usr/local/bin solution to fix, use: sudo chmod go-w /usr/local/bin but, again, me @ least, more similar errors appeared, difference dir changed, /usr/local , /usr/local/bit/bin , /usr/local/git have used chmod above on dirs , otto dev works!

bash - Sed command not working through SSH -

consider following command: ssh machine sed -i 's#\[ "\$jboss_mode" = "standalone" \]#\[ "\$jboss_mode" = "sim_standalone" \]#' /tmp/sim-wildfly when run command command line, error: sed: -e expression #1, char 3: unterminated `s' command however, when ssh particular machine first, , run sed part of command, works fine: > ssh machine > sed -i 's#\[ "\$jboss_mode" = "standalone" \]#\[ "\$jboss_mode" = "sim_standalone" \]#' /tmp/sim-wildfly any idea why happen? edit: believe has how i'm escaping characters, because tried simple test replacement no escaped characters , worked fine. tried double-escaping, didn't work either. try ssh here-doc avoid crazy escaping: ssh -t -t machine <<'eof' sed -i 's#\[ "\$jboss_mode" = "standalone" \]#\[ "\$jboss_mode" = "sim_standalone" \]#' /tmp/sim-wi...

python - How to dereference void* in ctypes? -

consider following code: import ctypes ipc_private, map_size, ipc_creat, ipc_excl = 0, 65536, 512, 1024 shmget = ctypes.cdll.loadlibrary("libc.so.6").shmget shmat = ctypes.cdll.loadlibrary("libc.so.6").shmat shm_id = shmget(ipc_private, map_size, ipc_creat | ipc_excl | 0600) trace_bits = shmat(shm_id, 0, 0) s = ctypes.string_at(ctypes.c_void_p(trace_bits), 1) print(s[0]) when try run it, gives me "segmentation fault" after successful run of shmat . doing wrong? by default, ctypes functions wrapped have restype == c_int . need set correctly before call it. same argtypes .

javascript - Using form input in jQuery function -

so trying allow user enter "access code" timestamp , , start countdown timer based on that. can set var manually , works, cannot form. missing? html <form> <input type="text" name="access" onkeyup="formchanged()" onchange="formchanged()" /> <button type="submit" class="btn btn-default">submit</button> </form> jquery $(function() { function formchanged() { var access = document.getelementsbyname("access")[0].value; } //var access = 1443564011; var note = $('#note'), // notice *1000 @ end - time must in milliseconds ts = (new date(access * 1000)).gettime() + 1 * 24 * 60 * 60 * 1000; $('#countdown').countdown({ timestamp: ts, callback: function(days, hours, minutes, seconds) { var message = ""; message += days + "<small class='white...

java - Hello World in Webratio -

Image
i'm new webratio , trying hello world working. i've created new hello world project here's looks like i've created debug configuration but when hit debug error message i'm not sure error means deployment information not found project helloworld: regenerate project , retry. and google doesn't seem know message either. so thought, maybe webratio projects not mean built, maybe supposed else. i tried generate , run on cloud button. but did not appear produce results. i tried hitting deploy button. there 2 types of deployments available me, 1. webratio 2. openshift using webratio deployment error message unrecognized cloud account launch configuration 'helloworld - webratio cloud' i think because don't have account webratio. using openshift deployment seems work without errors, can't find output. i message in console reads [30 sep 2015 09:39:33,021] output folder: c:\webratio\webratio ...

sql - Query that can benefit from index, cluster or hash-cluster -

i'm trying find equi-join query shows decent performance bump when use index, cluster or hash-cluster structure on data. need run query on unstructured data first , execution time should significant can see performance boost of 3 structures. issues having if use query utilizes index column search narrow , few rows returned , baseline query's execution time fast can't measure time later. it seems queries have major effect on baseline queries execution time cause full table scan of table rows, makes using index structure useless won't use index. clusters or hash-clusters benefit full table scans - in general don't know queries benefit clusters/hash-clusters. my table has 500,000+ rows , of queries have tried: select c.cust_name, s.total_price sales s, customer c s.cust_id = c.cust_id order c.cust_name; select count(*) sales s, customer c s.cust_id < 500 , s.cust_id = c.cust_id; select c.cust_name, s.total_price sales s, customer c s.cust_i...

web - Can't crawl hidden form content not shown in the page source -

i have crawl comments in web page: https://myglu.org/statuses/6587/comments in web page, there 1 post , several other users' comments.. from page source, can see form , following html, source doesn't show of users' comments contents. <div class="comment-form"> <form novalidate="novalidate" class="simple_form new_comment" id="new_comment" action="/statuses/6587/comments" accept-charset="utf-8" data-remote="true" method="post"><input name="utf8" type="hidden" value="&#x2713;" /> <div class="input hidden comment_photo_id"><input class="hidden" type="hidden" name="comment[photo_id]" id="comment_photo_id" /></div> <div class="input text required comment_body"><label class="text required" for="comment_body">...

ruby - How does this code with send :[] work? -

the following code generates output of 9. understand send calling method :[] , confused how parameters work. x = [1,2,3] x.send :[]=,0,4 #why x [4,2,3] x[0] + x.[](1) + x.send(:[],2) # 4 + 2 + 3 how line 2 , line 3 work? line 2 is x.send :[]=,0,4 that fancy way of writing this: x[0] = 4 (calling send allows call private methods though, , 1 difference between 2 syntaxes. also, object conceivably override send method, break first syntax.) so line 2 has effect of writing 4 first spot in array. now on line 3, see adding 3 things. here list of things adding: x[0] - first element x.[](1) - syntax accessing elements, accesses second element. syntax traditional method call, name of method happens [] . x.send(:[], 2) - shows feature of ruby, send method. accesses third element. so result 9, because third line adds first, second, , third elements of array. these examples appear illustrate interesting po...

css - Table Cell Not Growing to its Contents Size -

i have simple table: <table> <tbody> <tr> <!-- note: min-width make td's outline more visible --> <td style="border: 1px dotted blue; min-width:130px;"> <span style="padding: 50px; background:red">x</span> </td> </tr> </tbody> </table> however, i'm confused produces. have expected <td> grow size of contents, giving me blue dotted line surrounding big block of red. that doesn't happen though. instead, row's height remains fixed (as can see looking @ blue line), , inner <span> spills out past <td> , without changing it. clearly i'm misunderstanding how table cells grow, thought expand fit contents (unless use, say, overflow: hidden ). can please explain: why <td> isn't growing encompass <span> ? what css use make encompass span? p.s. did try searching answer this...

parse.com - not recieving Parse Push Notification -

i'm having problem receiving parse push notification using devices lower android lollipop. parse push notification works devices os lollipop versions lower lollipop not work hope me in advance. manifest file <?xml version="1.0" encoding="utf-8"?> <uses-permission android:name="android.permission.internet" /> <uses-permission android:name="android.permission.access_wifi_state" /> <uses-permission android:name="android.permission.access_network_state" /> <uses-permission android:name="android.permission.camera" /> <uses-feature android:name="android.hardware.camera" /> <uses-permission android:name="android.permission.wake_lock" /> <uses-permission android:name="android.permission.vibrate" /> <uses-permission android:name="com.google.android.c2dm.permission.receive" /> <uses-permission android:name="android.permi...

javascript - How to get the value of input from different div in jquery? -

here's html: <div id="parent"> <div id ="child1"> <div id="subchild1"> <input type="text" name="first" value="3"> </div> </div> <div id ="child2"> <div id="subchild2"> <input type="text" name="second" value="7"> </div> </div> <div id ="child3"> <div id="subchild3"> <input type="text" name="third" value="8"> </div> </div> </div> <div id="result"> here's jquery: $(function(){ var len = $('#parent > div').length; for(var i=0; < len; i++){ var = $('#subchild'+ [i + 1]).find('input'); $('#result').html(a); } }); it get's last value. tried best here's code can do. maybe can me. js fiddl...

Delphi only allow horizontal Drag-and-Drop on TControlBar -

i have tcontrolbar aligned bottom of main form (same width). height of control bar fixed. this control bar contains number of tpanels , aligned horizontally (with matching heights). these panels contain various other components. want able move , rearrange these panels horizontally side-to-side disallow vertical movement (fix top of panels). how can achieve this. have tried setting anchors->aktop property each panel true . panels move vertically try , drag them side side. i using rad studio xe4 set rowsize height of controlbar: specifies height of control bar's rows. and set rowsnap false : specifies whether controls snapped control bar's rows when docked. use rowsnap specify whether controls snapped control bar's rows when docked. controls snapped have top , height properties set automatically correspond control bar's rows.

android - Retrofit 2 file down/upload -

i'm trying down/upload file retrofit 2 can't find tutorials examples on how so. code downloading is: @get("documents/checkout") public call<file> checkout(@query(value = "documenturl") string documenturl, @query(value = "accesstoken") string accesstoken, @query(value = "readonly") boolean readonly); and call<file> call = retrofitsingleton.getinstance(serveraddress) .checkout(document.getcontenturl(), apitoken, readonly[i]); call.enqueue(new callback<file>() { @override public void onresponse(response<file> response, retrofit retrofit) { string filename = document.getfilename(); try { system.out.println(response.body()); long filelength = response.body().length(); inputstream input = new fileinputstream(response.body()); file path = environment.getexternalstoragedirectory(...

uiscrollview - Autolayout constraints not being applied iOS -

Image
i making app uiscrollview uibuttons in along uilabels. i'm trying way outlined here on apeth.com referenced on question. implementation not set contentsize or use contentview scrollview should adjust size of it's subviews. the problem uibuttons , uilabels seem not have constraints applied. had bunch uibuttons , uilabels fit on storyboard see them so. however, appear when run app. constraints should work @ runtime, seems using storyboard rough layout. and how looks on 5s the uiscrollview constraints superview 0 0 uiscrollview 0 0 the subviews of uiscrollview follows subviews - center vertical 16-firstbutton-4-firstlabel-16-secondbutton-4-secondlabel-etc...-16-lastbutton-4-lastlabel-16 edit: followed suggestion in comment , added label button make simpler , set contentview 728. now, have problem of button truncating button text, awful localization purposes. please advise.

java - How do I add more objects to the program? -

i have started taking java classes new , got task "bouncing balls". have make user input how many balls he/she wants see in screen. have tried doing loops sure have done wrong because keep seeing 1 ball. give me pointers/hints/ or indicate problem? thank :) program: public class bouncingball { public static void main(string[] args) { int n = stdin.readint(); for(int i=0;i<n;i++){ // set scale of coordinate system stddraw.setxscale(-1.0, 1.0); stddraw.setyscale(-1.0, 1.0); // initial values double rx = math.random(); double ry = math.random(); // position double vx = 0.015, vy = 0.023; // velocity double radius = 0.05; // radius // main animation loop while (true) { // bounce off wall according law of elastic collision // (int = 0; < n; i++) { if (math.abs(rx + vx) > 1.0 - radius) vx = -vx; ...

java - JScrollBar don't show thumb in Nimbus L&F -

Image
i got problem happens on nimbus l&f. if there many items in jlist, thumb of jscrollbar disappear. in metal l&f, thumb visible, because has min size. have checked logic in nimbus l&f, there have same min size. not effected. please see code below: public static void main(string[] args) { (uimanager.lookandfeelinfo info : uimanager.getinstalledlookandfeels()) { if ("nimbus".equals(info.getname())) { try { uimanager.setlookandfeel(info.getclassname()); } catch (classnotfoundexception ex) { logger.getlogger(demo.class.getname()).log(level.severe, null, ex); } catch (instantiationexception ex) { logger.getlogger(demo.class.getname()).log(level.severe, null, ex); } catch (illegalaccessexception ex) { logger.getlogger(demo.class.getname()).log(level.severe, null, ex); } catch (unsupportedlookandfeelexception ex) { ...

java - Eclipse hangs on startup -

this question has answer here: how prevent eclipse hanging on startup? 30 answers i have problem running eclipse. tried 3.7, 4.2 , 4.3 versions java 6 , java 7. nothing can me. shows me popup screen doesn't start load( dont have chance choose workspace). starting -debug -console parameters shows stops running in moment: time load bundles: 10 starting application: 6374 osgi> i have started jvisualvm cannot observe special. there no deadlocks etc. edit my observations deep... after ~60s pid of eclipse dead. edit 2 now stops on time load bundles: 8 org.eclipse.m2e.logback.configuration: org.eclipse.m2e.logback.configuration bundle activated before state location initialized. retry after state location initialized. starting application: 3557 edit 3 i have managed start -clean parameter , choosing workspace command line -data parameter. ...

wordpress - Template Overriding using a customization section -

i trying override default templates customization section, using code that, if using unable assign template edit-page page, can give idea how both customization section , edit-page assign template work. want set template when creating page , after assigning want override. consider have blog page, want assign archive.php template , ten want override customization section. there particular condition want work. <?php /** * adds customize page select template pages */ add_action( 'wp_footer', 'cur_page_template' ); function cur_page_template(){ var_dump( get_option('current_page_template') ); var_dump( get_page_template() ); exit; } function widgetsite_template_override($wp_customize){ $wp_customize->add_panel( 'template_options', array( 'title' => __( 'template options', 'widgetsite' ), 'description' => $description, // include html tags such <p>...

.htaccess - 301 Redirect Directory But Not Its Content -

i want redirect mysite.com/blog/ mysite.com/blogs/. redirect should not apply other pages inside blog directory. example, mysite.com/blog/article-1 should not redirect mysite.com/blogs/article-1 first tried simple 301 redirect unfortunately redirecting content. tried following code didn't work out. rewritecond %{request_uri} ^/blog/$ rewriterule ^(.*)$ http://www.easydestination.net/blogs/ [l,r=301] any idea how htaccess?

base64 - OutOfMemory Exception while executing JAVA Mapping -

Image
i have transfer big files (500 mb+...can of 1gb in size). these files have base64 encoded , encoded string has put in xml file. while below code works smaller files (30 - 50 mb) fails files great 100 mb. using base64 encoder sun (sun.misc.base64encoder). public void execute(inputstream inputstream, outputstream outputstream) throws streamtransformationexception{ try { string sourcefilename = "test_file"; string receiverstr = ""; //2. convert input data in base64encoded string base64encoder encoder = new base64encoder(); byte input[] = new byte[inputstream.available()]; inputstream.read(input); string base64encoded = encoder.encode(input); //3. build soap request format string serverurl = "http://website/url"; string soapenvelope = "<soapenv:envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envel...

android - Toast not showing well when using AppCompatActivity -

Image
i inherited "appcompatactivity" activity in custom activity shown in code below : public class myhomeactivity : appcompatactivity { toast.maketext(this, "email & message sent @ sos contacts.", toastlength.long).show(); } the toast message not showing in activity shown in picture below.. please if have solution it.... create custom view toast textview support multiple lines, create custom view toast text fits in it. view view = layoutinflater.inflate(resource.layout.custom_toast, null); var txt = view.findviewbyid<textview>(resource.id.txtcustomtoast); txt.text = "your toast message"; var toast = new toast(this) { duration = toastlength.short, view = view }; toast.show(); also inserting new line character (i.e \n) toast message in current code, show toast message in 2 lines , background proper.

sdl - C primary expressions - Is it primary expression or not? -

i'm using basic sdl program learn print screen. i following error when run application: error: expected primary expression before '=' token" #include "sdl.h" #include <stdio.h> #define window using namespace std; const int screen_width = 640; const int screen_height = 480; int main( int argc, char* args[] ) { sdl_surface* screensurface =null; if( sdl_init( sdl_init_video ) < 0 ) { printf( "sdl not initialize! sdl_error: %s\n",sdl_geterror() ); } else { window = sdl_createwindow( "sdl tutorial", sdl_windowpos_undefined, sdl_windowpos_undefined, screen_width, screen_height, sdl_window_shown ); } if(window==null) { window = sdl_createwindow( "sdl tutorial", sdl_windowpos_undefined, sdl_windowpos_undefined, screen_width, screen_height, sdl_window_shown ); } } the preprocessor simple, when has macro replaces macro as is ...

angularjs - How to pass arrays from angular to VB API? -

i'm new vb , i'm trying pass array values angular vb api values var topass = [{"codemerch":440077,"namemerch":"aelpler¿ magrone 2kg (2)","categorymerch":3576,"statusmerch":null,"unitpricemerch":0,"unitmerch":"g","kioskmerch":"10","existingingredient":"440077","linkedmerch":"","$$hashkey":"object:431"},{"codeprod":"441371","nameprod":"test product","categoryprod":"tine test","statusprod":"1","unitpriceprod":"15","unitprod":"","$$hashkey":"object:441"}] here's code $.ajax({ url: "api/postproductlink", type: "post", data: topass, datatype: "json", success: function (result) { alert(result);...

c# - Converting string to date 12/29/2014 00:00:00.000 -

i not able convert string of following format "12/29/2014 00:00:00.000" datetime value....i tried using following code. can me please. var value = "12/29/2014 00:00:00.000"; datetime validdate = new datetime(); datetime.tryparseexact(value, "yyyy-mm-dd hh:mm:ss.sss", null,system.globalization.datetimestyles.none,out validdate); datetime.tryparseexact(value, "mm/dd/yyyy hh:mm:ss.sss", null, system.globalization.datetimestyles.none, out validdate); datetime.tryparseexact(value, "mm/dd/yyyy", null, system.globalization.datetimestyles.none, out validdate); console.writeline(validdate); try one using system; public class program { public static void main() { var date = "12/29/2014 00:00:00.000"; iformatprovider culture = new system.globalization.cultureinfo("en-us", true); datetime checkindate = convert.todatetime(date, culture); console.writeline(checkindate); ...

java - Wicket basic implementation of wizard steps -

is there basic implementation wicket 6.20 provides step overview functionality in this picture or like if other won't work ? when looking @ documentation couldn't find close it, started doing own implementation like public list<string> getsteps(wizardmodel model){ iterator<iwizardstep> iterator = model.stepiterator(); list<string> steps = new arraylist<string>(); for(int = 1; iterator.hasnext(); i++){ steps.add(string.valueof(i)); iterator.next(); } //model.getactivestep(); unnecessary in context return steps; } to possible steps in list. , go on getting index of current panel (if possible) , it's state iscolmplete(); mark in different color. can't believe, i'm first 1 problem. should go on idea or there better option? you can (have to) implement wizard yourself, not hard. i use ajaxtabbedpanel basis. have add 'next', 'back' , 'finish' bar below, , cs...

Rewrite serial port communicationf rom C++ to C# -

i want know if correctly mapped c++ code establishes serial port communication c#. void func(...) { *hdev = createfile(portnameunc, generic_read|generic_write, 0, null, open_existing, file_attribute_normal, null); if(*hdev == invalid_handle_value) return false ; dcb *dcb = new dcb ; memset(dcb, 0x00, sizeof(dcb)) ; dcb->dcblength = sizeof(dcb); dcb->baudrate = baudrate; dcb->parity = parity; dcb->stopbits = stopbits; dcb->bytesize = bytesize; dcb->fbinary = true; dcb->fdsrsensitivity = 0; dcb->fdtrcontrol = (dtr ? dtr_control_enable : dtr_control_disable) ; dcb->frtscontrol = (rts ? rts_control_enable : rts_control_disable) ; dcb->foutxctsflow = (cts ? 1 : 0) ; dcb->foutxdsrflow = (dsr ? 1 : 0) ; dcb->foutx = (xonnxoff ? 1 : 0) ; dcb->finx = 0 ; if(!setcommstate(*hdev, dcb)) ...

jquery - How to sort dates by asending order. Dates are like dd/mm/yyyy (31/12/2015) or (dd-MMM-yyyy) format -

i have scenario need sort dates different format dd/mm/yyyy (31/12/2015) , mm/dd/yyyy (12/31/2015) . for mm/dd/yyyy (12/31/2015) using sortedkey = sortedkey.sort(function(a,b) { return - b;}) how can sort format mm/dd/yyyy javascript not work dates in dd/mm/yyyy format. if had dates in mm/dd/yyyy format, able convert strings date , compare : var arr = ['01-01-2015', '03-03-2015', '07-30-2015', '12-30-2014']; // mm-dd-yyyy arr.sort(function(a, b) { var adate = new date(a); var bdate = new date(b); return (adate < bdate ? -1 : 1); }); document.write(arr.join("<br/>")); the best way solve problem change format of dates. however, if cannot change format of dates , can use hacks parsing using regular expressions : function parse_ddmmyyyy(str) // example: str = '07-30-2015' { var numbers = str.match(/\d+/g); // numbers [7,30,2015] return new date(numbers[2], number...

vb6 - I can not get result every time I run data report . How can I fix this ? -

i want make report of daily income expense account. using data environment report , made date field group field. problem every time run program data appears , sometime it's showing blank. can't understand why happening , reason it? have bind table directly through data environment tool code here private sub cmdok_click() dim rsrojmelincome new adodb.recordset dim rsrojmelexp new adodb.recordset dim rstemprojmel new adodb.recordset cn.execute "delete temprojmel" rsrojmelincome.open " select * rojmel date1 between #" & format(dtpicker1.value, "mm/dd/yyyy") & "# , #" & format(dtpicker2.value, "mm/dd/yyyy") & "# , incexp = 'ytjtf'", cn, adopenkeyset, adlockoptimistic rsrojmelexp.open " select * rojmel date1 between #" & format(dtpicker1.value, "mm/dd/yyyy") & "# , #" & for...

How to delete a folder from sdcard when application is closed or uninstall in android -

i want delete folder when application closed or uninstalled. automatically folder delete when application close. there function available in android. try this code folder delete using code. want delete folder when application close. can put code?? place file deletion code inside ondestroy() call method of home screen.

Use the eclipse hibernate tool with hibernate spatial library -

there 1 able configure hql tool of eclipse hibernate tool? have try configure using jpa. configuration generate entity (that observable in configuration) , connection database session factory return following not determine type for: org.hibernate.spatial.geometrytype, @ table:.... there way solve problem, maybe adding library or configuration? i using postgis db , proprietis of configuration are: <properties> <property name="hibernate.show_sql" value="true" /> <property name="hibernate.hbm2ddl.auto" value="off" /> <property name="hibernate.dialect" value="org.hibernate.spatial.dialect.postgis.postgisdialect" /> </properties>

ruby on rails - How setup selenium firefox tests on CodeShip? -

intro hi, i'm developing rails application, use capybara , selenium-webdriver , rspec tests. problem have functional tests, runs in firefox (default selenium browser) , works redirects other hosts. example, rspec before hook fresh google access token. locally on laptop tests runs success: bundle exec rspec but codeship's builds fails. questions do need setup codeship support "firefox" tests? if yes, how can it? does codeship supports redirects other hosts? thanks! codeship supports running selenium tests in ci , can find more info here https://documentation.codeship.com/continuous-integration/browser-testing/ however when tried run selenium tests in ci , chrome failed start 90% of times , planning spin selenium grid elsewhere , run tests in codeship

iis 7 - Connect remotely to an iis based website -

i asked make modifications on website hosted on iis7 server. given dns address , password (i'm guessing need username also..) have no idea how connect server see files (after know how make necessary changes). is there manual on how (i'm guessing it's pretty simple). need special software? i figured out needed connect through mtscs server

[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied -

i have sql server 2008 r2 installed. running fine unless wifi got disconnected. desktop application unable find sql server , throwing error message "[dbnetlib][connectionopen (connect()).]sql server not exist or access denied." my application , sql server in same machine. have my protocols enabled , have disabled firewall. wondering why sql server unreachable when wifi gets turned off? check link i went surface area configuration , set remote connections both tcp/ip , named pipes , restarted server.

python - Converting number in scientific notation to int -

could explain why can not use int() convert integer number represented in string-scientific notation python int ? for example not work: print int('1e1') but does: print int(float('1e1')) print int(1e1) # works why int not recognise string integer? surely simple checking sign of exponent? behind scenes scientific number notation represented float internally. reason varying number range integer maps fixed value range, let's 2^32 values. scientific representation similar floating representation significant , exponent. further details can lookup in https://en.wikipedia.org/wiki/floating_point . you cannot cast scientific number representation string integer directly. print int(1e1) # works works because 1e1 number float. >>> type(1e1) <type 'float'> back question: want integer float or scientific string. details: https://docs.python.org/2/reference/lexical_analysis.html#integers >>> int("13.3...

git - What is a more efficient and collaborate way of merging branches that has too many commits? -

we medium level organization around 40 developers. have multiple branches different releases simultaneous development. the problem face when merge release-branch on master is, there 2 many commits involved , overwhelming understand changes went in , developer merging branches unable decide chunks let in , not. auto-merged files catching lots of wrong merges. how big companies go doing these merges in more efficient , collaborative way? popular git workflows aware of? create new merged branch , ask developers check/comment if merge happened , merge master? please advice i suggest @ pull requests. they way @ has changed 1 branch and, because can add many approvers wish, many developers can review , comment wherever want, creating discussion changes merged. in experience, used on atlassian stash , nice collaborate on merge. suggest @ this documentation atlassian, part "discussing pull request". pull requests used lot on github, merge contribution fork i...

javascript - How to calculate the centre point of a circle given three points? -

i using javascript , know positions of 3 points. wish use these find out center point of circle. i have found logic (not chosen answer 1 11 upvotes) : https://math.stackexchange.com/questions/213658/get-the-equation-of-a-circle-when-given-3-points but can't seem head around how write logic it. i can't use bounding box way, has done using 3 points :) any ideas ? my favorite resolution : translate 3 points bring 1 of them @ origin (subtract (x0,y0) ). the equation of circle through 2 points , origin can written 2x.xc + 2y.yc = x² + y² plugging coordinates of 2 points, easy system of 2 equations in 2 unknowns, , cramer xc = (z1.y2 - z2.y1) / d yc = (x1.z2 - x2.z1) / d d = 2(x1.y2 - x2.y1), z1 = x1²+y1², z2 = x2²+y2² to translated (add (x0,y0) ). the formula fails when 3 points aligned, diagnosed d = 0 (or small in comparison numerators). x1-= x0; y1-= y0; x2-= x0; y2-= y0; double z1= x1 * x1 + y1 * y1; double z2= ...

scala - Slick Plain SQL Query with Dynamic Conditions -

i'm struggling on appending additional conditions query. in simplest form, need below: def findpeople(name: string, maybesurname: option[string]) = { val sql1 = sql"select * my_table name = $name" val sql2 = maybesurname.map( surname => sql"and col2 = $surname" ).getorelse(sql"") val finalsql = sql1 + sql2 // need kind of feature ... ... } using #$ option, surname wouldn't bind variable, big issue. here sample test on slick 3.1.x import slick.jdbc.{sqlactionbuilder, setparameter, positionedparameters} object slickkit { implicit class sqlactionbuilderconcat (a: sqlactionbuilder) { def concat (b: sqlactionbuilder): sqlactionbuilder = { sqlactionbuilder(a.queryparts ++ b.queryparts, new setparameter[unit] { def apply(p: unit, pp: positionedparameters): unit = { a.unitpconv.apply(p, pp) b.unitpconv.apply(p, pp) } }) } } } and then import slickkit._ v...

Why Associations are Magnitudes in Smalltalk? -

i haven't checked many dialects yet (in pharo association subclass of lookupkey , subclass of magnitude ) presume common. isn't definition counterintuitive? associations take part in unordered collections , don't think smalltalker ever takes account keys sent #<= . know whether inherited old implementations of smalltalk , never bothered challenge, or me missing something. bottomline: has ever used feature? i don't think dictionary needs that; needs = , hash. however, want list of associations , sort them later (eg. show them in sorted list). then, nice have order defined already. and cost "<" method in association (or lookupkey, if superclass), comes free inheriting magnitude instead of object.