Posts

Showing posts from July, 2015

c# - Units in [Location1].DistanceTo[Location2] -

i have been trying find out unit .distanceto gives me. the articles related far mention geounits, no further explanation using elapsed time, , 2 locations calculating speed device going. i'm not sure how result distance=location1.distanceto(location2); in km, or other metric unit. have use metric app. any solving or guiding me toward solution helpful. according developer documentation method returns distance in metres. returns approximate distance in meters between location , given location. so in kilometres, divide result 1000: float distanceinmetres = location1.distanceto(location2); float distanceinkilometres = distanceinmetres / 1000;

vb.net - How to export/import data from/to datagridview to a Excel file? -

i using microsoft office 2007 , visual studio 2010 . i want save data of datagridview excel file once click button on windows form. also want load data excel file datagridview clicking button. pls help...i new vb unable write code. plsss help.. this rather big question , there's number of solutions. 1) writing excel.. there 3 common ways this, 1) write data out csv format , excel happily read it. 2) use excel interop create workbook , write work sheet it. requires excel installed , 3) use oledb create excel. 2) reading excel... again can use excel interop read excel workbooks , again need excel installed, , can use oledb read excel files. there other ways, these commonly used ones. on balance approach using oledb in first instance , there's lots of examples on stackoverflow on how read , write excel. if need access of excel's formatting or charting facilities need interop. it's relatively easy use , again there's lots of examples of how

ms access - Exporting Recordset to Spreadsheet -

just getting grips vba (this stuff's new me bear us!) from query contactdetails_surveysoftoutcomes , i'm trying first find list of unique values in deptname field in query, hence rsgroup dim storing grouped query on deptname field. i'm going use grouped list way of cycling through same query again, passing through each unique entry filter on whole recordset , export each filtered recordset own excel spreadsheet... see do while not loop. my code's tripping on docmd.transferspreadsheet ... rsexport part. i'm bit new this, guess dim name rsexport recordset isn't accepted in method..? is there easy fix code i've started or should using different approach achieve this? code : public sub exportsoftoutcomes() dim rsgroup dao.recordset dim dept string dim mypath string mypath = "c:\myfolder\" set rsgroup = currentdb.openrecordset("select contactdetails_surveysoftoutcomes.deptname " _ & "from contactdetails_surve

php - Propel: Get Raw SQL from Query object? -

how raw sql statement query object in propel? need debugging purposes. for example: have function in $rawsql = new bookquery::create()->filterbyid(25)->getrawsql(); does exist? yes; you're after tostring method criteria parent class: $rawsql = (new bookquery)::create()->filterbyid(25)->tostring(); as @jakerella says, specific values use filtering bound database engine, rather propel, , you'll see structure of query not executed. if want see that, can check database query logs, if they're enabled.

jquery - Add event handler when checkbox becomes disabled -

is there way add event handler (like .on('change' ..) checkbox when becomes disabled? i tried (see jsfiddle ), not fire when disable checkbox: $('#mycb').on('change', function() { console.log('checkbox disabled? ' + $('#mycb').is(':disabled')); }); $('#mycb').prop('disabled', true); // not trigger function above edit: want add logic checkbox because in application don't know when checkbox might become disabled. the simplest way should be: $('#mycb').prop('disabled', true).triggerhandler('change');

animation - Unity - GetCurrentAnimatorStateInfo () returns null after a scene is destroyed then relaoded -

i having issue unity animation controller. controller working when scene first loaded. scene destroyed , when loaded again receive nullreferenceexception at: (wrapper managed-to-native) unityengine.animator:getcurrentanimatorstateinfo (int) the animation controller appears present character controlling in default idle state , moving. has had similar issue?

ios - UICollectionView performance - _updateVisibleCellsNow -

Image
i'm working on custom uicollectionviewlayout displays cells organized day/week/month. it not scrolling smooth, , looks lag caused [uicollectionview _updatevisiblecellsnow] being called on each rendering loop. performance ok < 30 items, @ around 100 or more, terribly slow. limitation of uicollectionview , custom layouts, or not giving view enough information perform correctly? source here: https://github.com/oskarhagberg/calendarcollection layout: https://github.com/oskarhagberg/calendarcollection/blob/master/calendarheatmap/ohcalendarweeklayout.m data source , delegate: https://github.com/oskarhagberg/calendarcollection/blob/master/calendarheatmap/ohcalendarview.m time profile: update maybe futile? testing plain uicollectionviewcontroller uicollectionviewflowlayout given approximately same amount of cells/screen results in similar time profile. i feel should able handle ~100 simple opaque cells @ time without jitter. wrong? also don't f

How to replace a particular string with value in java -

edit : goal : http://localhost:8080/api/upload/form/test/test is possible have thing `{a-b, a-b..0-9}` kind of pattern , match them , replace value. i have following string http://localhost:8080/api/upload/form/{uploadtype}/{uploadname} there can no of strings {uploadtype}/{uploadname} . how replace them values in java? [edited] apparently don't know substitutions you'll looking for, or don't have reasonable finite map of them. in case: pattern subst_patt = pattern.compile("\\{(\\w+)\\}"); stringbuilder sb = new stringbuilder( template); matcher m = subst_patt.matcher( sb); int index = 0; while (m.find( index)) { string subst = m.group( 1); index = m.start(); // string replacement = "replacement"; // .. lookup subst -> replacement here sb.replace( index, m.end(), replacement); index = index + replacement.length(); } look, i'm expecting +1 now. [simpler approach] string.replace() '

css3 - Create a gradient for an image -

Image
i've following image , trying create gradient that. i'm beginner gradient learning please me css image. work more appreciated. how this? demo background: #2ea2f5; background: -moz-linear-gradient(top, #2ea2f5 0%, #2ea2f5 50%, #0089f3 50%, #0089f3 100%); background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#2ea2f5), color-stop(50%,#2ea2f5), color-stop(50%,#0089f3), color-stop(100%,#0089f3)); background: -webkit-linear-gradient(top, #2ea2f5 0%,#2ea2f5 50%,#0089f3 50%,#0089f3 100%); background: -o-linear-gradient(top, #2ea2f5 0%,#2ea2f5 50%,#0089f3 50%,#0089f3 100%); background: -ms-linear-gradient(top, #2ea2f5 0%,#2ea2f5 50%,#0089f3 50%,#0089f3 100%); background: linear-gradient(to bottom, #2ea2f5 0%,#2ea2f5 50%,#0089f3 50%,#0089f3 100%); filter: progid:dximagetransform.microsoft.gradient( startcolorstr='#2ea2f5', endcolorstr='#0089f3',gradienttype=0 ); if want create more gradients, refer source, make life much easier

asp.net - C# Response.Write CSV file not splits the cells -

i have code: context.response.clearheaders(); context.response.addheader("content-disposition", "attachment; filename=clients.csv"); context.response.clearcontent(); context.response.contenttype = "application/ms-excel"; context.response.contentencoding = system.text.encoding.unicode; context.response.binarywrite(system.text.encoding.unicode.getpreamble()); context.response.bufferoutput = false; context.response.buffer = false; foreach (var c in clients) { context.response.output.writeline(string.format("{0},{1}", c.firstname, c.lastname)); } the downloaded file looks fine, except fact row cells merged 1 cell. must use response binarywrite because of hebrew , japan characters in csv/xls content. how write splitted cells csv/xls file binary write? to quote wikipedia : microsoft excel open .csv files, depending on system's regional settings, it may expect semicolon sep

Zero padding/stuffing in matlab -

basicly have array this: [1 2 3 4 5 6] i want have array this: [1 0 2 0 3 0 4 0 5 0 6] so l-1 zeros in array l number of values inside array before 0 stuffing. anyone have idea how solve in matlab? you can try this: a = [1 2 3 4 5 6]; b = zeros(1, 2 * length(a) - 1); b(1:2:end) = a; this results in b = 1 0 2 0 3 0 4 0 5 0 6 a shorter version suggested dan in comments: b(1:2:2 * length(a) - 1) = a;

java - Exception on create JaxWsServerFactoryBean -

i have old maven project , need add clien-server module project. i added dependencies: cxf-rt-frontend-jaxws cxf-rt-transports-http-jetty after created next classes testing: // ihelloworld.java import javax.jws.webparam; import javax.jws.webservice; @webservice public interface ihelloworld { string sayhi(@webparam(name="text") string text); } and // helloworldimpl.java import javax.jws.webservice; @webservice public class helloworldimpl implements ihelloworld { public string sayhi(string name) { system.out.println("sayhello called " + name); return "hello " + name; } } and // server.java import org.apache.cxf.jaxws.jaxwsserverfactorybean; public class server { public static void runserver(){ ihelloworld helloworld = new helloworldimpl(); jaxwsserverfactorybean factory = new jaxwsserverfactorybean(); factory.setserviceclass(ihelloworld.class); factory.setaddress("http://localhost:9000/hellowo

asp.net - Web Form Validator Layout Issue -

Image
i have div holds radiobuttonlist 2 values , required field validator. as can see validator wraps next line (circled). trying display next radiobuttonlist (where red dot is). no matter remains on next line. i have made cell wider no effect. have set display dynamic, no effect. other controls on form (textboxes & drop downs) validator displays correctly 1 wont. same in design mode when run app. on radiobuttonlist set repeatdirection flow. fixed problem.

android - Custom Adapter getView() method is not called -

here code of fragment in setting custom adapter list. there no errors listview empty. have implemented getcount() returns right number of items in arraylist. don't see ("inside", "getview") in logcat fragment public class servicecarlistfragment extends fragment { private string url; private arraylist<cardetail> cardetaillist = new arraylist<cardetail>(); private carlistadapter adapter; private listview mlist; @override public void oncreate(bundle savedinstancestate) { // todo auto-generated method stub super.oncreate(savedinstancestate); url = getactivity().getintent().getstringextra("url"); new downloadcardetail().execute(url); } @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { // todo auto-generated method stub view v = inflater.inflate(r.layout.fragme

android - Canvas animation slows down -

i creating custom view arc of 45% rotates around circular image. have achieved this, animation slows down animation proceeds , after sometime stops, can 1 me out problem same, here's code public class glowcircle extends imageview { private context context; private paint paintbitmap,paintring; private bitmap imagebitmap; private path path; private int width,height; private float radius; private rectf oval,dst; private string tag="glowcircle"; private int i=0; private float strokewith; private float strokemultiplier=1/10f; // constructors public glowcircle(context context) { super(context); initview(context); } public glowcircle(context context, attributeset attrs) { super(context, attrs); initview(context); } public glowcircle(context context, attributeset attrs, int defstyle) { super(context, attrs, defstyle); initview(context); } // overri

php - can't fetch messages with its commets in chart system -

the following code fetching messages (status) comments mysql database tables chart , comments. problem code dieing when it's returning messages database causing comment field , messages not appear in html page because msg_id didn't match in table commets. can me solve this? or better way can this? sample code note: first have form using create messages bellow code fetch messages commented , return comments bellow message has been commented. <?php //myqsl query select 2 tables chart , comments //this query not returning because script dieing on ch.msg_id=co.comment_id, cant find co.comment_id because has not yet created. $result = mysqli_query($con, "select ch.msg , ch.msg_id , co.comment , co.comment_id chart ch join comments co on ch.msg_id=co.comment_id order ch.msg_id, co.comment_id"); $last_msg = null; while($row = mys

neo4j - How to paginate query results with cypher? -

is possible have cypher query paginated. instance, list of products, don't want display/retrieve/cache results can have lot of results. i'm looking similar offset / limit in sql. is cypher skip + limit + orderby option ? http://docs.neo4j.org/chunked/stable/query-skip.html skip , limit combined indeed way go. using order by inevitably makes cypher scan every node relevant query. same thing using where clause. performance should not bad though.

swing - Java button/gridbaglayout -

is there way either set max size of button(or non re sizable), or not allow columns in gridbaglayout change size if component grows ? i.e btn.setmaxsize(); btn.resizable(false); gridbaglayout.lockcolumns(); this not coding trying achieve. provided. set below 3 properties max value. btnnewbutton.setmaximumsize(new dimension(10, 10)); btnnewbutton.setminimumsize(new dimension(10, 10)); btnnewbutton.setpreferredsize(new dimension(10, 10));

javascript - How to change image using .on click event with 4 button as trigger -

i need guys here. so,here condition. have 4 buttons trigger images, when button clicked have active (i'm 1 - let me know if there better way), scenario: when click on button 2, want "image2" appear (have class="active"). if click on button 3, "image2" fadeout (remove class active) , add class active "image3" lets 4 buttons : <div id="button"> <div class="trigger button-1" data-target="0"></div> <div class="trigger button-2" data-target="1"></div> <div class="trigger button-3" data-target="2"></div> <div class="trigger button-4" data-target="3"></div> </div> and have section images wrapped this: <div id="images-container"> <img src="image-1" class="image1"> <img src="image-2" class="image2"> <im

wpf - How to deploy any module of prism application? -

in application have more 10 modules once publish application using clickonce after want publish modules changes.. not want publish whole application again takes lot of time , load on server .. not know how can achive this... have looked @ http://msdn.microsoft.com/en-in/library/gg405497%28v=pandp.40%29.aspx but doesn't me... we have our modules stored on network share version information , permissions held in database, have small utility app manage , update these modules. when app starts (in bootstrapper) checks modules have permission , versions using shared service (imoduleservice) copies on new or updated dlls local module directory - ready loaded custom implementation of directorymodulecatalog

Best way to represent a UUID in Avro? -

i curious understand best practice encoding 1 specific type of data within avro: uuids. so far, way found defining custom uuid: { "namespace" : "your.namespace", "type" : "fixed", "name" : "uuid", "size" : 16 } i'm using scala, defined implicit conversion between java.util.uuid , custom uuid, it's not of hassle use it.

android - How to use listview and checkbox? -

i have adaptor class getview method follows: public view getview(int position, view convertview, viewgroup parent) { view view = null; if (convertview == null) { layoutinflater inflator = context.getlayoutinflater(); view = inflator.inflate(r.layout.userlist, null); final viewholder viewholder = new viewholder(); viewholder.text2 = (textview) view.findviewbyid(r.id.stuname); viewholder.text = (textview) view.findviewbyid(r.id.rollno); viewholder.checkbox = (checkbox) view.findviewbyid(r.id.cb); viewholder.checkbox .setoncheckedchangelistener(new compoundbutton.oncheckedchangelistener() { @override public void oncheckedchanged(compoundbutton buttonview, boolean ischecked) { model element = (model) viewholder.checkbox .gettag(); element.setselected(buttonview.ischecked()); // toast.maketext(getcontext(), "checked", // toast.length_short).show()

c# - How to add json data to table or jqueygrid -

i using oauth2.0 accessing onhub site uploading , downloading files , creating folders. when getting details of files getting in format {"total_entries":2,"current_page":1,"total_pages":1,"per_page":2,"items":[{"workspace":{"background_color":"white","data_room":false,"default_sort":"alphabetical","default_view":"list","id":330201,"name":"myworkspace","updated_at":"2013-05-02t05:55:02-07:00","root_folder_id":166325721,"owner_id":991101,"is_owner":true,"effective_role":"administrator","audit_trail":true,"require_agreement":false,"agreement_accepted":false}},{"workspace":{"background_color":"white","data_room":true,"default_sort":"alphabetical","default_view&q

django - Separate media server -

Image
i have 1 web server, 1 db server , 1 file server. web , db servers works fine, want place media files (photos, etc) on file server. architecture that: i read this , this , cant find instructions, how this. if has done it, share experiences , code, please :) thanks.

flask - Moved my project dir, where did my dependencies go? -

i moved project directory new location. now, when try , run application locally, receive "importerror: no module named flask" here work flow: $ mv my_project/ ~/new_dir/ $ cd ~/new_dir/my_project $ source venv/bin/activate (venv)$ python my_app traceback (most recent call last): file "my_app.py", line 1, in <module> flask import flask, request importerror: no module named flask i realize path issue, want understand why happens , how fix it. i'm more interested in explanation quick solution. flask still in venv/lib/python2.7/site-packages/ directory, python not finding it. never explicitly added previous location of site-packages path, i'm assuming pip and/or venv did behind scenes magic me. what's going on? thanks!

math - Why can't I get big number libraries for javascript to work? -

looking library work large numbers on javascript (bigger 2^53) checked couple of questions ( javascript large number library? , is there bignum library javascript? ) , tinkered little bit javascript-bignum.js , big.js , thing unable represent odd numbers, since both big(9007199254740995); and schemenumber.fn["string->number"](9007199254740995); return 9007199254740996 rather than 9007199254740995 as expect. so, doing wrong? or there's no way represent large odd numbers? when big(9007199254740995) you not giving bignum library chance! numeric literal first parsed pure js, in number isn't representable. can see with window.alert(9007199254740995); which alerts 9007199254740996 . in order let chosen bignum library represent number, need pass string , example: big('9007199254740995') should exact number, bignum.

java ee - Hibernate one to many:"many" side record's foreign key is updated to null automatically -

i defined 2 entity following 1.booking @entity @table(name="booking") public class booking extends basemodel{ .. @onetomany(cascade=cascadetype.all,fetch=fetchtype.lazy) @joincolumn(name="bookingno") private list<part>parts = new arraylist<part>(); ... 2.part @entity @table(name="part") public class part extends basemodel{ @id @generatedvalue private integer sequence; @column(length=50) private string bookingno; now issue @ first saved 1 booking 2 part,then in view(jsp),i update booking , added new part ,finally save booking again new part create @ second time.if okay,i think in db,it should have 3 part,yes,it have 3 part in db,two saved @ first time , third part saved @ second time.but make me surprised first 2 part's foreign key "bookingno" updated null. using hibernate's saveorupdate api.is because of when save booking second time,there 1 part under booking,such hibernate re

windows - Script to remove characters -

i have file thousands of records pipe delimited each field enclosed quotes "first name"|"last name"|"address"|"city"|"state"|"zip" how write batch script on windows process thousands records in file? each line has 1 record on line make below first name|last name|address|city|state|zip @echo off setlocal enabledelayedexpansion del outfile.txt 2>nul /f "delims=" %%i in (pipedelims.txt) ( set line=%%i set line=!line:"=! >>outfile.txt echo(!line! ) should job you.

join - MYSQL "SELECT *:not(id) FROM...". Is there something similar? -

this question has answer here: select columns except 1 in mysql? 28 answers when joining tables both have 'id' column, getting result 'id' not table need. , both these table has lot of columns don't want type them in query. posible similar css :not select table1.*, table2.*:not(id) ... ? or maybe there other solution? thanks if not want particular column table, cannot use * , have type out of columns want get.

C# multiple managed dependencies failing when not run with optimizations -

i've found utterly hilarious bug when i've been trying debug wix installer's custom actions. i didn't write code, somehow 1 of 3 managed .dlls decides invisible main .dll, that's referenced , called wix, when turn optimisations off (to debug) main .dll. as understand, multiple dependencies in wix difficult or impossible without using tool ilmerge , i'll end splitting down own separate .dlls , have loads of custom actions instead. the main question here is: ( out of pure curiosity ) why dependencies loading when optimisations enabled , not without them being enabled?

SQL nested query (not exists) -

i have table called train, has columns number, arrive_station, depart_station i have populated , find trains serve edinburgh (i.e., trains departing station arrive edinburgh) use nested query , use not exists operator. so far have tried.. select depart_station train arrive_station = "edinburgh" , not exists ( select arrive_station train arrive_station != "edinburgh" ); you need relate nested query outer query somehow if number train number you'd want add aliases tables , add and t1.number = t2.number . select depart_station train t1 arrive_station = "edinburgh" , not exists ( select arrive_station train t2 t2.arrive_station != "edinburgh" , t1.number = t2.number );

java - What is the trade-off for disabling CSS in HTMLUnit? -

i experienced slowness in htmlunit 2.12, , therefore disabled css explained in htmlunit : super slow execution? . i want understand trade-off is. mean cannot use xpath selectors? there other tradeoffs? xpath selectors take account html/xml document. css not affect queries. if have non-deterministic results based on whatever css rule applied. as far css selectors , xpath selectors go, can safely use without loading css beforehand. loading them have no effect on result receive. for css have influence on usage of htmlunit code or javascript code loaded depend on computed style of elements.

grails - What would be the return type of this method in groovy? -

i have method such this: def getinformation () { return [true, "reason why"] } which i'm using this def (isclear, reason) = getinformation() is there way define return type method better read when going through method? the real return type of method object, since declared using 'def'. means can return anything, regardless of object you're returning. the following code valid: def getinformation () { return "this information" } or def getinformation () { return 42 } but returntype of method hasn't changed. the real question here is: why choose such approach? in opinion, following make things more clear: result getinformation() { return new result(success: true, reason: "why") } this make more clear caller, , thing you'd need create trivial class: class result { boolean success string reason } now you've got defined api. never use def in method signature, bec

html - Button not working after appending jQuery 1.9.1 -

here code: http://jsfiddle.net/cwwwn/ i'm still fresh jquery. i'm wanting have add , delete button that'll add row when add pushed , delete row button clicked on. reason, add button stops working after first append. if clone, commented out code, add button stops working after first delete. ideas? html: <table border="1" name="phonetable" id="phonetable" width="100%"> <thead> <tr> <th> primary </th> <th> type </th> <th> phone number</th> <th> details </th> <th> add </th> <th> delete </th> </tr> </thead> <tbody> <tr> <td><input type="radio" name="phoneprimary[]"/></td> <td> <select style="" name="phonetype[]"> <option value="1">

java - DWR call throws "Failed to read input" in IE8, appearing too frequent -

this issue occurs in ie8 only, on browser throws http 502 error ,while in apache throws http 103 & application breaks due error after adding sysout in dwr jar got following logs: dwr exception in parsepost data failed read input java.io.ioexception: underlying input stream returned 0 bytes @ sun.nio.cs.streamdecoder.readbytes(streamdecoder.java:268) @ sun.nio.cs.streamdecoder.implread(streamdecoder.java:306) @ sun.nio.cs.streamdecoder.read(streamdecoder.java:158) @ java.io.inputstreamreader.read(inputstreamreader.java:167) @ java.io.bufferedreader.fill(bufferedreader.java:136) @ java.io.bufferedreader.readline(bufferedreader.java:299) @ java.io.bufferedreader.readline(bufferedreader.java:362) @ org.directwebremoting.dwrp.parseutil.parsepost(parseutil.java:65) @ org.directwebremoting.dwrp.batch.<init>(batch.java:58) @ org.directwebremoting.dwrp.basecallmarshaller.marshallinboun

Is it possible to use immutable class in Struts2 form? -

situation: moving using struts 1 struts 2. in struts 1, necessary form classes follow javabean specification. since business data objects immutable, required creating javabean version of many classes, , methods mapping between two. does struts2 support using immutable objects forms? if so, how configure such immutable object instantiated builder using form fields? the object being populated request can't immutable, because ognl calls setters on it–that's how ognl (and els) work. i figure have 2 options: either custom parameters interceptor, or create constructor or builder takes bean used form. without real thought, i'd latter, although might create quick tool generate form classes if there lot of them. interceptor more elegant, it'd need use reflection.

Excel: Allowing grouping/outlining on multiple worksheets with protection on -

i trying allow grouping/outlining on multiple worksheets have protection turned on. reason excel doesn't have simple option box when protecting- i'm using macro code: sub group() activesheet.enableoutlining = true' activesheet.protect contents:=true, userinterfaceonly:=true end sub i set auto-run macro when workbook opened. issue have want apply sheets, not active sheet. code aboves works on active sheet, still have manually run macro on other sheets allow outlining work. i need flexibility in worksheets added or deleted, , want code flexible affects worksheets without me having name every worksheet in code. is possible? thank you. the should be: option explicit sub group() dim ws worksheet each ws in thisworkbook.worksheets ws .protect contents:=true, userinterfaceonly:=true .enableoutlining = true 'add after adding protection sheet end next ws 'you need next rule "for" routine. end sub greetings paul

java - Hash (with Spring) and salt: is this safe? -

i've spring based web app, came using spring-security-3.0.8 (i know, that's not reason, lol) , find out passwordencoder class. in case i'm using md5passwordencoder, i'm not sure if best implementation. http://static.springsource.org/spring-security/site/docs/3.0.x/apidocs/org/springframework/security/authentication/encoding/passwordencoder.html the salt generated securerandom. the whole code this: string salt = new biginteger(130, random).tostring(32); user.setsalt(salt); user.setpassword(passwordencoder.encodepassword(user.getpassword(), salt)); db.save(user); i don't need big security it's knowledge's sake. :) (what making salt big hash putting bit 160?) for improved security might want consider jbcrypt or scrypt . spring security 3.1 supports bcrypt out of box. further universally valid information can found in post secure hash , salt php passwords .

python - Numpy subclass attribute slicing -

myclass numpy.ndarray subclass, intended represent set of images change on time. each image there set of metadata, time, ambient temperature , camera temperature. i've stored these metadata in list of dictionaries, each dictionary corresponds layer in array ( myclass.metadata[0] dictionary corresponds image in myclass[0] ). i've overloaded getattr() make items in dictionary accessible key, myclass.etemp yields e.g. [24.9, 25.0, 25.1] . when slice myclass-object, how achieve attribute-array gets sliced same way? now if myobject[1].etemp , [24.9, 25.0, 25.1] , want [25.0] . this class: class stack(numpy.ndarray): props= [ 'version', 'width', 'height', 'shotrange', 'calibrange', 'unit', 'irb_fname', 'fidx', 'distance', 'etemp', 'zoom',

c# - Enable multitouch on all Elements windows phone -

how can enable multitouch support elements in windows phone? so, example, if had 2 sliders , couple of buttons, how can allow 3 manipulated different simultanous effects on touch screen. i saw couple of tutorials online, believe outdated: multi-touch manipulation events in wpf windows phone 7 multi-touch drawing demo

How to integrate Karma with TeamCity -

i able run tests via karma in teamcity since can run that's accessible via command line. but, teamcity reports overall pass/fail -- not report details of failed tests. if fails, "process exited code 1". the karma homepage says there teamcity integration, teamcity link says "not available yet". there seems git project npm install package . but, npm install failed messages don't mean me. > npm http https://registry.npmjs.org/karma-teamcity-reporter npm > http 304 https://registry.npmjs.org/karma-teamcity-reporter npm http > https://registry.npmjs.org/karma npm http 304 > https://registry.npmjs.org/karma npm warn `git config --get > remote.origin.url` returned wrong result > (git://github.com/vojtajina/node-di.git) undefined npm warn `git > config --get remote.origin.url` returned wrong result > (git://github.com/vojtajina/node-di.git) undefined npm http > https://registry.npmjs.org/chokidar npm http > https://registr

sql - Group one Column CSV -

Image
i trying resource , assosiate skills want ask if there away group skill in 1 column csv id skills 1, reading,writing 2,programing, reading select resources.id, skills.description resources inner join skills_resources on resources.id = skills_resources.resourceid inner join skills on skills_resources.skillid = skills.id in order concatenate multiple rows need use for xml path : select distinct r.id, stuff( (select ', ' + cast(s.description varchar(50)) skills s inner join skills_resources sr on sr.skillid = s.id r.id = sr.resourceid xml path ('')) , 1, 1, '') skills resources r; see sql fiddle demo . you use cross apply for xml path : select distinct r.id, left(s.skill, len(s.skill)-1) skills resources r cross apply ( select s.description + ', ' skills s inner join skills_resources sr

android - Handle Concurrency for GridView when used in conjunction with AsyncTask -

Image
i'm reading chapter processing bitmaps off ui thread in android training. in chapter, author talks handling concurrency gridview when used in conjunction asynctask: common view components such listview , gridview introduce issue when used in conjunction asynctask demonstrated in previous section. in order efficient memory, these components recycle child views user scrolls. if each child view triggers asynctask, there no guarantee when completes, associated view has not been recycled use in child view. furthermore, there no guarantee order in asynchronous tasks started order complete. for above paragraph, have 2 questions: (1) what's child view of gridview? take following figure example, every grid child view? (2) i'm confused "if each child view triggers asynctask, there no guarantee when completes, associated view has not been recycled use in child view." can explains more detail? example, grid[1,1] triggers asynctask, when asynctas

javascript - Is Google Dogfooding Angular.js? -

i've started learning angular.js, , far i'm extremely impressed framework. i wondering though (since it's being developed @ google) if there examples of google using angular.js "out in wild" ? i tried searching source of number of google pages variations of "ngapp" , or angular.js script includes, found nothing. evidence google dogfooding angular.js in own public web development huge value-add framework me. yes, google has build large applications angularjs: http://blog.angularjs.org/2012/06/doubleclick-super-powered-by-angularjs.html see meetup talk it: http://www.youtube.com/watch?v=ojoanvrivqo

c# - EF5 issues - table splitting -

i'm having issues table splitting because need same table columns in both entities. there way of doing that? my example scenario. table messages has id, sourcesystemid, destinationsystemid table systems has id , name to source system name , destination system name link same systems table, example sql be select m.id, s.name, d.name messages m join systems s on s.id = m.sourcesystemid join systems d on d.id = m.destinationsystemid i have table splitting working not when both entities have same columns. error "are being mapped in both fragments different conceptual side properties" thanks paul

php - how to stop dulicate entry and missing sequence while updating a database -

i taking max invoice no. table , incrementing 1 in , updating same table incremented value, problem multiple users performing operation, time misses sequence , time generating same sequence different jobs. can't make invoice no field unique other jobs 0. code like. $res=mysql_query("select max(invoice_no) complaints_master"); $result=mysql_fetch_array($res); $code_id=$result[0]+1; // update invoice details in complaint master $usr="update complaints_master set invoice_no='$code_id', invoice_flag='1', invoice_date='$today', invoice_total_amt='$_post[final_total]' job_no='$_request[job_no]'"; you need set transaction level serializable ensure each max(invoice_no)+1 returns unique value client. not sure how while using php, here mysql doc: mysql set transaction syntax .

How to solve java.lang.StackOverflowError in MVC design pattern (plus mySQL) -

i'm using mvc design pattern, , i'm complete beginner in design pattern , java. if didn't put loginmodel login = new loginmodel()); java.lang.nullpointerexception pop up. when put it, java.lang.stackoverflowerror happens. i'm not sure if give enough details, if need more, mention, i'll provide more details.. public class loginmodel { private string username; private int id; private string email; private long starttime; private long endtime; timer timer; private javax.swing.jtextfield jtextfield1; private javax.swing.jtextfield jtextfield2; connection conn = null; resultset rs = null; preparedstatement pst = null; loginmodel login = new loginmodel(); //this error happens public loginmodel(){} public loginmodel(int id,string username,string email){ this.id=id; this.username=username; this.email=email; } public int getid(){ return id; } public str