Posts

Showing posts from August, 2012

c# - TcpListener and TcpClient sharing local port -

i have 2 instances of same application, on different machines, should talk each other, no 1 typical server or client. both instances of application has tcplistener, local port = 8000. one application instance (call "a") creates tcpclient. now, client can't have local port = 8000, or constructor throws socket exception "only 1 usage of each socket address (protocol/network address/port) permitted" . so, create first client random local port, , run connect() connect other application instance "b". "b" accepts connection using tcplistener.accepttcpclient(), returns tcpclient can used communicate "a". though, tcpclient has same ip , port tcplistener!? how possible, when not use same port when created tcpclient manually on "a"? them use same port listener, on both machines... so, how can create tcpclient on "a" same port tcplistener? i think might not understand address port client server archi

CSS next element (none sibling) selector -

this question has answer here: selecting sibling of parent 2 answers i have html structure this: <svg> <path/> </svg> <img/> is there way "display:block;" <img/> when <path/> hovered, css only? this possible if possible select parent of <path/> unfortunately not possible, answer not possible. if try javascript can provide jquery (not best) example. $('svg > path').hover(function(){ $(this).parent().next().addclass('hover'); }, function() { $(this).parent().next().removeclass('hover'); }); then in css can do. img.hover{ // these styles take effect when hover `<path>` }

java - Setting text for TextView not working properly -

when set text in textview , text changes after going correctcondition() method; want change text before going correctcondition() . textview change when click button, , further operations run. i want play sound "one" , display text "1" @ same time here add code in image1.setonclicklistener(new onclicklistener() { @override public void onclick(view arg0) { if (mclicked == false) { mclicked = true; count = count + 1; numberwrite.settext("" + count); one(); correctcondition(); } } }); private void one() { thread tr = new thread(new runnable() { @override public void run() { assetfiledescriptor one; try { 1 = mactivity.getassets().openfd( "counting/one.mp3"); mediaplayer counting = new mediaplayer();

javascript - Working with two jquery document.ready functions -

this question has answer here: multiple $(document).ready functions [duplicate] 2 answers i have 2 document.ready functions shown below: $(document).ready(function() { $('#slider1').s3slider({ timeout: 3000 }); }); $(document).ready(function() { $(".modalbox").fancybox(); $("#contact").submit(function() { return false; }); the first banner jquery supposed rotate forever. second contact form modal box appears on user's click. possible 2 coexist? of course. add more handlers ready event , all of them fire once ready event fires.

c# - Should I use Exception Handling or Check the values -

i need conceptual problem. essentially, have data known source. know of data can potentially not have value. have 2 options. option 1: can check of data before stored prevent invalid cast exceptions option 2: can let throw exception. now know fact best practice use proactive error handling method , check nulls; however, sure out of million mappings tables objects have no more 2 errors. should throw exception or check? people check because exception takes more resources simple check; however, case when need on million checks verses 1 exception? exceptions should used in exceptional cases. 2 out of million sounds exceptional me.

iphone - How to display a PDF from NSMutableData? -

i need display pdf have stored nsmutabledata array. my question is, how display pdf view when have nsmutabledata array. i'd rather not save file disk if @ possible. i'm not dealing large pdf's. barely 2 pages @ most. ive seen lot of info displaying in webview. requirement? or people do? thanks unless have particular requirement use nsmutabledata array have @ vfr reader it's powerful pdf reader , nice , easy implement. you can either access locally stored pdf or use 1 web site. vfr reader

javascript - How do I get the id for a <tr> in when using jQuery DataTables? -

i adding button "approve" rows in table (call url process record). generate table attach datatable prefilled table. on each tr have id number of record. <tr id="11309742"> <td>blah</td> <td>blah</td> <td>blah</td> </tr> <tr id="11309743"> <td>blah</td> <td>blah</td> <td>blah</td> </tr> here have far: $.each(table.fngetdata(), function (i, row) { var id = $(this).attr("id"); $.get(myurl, { id: id }, function (json) { if (json.sucess) { // todo remove page } }, "json"); }); var id = $(this).attr("id"); worked before switched datatable plugin (and know won't work now). have seen either setting id or getting index click in row.

write file with setlocal enableDelayedExpansion error -

i want script write file output: rem ===[a]==========[b]==========[c] # =========[d]==========[e]==========[f] # =========[g]==========[h]==========[i] set "a1= " & set "b1= " & set "c1= " # & set "d1= " & set "e1= " & set "f1= " # & set "g1= " & set "h1=5" & set "i1= " in case want use enabledelayedexpansion wrote script: setlocal enabledelayedexpansion set file="test.bat" echo rem ===[a]==========[b]==========[c] # =========[d]==========[e]==========[f] # =========[g]==========[h]==========[i] >> %file% echo set "a1= " ^^& set "b1= " ^^& set "c1= " # ^^& set "d1= " ^^& set "e1= " ^^& set "f1= " # ^^& set "g1= " ^^& set "h1=5" ^^& set "i1= " >> %file% but output 1 line: rem ===[a]==========[b]==========[c] #

c - Writing and reading from a file and sort them in ascending order -

#include<stdio.h> void sort(int *p, int size) { int i, j; (i = 0; < size - 1; ++i) { (j = 0; j < size - - 1; ++j) { if (p[j] > p[j + 1]) { int temp; temp = p[j]; p[j] = p[j + 1]; p[j + 1] = temp; } } } } void createtestfile() { file *f1; f1 = fopen("program.txt", "w"); fprintf(f1, "6#this comment\n"); fprintf(f1, "3#this comment\n"); fprintf(f1, "7#this comment\n"); fprintf(f1, "2\n"); } void readtestfile() { file *fp; char buff[1024]; int value; int number_of_lines; fp = fopen("program.txt", "r"); { fgets(buff, 1024, fp); fscanf(fp, "%d", &value); number_of_lines++; buff[number_of_lines] = value; } while (fp != eof); sort(buff, number_of_lines); int i; (i = 1; < number_of_lines; i++) { printf("value %d", buff[i]); } } int main()

ios - How to read and render 30+ (60 is the goal of course) 1.5-megapixel images per second? (even on iPhone 4) -

i'm working on image app users can take photos , "scrub" through them. scrubber uislider , users move thumb left right, full-screen stored images display. there can hundreds of images , want scrubbing experience lag-free. so far, here's i've done. if know of these not efficient, please tell. 1) store low-res (about 40% quality) jpeg version of each photo in separate db table photolowquality. hear may better off storing files , putting filepath in database? high-res images in 1 branch of code, haven't tested performance difference yet. 2) store full-res photos 85% jpegs, resized 1.5 megapixel (1500x1000) (since iphone screen not 1 mp). leave bit of room them zoom in, don't need type of app. 3) when users scrub through photos, , it's fast (last photo displayed less 0.1 seconds ago, example), serve low-quality version first , kick off timer pulls high-quality version of photo 0.1 seconds later. when users keep scrolling, see low-version pics (

python - Exporting a matplotlib animation to an image -

i have matplotlib animation (for instance one of these ) , want export svg image several frames superimposed (e.g. in this paper , fig. 2. on 5th page). objective have image describes motion possible. what best way achieve this? unfortunately can't view .pdf @ moment, approach solving draw each 'frame' of animation in same plot in matplotlib using plot(x,y) , , use savefig('image.svg') (if .svg format can saved in manner matplotlib). optionally, add argument plot call, colours plots different shade of colour, according frame number.

mysql - How to combine two simple sql queries -

i have following sql query(s): //get id select id magazine name = 'web designer' select avatar person newsletter = 1 , id in ( select person_id id person_magazine magazine_id = 9 //use id previous query ) how combine them don't have run 2 queries? i think need learn joins. following query seem want: select p.avatar person p join person_magazine pm on pm.person_id = p.id join magazine m on pm.magazine_id = m.id p.newsletter = 1 , m.name = 'web designer'

sas - deleting observations based on date -

i trying delete observations date before 02/27/12. output data set same original one, should not be. data new1; set new; if service_start_date < '02/27/12' or date_of_first_revenue_from_acti < '02/27/12' delete; run; you need use proper date constants, one. data new1; set new; if service_start_date < '27feb2012'd or date_of_first_revenue_from_acti < '27feb2012'd delete; run; second, may need convert variables proper dates, if stored text. can use input that. data new1; set new; if input(service_start_date,mmddyy10.) < '27feb2012'd or input(date_of_first_revenue_from_acti,mmddyy10.) < '27feb2012'd delete; run;

android - How to make an Activity's background transparent? -

how can make activity appear in center of screen dialog while previous activity(the activity call intent transparent one) remains visible in background ? tried setting gravity center , background #00000000 seen in other answers doesnt work seen in other answers. try mention style shown dialog , transparent.. <style name="dialogtheme" parent="android:theme.dialog"> <!-- no backgrounds, titles or window float --> <item name="android:windowbackground">@null</item> <item name="android:windowistranslucent">true</item> </style> in activity apply theme this.. <activity android:name="com.afbb.smartlock.activitys.previewimagesactivity" android:theme="@style/dialogtheme" > </activity>

angularjs - Angular UI slider with Require JS fires before jQuery UI -

i building angularjs application using requirejs, angularui , jquery ui. i following error when using slider: typeerror: object [object object] has no method 'slider' @ init (http://example.com/assets/js/lib/angular-ui/slider.js?v=635137928871837150:18:29) @ ngmodel.$render (http://example.com/assets/js/lib/angular-ui/slider.js?v=635137928871837150:55:25) @ object. (http://example.com/assets/js/lib/angular-1.0.7/angular.min.js?v=635137928871837150:140:131) @ object.e.$digest (http://example.com/assets/js/lib/angular-1.0.7/angular.min.js?v=635137928871837150:86:286) @ object.e.$apply (http://example.com/assets/js/lib/angular-1.0.7/angular.min.js?v=635137928871837150:88:506) @ e (http://example.com/assets/js/lib/angular-1.0.7/angular.min.js?v=635137928871837150:95:38) @ p (http://example.com/assets/js/lib/angular-1.0.7/angular.min.js?v=635137928871837150:98:123) @ xmlhttprequest.t.onreadystatechange (http://example.com/assets/js/lib/angula

esri - How many geodatabases may be authorized per ArcGIS Server? -

i need create , authorize new esri arcgis enterprise geodatabase. our organization has existing arcgis server license has authorized 1 esri arcgis enterprise geodatabase. able specify existing arcgis server authorization file create enterprise geodatabase within same organization , network? try except else administers arcgis server , still in planning stage. i understand need arcgis desktop standard or advanced (not basic) create enterprise geodatabase. thank - tim arcgis server, includes enterprise geodatabases, typically licensed per cpu core ( more info ). if you're licensed run 1 enterprise geodatabase on machine, you're licensed run many enterprise geodatabases want on machine, or many machine handle. how many can handle depends on many factors: hardware, data, how maintain database, other software running on machine, etc. etc. etc. the point yes, can use same authorization file create multiple geodatabases. you're correct need arcgis desktop stand

scala - Convert Casbah findOne to Map -

val db = mongoclient("test") val coll = db("test") val q = mongodbobject("id" -> 100) val result= coll.findone(q) how can convert result map of key --> value pairs? result of findone option[map[string, anyref]] because mongodbobject map. map collection of pairs. print them, simply: for { r <- result (key,value) <- r } yield println(key + " " + value.tostring) or result.map(_.map({case (k,v) => println(k + " " + v)})) to serialize mongo result, try com.mongodb.util.json.serialize , like com.mongodb.util.json.serialize(result.get)

mysql - Where does a LIMIT apply in a UNION? -

it not clear me limit applies union if have: select * table conditions union select * table b conditions limit 10 does limit 10 apply result of union? or select of table b? need apply result of union where union operator? anyway limit of 10 applies on result of union @ least in place put it.

How do I upload both form data and multiple files from my android app, using HTTPURLConnection to my server, where I am using PHP? -

i have android application sending 1 or more zip files server. i'd send additional form data along files, because form data used determine disposition of files. i've been able upload files using multi-part content-type, can't seem php on server side see both form data , files. what i'd know how send form data , list of files server using httpurlconnection on android side , php on server side. i believe problem related content-type , content-disposition. i'd appreciate if point me @ definitive example, or explain i'm doing wrong. thanks taking time @ problem.' here's latest, revised android code: string postdriverupload(file[] filelist) { httpurlconnection connection = null; dataoutputstream outputstream = null; string tag = tag + "postdriverinfo()"; url url = null; string result = ok_to_continue; string targeturl = server + "/upload.php"; try { url =

jquery - passing variable from javascript to server (django) -

i trying send users current location variable (after user clicks allow) browser django server using jquery's post method. current location stored in variable pos . $(document).ready(function(){ $.post("/location", pos) }); in django, i've created url /location in urls.py captures pos variable in views.py through request.post(pos) , use carryout distance lookups. i see variable not being passed django server, can please advise going wrong ? i have assigned javascript location variable(pos) in google geolocation api input element (id= "location") in html form using below code document.getelementbyid('location').value = pos below html form <form id = "geolocation" action="/location" method="post" > {% csrf_token %} <input type="text" id = "location" name="location" value="" /> <input type="submit" />

php - Hide next button for last quiz in quiz application -

Image
i making quiz application using php. right problem last question showing next button shown in image since questions dynamically fetched db there no pages each question. not able specify @ point should hide next button (what if have 1000 questions). have tried javascript. doesn't quiet seem work. update source code demo : http://jsfiddle.net/e4ny6/2/ use var numquestions, navs; function init() { cd(); numquestions = document.getelementsbyclassname("qbutton").length; navs = document.getelementsbyclassname('navbutton'); show(0); } function show(i) { document.getelementsbyclassname("current")[0].classname="qbutton"; document.getelementsbyclassname("active")[0].classname="qpanel"; document.getelementsbyclassname("qpanel")[i].classname+=" active"; document.getelementsbyclassname("qbutton")[i].classname+=" current"; navs[0].style.displa

node.js - Specifying a subdomain in the route definition in Express -

i'm new expressjs , nodejs in general, need directions on how achieve effect: app.get('/', 'sub1.domain.com', function(req, res) { res.send("this sub1 response!"); }); app.get('/', 'sub2.domain.com', function(req, res) { res.send("this sub2 response!"); } so when request sub1.domain.com first handler reacts , on sub2.domain.com response second handler. i've read questions on using vhost purpose, i'd more happy if described above worked rather creating multiple server instances in vhost. a quick , simple solution is: app.get('/', function(req, res) { var hostname = req.headers.host.split(":")[0]; if(hostname == "sub1.domain.com") res.send("this sub1 response!"); else if(hostname == "sub2.domain.com") res.send("this sub2 response!"); }); reference: http://code4node.com/snippet/http-proxy-with-custom-routing

javascript - Remove element at specific screen width with jquery? -

i'm building responsive site mobile first approach need add html element when screen larger 641px , remove when less. problem i'm having when resize screen larger 641px code produces infinite numbers of said element , when reduce screen size there masses amounts of space when removed. my code looks this: <script> $(function () { $(window).resize(function () { if ($(window).width() > 641) { $('.project_nav').append('<li><a class="work_grid" href="#"><img src="images/noun_project_5193.svg"/> </a></li>'); } else { $('.work_grid').remove(); } }); }); </script> and here's html want append: <div class="project_nav"> <ul> <li><a class="up_arrow" href="#"><im

php - phpMyAdmin mbstring error -

whenever try enter phpmyadmin, gives me error: the mbstring extension missing. please check php configuration. i've looked on internet fix, i've found errors similar mine, not same, or exact same there no fix given. i using windows. in centos have installed php extension. did with: yum install php-mbstring

html5 - Why does Chrome keep attempting to mount mp4 files when it can't play them? -

why chrome keep attempting mount mp4 files when can't play them? i working on pc windows 7, ie 10, chrome version 25.0.1364.172. it doesn't matter whether mp4 source line before or after object lines, chrome seems want mount mp4 files if can't play them. i play mp4 file in ie 10 , flash equivalent in chrome, can't seem make combination of line ordering work. so far, workaround use flash in both browsers. why have to? thought html5 video tag supported both browsers? is correct way flash fallback coded, doesn't seem working. there way code don't have use flash in ie 10, can play mp4 files native? thanks whatever assistance can give me. here's copy of code generated @ http://sandbox.thewikies.com/vfe-generator/ <!-- "video everybody" http://camendesign.com/code/video_for_everybody --> <video controls="controls" poster="mark.jpg" width="640" height="480"> <source src

php - get URL id in zend framework -

i need url id particular data database in zend framework 2. controller script: $request = $this->getrequest(); return new viewmodel( array('request' => $request)); and view: echo $this->request; i got output like: get http://public.localhost.com:80/property/274 http/1.1 cookie: _ga=ga1.2.1235676771.1376588476; phpsessid=7bs59pfipit9eekd3tqmcocna3 host: public.teamleads.com connection: keep-alive cache-control: max-age=0 accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 user-agent: mozilla/5.0 (macintosh; intel mac os x 10_8_4) applewebkit/537.36 (khtml, gecko) chrome/29.0.1547.62 safari/537.36 accept-encoding: gzip,deflate,sdch accept-language: en-us,en;q=0.8 but, need property id, is: 274. should do? just use getparam() method : // $request = $this->getrequest(); return new viewmodel( array('property' => $this->getevent()->getroutematch()->getparam('property')

node.js - Check if document already exists if not create one -

im learning expressjs + mongo. want check after user logs in passport through steam if data in database if not create record him. for created static method in schema. unfortunatelly can't save inside of it. typeerror: object # has no method 'create' steamaccountschema.statics.checkaccount = function(identifier){ this.findone({ 'identifier' : identifier }, function(err, account){ if(err) throw err; console.log("checking account:" + account) if(account) { console.log("user in db") return true } else { console.log("creating new user account") this.create({ name : 'username', identifier: identifier }, function(err){ if(err) throw err; // if (err) return done(err); return false }); } }); } just cache this object. i.e. in code below self points need: steamaccountschema.statics.ch

php - Subtracting values from different table row -

i'm trying subtract 2 values using method, doesn't work me. idea how subtract using way? <td>'.$row['sales']-$row['return'].'</td> wrap in parentheses: <td>' . ($row['sales'] - $row['return']) . '</td>

ruby - Why does a Flip-Flop operator include the second condition? -

the following code using flip-flop operator. (1..10).each {|x| print "#{x}," if x==3..x==5 } why results 3,4,5 ? i think should 3,4 . as mentioned in tutorial, expression becomes true when x == 3 , , continues true until x == 5 . how '5' been printed if evaluates false? please clarify me? the important link, "the ruby programming language" : 4.6.9.1 boolean flip-flops when .. , ... operators used in conditional, such if statement, or in loop, such while loop (see chapter 5 more conditionals , loops), not create range objects. instead, create special kind of boolean expression called flip-flop. flip-flop expression evaluates true or false, comparison , equality expressions do. extraordinarily unusual thing flip-flop expression, however, value depends on value of previous evalu- ations. means flip-flop expression has state associated it; must remember information previous evaluations. because has state, expect flip-f

Error/Warning using the replicate function in R -

i trying replicate station number 24 times each using code follows: stnid <- null (i in 1:24) { stnid[i] <- rep(paste0("station",i),times=24) } > stnid [1] "station1" "station2" "station3" "station4" "station5" "station6" "station7" "station8" "station9" [10] "station10" "station11" "station12" "station13" "station14" "station15" "station16" "station17" "station18" [19] "station19" "station20" "station21" "station22" "station23" "station24" however, warnings saying : > warnings() warning messages: 1: in stnid[i] <- rep(paste0("station", i), times = 24) : number of items replace not multiple of replacement length 2: in stnid[i] <- rep(paste0("station", i), times = 24) : number

AIR for iOS -Quick Publish vs Ad Hoc -optimization difference? -

i use 'quick publish' option single kiosk based air ios apps. is there additional optimization occurs during compilation if using 'ad hoc' option? yes. there 4 different build options (at least in flash builder): ad hoc release build distribution release build standard debug build fast debug build release builds, standard debug, , fast debug substantially different in terms of performance. the release builds meant final releases , take 5-30 minutes build, depending on cpu , ram. ad hoc allows install on specific devices specified in mobileprovision file. distribution creates build can submit ios app store standard debug allows debug mode in close-to-release-mode environment , takes same time release builds, though bit quicker build. not fast release, won't notice difference in normal activities. in activities, however. on last app, had decode wav files playable on device. in standard mode, 10-15 second task on iphone 4s. using ad-hoc, le

compiler construction - Cannot execute wfc386 no such file or directory - Watcom Fortran IDE -

i've been given legacy fortan iv program need compile legacy programming languages class , i've been instructed use watcom ide http://www.openwatcom.org/index.php/downloads . my steps follows: install ide c:\program files\watcom fortan compiler create new project @ c:\sampleproject.wpj select win32 (nt/95/win32s) target environment select windows executable (.exe) image type select 'new source' under 'sources' menu locate , add c:\hilbert.for file project select 'make all' main menu bar my build environment: windows 7 x64 sp 1 intel core i7-3720qm @ 2.6ghz 16gb ram results: cd c:\ - "can't find filename in 'cd c:\'" wmake -f c:\sampleproject.mk -h -e - "can't find filename in 'wmake -f c:\sampleproject.mk -h -e'" wfc386 \hilbert.for -d2 -q -dep - "can't find filename in wfc386 \hilbert.for -d2 -q -dep'" error(e14): cannot execute (wfc386): no such file or directory

MongoDB Update Array element -

i have document structure like { "_id" : objectid("52263922f5ebf05115bf550e"), "fields" : [ { "field" : "lot no", "rules" : [ ] }, { "field" : "rma no", "rules" : [ ] } ] } i have tried update using following code push rules array hold objects. db.test.update({ "fields.field":{$in:["lot no"]} }, { $addtoset: { "fields.field.$.rules": { 'item_name': "my_item_two", 'price':1 } } }, false, true); but following error can't append array using string field name [field] how do update? have searched thru similiar posts nothing clicking. help. you gone deep wildcard $ . match item in fields array, access on that, with: fields.$ . exp

android - Dynamically created TextViews in Java - NullPointerException -

i try add dinamically textviews in java. assume when want use settext() method, should earlier connect java's textview object xml's textview - use setid() . at end, got nullpointerexception in line use setid() . my code: textview[] tvquestion = new textview[numberofquestions]; textview[] tvanswer1 = new textview[numberofquestions]; textview[] tvanswer2 = new textview[numberofquestions]; textview[] tvanswer3 = new textview[numberofquestions]; layoutparams params = new layoutparams(layoutparams.wrap_content, layoutparams.wrap_content); (int = 0; < numberofquestions; i++) { tvquestion[i].setid(view.generateviewid()); // nullpointerexception! tvanswer1[i].setid(view.generateviewid()); tvanswer2[i].setid(view.generateviewid()); tvanswer3[i].setid(view.generateviewid()); tvquestion[i].setlayoutparams(params); tvanswer1[i].setlayoutparams(params); tvanswer2[i].setlayoutparams(params); tvanswer3[i].setlayoutparams(params);

ontology - Is it safe or reasonable for owl ontologies to be mutually (circularly) dependant? -

is safe or reasonable owl ontologies mutually (circularly) dependant? ask because of potential see cross-domain data , reasoning. seems me of technical limitations might apply in mainstream executable programming languages don't have apply here. for example, have 2 ontologies: 'stuff' , 'creature'. in 'stuff' define physicalobject class, denote inheritors have position in space. in 'creature' define person class, denoting member of society. <!-- in 'stuff' --> <owl:class rdf:id="stuff#physicalobject"/> <!-- in 'creature' --> <owl:class rdf:id="creature#person"/> as individual person instance occupies position in space, seem appropriate declare subclassof physicalobject. can resolved importing 'stuff' in 'creature' ontology. want have property in 'stuff' refers person in range: isheldby. <!-- in 'creature' --> <owl:ontology rdf:about=&qu

iphone - Can't select UITableViewCell when TableView setEditing is set -

Image
i want able select multiple rows default mail app shown below: i have button called edit calls [self.mytableview setediting:yes animated:yes] the edit button shows circles on left of cells mail app shown above. however, when select 1 of rows, nothing happens. red checkmark not appear in circle expect. why isn't red checkmark appearing? #pragma mark - uitableviewdatasource methods - (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { uitableviewcell *cell = [tableview dequeuereusablecellwithidentifier:@"myidentifier"]; if (cell == nil) { cell = [[uitableviewcell alloc] initwithstyle:uitableviewcellstylesubtitle reuseidentifier:@"myidentifier"]; } cell.textlabel.text = @"hey"; return cell; } - (nsinteger)tableview:(uitableview *)tableview numberofrowsinsection:(nsinteger)section { return 3; } #pragma mark - uitableviewdelegate methods - (void)tablevi

visual studio 2010 - Generating vcxproj files with object output paths like in object_parallel_to_source mode -

what configuration need give qmake generate vcxproj file object files arranged in tree original code? i have been searching quite while , scrutinized source of qmake no avail. so far tried config -= flat changed filters, not output paths. , object_parallel_to_source works makefiles far can tell. i need feature avoid name clashes of object files having same name, because source files have same name reside in different folders. it possible avoid msvc setting appropriate output path files in properties dialog. however, tedious , developing project on linux , porting on windows time time have whole procedure on , on again.

delphi - Event when all mdi forms are closed -

guys, i'd if knows event or method can intercept when mdi forms closed. example: i want implement event in main form when close mdi forms, such event triggered. grateful if can help. mdi child forms (in fact form), while being destroyed, notify main form. can use notification mechanism. example: type tform1 = class(tform) .. protected procedure notification(acomponent: tcomponent; operation: toperation); override; .. procedure tform1.notification(acomponent: tcomponent; operation: toperation); begin inherited; if (operation = opremove) , (acomponent tform) , (tform(acomponent).formstyle = fsmdichild) , (mdichildcount = 0) begin // work end; end;

python - Store Big Dictionary Restrict Memory -

i have extremely big dictionary need analyze. how dictionary come existance? the dictionary pivot table of log file. have snapshot of inventory everyday , right have snapshots past month. each snapshot looks this: 2013-01-01 apple 1000 2013-01-01 banana 2000 2013-01-01 orange 3000 .... and then, group records product name , plan time series analysis later. output have looks this: { apple:[(2013-01-01,1000),(2013-01-02, 998),(2013-01-03,950)...], banana:[(2013-01-01,2000),(2013-01-02, 1852),(2013-01-03, 1232)...] orange.... } as know, assuming have years , years of inventory snapshots , wide inventory breadth... dictionary turns out huge. whole 'grouping' process happens in memory , size of dictionary exceeds memory limit. i wondering how restrict memory usage specific amount(say 5gb , don't want disable server normal usage) , work on disk. here similar question mine following 'best voted' answer, memory still eaten after change loop numbe

java - Having trouble loading MySQL database via Hibernate in Eclipse -

resolved problem lay jboss standalone.xml file. fat fingered database name - , can't find tables. else seeing error (because found lot of unresolved) driver , database definitions. i trying load populated mysql database through hibernate in eclipse. know have connected database, because can ping through eclipse. when publish informs me table not found. i'm not sure missed. see below persistence.xml file: <?xml version="1.0" encoding="utf-8"?> <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"> <persistence-unit name="test"> <jta-data-source>java:jboss/datasources/cser-ds</jta-data-source> <class>org.package.nicknames</class> <properties>

osx - Apple Dictation - Use in app -

is there way utilize apple's dictation voice text abilities in native apple application? your question little vague, know have tried using or doing first, or eve trying achieve. more commonly found keyword recognition api. speech recognition api can used open ears . along ceed vocal . the first free (open ears), apparently ceed vocal give better results. edit if want speech recognition api osx, use nsspeechrecognizer class. the nsspeechrecognizer class cocoa interface speech recognition on os x. speech recognition architected “command , control” voice recognition system. uses finite state grammar , listens phrases in grammar. when recognizes phrase, notifies client process. architecture different used support dictation. it configurable needs.

Python PIL For Loop to work with Multi-image TIFF -

each tiff file has 4 images in it. not wish extract , save them if possible, use loop @ each of them. (like @ pixel [0,0] )and depending on color in 4 accordingly. is possible using pil? if not should use. you can use "seek" method of pil image have access different pages of tif (or frames of animated gif). from pil import image img = image.open('multipage.tif') in range(4): try: img.seek(i) print img.getpixel( (0, 0)) except eoferror: # not enough frames in img break

assembly - Moving quadwords to xmm -

i want know code use move 64-bit register number in xmm register. thought was: `movsd xmm1, [r14]` but keep getting segmentation fault: 11 . i using nasm x86 on mac os-x. someone please help. movsd xmm1, [r14] attempts load double address stored in r14 . that's not want. instead, use: movq xmm1, r14

c++ - Makefile Errors -

i've been trying compile makefile on mac , bringing particular error. first, here folder makefile in: http://www.zezula.net/download/stormlib.zip direct download link. contains file, "makefile.mac", i'm trying run. so installed command line tools through xcode, , used: cd ~/downloads/stormlib/ make -f makefile.mac it showed error: makefile.mac:87: *** missing separator (did mean tab instead of 8 spaces?). stop. and yes, i've searched solution this. says add tab beforehand. tried that, , showed: makefile.mac:87: *** commands commence before first target. stop. i looked error, , 1 of solutions involved having spaces instead of tabs. i'm confused. should fix it? line 87 looks like: src/libtomcrypt/src/pk/asn1/der_length_utctime.obj \ thanks , help. edit: here makefile: http://pastebin.com/ksba5fuv a version of makefile lines deleted , line 87 marked is: [9 lines deleted] cpp = g++ cc = gcc cflags = -wall lflags = -lbz2 -lz

node.js - NodeJS Code Coverage of Automated Tests -

as part of custom testing framework nodejs rest api, i'd automatically detect when tests no longer providing proper coverage comparing possible outcomes test suite received. what methods exist doing this? can assume it's being used rest api list of entry functions (api endpoints) need coverage analysis, , each entry function end known 'exit function' responds requester in standard way. here's i've found far: 1: basic solution (currently implemented) when writing each rest endpoint, manually create list of possible outcome 'codes' [success, failureduetox, failureduetoy] example after tests have run, ensure every code in list has been seen test suite each endpoint. pros: basic , easy use; doesn't change performance testing times cons: highly prone error lots of manual checking; doesn't flag issues if there 5 ways 'failduetox' , test 1 of them. basic definition of 'coverage' 2: static analysis parse code s

java - Eclipse - set custom color theme and now when highlighted things turn black -

Image
so got custom color theme in eclipse, decided didn't , went default. know when click on variable in eclipse highlights other mentions of it. in black. removed other features not that. can me out? this option can modified under annotations section of preferences dialog (as shown below).

android - What are lib_k3_generic_audio_extractor.so, lib_k3_mov_extractor.so, and so on? -

i'm experimenting android mediacodec, code got here: https://code.google.com/p/android-source-browsing.platform--cts when tried run code "android-source-browsing.platform--cts/tests/tests/media/src/android/media/cts/decodertest.java", got these errors: d/android.media.cts.decodertest(6615): decode(): master = 2131034134 d/android.media.cts.decodertest(6615): decode(): masterfd = {assetfiledescriptor: {parcelfiledescriptor: filedescriptor[50]} start=1781867 len=529200} d/android.media.cts.decodertest(6615): decode(): masterlength = 529200 d/android.media.cts.decodertest(6615): decode(): = android.content.res.assetfiledescriptor$autocloseinputstream@417592a0 d/android.media.cts.decodertest(6615): decode(): bis = java.io.bufferedinputstream@41759368 i/extractorloader(6615): register extractor [lib_k3_avi_extractor.so] e/extractorloader(6615): open [lib_k3_mov_extractor.so] failed! e/extractorloader(6615): open [lib_k3_flv_extractor.so] failed! i/extractorloader(6615