Posts

Showing posts from May, 2014

.net - C# callbacks not working -

.net - C# callbacks not working - i'm defining function takes function parameter (using microsoft (r) visual c# 2005 compiler version 8.00.50727.4927) weird error. here's function definition: public managementscope connectcomputerwmi(string computername, string username, string password, action callbackprocessend) {... } and here's error: error cs0305: using generic type 'system.action<t>' requires '1' type arguments i'm not sure type system.action needs. the error message makes doesn't know non-generic action delegate, , reason can think of you're targeting .net 2.0. in .net 2.0, action<t> existed; more versions introduced in .net 3.5, , more in .net 4. edit: i've seen you're using visual studio 2005 - means are targeting .net 2.0. (did have previous version of question specified .net 4? have sworn did...) that's problem... there various solutions. could declare own delegate: p...

Multiple jquery dropdown menus on 1 page -

Multiple jquery dropdown menus on 1 page - i'm new jquery , i'm trying create dropdown menu list on www.teefury.com (mens , woman sizes). came pretty close when click 1 of buttons of them open (or on sec seek first one). questions: does know tutorial can utilize this? what's best way seek , create 1 on own? (i have html & css ready) how create 1 of dropdowns open on click , not of them or first one? this have far: http://users.telenet.be/ezarto/dropdown/ ps: first stackoverflow, please inform me of did wrong :) pss: 1 hyperlink allowed, sorry you'll have copy/paste teefury one use this , tranverse dom nail appropriate list trying show. refactored javascript so. $(function() { $(".dropdown dt a").click(function() { $(this).closest('dt').siblings('dd').find('ul').toggle(); }); $(".dropdown dd ul li a").click(function() { var text = $(this).text(); $(this).closest('dd')....

How to detect encodings on signed integers in C? -

How to detect encodings on signed integers in C? - the iso c standard allows 3 encoding methods signed integers: two's complement, one's complement , sign/magnitude. what's efficient or way observe encoding @ runtime (or other time if there's improve solution)? want know can optimise bignum library different possibilities. i plan on calculating , storing in variable each time programme runs doesn't have blindingly fast - i'm assuming encoding won't alter during programme run :-) you have check low order bits of constant -1 -1 & 3 . evaluates for sign , magnitude, for one's complement and for two's complement. this should possible in preprocessor look within #if #else constructs. c signed twos-complement ones-complement

actionscript 3 - AS3 / AIR - Creating a plain text file? -

actionscript 3 - AS3 / AIR - Creating a plain text file? - is possible create plain text file as3 or air? example: create plain text file named "mytextfile.txt", have contain text reads "this text file." , save desktop. another alternative have file exist in directory, have rewrite contents - assuming easier. all of should happen background process, without save dialoge panel appearing. var file:file = file.desktopdirectory.resolvepath("mytextfile.txt"); var stream:filestream = new filestream(); stream.open(file, filemode.write); stream.writeutfbytes("this text file."); stream.close(); actionscript-3 file air plaintext

c# - Algorithm uniform distribution of elements in the matrix -

c# - Algorithm uniform distribution of elements in the matrix - i need generate tasks in month of date of random uniform distribution. example, 10 people 10 tasks dates spaced not less 2 days. weekends , holidays not used. uniform random distribution of elements in multiplicity additional status multiplicity - people x dates of month. suggest, can watch algorithm. in general decided somehow. however, must say, decision not like, nil improve not think. parameters follows: taskspermonth - number of jobs per month, distancebetweentasks - minimum distance between 2 adjacent jobs, istasksinweekend - take business relationship whether or not weekend, minday - starting day (for various reasons, may not first day of month), listofdays - empty, holidays - list of days off , holidays, workdaysinmonth - list of working days, random - empty random (). rest, think, in principle, clear, function code shown below optimizationthedistributionoftasks public void generaterandomta...

node.js - How asynchronous functions work in nodejs internally -

node.js - How asynchronous functions work in nodejs internally - i want understand, how asynchronous functions work in nodejs internally. suppose, want read file filesystem: fs = require('fs') fs.readfile('/etc/hosts', 'utf8', function (err,data) { if (err) { homecoming console.log(err); } console.log(data); }); what going on, when phone call fs.readfile(...)? or, in words, how v8 interpreter interacts operating scheme (filesystem), when phone call fs.readfile(...)? how v8 knows, file reading done, , callback must called? node.js asynchronous

volume rendering - Visible edges from Opengl 3d texture -

volume rendering - Visible edges from Opengl 3d texture - i have encountered visible edges of cube volume rendering of volume data, happens when viewing done @ edges of cube. fyi, artifacts below: rendering artifacts 2 rendering artifacts 2 fyi, fragment shader snippet below(opengl development cookbook): void main() { //get 3d texture coordinates lookup volume dataset vec3 datapos = vuv; vec3 geomdir = normalize((vec3(0.556,0.614,0.201)*vuv-vec3(0.278,0.307,0.1005)) - campos); vec3 dirstep = geomdir * step_size; //flag indicate if raymarch loop should terminate bool stop = false; //for samples along ray (int = 0; < max_samples; i++) { // advance ray dirstep datapos = datapos + dirstep; stop = dot(sign(datapos-texmin),sign(texmax-datapos)) < 3.0f; //if stopping status true brek out of ray marching loop if (stop) break; // info fetching reddish channel...

c - Absolute Jumps Within Shared Object Code Unix -

c - Absolute Jumps Within Shared Object Code Unix - i have question regarding handling , interpretation of shared libraries. suppose, build shared object foo.c using command: gcc -shared -fpic -o libfoo.so foo.c where foo.c consists of: #include <stdlib.h> #include <stdio.h> int main(void) { int i; printf("this silly test\n"); if(i) goto ret; printf("hello world\n"); ret: homecoming 0; } now, let's @ objdump output, of foo's main: 0000000005ec <main>: 5ec: 55 force %rbp 5ed: 48 89 e5 mov %rsp,%rbp 5f0: 48 83 ec 10 sub $0x10,%rsp 5f4: 48 8d 3d 6b 00 00 00 lea 0x6b(%rip),%rdi # 666 <_fini+0xe> 5fb: e8 00 ff ff ff callq 500 <puts@plt> 600: 83 7d fc 00 cmpl $0x0,-0x4(%rbp) 604: 75 0e jne 614 <main+0x28> 606: 48 8d 3d 65 00 00 00 lea 0x65(%rip...

bash - How can I use multiple pattern in awk? -

bash - How can I use multiple pattern in awk? - i have command this: tac "$log" | awk -v pattern="$var1" '$9 ~ pattern {print; exit}' it prints lastly line if $9 equals $var1 . i need utilize "and" , "or" multiple patterns this: print if $9 ~ pattern , (if $9 ~ pattern2 or if $9 ~ pattern3) how can utilize awk this? tac "$log" | \ awk -v pat1="$p1" \ -v pat2="$p2" \ -v pat3="$p3" \ '$9 ~ pat1 && ($9 ~ pat2 || $9 ~ pat3) { print; exit }' however if don't need pass in patterns outside, can of in regexp: awk ... '$9 ~ pat1 && $9 ~ /pat2|pat3/ { print; exit }' bash awk

selenium - Is there any way with DevExpress to explicitly set the IDs of objects? -

selenium - Is there any way with DevExpress to explicitly set the IDs of objects? - i testing new web page beingness developed devexpress. object ids (html ids) come out random strings no tie identifying. ie: class="dxm-content dxm-hastext dx " href="/cr/sdpersonellhomepage" id="headermenu_dxi0i0_t" style="float: none;"> span class="dx-vam">summary page /span>/a> is there way tell devexpress give object more meaningful id? or add together parameter can utilize give readability our test artifacts? with watir can utilize regular expressions match attributes if pattern unique. it's slower exact string, much more flexible. example: browser.link(id: /headermenu_\w{6}_t/) browser.link(id: /headermenu_\w{6}_t/, class: 'dx-vam') browser.link(id: /headermenu_\w{6}_t/, class: /^dx/) browser.link(id: /^headermenu_/, href: /personellhomepage$/) selenium devexpress watir web-testing...

"newp" function in Matlab -

"newp" function in Matlab - in illustration have found function net = newp([-2 2;-2 +2],1); i have looked @ help newp , says: net = newp(p,t,tf,lf) takes these inputs, p - rxq matrix of q1 representative input vectors. t - sxq matrix of q2 representative target vectors. tf - transfer function, default = 'hardlim'. lf - learning function, default = 'learnp'. does mean perceptron has 2 inputs , expects 1 output? first send -2 , -2, expect receive 1 , sends 2, 2 , expects 1? your perceptron has 1 input has 2 elements. each input element has range [-2 2] since specified same rows [-2 2] matrix p. there 1 output. sec argument number of neurons. you utilize defining input , target vectors. perceptron input 2xn element matrix n number inputs each input having 2 elements. output n element vector. example, p = [0 0 1 1; 0 1 0 1]; t = [0 0 0 1]; net = newp([-2 2;-2 +2],1); net = train(net,p,t); y = n...

pandas - Python: "Squeeze" a particular plot in subplot -

pandas - Python: "Squeeze" a particular plot in subplot - below, plot next figure in python: as can see plot on right much more "smooth" 1 on left. that's because scaling of x-axis on both plot different. more observations on left on right (about 3 times more). hence how can "squeeze" horizontally right plot such approximative 1 of left? below code (i utilize pandas): fig, axes = plt.subplots(1, 2, sharey=true, figsize=(30, 15)) # plot same info on both axes #gs = gridspec.gridspec(1, 2, width_ratios=[3, 1]) ax1 = df1.plot(ax=axes[0], grid='off', legend=false, xticks=[-250, -200, -150, -100, -50, 0, 25], lw=2, colormap='jet', fontsize=20) ax2 = df2.plot(ax=axes[1], grid='off', legend=false, xticks=[-5, 0, 20, 40, 60, 80], ...

Simple IF Statement in MySQL isn't working -

Simple IF Statement in MySQL isn't working - i have table columns id , name . start transaction; update test set name='test' id=1; select row_count() @affected_rows; if (@affected_rows > 0) commit; else rollback; end if it seems returning error you have error in sql syntax; check manual corresponds mysql server version right syntax utilize near 'if (affected_rows > 0) commit' @ line 1 0 secs currently running mysql 5.6.22 first, if command flow look allowed in programming blocks -- stored procedures, triggers, , functions. second, logic doesn't create sense. if no rows affected, there no need rollback transaction. to point out documentation: the if statement stored programs implements basic conditional construct. the term "stored programs" means programming block. don't confuse if mysql function if() , can used in query. mysql

.net - MVC site when on web server, only can access home page -

.net - MVC site when on web server, only can access home page - i have little mvc site (only few controllers , views) works fine when running locally. when publiush site web server there issues. home page log in screen displayed, if effort log in past page comes 404 errors , pages not beingness able found. i thought because on web server have in subfolder called "file upload" web browser trying go fileupload/controller/action instead of controller/action. however, after messing manually putting in location still 404 errors. this isn't issue version of mvc have seen mentioned elsewhere. i'm not sure other info give have no thought causing this. ideas appreciated. have enabled windows authentication ? if yes, hosted environment can access active directory? [authorize] attribute authenticated access , permissions on folders points begin investigation .net model-view-controller deployment webserver

Abaqus Python script & Really Simple GUI interface syntax issues -

Abaqus Python script & Really Simple GUI interface syntax issues - i've been running python scripts in abaqus quite time now. so delighted find simple gui builder (rsgb), or until tried utilize it! the kernel script i'm using mature piece of code thought prime candidate test out in rsgb. all needed doing (or thought) matching widget inputs variables in kernel function. but unexplainable reason abaqus declares have syntax error on function declaration line, see if can spot it? def setup( modname, target, radmax, radmin, vx, vy, vz, hght, wdth, zlen, numsphere ): the error, syntaxerror:('invlid syntax',('.\rigidpyticle.py',22,86,'def setup( modname, target, radmax, radmin, vx, vy, vz, hght, wdth, zlen, numsphere )\n')) i should add together have checked indents & variables sent gui match in kernel function. kernel function same piece of code has been functioning outside rsgb framework when run using abaqus cli am missing ...

javascript - jquery scroll to element not working - scrolls to random places -

javascript - jquery scroll to element not working - scrolls to random places - there many stackoverflow questions regarding couldn't find answer. have javascript code: $(function() { $('a[href*=#]:not([href=#])').click(function() { $('html,body, .main').animate({ scrolltop: $(this.hash).offset().top - 10 }, 1000); }); }); and html code: <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>test</title> <meta name="viewport" content="width=device-width,initial-scale=1"> <!--[if gt ie 8]><!--><link rel="stylesheet" href="styles.css"><!--<![endif]--> <link rel="stylesheet" href="common.css"> <script src="responsive-nav.js"></script> <script src="//code.jquery.com/jquery-1.10.2.js"...

sqlite - Set Spinner value based on database record in android -

sqlite - Set Spinner value based on database record in android - i pulling info database , populating series of edittexts , spinners data. i can fill edittexts without issue spinners resetting default values. i have tried using setselection() doesn't work. here code: spinner = (spinner) rootview.findviewbyid(r.id.vehicle); arrayadapter<string> adapter = new arrayadapter<string>(getactivity(), android.r.layout.simple_spinner_item, new string[] {"car", "bus", "plane", "bicycle"}); adapter.setdropdownviewresource(android.r.layout.simple_spinner_dropdown_item); spinner.setadapter(adapter); spinner.getonitemselectedlistener(); spinner = (spinner) rootview.findviewbyid(r.id.category); arrayadapter<string> adaptercategory = new arrayadapter<string>(getactivity(), android.r.layout.simple_spinner_item, new string[] {"vacation...

how to read line 17 only from text file using batch -

how to read line 17 only from text file using batch - i have write batch script have read contents line 17 , save variable.i used skip eliminate first 16 lines clueless of how eliminate lastly 5 rows ie line 18 line 22. please find piece of code below: for /f "skip=16" %%g in (abcd.txt) set "variable=%%g" could please suggest me how read contents line 17 you can add together goto leave for-loop. for /f "skip=16" %%g in (abcd.txt) ( set "variable=%%g" goto :leaveloop ) :leaveloop batch-file

Rails 3 using fields_for in view doesn't work -

Rails 3 using fields_for in view doesn't work - i'm trying implement master detail in rails form fields_for. i have 1 model called recipe: class recipe < activerecord::base validates :name, :presence => true validates :directions, :presence => true has_many :recipe_ingredients end and 1 model called recipeingredient: class recipeingredient < activerecord::base belongs_to :recipe #belongs_to :ingredient end in new controller populate ingredients 3 empty records this: def new @recipe = recipe.new 3.times {@recipe.recipe_ingredients.build} # @ingredients = recipeingredient.new respond_to |format| format.html # new.html.erb format.xml { render :xml => @recipe } end end what in view output recipes fields (which works ok) , 3 fields recipe ingredients. in top part of view have this: <%= form_for :rec |f| %> i list recipe fields displayed correctly, like: <div class="fie...

workflow - How can I safely use git rebase when working on multiple computers? -

workflow - How can I safely use git rebase when working on multiple computers? - i work on same project on 2 different computers, desktop , laptop. need transition between them while in middle of task/feature. so want create commit on laptop, , transport (push/pull) desktop , continue. then, when feature finish want create new commit , crush half-done commit. how can pull/push laptop without confusing history? what's proper way of handling this? after doing this, must able publish commits. i'm working on master branch directly, if working on separate branch helps that. i know how utilize git rebase -i, , have used few times while still on same computer without problem, reply not have include details of git rebase/squash. i time , utilize next workflow, using github authorative master repository when i'm not sitting @ given computer: when leave computer always git force -f when arrive @ computer do git fetch -v git reset --hard origin...

database - Update Drupal Application with an external DB script -

database - Update Drupal Application with an external DB script - i’m trying update drupal application external script writing straight in mysql db, need modify 1 field of 1 specific datatype. see in table named field_data_field_fieldname when update application doesn’t change. need modify else? thanks assuming trying alter field's value, seek modifying both field_data_field_fieldname , field_revision_field_fieldname, clear cache. note not need clear cache if know need clear, e.g. clear field's value particular node, can utilize cache_clear_all('field:node:[your nid here]', 'cache_field'); if trying alter more field's value, suggest through field api. database drupal

node.js - Create/Update multiple records with one request in Sails.js -

node.js - Create/Update multiple records with one request in Sails.js - i know best practice create/update multiple records in 1 request. know can using promise.all(). if want tell client records succeeded , failed? for example, user post like: { departmentid: 1, students: [ {name: 'john', studentid: 123}, {name: 'mike', studentid: 124}, ] } and current solution is: studentcontroller: var departmentid = req.param('departmentid'); var poststudents = req.param['students']; var department; var failedrecords = []; department.findone() .then(function (_department) { section = _department; var students = []; while (poststudents.length) { var pupil = poststudents.pop(); student.department = departmentid; var s = student.create(s) .then(function(s){return s;}) .catch(functio...

php - have Restler method return a Content-Disposition header -

php - have Restler method return a Content-Disposition header - in 1 of methods possible specify specific content-type , content-disposition? after getting info i'm doing this: class="lang-js prettyprint-override"> return scope::get('csvformat')->encode($data); and info returned in csv format. want set content type text/csv , set content-disposition allows file download, instead of showing content. here working example! in excel.php <?php class excel { /** * download csv info can rendered excel * * @return array * @format csvformat * @header content-disposition: attachment; filename="excel.csv" */ public function download() { //csv compatible array $data = [['name' => 'john doe', 'age' => '23'], ['name' => 'mika', 'age' => '45']]; homecoming $data; } } your index.p...

regex - How do I get data from below service response using regular expression extractor in Jmeter? -

regex - How do I get data from below service response using regular expression extractor in Jmeter? - how info below service response using regular look extractor in jmeter? extract token id: <validateuserresponse xmlns="http://tempuri.org/"><validateuserresult xmlns:a="http://schemas.datacontract.org/2004/07/isos.medtrack.mobile.entity" xmlns:i="http://www.w3.org/2001/xmlschema-instance"><a:errorkey i:nil="true"/><a:errormessage i:nil="true"/><a:systemid>0</a:systemid><a:type>0</a:type><a:status>success</a:status><a:isauthenticated>true</a:isauthenticated><a:isdashboardlanding>true</a:isdashboardlanding><a:isemployee>true</a:isemployee><a:ismobileappenabled>true</a:ismobileappenabled><a:ispwdchgrqd>false</a:ispwdchgrqd><*a:tokenid>**9de2dbfbcc94241002f57275e8dc78e60f26baabc05c1eebe39088d02e6e454f***...

jquery - How to hide JqGrid search operators dropdown? -

jquery - How to hide JqGrid search operators dropdown? - i need hide search operators dropdown in search dialog of jqgrid control. please tell me how done? please see image below thanks, see wiki: single field searching e.g: class="snippet-code-js lang-js prettyprint-override"> $(s4list).jqgrid('searchgrid', { multiplesearch: true, aftershowsearch: function () { var dialogid = $('#fbox_' + this.id); dialogid.find('.operators').hide(); console.log(this) } }) also afterredraw function:this function if defined lunched every time filter redrawed - filter redrawed every time when add together or delet rules or fields tio function pass search parameters parameter jquery jqgrid

output - error in outputting information c programming -

output - error in outputting information c programming - this programme works how want there 1 bug. doesn't convert euro dollar, gives me 0.0 euro = 0.0 dollars; can guys help me please? #include <stdio.h> #include <stdlib.h> void dollar(float dollar); int main() { char what; int howmany; int i; float dollar2; float euro2; printf("enter how many times want convert\n"); scanf(" %d", &howmany); printf("enter u if want convert usd euro\n"); printf("enter e if want convert euro usd\n"); for(i=0; i<=howmany-1; i++) { scanf(" %c", &what); if(what == 'e') { printf(" come in how many euros want convert\n"); scanf(" %f", &euro2); euro(euro2); } if(what == 'u' ){ printf(" come in how many dollars want convert\n"); ...

sql - I Need some sort of Conditional Join -

sql - I Need some sort of Conditional Join - okay, know there few posts discuss this, problem cannot solved conditional statement on bring together (the mutual solution). i have 3 join statements, , depending on query parameters, may need run combination of three. bring together statement quite expensive, want bring together when query needs it, , i'm not prepared write 7 combination if..else.. statement fulfill combinations. here i've used solutions far, of these have been less ideal: left bring together joinedtable jt on jt.somecol = somecol jt.somecol = conditions or @neededjoin null (this expensive, because i'm performing bring together when don't need it, not evaluating join) outer apply (select top(1) * joinedtable jt jt.somecol = somecol , @neededjoin null) (this more expensive left joining) select @sql = @sql + ' inner bring together joinedtable jt ' + ' on jt.somecol = somecol ' + ...

Selenium--The error message is: table.rows[row] is undefined -

Selenium--The error message is: table.rows[row] is undefined - please see below example. whenever utilize counter in row see below error message: error: command execution failure. please search forum @ http://clearspace.openqa.org error details log window. error message is: table.rows[row] undefined public static string verifylinkedsubmissions(string articletitle){ int rowcount=0; string truestring="submission found"; string falsestring="submission not found"; rowcount=browser.getxpathcount("//table[@id='linkedwithrepeater']/tbody/tr").intvalue(); for(int i=1; i<=rowcount; i++){ string val=selenium.gettable("linkedwithrepeater."+i+".4"); if (val.equals(articletitle)){ log.info("title name "+articletitle+" found"); homecoming truestring; } } log.error("title name: "+articletitle+" not found in linked submissions"); homeco...

java - Spring scheduler in multiple server nodes -

java - Spring scheduler in multiple server nodes - i using spring scheduler using cron run task every 5 minutes.now have implemented load balancer 7 websphere nodes. , since there delay while publishing application 7 nodes,the scheduler job not running @ same time in nodes.how can create sure nodes run scheduled job @ same time(all nodes having same scheme time) java spring spring-mvc spring-scheduled

MonoDevelop can't resize main window -

MonoDevelop can't resize main window - can explain me why monodevelop main window not resize bellow lower width , height? normal? bug? ps: on mac, version 4.0.1 monodevelop

javascript - Passing multiple form data to PHP controller -

javascript - Passing multiple form data to PHP controller - $('#save').on("click", function() { //collect form info while iterating on inputs var info = []; $('[name=form]').find('input, select, textarea').each(function() { if ($(this).attr('value') != '') { var name = $(this).attr('name'); var value = $(this).attr('value'); data[name] = value; } }) (var = 1, ii = form.length; < ii; i++) { var name = 'form' + i; $('[name=' + name + ']').find('input, textarea').each(function() { data[i] = []; if ($(this).attr('value') != '') { var name = $(this).attr('name'); var value = $(this).attr('value'); data[i][name] = value; } }) } $.post('foo', data, function(da...

reporting services - How to migrate reports (RDL files) from SQL Server 2008 R2 to 2012? -

reporting services - How to migrate reports (RDL files) from SQL Server 2008 R2 to 2012? - we have sql server 2008 r2 server reporting services more 200 reports. for migration purpose have installed sql server 2012 reporting services on new server. have published same rdl reports new server , have terrible performance results. reports working takes 10times longer sql server 2008 r2. we think these performance troubles can caused fact rdl files 2008 r2 based. how can migrate these reports sql server 2012 ? and/or how can troubleshoot these performance problems ? [update] after investigations, i've found performance problem not related reports. reports generated asp.net application phone call render2 method of reportexecution2005.asmx web service. if phone call method production front end web server phone call takes more 1 minute, if phone call exact same method same web service hosted on same reporting services dev machine, phone call takes few seconds. that's...

overwrite switch condition to something else -

overwrite switch condition to something else - im making game , im trying create area area impassible if dont utilize item (key guess). want rewrite switch condition movefunction () { switch(action) case "east": if (maplocation == 7) { gamemsg = "you cannot pass"; } } useitem() { switch(item) { case "key": if (maplocation == 7) { gamemsg += may pass! //what can write here create area passible? had was: /* switch(action) { case "east": maplocation += 1; break; } */ } } } yea how far got cant manipulate switch(action) insdie useitem function wont work. switch-statement overwrite

paypal payment standard page in mobile view -

paypal payment standard page in mobile view - in our application paypal site not in mobile view. looks web view , not fit mobile display . need know how create mobile responsive paypal site. please help me out of this. , using paypal payment standards.thanks in advance. mobile paypal

math - Find all lat/long under certain radius -

math - Find all lat/long under certain radius - i have set of lat/long stored in database , have find lat/long database lies between given lat/long(e.g latitude = 37.4224764,and longitude=-122.0842499 ) , given radius(say 5miles).for need add-on , subtraction like: 37.4224764 + 5mile 37.4224764 - 5mile , -122.0842499+5mile -122.0842499-5mile don't know how conversion works here. you're little vague in requirements, want find out coordinates of point distance current location in given direction? or circle of radius of particular distance around coordinates? or draw line of length coordinates point particular distance away? i assume you'd probabaly want utilize geometry spherical library, e.g. var latlng = new google.maps.latlng(geometry.location.lat, geometry.location.lng); var newlatlng = google.maps.geometry.spherical.computeoffset( latlng, 1000, 0 ); see https://developers.google.com/maps/documentation/javascript/geometry#dista...

Android volley unknown constructor -

Android volley unknown constructor - i trying utilize android volley. here code far: jsonobjectrequest getrequest = new jsonobjectrequest(request.method.get, url, null, new response.listener<jsonobject>() { @override public void onresponse(jsonobject response) { system.out.println(response); } }, new response.errorlistener() { @override public void onerrorresponse(volleyerror error) { system.out.println(error); } } ); and here imports regarding volley: import com.android.volley.request; import com.android.volley.requestqueue; import com.android.volley.response; import com.android.volley.volleyerror; import com.android.volley.toolbox.jsonobjectrequest; import com.android.volley.toolbox.volley; however giving me "cannot resolve constructor" error. ideas? cast null string jsonobjectrequest getre...

android - How to reduce the size of an APK file -

android - How to reduce the size of an APK file - when create new android app using android studio , export apk file, resulting file 914kb in size. did not add together code or resources. how can bring size bare minimum. thanks in advance. update: enabled proguard, brought downwards size 564kb. extracted apk , saw there many drawable folders in apk all these folders contains png files names starting "abc_ic.." . there way exclude them? i think can utilize android proguard tool . proguard tool shrinks, optimizes, , obfuscates code removing unused code , renaming classes, fields, , methods semantically obscure names. result smaller sized .apk file more hard reverse engineer. for more details, please refer here. you can seek remove reference's libary(seem added android-support-v7 project). android apk

Contributing a template to Eclipse via a Plugin to the Java Editor, but should vary based on the context -

Contributing a template to Eclipse via a Plugin to the Java Editor, but should vary based on the context - so wrote plugin contribute template java editor in eclipse using extension "org.eclipse.ui.editors.templates". adds template. that's not want. want replace existing template new one, based on condition. for example, if file name "john.java", within file if type "sysout", want template show rather default one. ideas how might able ? ok. found work around. jdt plugin not offer extension point trying do. got templatestore , modified suit needs. @override public void sessionstarted() { filtertemplates(); } private void filtertemplates() { templatestore = gettemplatestore(); file = getfilethatsvisibleintheeditor(); if (//file name john.java) { deletetemplate(templatestore, "org.eclipse.jdt.ui.templates.sysout"); } else { deletetemplate(templatestore, "com.eclipse.jdt.ui.templates.sys...

yql - Passing Data from variable to JSONP call -

yql - Passing Data from variable to JSONP call - i using yql gather weather info yahoo, yet having problem in passing parameters endpoint. seems trivial task various methods i've tried have seemed fall short. <script> //to gather users response var form = document.queryselector("form"); form.addeventlistener("submit", function(event) { var userzip = form.elements.value.value; event.preventdefault(); form.reset(); }); </script> <script> //makes request yql weather conditions var callbackfunction = function(data) { var status = data.query.results.channel.item.condition; var description = data.query.results.channel.item.condition; var location = data.query.results.channel.location; var currenttemperature = ("current conditions for" + " " + location.city + "," + " " + location.region + ":" + " " + ...

logic - What is wrong in this C code ? If its a logical error please suggest the right way -

logic - What is wrong in this C code ? If its a logical error please suggest the right way - int i; for(i=7;i<6;i--)//loop not execute { printf("*"); } the above code should print 1 * nothing. shouldn'tit run same for(i=7;i<8;i++) ? is logical error ? please help. let's @ loop for( = 7 ; < 6 ; i-- ) i initialized 7 , have status i < 6 , i 7 , , therefor, not satisfy status of loop. so, code not go through 1 iteration of loop. maybe, meant i > 6 c logic

text - Android: SMS Sender Information -

text - Android: SMS Sender Information - i made app can send text messages, want can done anonymously receiver. of course, nsa have original sender's digital thumbprint , all, , these messages hard-coded (which purpose of app), it's controlled environment of messages can sent. the app sends people, give sender's info (so if texted friend, it'll show me due beingness in contact list). how alter phone number nxx-xxx-1234 nxx-xxx-0000 or pre-set value (such app's name)? android text sms anonymous

php - Filter a multidemensional array -

php - Filter a multidemensional array - i have array looks kinda this: array(1) { ["special"]=> array(4) { [0]=> array(2) { ["id"]=> int(1) ["visitors"]=> int(2) } [1]=> array(2) { ["id"]=> int(4) ["visitors"]=> int(5) } [2]=> array(2) { ["id"]=> int(169) ["visitors"]=> int(0) } } } how can filter 'id' value, result looking (if need arrays id = 4): array(1) { ["special"]=> array(4) { [1]=> array(2) { ["id"]=> int(4) ["visitors"]=> int(5) } } } i tried utilize function, doesn't homecoming need: function search($array, $key, $value) { $results = array(); if (is_array($array)) { if (isset($array[$key]) && $array[$key] == $value) { $results[] = $array; } foreach ($array $subarray) { $results = array_merge($results, search($subarray, $key, $value)); } } homecoming $result...

ruby on rails - How to access controller action from production command line -

ruby on rails - How to access controller action from production command line - i have controller action changes status of records in database. want run in production. on local server, can access rails console , => x= welcomecontroller.new => x.method_name on production don't have rails console. can run controller method straight command line? what's preferred way perform kind of task? can move method anywhere in helper etc. keeping such logic in controllers bad practice. should move model or service layer. recommend take @ this article. ruby-on-rails ruby

c# - Dynamic combo box names -

c# - Dynamic combo box names - i'm working c#. want utilize string variables combo box names. suppose, have 3 combo box named box1 , box2 , box3 . want alter properties of these combo boxes. can write: box1.someproperty = somevalue1; box2.someproperty = somevalue2; box3.someproperty = somevalue3; but want within for or while loop. like: string[] names = new string[3] {"box1","box2","box3"}; int[] values= new int[3] {4,5,6}; (int = 0; <= names.length; i++) { ?names[i]?.someproperty = values[i]; } ?name[i]? replaced strings names variable. first post. please forgive errors. if have set of controls know you'll want update, create collection: var comboboxes = new list<combobox> { box1, box2, box3 }; foreach (var cb in comboboxes) { cb.someproperty = somevalue1; } if wanted utilize names, search them in current form's controls collection (assuming winforms... didn't specify): var combobo...

c# - HTTP Header on server side -

c# - HTTP Header on server side - we have build asp web api. authentication done hmac in authorization header. on server side check hmac code , if valid request proceeds resource. our project construction consist of multiple layers. -api- -businesslogic- in businesslogic have linq sql connection. connectionstring dynamic , in api layer. best way pass connectionstring businesslogic ? came thought of adding header connectionstring in it. specific header system.web.httpcontext.current.request.headers. works safe ? you should seek me more clear because question doesn't exclusively makes sense me. "this connectionstring dynamic , in api layer" do mean store somewhere in web.config / app.config of web api project? " best way pass connectionstring businesslogic ?" do want pass web api project class of "businesslogic" project? advise appsettings of business logic (will inherit 1 of web api project). configurationmanager.connecti...

android contact api calling again and again -

android contact api calling again and again - i'm trying sync contact in local database noticed contact observer running whether contact updated or not. it's calling 1 time again , again, can 1 help me resolve issue. i'm posting here contact observer class. public class contactservice extends service { private int mcontactcount; @override public ibinder onbind(intent arg0) { homecoming null; } @suppresslint("newapi") @override public void oncreate() { super.oncreate(); seek { monkeygapdbmanager.initializeinstance(new monkeygapdbhelper( getapplicationcontext()), getapplicationcontext()); this.getcontentresolver().registercontentobserver( contactscontract.contacts.content_uri, true, mobserver); mcontactcount = getcontactcount(); log.d("contact service", mcontactcount + ""); } grab (exception e) { e.printstacktrace(); } } private int ...

c# - send arabic letter to serial port -

c# - send arabic letter to serial port - i utilize datamax printer , send serial port c# software print standard arabic in labels code serialport1.portname = "com1"; serialport1.baudrate = 9600; serialport1.open(); //serialport1.encoding = encoding.getencoding("windows-1256"); serialport1.encoding = encoding.ascii; serialport1.write("\x02" + "l" + "\x0d"); serialport1.write("d12" + "\x0d"); serialport1.write("h20" + "\x0d"); string test_arab = "الحملله"; serialport1.write("190000202600010 " + test_arab + "\x0d");//text //serialport1.write("b" + test_arab + "\x0d"); serialport1.write("q" + ' ' + test_arab + "\x0d"); serialport1.write("e" + "\x0d"); serialport1.close(); the result in labels "???????" how can print stan...

html - AngularJS Ng-repeat vs performance -

html - AngularJS Ng-repeat <div> vs <ul> performance - basically want know if there performance difference using ul instead of div when i'm using ng-repeat you can give @ angular source code, $compile apply on $element, angular not care html tag. here code looking : https://github.com/angular/angular.js/blob/master/src/ng/directive/ngrepeat.js#l323 as can see, no specific utilize of $element in code. question more oriented on browser behaviors, little bit more complexe questions complexe. just utilize 1 sense more adapted content. have fun. html angularjs performance

send data through WIFI and 3G in android -

send data through WIFI and 3G in android - i know if possible forcefulness android application send info through wifi/3g. also, possible access wifi signal? not really, when android connects wifi, disconnects 3g. can check which network type connected , decide whether communicate or not. android

c++ - Size of pointer to member function varies like crazy -

c++ - Size of pointer to member function varies like crazy - got subtle problem. got class compiled ms vs 2013 c++ compiler, 32 bit platform has size of 4 bytes. function pointer has sizeof 4 bytes. when class compiled same compiler included different project produce library, targeted fo 32 bit platform, class has *m_function pointer occupy 16 bytes! of course, when i'm instantiating class main project thinks class occupies 4 bytes , allocates memory size, while in reality occupies 16 bytes , causes memory overruns. class cc1 { public: cc1(); void (cc1:: *m_function) (); }; i know size of pointer-to-member function can vary. qustion - compiler setting controls this? don't care 4 or 16 bytes - need them same. struct fellow member alignment settings same both projects. /vmm /vmg options? no mention of them in compiler settings in both projects. by way, tried building x64 target , in case sizeof *m_function 8 bytes, main , libray proje...

Avro (Microsoft) Serialization of derived type members missing -

Avro (Microsoft) Serialization of derived type members missing - i evaluating performance of microsoft's implementation of avro, , @ first thought getting phenomenal performance until realized wasn't serializing entire message ;-) in next there simple hierarchy of messages decorated [datacontract] (a base of operations , 2 derived types). members decorated [datamember] attribute. create serializer base of operations message type , serialize list of derived messages, appears serialize/deserialize base of operations class members. of derived message members missing result. am missing something? application require mixed message types. fwiw don't see strings sec derived type in binary file, suspect derived type members aren't beingness serialized. thanks, greg class programme { [datacontract(name = "sidetype", namespace = "avromessage")] public enum eventtype { unknown = 0, 1 = 1, 2 = 2 ...

mysql - Password hash being changed on database entry php -

mysql - Password hash being changed on database entry php - using password_hash() , hash password , store in db, not pass password_verify. tried testing functions out running word through them outside of database, worked fine. and, if hash word, manually set in database, works fine in login. but, when come in hash database via code/sql...something apparently happening hash @ point , making unusable (from can tell). can't figure out what. checked table..that seems fine, varchar(255) utf8_bin. using codeigniter framework. codeigniter escapes it's inserts unless set below , utilize false - did not work. function register($data){ $this->db->set($data, false); $this->db->set('word_of_passing', $data['word_of_passing'], false); $this->db->insert('cred'); } this did not work - function register($data){ $this->db->query('insert cred (user_name, word_of_passing) values ("'.$data['user...

android - ARC Welder app showing blank page on startup -

android - ARC Welder app showing blank page on startup - i using google chrome version 41.0.2272.118 (64-bit) in ubuntu 14.04.1. installed arc welder extension chrome web store. when opened it, shows blank window.. i tried install apk files using drag , drop method.. it's failed.. now how install android apps using arc welder? i had same thing , shivaraj's comment mentioning 'archon custom runtime' gave me tip. i'd forgotten i'd installed removed chrome, re-installed arc welder , loads without issue. android linux ubuntu-14.04 google-chrome-arc

Writing and then Calling a C++ DLL from Excel VBA -

Writing and then Calling a C++ DLL from Excel VBA - i using visual studio 2010 write 32 bit dll in c++ intend phone call excel vba. the c++ cpp file contains this: #include "windows.h" #include "stdafx.h" int _stdcall fngetdata (const lpcstr sometext) { messageboxa(0, sometext, "wizzle wuzzle", mb_ok | mb_iconinformation); homecoming 42; } while def file has this: library getpdata exports getdata=fngetdata the excel vba this: alternative explicit private declare function getdata lib "getpdata.dll" (byref sometext string) integer public sub passsometext() dim ret integer, sometext string sometext = "hello excel subroutine." ret = getdata(sometext) end sub the code compiles fine, , produces dll. when phone call function in dll excel vba, text in messagebox garbled nonsense: i seeing text representation of pointer? how text value excel v...

javascript - Ace Editor and entity encoding/decoding -

javascript - Ace Editor and entity encoding/decoding - i have searched across entire so. similar or exact topic , couldn't find *(or didn't saw) topic on issue that's bothering me. if duplicate, , solution exists, take apologies. currently working on cms application uses both codemirror , ace editor, either 1 or one, , depends on user/operator preference 1 going fired 1 time when particular document loaded. with codemirror, have no issues @ all. works expected. codemirror loading files via php's file_get_contents() straight textarea, while ace loading contents via ajax (current application nature demands so) , issue bothers me 1 single operator/character : & i have checked methods wrote in backend , there no single sanitize method or function or preg or whatever.. implemented. the thing beingness sanitized me personally, on backend side textarea tag, beingness wrapped within comment, , unwrapped 1 time again upon saving file php/html. ace -aggr...