Posts

Showing posts from March, 2010

php - Codeigniter XML-RPC Response Multi Dimensional Array Approach -

i need create xml-rpc server gets cities corresponding ids. response looking weird me because of unnecessary duplicate entries couldnt find better way. array ( [cityid] => array ( [0] => 34 [1] => 35 [2] => 06 ) [cityname] => array ( [0] => istanbul [1] => izmir [2] => ankara ) ) i implemented above response. implementation: $response = array( array( 'cityid' => array(array('34', '35', '06'), 'array'), 'cityname' => array(array('istanbul', 'izmir', 'ankara'), 'array') ), 'struct' ); the problem want take response : array (

actionscript 3 - My var doesn't seem to want to inherit from a custom class -

i'm sorry if ends being noob question. i have var set new object of class. however, keep getting error 1120 whenever test it. know error means it's undefined property. tried changing scope of (to every possible place in main class. namely class, after imports , constructor). the code supposed part of character creator dungeons , dragons 4e. have tried hours find solution i'm not sure. include attributes class if it's help. var humon:attributes = new attributes it's declared part of main class: package { //imports import com.classes.attributes; import flash.text.*; public class main extends movieclip() { private var humon:attributes = new attributes; public function main() { atties.text = (humon.getstr()+", "+humon.getdex()+", "+humon.getcon()+", "+humon.getint()+", "+humon.getwis()+", "+humon.getcha()+"."); var res:int = humon.getstr(); tra

php - call function through function to search array -

my objective search multidimentional array plot , output information buried there. my code is function searchbyplot($plot, $array) { foreach ($array $key => $val) { if ($val['plot'] === $plot) { return $key; } } return null; } function calculate() { $id = searchbyplot('681', $ma); $code = $ma[$id]['code']; $last = $ma[$id]['h_last']; $plot = $ma[$id]['plot']; if (isset($last)){ echo 'id: '.$id.' code: '.$code.' lastname'.$last.''; } echo "test".$id.""; } calculate(); however when call calculate function there no response though there result in array. when call searchbyplot function directly works fine. $id = searchbyplot('681', $ma); echo $id; however when call calculate function doesn't work @ all, nothing outputted on $id can see test call above. echo $id; can please? many thanks, buster

javascript - Why is Highchart loaded twice in my rails app ? (Uncaught Highcharts error #16) -

i can't make working basic example of highcharts. i got these errors : uncaught highcharts error #16 in app/assets/javascripts/application.js uncaught typeerror: undefined not function in app/assets/javascripts/graphique_repartition_budgetaire highcharts says error 16 because : this error happens second time highcharts or highstock loaded in same page, highcharts namespace defined. keep in mind highcharts.chart constructor , features of highcharts included in highstock, if running chart , stockchart in combination, need load highstock.js file. but can't figure out how can highcharts loaded twice in same page. i'm using rails 3.2.21 i put gemfile : gem 'jquery-rails' gem 'highcharts-rails', '~> 3.0.0' i put app/assets/javascripts/application.js : //= require jquery //= require jquery_ujs //= require_tree . //= require highcharts i put app/views/layouts/application.html.haml : %html %head %title titl

ios - Provisioning profile use existing certificate doesn't work -

i want use push notifications. what have done far: - generated app id - enabled push notification app id - generated development certificate push notification now want generate provisioning profil. can see generated certificate in member center, can't use generate promising profile. wants me generate new certificate. can't select existing one... do know why? the certificate generated not intended generating provisioning profiles, authenticating push server apple's push notification service (apns). you need regenerate current development provisioning profile pick development push notification entitlement (even may not necessary!). the same applies production push certificates , provisioning profiles.

java - extract language from a web page with Jsoup -

for example have <html lang="en"> ...... web page </html> i want extract string "en" jsoup. i tried selector , attribute without success. org.jsoup.nodes.document htmldoc = jsoup.parse(html); element taglang = htmldoc.select("html").first(); system.out.println(taglang.text()); looks want value of lang attribute . in case should use attr("nameofattribute") like system.out.println(taglang.attr("lang"));

javascript - How to change name of input text, when adding more inputs -

this form <form action="" method="post"> <input type="button" value="addmore" onclick="addrow('datatable')" /> <table id="datatable" class="tftable" border="1"> <tr> <td><label>should auto increment(like (name1, name2, name3 ...))</label> <input type="text" required="required" name="doninid[]" value=""></td> </tr> </table> <input class="submit" type="submit" value="confirm &raquo;" /> </form> this script add more => script.js: function addrow(tableid) { var table = document.getelementbyid(tableid); var rowcount = table.rows.length; if(rowcount < 20){ // limit user creating fields more limits var row = table.insertrow(rowcount); var colcount = table.r

php - How to effeciently track dependency version changes? -

i'm working on php driven website has number of dependencies via composer . recently, dependency had minor version (as per semver ) change backwards compatibility breaking change in it. website broke unexpectedly. updated dependency version number more precise, 1.2.16 instead of 1.* . but makes versions harder track, because minor versions change often. how keep track of dependencies in way both simple , avoids breaking changes break project ?

android - How to emulate TrustZone in QEMU? -

i'm trying emulate trustzone features in qemu. i've found 2 links seems explain process. the first reference doesn't attach image kernel supports trustzone (where can find it?) the second reference explains how can compile kernel doesn't start command line written in first website follows ./arm-softmmu/qemu-system-arm -kernel $path_to_kernel/zimage -m vexpress-a15 -cpu cortex-a15 -dtb path_to_dtb/vexpress-v2p-ca15-tc1.dtb -m 1024 -append 'console=ttyama0,38400n8' -serial stdio -initrd $path_to_initrd/initrd.img is there alternate way run trustzone emulator? with op-tee (an open source tee) it's easy run trustzone on qemu. have entire stack running code normal world user space , linux kernel down secure world, running both tee trusted applications. qemu + op-tee works on both armv7-a , armv8-a. if want try out on local pc encourage head on optee_os/readme.md , follow instructions in section 4.1, 5 (only qemu related) , 6. in we're

Python 3 - using multiple times choice -

how use 'choice' multiple times in single command line. want use command 'choice' following - >>> l ['9', '10', '1', '2', '3'] >>> choice(l) '2' >>> choice(l)*3 '222' i need generate 3 different values l , not 3 times same number. if values can same run random.choice() 3 times (in loop, example). but if need different , use random.sample() instead , have pick 3 values that different you: random.sample(l, 3) using random.choice() repeatedly can lead values being picked more once, random.sample() ensure 3 values picked unique.

osx - change the color and the font of NStextView -

Image
i trying change color , font size of nstextview doesn't seem work.this code.i have checked other posts dont seem working.this code. var area:nsrange = nsmakerange(0, textview.textstorage!.length) self.textview.settextcolor(nscolor.graycolor(), range: area) self.textview.textstorage?.font = nsfont(name: "calibri", size: 16) you should use attributed strings: let textview = nstextview(frame: nsmakerect(0, 0, 100, 100)) let attributes = [nsforegroundcolorattributename: nscolor.redcolor(), nsbackgroundcolorattributename: nscolor.blackcolor()] let attrstr = nsmutableattributedstring(string: "my string", attributes: attributes) let area = nsmakerange(0, attrstr.length) if let font = nsfont(name: "helvetica neue light", size: 16) { attrstr.addattribute(nsfontattributename, value: font, range: area) textview.textstorage?.appendattributedstring(attrstr) }

assembly - Calling C function from masm 64 -

i have problem assembly code (64 bit masm in visual 2013 on win8 64). when i'm calling c function (printf), throwing exception ntdll.dll. i'm doing wrong? how can read , write data console in 64 bit masm? can find tutorial masm 64 bit? extrn printf : proc .data format byte "arg1: %d", 10, 0 .code printdata proc mov rbx, 100 push rbx lea rax, format; format address push rax call printf; throw unhandled exception ntdll.dll - access violation reading location 0xffffffffffffffff. add rsp, 16 ;2* 64bit value ret printdata endp end p.s i'm calling printdata c++ code. the 64-bit calling convention ( https://msdn.microsoft.com/en-us/library/ms235286.aspx ) requires pass arguments starting in rcx, followed rdx, r8 , r9 if needed. in case need rcx store address of format, , rdx integer value want print.

javascript - Karma, PhantomJS and es6 Promises -

i writing javascript library uses new es6 promises. can test library in firefox because promises defined. however, when try test code karma , phantomjs, error can't find variable: promise. . guessing because phantomjs browser doesn't support es6 promises yet. how can configure karma bring in polyfill promises? you can pull in babel polyfill installing babel polyfill : npm install --save-dev babel-polyfill and include polyfill file before source , test files within files section of karma.conf.js : files: [ 'node_modules/babel-polyfill/dist/polyfill.js', 'index.js', //could /src/**/*.js 'index.spec.js' //could /test/**/*.spec.js ], unless know target browsers support promises, want apply polyfill released build too. if you're feeling adventurous can use browserify pull files in make testing more modular, , use babelify transpile es6 es5. i've created sample project these , working test involving promise (running on

XML operation in ColdFusion -

i have problem xml, in case receive xml data. want delete it, because crashes result. <a:exceptioninformation> <a:exceptioninformation> <a:description>xxx</a:description> <a:exceptiontype>yyy</a:exceptiontype> </a:exceptioninformation> </a:exceptioninformation> <a:exceptioninformation> <a:exceptioninformation> <a:description>aaa</a:description> <a:exceptiontype>yyy</a:exceptiontype> </a:exceptioninformation> </a:exceptioninformation> i want find node exceptiontype == yyy , delete all: <a:exceptioninformation> <a:exceptioninformation> <a:description>aaa</a:description> <a:exceptiontype>yyy</a:exceptiontype> </a:exceptioninformation> </a:exceptioninformation>

xaml - How to change TextBox's Background color for the "Not selected state"? -

Image
i can change background color textbox , passwordbox in xaml in windows phone 8.1 project. noticed when textbox , passwordbox in "not selected state" (when i'm not typing in it) has light gray color. is there way change light gray color white? in app resources, override following properties: <x:double x:key="textcontrolbackgroundthemeopacity">1.0</x:double> <x:double x:key="textcontrolborderthemeopacity">1.0</x:double>

Issues with removing a synced folder from Vagrant -

i trying remove synced folder no success. i had vagrantfile like: .. config.vm.synced_folder "/folder", "/vagrant/folder", default_sync_opts .. but no longer have folder 'folder', tried removing line keeps trying sync folder. i've tried add again line , add disabled : true option not work. still tries sync. (plus annoying keep ever every folder ever synced on vagrantfile disabled: true) anyone has gone through this/what can do? don't want vagrant destroy/vagrant up have run vagrant reload --provision ? won't destroy environment.

mysql - PHP change variable to corresponding type -

i'm making website in php different config files depending on company thats using @ moment. every company has +/- 15 config files same variables ofcourse, different values. every company has able change settings saving settings in mysql database. database has 3 columns 'company_id', 'setting' , 'value'. when i'm reading config items database, variable type 'string'. ofcourse, if statements "if($setting->value === false)" fails... is there easy way change type of variable corresponding returned value database? if want store arbitrary types in single database column, you'll have serialise them string representation, can unserialise value again. php offers serialize , unserialize purpose, can use language-neutral format json , xml or yaml.

regex - Bash: list different prefixes of files -

suppose have series of files, listed as: t001_000.txt t001_001.txt t001_002.txt t005_000.txt t005_001.txt t012_000.txt ... t100_000.txt we want merge files same t??? prefix. example, every file prefix t001 want do: merge t001_*.txt > newt001.txt #i made function how bash list of different prefixes? here's pure bash way of getting prefixes: for file in *.txt echo "${file%_*.txt}" done | sort -u this give list of file prefixes. there, use cat. the for loop goes through of files. for file in t*_*.txt limit files you're picking up. the ${file%_*.txt} small right pattern filter removes _*.txt variable $file . sort -u sorts of these prefixes, , combines duplicates. the best way use function: function prefix { file in *.txt echo "${file%_.txt}" done | sort -u } prefix | while read prefix ${prefix}_*.txt > cat $prefix.txt done note ${...} around name. that's because $prefix_ valid shell

ios - In a UICollectionView, how can I get my cells to autolayout BEFORE they appear on screen? -

i have uicollectionview self sizing cells. when scroll through collection can see cells resizing @ bottom of screen. is there way can cells resize before appear? i using flow layout , cells contain 3 labels. using estimateditemsize.

Laravel 4.2 generate sub query like this -

i want in eloquent way. select * `documents` (`id` in (select `related_id` `common_data` `meta_key` = 'meta_key_name' , `meta_value` = '1') or `created_by` = '1') thanks answer. try it $data = document::where(function($query){ $query->whereraw(" id in (select `related_id` `common_data` `meta_key` = 'meta_key_name' , `meta_value` ='1')") ->orwhere('created_by',1); })->get();

android imageview bottom to top animation / create imageview programmatically -

i have got android app, want add @ button click 1 of 10 images (r.raw.geld1-10) animated before bottom of activity after top. tried numbers of pixels , multiply math.random(), problem pressed button , lagged hard without reason. seemed generation , animation of uithread. besides not avd, modern smartphone (snapdragon). please can me , send me alternative no overhead. that solved me, thank you! http://developer.android.com/guide/topics/graphics/prop-animation.html

postgresql - st_intersect count result for each row -

i have 2 polygon tables freeform, , grid in postgres. count grid polygons intersect freeform polygons each freeform polygons. can 1 freeform: select count (*) (select a.* durs_area b, grid b.job_reference = '1571754' , st_intersects(a.geom, b.the_geom)) zulu; is there way create query add number of intersecting grid polygons each freeform polygons? use join (rather unnecessary sub-query), , aggregate. select ff.job_reference, count (g.*) durs_area ff join grid g on st_intersects(g.geom, ff.the_geom) group ff.job_reference, ff.the_geom;

javascript - How to add JS array to Meteor autoform entry -

i using meteor 1.1.0 , aldeed:autoform , need put values string array generated in template's js file document entry of type [string] during (or before) submit. how can that? the solution add before: hook in autoform.hooks insert: function in it, modify document entries ( work parameter must defined in schema ). example: autoform.hooks({ 'add-form': { before:{ insert:function(doc){ doc.fileid = '1234; // doc data form. return doc; // .fileid element try modify } } } });

angularjs - Animating ng-repeat index changes using custom directive -

this forked plunker shows 2 ng-repeat s each displaying array list. each list item uses custom directive animate whenever or down arrow clicked. the first list, records changes array item values animates correctly second, records changes array item indexes not. can suggest how edit directive animate second list correctly? the way move elements triggers incorrect animation. try this function arraymove(arrayvar, from, to) { var item = arrayvar.splice(from, 1).pop(); arrayvar.splice(to, 0, angular.copy(item)); } you need make (deep) copy of element preserve properties $$hashkey used angularjs track objects.

c# - ASP .NET Scaffolding ignoring list data structures? -

i'm trying learn asp .net creating sample website, , have problem. suppose have following classes: public class player { public string name {get; set;} public int age {get; set;} public double salary {get; set;} public string gender {get; set;} public datetime contractsigndate {get; set;} } public class team { public string teamname {get; set;} public string sportplayed {get; set;} public list<player> players {get; set;} } now if try use scaffolding in vs2013 create controller , crud pages around model team, pages have fields teamname , sportplayed . players list control not catered for. ideally speaking, when i'm creating new team, i'd way define new players , add them team well. can either through player addition controls on team create page, or maybe button such 'manage players' when clicked, opens small popup players can added. how can achieved while using scaffolding ? you fix using partial view can use

html - highlight the image icon when clicked on it -

i have 3 images icons different use. now want is, if first icon clicked, first icon should highlighted , if second clicked second icon should highlighted . please see html ref:- <tr> <td width="18%" height="40" align="left" valign="middle"></td> <td style="text-align: left; vertical-align: middle;" width="6%"> <input type="checkbox" id="branchchkbx" title="branch" checked="checked" class="hidechkbx" /> <a href="locatebranches_rbl_view.aspx" style="color: #666; font-family: 'signika_negativeregular', sans-serif;"> <img alt="branch" src="images/branch_icon.png" height="40" width="40" title="branch" style="border: 0;" /> <p class="para01">branch</

ios - Custom TableViewCell Button should toggle active status and icon of a specific row, but it also changes the icon of other unrelated rows -

i need toggle per-object state (active/inactive) in tableview contains custom objects : want show active objects in tableview , when state of object changes inactive, disappears list. the app working (creating new custom objects, displaying them in tableview , viewing , editing content - including active/inactive status - in detailview...); in case relevant, please consider my project uses core data , use methods populate tableview . i need custom design tableview cells, i've implemented (i have subclass of uitableviewcell , custom cells displaying desired content ) , seems work, it's first time custom cells , must have done wrong... when tap active-inactive button in cell change custom object status (and make disappear list because has become inactive), i want object (its status changes , object disappears list). my issue see image of uibutton (which shows 2 different icons when object active or inactive) of few other rows change inactive icon. button image

Python multithreading: spawning multiple threads, only last one executed -

i'm trying write basic simulator clients arriving @ random arrival times , stay random amount of time , leave again. the idea every time client generated, seperate thread spawned client deleted after random amount of time (see delete_user() function). def delete_user(user): time.sleep(random.randint(5,20)) print "user %s left @ %s" % (user.id, time.ctime()) def start_simulation(number_users, interval): in range(number_users): t = random.expovariate(1.0 / interval) time.sleep(t) # wait random time before generating new user user = generate_user() print "user %s generated @ %s" % (user.id, time.ctime()) worker = threading.thread(target=delete_user, args=(user,)) worker.start() the problem delete_user() executed once, last user generated. seems though last spawned thread something. this output: user b490fbd0-8740-4d7e-a3a6-d46449ff918b generated @ wed apr 1 07:22:47 2015 user 844122d9-4032-

javascript - jQuery do code if class is changed -

i'm trying check li inside other li having class is-visible, , in case nothing, if doesn't add style width: 0px. if (jquery("li:has(li.is-visible)")){ //nothing @ moment } else { jquery('ul.cd-gallery li').css({'width' : '0px'}); } html part of code <ul class="cd-item-wrapper"> <li data-type="sve" class="is-visible"> <img class="img-reponsive" src="someimg.jpg" alt="jabuka" height="150" /> </li> <li data-type="proizvodi" class="is-hidden"> <img class="img-reponsive" src="someimg.jpg" alt="jabuka" height="150" /> </li> <li data-type="vocnaci" class="is-hidden"> <img class="img-reponsive" src="someimg.jpg" alt="jabuka" height="

excel - DMAX Function Referencing Different Worksheet -

i have following function in 1 worksheet: =dmax(servicecompleted!a$1:e$430, 5, a2) it reference "servicecompleted" worksheet #value error. a2 references text field. return column (5) number. don't know if makes difference. i've been racking brain on this; sure answer there... appreciated.

javascript - image retrieval from directory and session variable issues - php -

Image
i have problem when retrieving images directory on server, main sequence is: in page (multiupload.php) added input, allowed image previewed , when user submitted, new directory session id created, images stored in unique directory , page directed (drag.php). newly loaded page has canvas different divs controls filters attached canvas. problem lies retrieving image specified s_id directory name 1 page other. q: retrieving session variables properly? or using them appropriately? this necassary snippets multiupload.php's upload script. <?php $dir_id = session_id(md5(uniqid())); session_start($dir_id); $path = "uploads/"; $dir = $path.$dir_id; $path = $path.$dir_id."/"; if (file_exists($dir)) { system('/bin/rm -rf ' . escapeshellarg($dir)); } else { mkdir($path); chmod($path, 0722); } $_session["id"] = $dir_id; $_session["directory"] = "/" . $dir; $_session["path_name"]

c++ - What's the result of a & b? -

this awkward, bitwise , operator defined in c++ standard follows (emphasis mine). the usual arithmetic conversions performed; the result bitwise , function of operands . operator applies integral or unscoped enumeration operands. this looks kind of meaningless me. "bitwise , function" not defined anywhere in standard, far can see. i , function well-understood , may not require explanation. meaning of word "bitwise" should rather clear: function applied corresponding bits of operands. however, constitute bits of operands not clear. what gives? this underspecified. issue of standard means when refers bit-wise operations subject of few defect reports. for example defect report 1857: additional questions bits : the specification of bitwise operations in 5.11 [expr.bit.and], 5.12 [expr.xor], , 5.13 [expr.or] uses undefined term “bitwise” in describing operations, without specifying whether value or object representation in view.

regex - htaccess mod_rewrite regular expressions -

i have old website indexed on google , need make 301's let ex. google know page moved. i moved site wordpress "builded os", single urls. it goes first page, when need 301 redirect sub links fails. code: redirect 301 /what-we-do/ mypage.nu/services redirect 301 /what-we-do/about-us mypage.nu/about second line fucks , makes "servicesabout" - cant found. how can make hyphen (-) old url , sub url, direct "single urls" - mean ex. mypage.nu/what-we-do/about-us/members ex mypage.nu/members please me, i'd tried several regulair expressions ex redirect 301 /what-we-do/about([^/_]+?)-?us mypage.nu/about nothing works, can fine rewritematch - mod_rewrite activated on server. can me? use redirectmatch regex support match exact urls: redirectmatch 301 ^/what-we-do/?$ mypage.nu/services redirectmatch 301 ^/what-we-do/about-us/?$ mypage.nu/about better test in new browser avoid old cache.

mouseevent - JavaFX Circle object not registering mouse events properly -

i want user able drag-move circles around pane. circles dont seem register (almost) no mouse events (as defined in end). have same exact code empty pane works fine. if change circle1.setonmousedragged to paneforcircles.setonmousedragged it works fine not want because need manipulate both circles. ideas ? appreciate if tell me how hide part of circle overlaps adjacent elements if center close pane border. import javafx.application.application; import javafx.geometry.insets; import javafx.geometry.pos; import javafx.scene.scene; import javafx.scene.control.button; import javafx.scene.control.contentdisplay; import javafx.scene.control.label; import javafx.scene.control.textfield; import javafx.scene.layout.hbox; import javafx.scene.layout.pane; import javafx.scene.layout.vbox; import javafx.scene.paint.color; import javafx.scene.shape.circle; import javafx.stage.stage; public class ex168 extends application { @override public void start(stage primarystage) throws excepti

c# - GetIndexParameters() empty on Dictionary property -

Image
i'm using reflection info class i'm exporting excel. loops through properties values. i want able handle indexed types list s , dictionary s. however, getindexparameters() method on property returning none. using wrong? here can see prop.property (which propertyinfo ) showing value dictionary<int, decimal> , indexparams has 0 length. loop logic (slightly modified so, partially pseudocode) foreach (var prop in exportingpropertiesinorder) { //detect if needs have indexing applied. var indexparams = prop.property.getindexparameters(); var isindexed = indexparams.any(); if (!isindexed) { //get value property export }else{ //loop through indeces, each value } the property shown on screenshot dictionary<int, decimal> tiervalues it not indexer, getindexparameters() method on property returning empty array dictionary<int, decimal> type has indexed property item

reflection - Any API for TSYS(TOTAL SYSTEM SERVICES) -

it's credit card company , using system called "tsys" "total system services, inc". in order information "tsys", it's using reflecltion ibm 9 connect "tsys" server information. , sake of efficientcy, it's using vba macro simulate user's input in reflection information. it's still slow , easy interrupted other application. people familiar "tsys", there api(java or c#) allow people communicate tsys server directly without using third party software reflection ibm? yes. tsys offers transit api developer integration. see here sign , access.

javascript - jquery ajax "SyntaxError: Unexpected end of input" on valid JSON -

the json returned php is: {"success":0,"message":"error: no entityid passed!"} still javascript tells me "syntaxerror: unexpected end of input". php: ... //check if image id passed removal in post data if ( isset($_post["entityid"])) { $entityid = $_post["entityid"]; } else { //setup response json $resp = array(); $resp['success'] = 0; $resp['message'] = "error: no entityid passed!"; header('content-type: application/json'); echo json_encode($resp); } ... js: // send xhr request $.ajax({ datatype: 'json', type: $theform.attr('method'), url: $theform.attr('action'), data: $theform.serialize(), success: function(data) { //backend returns jso

c# - What are self contained functions? -

so i've been assigned talk adding new code routines program such self contained functions , new classes, yet haven't been taught kind of programming terminology yet. i've tried looking online everywhere doesn't explain enough. the questions i'm little confused following: what self contained functions in c#? (code examples :3) , how added in object-oriented way? help appreciated, thanks. self-contained functions , classes , object-oriented pretty same thing @ high level you're talking about. http://en.wikipedia.org/wiki/object-oriented_programming i'm guessing code base mess, functions using global variables, , giant code files. goal make each item 1 thing. instead of function called "run" 500 lines long, should instead have function called "run" calls functions "getrecentdata", "checkdataforerrors", "reporterrors", "processvaliddata", , "reportsuccess". means whe

python - Hierarchical indexing with Pandas -

i have pandas dataframe with 3 index levels , 2 columns. can see part of here: av_intensity std_dev key1 key2 time 0 0 32000 -0.005203 0.006278 32200 0.005330 0.005221 32400 0.002679 0.005006 32600 -0.000723 0.006145 32800 -0.000317 0.010467 33000 -0.006543 0.007808 33200 -0.004180 0.005070 33400 -0.006275 0.009662 33600 -0.014763 0.006938 33800 -0.029516 0.004710 the indices numbers, e.g. (0.0, 0, 32000.0) set of indices. i trying use df.ix[ 0.0, :, 32000.0] or df.ix[ :, 0, 32000] kind of hierarchical indexing doesn't work. is because indices not integer? how can kind of hierarchical indexing data frame? see advanced hierarchical indexing section in docs full explanation: http://pandas.pydata.org/panda

gcc - Determine if compiled ELF object is 32-bit or 64-bit -

i want verify if object has been compiled in 32-bit or 64-bit: % readelf -h my_obj elf header: magic: 7f 45 4c 46 01 02 01 00 00 00 00 00 00 00 00 00 class: elf32 data: 2's complement, big endian version: 1 (current) os/abi: unix - system v abi version: 0 type: exec (executable file) ... since elf32 displayed, guarantee object in 32-bit mode? fat binaries aren't common or standard elf, class reliably indicate 32 vs 64 bit. figure out whether you're looking @ 32-bit x86, arm, mips, or whatever, have inspect machine field right below type field.

c# - ReactiveUI - Views not rendering properly (or in full) -

i'm in process of starting new project, using reactiveui , mahapps.metro . first hurdle i've hit problem of views not showing in entirety. have window , , in window have viewmodelviewhost rxui library. simple container nested view-model. activeitem binding binded view-model of user control, , button user control visible on screen. what expect see window dark gray background , button in middle. see window default background , button in middle. not right. if remove button, see nothing on window , default background. it seems viewmodelviewhost showing actual contents of usercontrol , disregarding isn't considered real control, such grids etc. has come across behaviour before? <mah:metrowindow x:class="...mainwindow" xmlns:mah="clr-namespace:mahapps.metro.controls;assembly=mahapps.metro" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://sc

asp.net - Fetch Weekly Data By Query in Sql Server -

i have table name 'emp_attendance_new' kept record of emp attendance.when fire query give particular result. query: select atendencedate ,emp_id,attendance_status ,empname emp_attendance_new emp_id ='20140160' , atendencedate between '3/30/2015' , '4/5/2015' result: atendencedate emp_id attendance_status empname 2015-03-30 20140160 p vikash prasad 2015-03-31 20140160 p vikash prasad 2015-04-01 20140160 p vikash prasad 2015-04-02 20140160 p vikash prasad 2015-04-03 20140160 p vikash prasad 2015-04-04 20140160 p vikash prasad but want result in single row this: emp_id empname 2015-03-30 2015-03-31 2015-04-01 2015-04-02 2014016 vikash prasad p p p p

java - Letting a SwingWorker thread sleep -

i have swing gui should read rss feed periodically (the feed provided application wrote). i've implemented in swingworker , want ask if sound design. here code wrote background method: @override protected void doinbackground() throws exception { comboboxmodel.removeallelements(); while(true) { channel feedchannel = webresource.path(role.role()) .accept(mymediatype.application_rss) .get(rss.class).getchannel(); list<item> itemlist = feedchannel.getentrylist(); for(item item : itemlist) { string itemlink = item.getlink(); if(!feeditemmap.containskey(itemlink)) { comboboxmodel.addelement(new pair<>(itemlink, true)); feeditemmap.put(itemlink, true); } } thread.sleep(10000); } } my idea letting thread sleep reduce number of gets. program doesn't need dat

How to approach simple recursion in python -

i've been trying understand recursion/recursivity in programming languages , i've chosen work python, since it's language understand most. i've tried resolving following problem - given 3 different lists of elements, find possible patterns person has followed during shopping day. lists purchases = [[money_spent, time0], [money_spent, time1], [money_spent, time3]] time_between_shops = [[time_to_self, time_to_shop2, time_to_shop3, time_to_shop4], [time_to_shop1, time_to_self, time_to_shop3, time_to_shop4], [time_to_shop1, time_to_shop2, time_to_self, time_to_shop4], [time_to_shop1, time_to_shop2, time_to_shop3, time_to_self]] list_of_products = [["shop1", {"product1": price_of_product1, "product2": price_of_product2}], ["shop2", {"product3": price_of_product3, "product4": price_of_product4, "product5": price_o

algorithm - computing 3D reduced convex hull -

i'm looking algorithm provides call "shrunken convex hull" (as distinct "reduced convex hull") in 3d. defining shrunken hull, h', volume of space has, no less d distance original convex hull, h. analytically, can formed moving each plane of h inwards along normal d, computing convex hull (if exists) of resultant planes. tricky bit planes might trimmed or dropped, others may move past other planes, , entirely "snipped" out due normal reversal (if d big enough). i’m bit fuzzy on how algorithm, have badly thought out ideas below. i doing identify subset of points in dataset guaranteed no less given distance surface of original point set (which assumed convex, , have this). remove surface effects disrupting our signal in calculations doing. i'm looking name, or examples of doing this, or way compute this. ideally good-old open code great, think problem far niche. i found reduced convex hulls, seems different idea. current closest thin

SymmetricDS Sample - wrong port being used by client -

i trying example symmetricds tutorial work. using configuration files corp-000.properties , store-001.properties found in samples directory of download zip. have placed them in engine directory , edited them corp-000 using mysql db , store-001 using h2 db, both on local machine. here registration , synch urls corp-000.properties: registration.url= sync.url= http : // localhost : 31415 / sync / corp-000 here ones in store-001: registration.url= http: // localhost : 31415 / sync / corp-000 sync.url= http : // localhost : 31415 / sync / corp-000 when run bin/sym, finds 2 databases. then, store-001 reports: [store-001] - defaultofflineclientlistener - failed connect transport: http: // localhost : 8080 / sync / corp-000 [store-001] - pushservice - not communicate corp:000:000 @ http: // localhost : 8080 / sync / corp-000 because: connection refused this mystery since port 8080 not specified anywhere in 2 properties file. note: urls above don't have spaces in prop

c - Understanding GCC generated map files -

i'm trying write script parses .map files generated gcc , me figure out footprints of various libraries in memory. ( github repository of have far ) i'm trying understand following means / how should read : .debug_line 0x00000000 0x67b1 *(.debug_line .debug_line.* .debug_line_end) .debug_line 0x00000000 0x105 /opt/ti/gcc/bin/../lib/gcc/msp430-elf/4.9.1/../../../../msp430-elf/lib/crt0.o .debug_line 0x00000105 0x4b5 cmakefiles/firmware-msp430f5529.elf.dir/main.c.obj .debug_line.text.bc_printf.constprop.1 0x000005ba 0x23 cmakefiles/firmware-msp430f5529.elf.dir/main.c.obj .debug_line.text.deferred_exec 0x000005dd 0x60 cmakefiles/firmware-msp430f5529.elf.dir/main.c.obj .debug_line.text.startup.main 0x0000063d 0xfc cmakefiles/firmware-msp430f5529.elf.dir/main.c.obj .debug_line_end 0x00000739 0x0 cmakefiles/firmware-msp430f5529.elf.dir/main.c.obj i've b

How to find the mode of an array using Java -

i'm trying find mode program, user inputs amount of numbers 0-100 many want, i'm attempting find mode of these numbers each time attempt find mode gives me 3, i've found else, need mode. import java.util.scanner; public class deveation { public static void main(string args[]) { scanner kbreader = new scanner(system.in); int sum = 0; int bob[] = new int[101]; int total = 0; int = 0; int min = 0; int max = 100; int mode = 0; boolean stay_in_loop = true; while (stay_in_loop) { system.out.println("please enter interger(s) 0-100: "); int number = kbreader.nextint(); if (number < 0) { stay_in_loop = false; } else { total++; bob[number]++; } } int median = total / 2 + 1; while (median > 0) { median -= bob[a];

python - PyQt QTableWidget signal emitted when selecting no rows -

i have qtablewidget in pyqt single row selection set. connecting itemselectionchanged call row selection function , take action on selected row. detect when user selects inside qtablewidget , selects empty space (no row selected), can deselect selected row. similar how "windows explorer" works file selections. what signal triggered when selecting blank area inside qtablewidget ? how can accomplished? check mouse-press events see if clicked item none : class table(qtgui.qtablewidget): def mousepressevent(self, event): if self.itemat(event.pos()) none: self.clearselection() qtgui.qtablewidget.mousepressevent(self, event) or if can't subclass, use event-filter: class window(qtgui.qwidget): def __init__(self): ... self.table.viewport().installeventfilter(self) def eventfilter(self, source, event): if (event.type() == qtcore.qevent.mousebuttonpress , source self.table.view