Posts

Showing posts from January, 2012

arrays - sum two lists element-by-element in python recursively -

this question has answer here: element-wise addition of 2 lists? 12 answers is possible recursively sum 2 lists element element , return new list? def sumlistelements(listone, listtwo): list = [] = 0 while < len(listone): list.append(listone[i] + listtwo[i]) += 1 return list so, a = [1, 2, 3] b = [3, 4, 5] results r = [4, 6, 8] here recursive implementation def recursive_sum(l1, l2, idx = 0): if idx < min(len(l1), len(l2)): return [l1[idx] + l2[idx]] + recursive_sum(l1, l2, idx + 1) else: return [] print recursive_sum([1, 2, 3], [4, 5, 6]) # [5, 7, 9] or def recursive_sum(l1, l2, result = none, idx = 0): if result none: result = [] if idx < min(len(l1), len(l2)): result.append(l1[idx] + l2[idx]) return recursive_sum(l1, l2, result, idx + 1) e

dictionary - android map fragment in dialog fragment -

this xml code dialogfragment.xml : <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="match_parent" android:orientation="vertical" > <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text = "this map"/> <fragment android:layout_width="match_parent" android:layout_height="wrap_content" android:name="com.google.android.gms.maps.mapfragment"/> </linearlayout> this java code: public class mydialog extends dialogfragment implements onclicklistener { public view oncreateview(layoutinflater inflater, viewgroup container,bundle savedinstancestate) { getdialog().settitle("title"); view v = inflater.inflate(r.layout.dialogfragment.xml, nul

ios - Issue with UILabel not loading in a UIView -

ok, have uiview in view controller, when run program uiview displayed fine, when put either uilabel , button or else in uiview wont display when run, displays when uiview on own, works when there uiimageview or uitextfield in it. suggestions why may happen , how fix it? edit: console showing label , uiview exist , 'on screen' cant seem see it. seems position problem. can nslog position?

jquery - Retain height of 'tr' of table after deleting first col -

i'm working on table first col should deleted dynamically using jquery. after removal of first col, tr height adjusting according content. i want tr height same after removal of first col. please suggest answer. this code i'm using remove first col $(document).ready(function(){ $('.remove tr').each(function(){ $(this).find('td:first-child').remove(); $(this).find('th:first-child').remove(); }) }) please see fiddle add line-height:0px, width , height in css following: td,th{ border:1px solid #ccc; line-height:0px; height:40px; width:100px; } see updated fiddle : demo hope helps.

sql server - How to filter the SQL query result using regular expression or SQL functions -

i have got below types of urls: /fullnews/news/english/2014/2014.xml /fullnews/news/english/2014/1221264.xml /fullnews/news/english/2014/1221272.xml /fullnews/news/english/2013/2013.xml /fullnews/news/english/2013/1251272.xml /fullnews/news/english/2012/2012.xml /fullnews/news/english/2012/1281272.xml /fullnews/news/english/config.xml /fullnews/news/english/list.xml now need write sql procedure pass "fullnews" parameter , procedure return below results getdata("fullnews"); /fullnews/news/english/2014/1221264.xml /fullnews/news/english/2014/1221272.xml /fullnews/news/english/2013/1251272.xml /fullnews/news/english/2012/1281272.xml it should filter ther urls last part not numeric (config,list etc.) , should not return urls last part (2014,2013,2012 etc.) else (1281272, 1221264 etc.) need rendered. create procedure p_test ( @parameter varchar(400) ) begin select * <tablename> url '/'+@parameter+'/news/english/20[0-2][2-9]/[0-9

java - Does distributed queues also help in load balancing? -

i went thru http://activemq.apache.org/how-do-distributed-queues-work.html , , found out distibuted queues advantageous when if master fails, clients failover slave , don't loose message. somehow had 1 more point in mind distributed queues (say have 4 distributed queues), message published go 1 of queue balance load on each queue. looks had wrong understanding. right? is configurable if load on specific queue reaches specific limit, message gets published on distributed queue? update:- per http://activemq.apache.org/clustering.html clustering of brokers exist did not find queue clustering?

css3 - CSS - dynamically calculate width -

i come across width: calc(25% - 20px + 5px); i couldn't find answer via google. wanted know how width 410px 3 boxes in each row, because right returns me 4 boxes in smaller width 410px. any or insight appreciated. this method resolves entire expression single value , applies element. the thing you're trying first calculate 25% of parent element integer value , move on next operand. calculate result , apply. i think, need lessen down parent element's width property. you'll see 3 checkboxes width of 410px. secondly, can try make sure expression accurate while calculating result width. try fiddle: http://jsfiddle.net/afzaal_ahmad_zeeshan/d6sq5/ see, how calc() method works.

java - Split a string by period, but string contains float numbers -

i have string formed names (w/o spaces) separated periods. each token (after period) can start [a-za-z_] or [ (and ends ] ) or $ (and ends $ ). examples: house.car.[0].flower house.car.$something$ house.car2.$4.45$.[0] house.car2.$abc.def$.[0] so need split string period, in last 2 examples dont want split 4.45 (or abc.def ). surrounded $ should not splitted. for last 2 example want array that: house car2 $4.45$ //fixed, sabuj hassan [0] or house car2 $abc.def$ [0] i have tried use regex, i'm wrong. i informed after closing $ there could string surrounded < , > can again contain dots should not split: house.car.$abc.def$<ghi.jk>.[0].bla and need like: house car $abc.def$<ghi.jk> [0] bla thanks help. you better off collecting results "walking" string match .find() : // note alternation private static final pattern pattern = pattern.compile("\\$[^.$]+(\\.[^.$]+)*\\$|[

How to correctly use google analytics measurement protocol? -

i'm learning use google analytics apps. test purpose have created new google account, enabled analytics apps , issued following command terminal test working: curl "http://www.google-analytics.com/collect?v=1&tid=ua-12345678-1&cid=123&an=myapp&t=event&ec=action&ea=click" unfortunately, request don't affect numbers see on analytics page - it's zeroes. request google analytics results in "200 ok" , 1x1 pixel gif image, can't figure out problem: request incorrect, or need somehow preconfigure google analytics, or have days delay before data displayed etc. any suggestions? it looks issue solved. pointers other people coming page: look in realtime reports. try send pageview or screenview instead of event. show in more places. the cid should uuid v4 .

actionscript 3 - Flash Timer Issue -

Image
so i'm trying create timer in flash, basic timer. have looked @ tutorials on google , found couple of ones. problem i'm running when try create timer on different screen. have made dynamic text box mytext . when try access mytext gives me game screen, layer 'as3', frame 156, line 11, column 2 1120: access of undefined property mytext. this code looks when calling timer: import flash.utils.timer; import flash.events.timerevent; var count :number=60; var mytimer :timer=new timer(1000, count); mytimer.addeventlistener(timerevent.timer, countdown); mytimer.start(); function countdown(event:timerevent):void { mytext.text=string((count)-mytimer.currentcount); } i have followed tutorial t , keep getting issue. am creating text box wrong? need add text box screen want on? need create movie clip text box in it? i'm not sure i'm doing wrong, appreciated. thanks! do need add text box screen want on? yes. error states, text field can'

JAVA Checking if a 3D object is within another 3D object/Bounds -

i working on project on particle simulation and, in order simulate correct physical behavior, need make objects collide , bounce off. thing need check whether or not particle within central object (a cone). know in sphere class , in other primitives vecmath, there function .intersect(), perfect collisions. however, not find function .contains() check whether 1 object within (like in 2d library). of got suggestions and/or other libraries implement that? lot

How to check urls againts a predefined list of regex rules in order to get a match in python? -

i'm trying match url request have literal components , variable components in path list of predefined regex rules. similar routes python library. i'm new regex if explain anchors , control characters used in regex solution appreciate it. assumming have following list of rules. components containing : variables , can match string value. (rule 1) /user/delete/:key (rule 2) /user/update/:key (rule 3) /list/report/:year/:month/:day (rule 4) /show/:categoryid/something/:key/reports here example test cases show request urls , rules should match /user/delete/222 -> matches rule 1 /user/update/222 -> matches rule 2 /user/update/222/bob -> not match rule defined /user -> not match rule defined /list/report/2004/11/2 -> matches rule 3 /show/44/something/222/reports -> matches rule 4 can me write regex rules rule 1,2,3,4 ? thank you!! i'm not sure why need regex that. can split , count: if len(url.split("/")) == 4: # you mak

3d - DirectX 11, Sky dome canges shape while moving -

my issue quite annoying because can't grip on how fix it. the basic idea created sky sphere rendered , moves camera position. rendering of sky sphere done turning of z buffering , after turning on, , movement of sky done translating world matrix camera position values. when move camera implicitly sky dome long distances, let's 1000000.0f units on deptz(z) axis, sky sphere starts change shape... , gets worse longer distances... i checked see if it's not texture rendering switching on wire-frame, , can see polygons of sphere changing. anybody having ideas ??? thank you. as trillian suggests, should render small skydome, centred around camera. procedure this: clear colour , depth buffers disable depth buffer writes render sky dome using camera's rotation not translation view matrix re-enable depth buffer writes render rest of scene this way sky behind rest of scene though small , never have issue of walking 'past' sky.

html5 - Dynamically add textbox in HTML Page through Angular JS -

i want dynamically add text-box in html page when user press button. , after want respective field value or field value. i tried doing ng-repeat not work. can tell me how achieve this. i indeed use ng-repeat, , push new object onto array. maybe this? <button ng-click="textfields.push("")">add</button> <textarea ng-repeat="val in textfields" ng-model="val"></textarea>

has and belongs to many - cakephp HABTM and dependency upon another foreign model -

i have resource habtm room. room model depends on model building. how can integrate dependency? class resource extends appmodel { public $hasandbelongstomany = array('room' => array( 'conditions' => array('room.building_id = building.id'), ) ); } class room extends appmodel { public $belongsto = array('building'); public $hasandbelongstomany = array('resource'); public $virtualfields = array( 'name' => 'concat(building.short, room.floor, ".", room.number)' ); in model , belongsto linking did way: public function beforefind($query) { parent::beforefind($query); $this->bindmodel(array( 'belongsto' => array( 'room' => array( 'foreignkey' => false, 'conditions' => array('booking.room_id = room.id')

python - error site register django -

i have 2 classes in admin.py. because can't register them twice, don't know how fix problem. says: "register() takes @ 3 arguments (4 given)". code: class tesi_availableadmin (admin.modeladmin): model=tesi fieldsets = ( (none, { 'fields': ('teacher', 'title', 'description', 'date') }), ) list_filter = ['date'] search_fields = ['teacher', 'title', 'description'] def queryset(self, request): qs=super(tesi_availableadmin, self).queryset(request) return qs.filter(state='available') class tesi_requestadmin (admin.modeladmin): models=tesi fieldsets = ( (none, { 'fields': ('teacher', 'title', 'description', 'date', 'student') }), ) list_filter = ['date'] search_fields = ['teacher', &#

java - Steps to enable the Maven integration with eclipse -

i have installed maven , eclipse juno, on centos. can guide me how integrate eclipse maven. going use configuration mahout. you can download maven from eclipse market place go -> eclipse market place, search maven. (though have got integrated in eclipse). after can make various customizations suite needs selecting, window -> preferences, type in maven in search bar ontop, can configure location of settings.xml file, maven installation use , other things may want. hope helps.

excel - Filter Grand Total in PivotTable based on amount condition -

i have list of customers amounts in 2 periods compared each other , create grand total value can see increase/decrease of customer value in time. i select only customers have grand total of absolute value above 100k . other customers should become hidden can work ones above 100k , add further details (divisions, invoice numbers etc.) so far i've used conditional formatting, helps, data splits once add further columns (e. g. invoice numbers , on) , not clear customer on 100k then. the number of customers on 100k varies 0 25. any suggestions how make happen? i have uploaded sample ms excel file . add row above pt, select sheet,sort & filter, filter , column grand total: number filters, greater than... 100000 , and, less -100000 .

javascript - jQuery validation of two fields len(). -

guys using jquery validation plugin validate input text fields... like this: $("#formsettings").validate({ rules: { sta: { required: true, }, crs: { equalto: "#password" } }, messages: { email: { required: "please provide email address", email: "provide valid email address" }, }); the issue: need match 1 textfield value other, each textfield have comma separated values , should match before continuing, idea how can like if textfield 1 is: 1,2,3,4,5,6 textfield2 should match. $('#selector').val().length above basic jquery version of .length after if statement. here brief untested test try: <input type="text" value="1,2,3,4,5" id="thing1"> <input type="text" value="1,2,3,4" id="thing2"> <input

java - SMARTGWT - SectionStackSection - deleting an Item from the Section possible? -

im using smartgwt 4. have sectionstack sectionsstacksections in it. added dynamicforms textitems, checkboxes etc. section. added delete button each dynamic form want is, when click on delete button dynamicform should deleted section but.. can't find delete function in sectionstacksection there function dynamicforms called "removefromparent" doesn't seem work.. does got ideas? :-) thank simply call below line dynamicform.getelement().removefromparent();

android - Google Maps V2 + Drawer Layout -

i have tried add drawer layout(from android tutorial) "hello world" google maps app. problem cannot click items on sliding menu. think there's issue fragment part in xml. i've tried find workaround none worked. ideas how add in different way make work? here's activity code: public class mainactivity extends fragmentactivity { private googlemap mmap; private supportmapfragment fragment; private drawerlayout mdrawerlayout; private listview mdrawerlist; private actionbardrawertoggle mdrawertoggle; private charsequence mdrawertitle; private charsequence mtitle; private string[] mplanettitles; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); requestwindowfeature(window.feature_action_bar); setcontentview(r.layout.activity_main); setupmapifneeded(); mtitle = mdrawertitle = gettitle(); mplanettitles = getresources().getstringarray(r.array.menu_item); mdrawerlayout = (drawerlayout) fin

(PHP,xampp) syntax error in every code I test -

i " parse error: syntax error, unexpected" error whatever print. the error "parse error: syntax error, unexpected '"test"' (t_constant_encapsed_string) in c:\xampp\htdocs\firstfile\test.php on line 3" the code tested <?php  echo 'test';   ?> a basic code, error persist. how solve problem? could posted not actual file executed? file fine syntactically, there must stupid mistake somewhere. see faulty file inside folder firstfile. sure posted file file inside folder? what outstanding here double quote chars in error message not present in file posted. when error remains unchanged whatever do, typically edit wrong file.

C: How to filter commands? -

i asked write program operates on given string. commands come in form of 2 letters followed nothing, or int(s) or string(s). commands work on given string (reversing it, multiplying it, replacing instances of substring substring). i'm pretty new c , programming in general, , have difficulty in recieving commands themselves. how both make sure command i'm given correct in both name , arguments? need use array of functions (does exist?) after i've found command given correct? i'd recommend learn how use sscanf , sounds perfect want. if string stored in array a , can use see if 2 letters "ia" followed int: sscanf(a, "ia %d", &intvar); if want check case of letters "sa" followed string: sscanf(a, "sa %s", &chararray); the key here checking return value of sscanf , can know how many of arguments assigned values format string. means can add arguments more strings, assuming there's maximum number of i

sql - Entity Framework performance vs Traditional ADO.Net -

to show question try explain sample: suppose have table usersinfo these columns: id, username, password, fname, lname, gender, birthday, hometel, mobile, fax, email, lockstatus now want select lockstatus table. in traditional mode made query , send sqlcommand execute: select lockstatus usersinfo and today use entity framework, use of query: var q = r in new data_dbentities().usersinfo select new { r.lockstatus }; entity sql: select usersinfo.lockstatus data_dbentities.usersinfo now start application , trace sql server profiler. if use first type of query (traditional mode) see result: select lockstatus usersinfo but when use entity framework (linq || entity sql) sql server profiler show result: select [extent1].[lockstatus] [lockstatus] (select [usersinfo].[id] [id], [usersinfo].[username] [username], [usersinfo].[password] [password], [usersinfo].[fname] [fname], [usersinfo].[lname] [ln

java - Issue with JavaLoader while loading jsoup -

i trying load jsoup using javaloader getting initiation error: <cfscript> // array absolute file paths of referred jar files. paths = expandpath("jars/jsoup-1.7.3.jar"); //creating java loader object passing in array containing file paths - loaderobj =createobject("component","javaloader.javaloader").init([expandpath('jars/jsoup-1.7.3.jar')]); //so now, can create instance of object 'bmw' , 'pulsar' class. writedump(loaderobj); abort; jsoup = loaderobj.create("org.jsoup.jsoup"); </cfscript> object instantiation exception. class not found: org.jsoup.jsoup the error "class not found" means javaloader not find requested class. this suggests expandpath('jars/jsoup-1.7.3.jar') not resolving correct location file. to see looking, dump out: writedump( expandpath('jars/jsoup-1.7.3.jar') ); that tell javaloader being told look, can either move existing jsoup

html - Debugging javascript code for generating images -

hey guys need figuring out error in javascript code is. i know code stops working, can't figure out issue is. can help? function createcardio(){ var randomimages=new array(); randomimages[0]="images/strength/armcircles.gif"; randomimages[1]="images/strength/calfraises.gif"; /**add more images**/ var preload=new array() (n=0;n<randomimages.length;n++){ preload[n]=new image() preload[n].src=randomimages[n] } if(document.getelementbyid("impact").checked == false && document.getelementbyid("pregnant").checked == false && document.getelementbyid("none").checked == false){ document.getelementbyid("error").innerhtml = "*all fields required"; } else if(document.getelementbyid("beginner").checked == false && document.getelementbyid("intermediate").checked == false && document.getelementbyid("advanced").checked == false){ document.gete

java - Change all ImageViews in ListView to a particular image -

i'm trying make audio file preview page consists of listview of files in folder. each row has play button next changes stop button when clicked. need way of setting other images play button if row clicked 1 audio file should playing @ once. tried iterating through list , getting imageview had no luck (shown below): public void onactivitycreated(bundle savedinstancestate) { super.onactivitycreated(savedinstancestate); incidentlogger logger = new incidentlogger(this.getactivity()); final list<audio> audiolist = logger.getallaudio(); audiolistviewadapter adapter = new audiolistviewadapter(audiolist, getactivity()); final listview listview = (listview) getactivity().findviewbyid(r.id.listview); listview.setadapter(adapter); onitemclicklistener onitemclicklistener = new onitemclicklistener() { @override public void onitemclick(adapterview<?> parent, view view, int position, long id) { for(int = 0

c# - WPF: Memory implications of using ValueConverter to create BitmapImage for ImageSource -

i had issue using images , provide right-click context menu deleting image. originally binding absolute file path: <image source="{binding path=imagefilename} .../> where imagefilename c:\myapp\images\001.png . i getting error, the process cannot access file 'x' because being used process . after lot of research, figured out necessary code change. i used stackoverflow answer: delete file being used process , put code valueconverter . xaml: <image source="{binding path=imagefilename, converter={staticresource pathtoimageconverter}}" ...> value converter: public class pathtoimageconverter : ivalueconverter { public object convert(object value, type targettype, object parameter, cultureinfo culture) { try { string filename = value string; if (filename != null) { bitmapimage image = new bitmapimage(); image.b

android - Dalvik heap size and heap base -

i wonder how can determine heap base address , heap size, i able dump application heap, is there way ? plus when trying read process memory map via /proc/pid/maps, don't see [heap] section, why ? does dvm allocate anonymous regions using mmap ? if yes how can track them ? in linux api, can use showmap dump heap size information, , section /ashmem/dalvik-heap . , android ddms gives 2 tools analysis java heap , native heap. java heap android hprof, , native heap native heap analysis.

java - Sum of 3x3 in 2D-Array -

write program in java read 2 3 3 matrix , find out sum , display result? i tried got runtime error scanner r=new scanner(system.in); int [][]array = null; int[][]array2 = null; int total=0; system.out.println("enter matrix"); for(int row=0;row<array.length;row++){ for(int col=0;col<array[row].length;col++){ array[row][col]=r.nextint(); array[row][col]=r.nextint() ; system.out.print(" "+total +" "); total=array[row][col]+array2[row][col]; system.out.println(" "); the first for-loop demonstrates how input values in arrays. code require user inputs values of both arrays simultaneously. the second for-loop demonstrates how sum values of each array. later, both arrays added together. //since know the array 3x3, //declare it! int[][] array1 = new int[3][3]; int[][] array2 = new int[3][3]; int array1total = 0; int array2total =

swing - How to alignment right to left in JFrame/java? -

i wrote code, i'm having problem making align right left. tried several things, none of them works. know can done playing coordinates, want way wouldn't need every word. how supposed right way? code: import java.util.*; import javax.swing.*; import java.awt.*; public class gui { //messages public static final string connectc_msg = "התחבר" ; public static final string disconnectc_msg = "התנתק" ; public static final string serverlbl_msg = "שרת יעד:" ; public static final string usernamelbl_msg = ":שם משתמש"; public static final string passwordlbl_msg = ":סיסמא" ; public static final string portlbl_msg = ":פתחה" ; //sizes public static final int srevertxtfield_width = 10; public static final int usernametxtfield_width = 10; public static final int passwordtxtfield_width = 10; public static final int porttxtfield_width = 5 ; public static final int window_width = 800; public static f

unity3d - Unity 2d Box Collider Not Triggering C# -

using unity 4.3.4f scenario: i'm attempting creating background moves camera object using box collider 2d , rigidbody 2d attributes in order create feel background looping camera moves across screen. the background elements set trigger , object on camera includes detection script has kinematic 2d rigidbody. test if works added below script in c# see if collide. void ontriggerenter2d(collider2d collider) { debug.log ("collision: " + collider.name); } in theory should of course print name of object collider makes contact with, right? reason i'm getting no output log. suggestions on i'm not seeing here or document review figure out problem? you have capitalization issue. void ontriggerenter2d(collider2d other) { //your handler code goes here! }

Combining multiprocessing with gevent -

if use multiprocessing pipe pass data second process, , second process uses gevent pool perform network operations, safely allow of green-threads read pipe long use gevent semaphore control access? i'd use gipc , prefer able have shared-data facilities of mp. short answer.. yes should work!

java - Fetching Private Messages of users on Facebook using RestFB -

i new using java apis , confused using restfb fetch user private messages facebook. what have figured till now.. connection<message> cnv = facebookclient.fetchconnection("me/inbox", message.class); //system.out.println(cnv.getdata().get(1).getid()); for(message msg:cnv.getdata()){ system.out.println(msg.getmessage()); } here id of 1 particular conversation being fetched nothing else. other getter methods return null. i unable understand if message.class correctly mapped pojo message threads, or conversation.class . i grateful if answered question stuck here , need quick relief. what correct way go this, please attach code sample. want fetch private messages of user. 2) i read somewhere fb allows 25 items or something? this? concern me? i need fill own domain pojos, need not only a. chat messages b. based on thread id c. based on after received time . facebookclient facebookclient = new defaultfacebookclient(ac

javascript - Sencha Touch 2: Listen for tap on two different HTML buttons -

in nested list have 2 html buttons. have listener nested list displays detailcard holding 2 buttons, add listener action when 1 of buttons pressed. each button different, have been unable delegate 1 of buttons particular function. there way like: listeners : { element : 'element', delegate : 'button.mybutton', tap : function() { //... } } but multiple delegates each delegate else? you add data attributes buttons , react accordingly: <button data-do="showdetailcard"> <button data-do="anotheraction"> // ... listeners: { tap: { element: 'element', delegate: 'button', fn: 'doaction' } } // ... function doaction(event) { var = event.target.dataset.do; if (do === 'showdetailcard') { // show detail card } else if (do === 'anotheraction') { // action } }

bash - Too many arguments in find -

#!/bin/bash read dir read search if [ `find $dir -type f -exec grep $search /dev/null {} \;` ]; echo "find" fi what wrong in code? have error: many arguments [ or [[ or test aren't part of if shell structure commands provided comparisons. you try : #!/bin/bash read dir read search [[ $(find "$dir" -type f -exec grep "$search" {} \;) ]] && echo "find" # or [[ -n $(find "$dir" -type f -exec grep "$search" {} \;) ]] && echo "find" # or [[ $(find "$dir" -type f -exec grep "$search" {} \;) != "" ]] && echo "find" you try : if [[ $(find "$dir" -type f -exec grep "$search" {} \;) ]]; echo "find" fi otherwise, not forget redirection operator before /dev/null.

coldfusion - Looping over the query results set -

i checking work geting query result as: query value 1 #ff6600,#339933,#0033cc,#ff0000,#00cc66,#ff9900,#ffff00,#00ffff,#ff66ff 2 open, resolved, in-progress, escalated, closed, re-opened,rejected,on-hold,locked now need map 1st row parrallel value 2row, know can done via cfloop or should convert array.. need nested loops, not sure how work please guide something should work data in question. <cfset numberofitems = listlen(queryname.value[1])> <cfoutput> <cfloop from=1 to=numberofitems index=idx> row 1 item #listgetat(queryname.value[1], idx)#<br> row 2 item #listgetat(queryname.value[2], idx)#<br> </cfloop> </cfoutput>

python - How do you set up Pycharm to debug a Fabric fabfile on Windows? -

Image
is possible set pycharm step through a fabric fabfile.py? it seems doable run/debug configuration editor can't seem settings right. editor asking script run , i've tried fab-script.py file giving me fab options. it seems i'm close not quite there. here how ended setting in case useful else. things this, once know magic settings, easy. these instructions through pycharm several of them can done in alternate ways. however, since debugging in pycharm, that’s i’m using instructions. also, i’m using windows. install fabric package project environment (using settings-->project interpreter package installation). installs fabric virtual environment’s site package folder putting fab.exe , fab-script.py file in /scripts folder. find location of fab-scripts.py file , copy path (something “c:\\scripts\fab-script.py”) now, create run configuration (run --> edit configuration… --> python) script file name. script parameters point fabfile.py , command

Access customer information using Square Connect API -

is possible access information merchant's customers using square connect api? ideal piece of information email address customers enter receipt, but type of unique customer id nice determine repeat customers. looking through square connect api documents there no endpoints customers , payment objects not include of information. there square api capability? not @ time. regarding customer email addresses obtained receipts, square center : based on our privacy policies , governing regulations, cannot share cardholders' personal information our customers when contact information collected receipt purposes. however, i'll pass feedback along connect api engineering team (i write docs).

linux - Get Power (Voltage/Watts) with python or bash -

is there possibility input power (like voltage or watts) of linux operating system in python or bash? my system running battery , want shut down when battery level gets low supply system. you might want read files in /sys/class/power_supply/bat*/ . here 2 of more interesting files: /sys/class/power_supply/bat0/capacity - shows current capacity (e.g. 75%) /sys/class/power_supply/bat0/status - current status (e.g. full/discharging/charging) the information aggregated in /sys/class/power_supply/bat0/uevent $ cat /sys/class/power_supply/bat0/uevent power_supply_name=bat0 power_supply_status=unknown power_supply_present=1 power_supply_technology=li-ion power_supply_cycle_count=0 power_supply_voltage_min_design=10800000 power_supply_voltage_now=12464000 power_supply_power_now=0 power_supply_energy_full_design=93960000 power_supply_energy_full=95090000 power_supply_energy_now=94830000 power_supply_capacity=99 power_supply_model_name=45n1173 power_supply_manufacturer=s

Consume WCF Json Service with JQuery -

before start: i've read posts consuming wcf json service jquery - no results. i have wcf json service link works fine. can retrive data in android app, assume wcf's part not problem. script looks like: function btn() { $.ajax({ url: "http://amder.pl/wcftest.svc/getpracownicy", type: "get", processdata: true, contenttype: "application/json", timeout: 10000, datatype: "json", success: function (response) { alert(response); }, }); }; it doesn't work. spent on 2 hours searching solution, tried dozens scripts... now, ask help, please spare me comments "use google ..." etc. here web.config service part: <system.servicemodel> <behaviors> <servicebehaviors> <behavior name=""> <servicemetadata httpgetenabled="true"