Posts

Showing posts from January, 2011

python - Matplotlib cmap color-to-number mapping -

Image
i'm parsing data , plotting matplotlib. i've produced following graph following code: n = 10000 num_clusters = 8 cluster_values = kmeans(data, num_clusters=num_clusters) y = np.random.normal(1, 0.1, n) py.figure(num=1, figsize=figsize) py.scatter(data[:n], y, c=cluster_values[:n]) py.title("%s clustering of first %d data points %d clusters" % (data_label, n, num_clusters)) py.show() i'm taking income data, running through kmeans cluster , plotting data colormap of cluster index of each point. figure out relationship between colors , cluster index. i'd know that, example, blue = 2 , green = 0. put way, want know color point assigned based on it's cluster_value . as code, n=10000 there decrease number of points (i have ~100000, slows down computer) , np.random.normal there spread out data.

Create a audio object by using JavaScript code -

i need create popup window , insert content using javascript coding. now, web page show pop-up when function(camanjs) processed. function output image in dataurl form.and show in pop-up var w=window.open('about:blank','image canvas'); w.document.write("<img src='"+this.tobase64()+"' alt='from canvas'/>"); i want insert audio 5 second pop-up. , played audio execute function2(). you can encode binary file base64 string , decode. here's example in php encoding: function encodedaudiostring($type, $file) { return 'data:audio/' . $type . ';base64,' . base64_encode(file_get_contents($file)); } if want encode , decode in browser, need request file xhr arraybuffer. check link full code: https://github.com/dondido/mp3-to-base64-encoder-and-decoder/blob/master/index.html then can embed datauri string src of audio element: <audio controls src="data:audio/ogg;base64,t2dnuwacaaaaaaaa

How to disable a Dynamic button by clicking another Dynamic button in android -

i creating 4 buttons dynamically in android in loop. number of buttons can increased 4 in other cases. trying disable other buttons while clicking 1 button. trying array of button object. button btn[] = new button[4]; for(int i=0;i<4;i++) { tablelayout layout = (tablelayout)findviewbyid(r.id.tableforevents); btn[i]=new button(this); btn[i].setid(i); btn[i].settext("button"+i); layout.addview(btn[i]); btn[i].settext(i); } this code giving me null pointer exception , results in application crash. unable perform next operation of enabling or disabling. kindly tell me solution or if there way solve problem make sure r.id.tableforevents present in current layout activity. should getting layout null also move below code outside loop (no need instantiate multiple times.) tablelayout layout = (tablelayout)findviewbyid(r.id.tableforevents);

javascript - What could be the reason for Error: Can't set headers after they are sent -

hi getting below error error: can't set headers after sent. @ serverresponse.outgoingmessage.setheader (_http_outgoing.js:331:11) @ serverresponse.header (/users/rajesh/documents/nodeproject/nodetest1/node_modules/express/lib/response.js:662:10) @ serverresponse.send (/users/rajesh/documents/nodeproject/nodetest1/node_modules/express/lib/response.js:146:12) @ fn (/users/rajesh/documents/nodeproject/nodetest1/node_modules/express/lib/response.js:896:10) @ view.exports.renderfile [as engine] (/users/rajesh/documents/nodeproject/nodetest1/node_modules/jade/lib/jade.js:325:12) @ view.render (/users/rajesh/documents/nodeproject/nodetest1/node_modules/express/lib/view.js:76:8) @ function.app.render (/users/rajesh/documents/nodeproject/nodetest1/node_modules/express/lib/application.js:527:10) @ serverresponse.res.render (/users/rajesh/documents/nodeproject/nodetest1/node_modules/express/lib/response.js:900:7) @ /users/rajesh/documents/nodeproject/

reporting services - SSRS Deployment complaining about path length when my path is short -

i attempting deploy ssrs solution. have set "targetreportfolder" property of project "reports" when right-click , select "deploy", following error: the path of item '/reports' not valid. full path must less 260 characters long; other restrictions apply. if report server in native mode, path must start slash. obviously path less 260 characters long. i've tried setting targetreportfolder property "/reports", name of project, , name of project slash @ beginning - give same error. i don't understand deployment process well. can me understand? (i feel may not on topic, encouraged presence of ssrs tag) my problem didn't understand how reporting services works sharepoint. comment above incorrect, did need deploy, had wrong parameters properties. page helped me: http://msdn.microsoft.com/en-us/library/bb283155.aspx the key takeaways article are: all target*folder properties need either url document l

unit testing - unittest python, missing function test -

i'm learning unittesting , i'm finding not of test functions being run. i've found first 4 run last 2 give no results. if comment out first 4 functions last 2 show up. how can of functions test? i'm new unit-testing advice received class mytest(unittest.testcase): def test_country(self): self.asserttrue(country in x) def test_company_size(self): self.asserttrue(company_size in x) def test_zipcode(self): self.asserttrue(zipcode in x) def test_region(self): self.asserttrue(region in x) def test_street(self): self.asserttrue(street in x) def test_address(self): self.asserttrue(address in x) if __name__ == '__main__': suite = unittest.testloader().loadtestsfromtestcase(mytest) unittest.texttestrunner(verbosity=3).run(suite) results: test_company_size (__main__.mytest) ... ok test_country (__main__.mytest) ... ok test_region (__main__.mytest) ... ok test_zipcode (__main_

osx - Will a Microsoft Office Add-In developed in Visual Studio work for both a Windows and Mac (OS X) versions of MS Office? -

i want develop microsoft office word add-in mac users. know if create using visual studio in windows compatible mac version of microsoft office or there different way develop mac? please provide links can follow guidelines. http://msdn.microsoft.com/ site doesn't speak of platform compatibility of add-in. office mac not provide api add-ins , documentation office automation on mac os x rare. however, should able customize using vba solutions described in tutorial microsoft: office mac: automate tasks visual basic macros

android - EditTextPreference crashes on OK press -

i have preferencefragment activity shows following edittextpreference: <edittextpreference android:key="year" android:title="@string/prefs_yearpicker" android:summary="@string/prefs_yearpickersummary" android:textallcaps="true"/> but when want change value, shows no cursor, , when press ok, crashes, returning following message: 11-27 07:59:33.900: e/androidruntime(23355): fatal exception: main 11-27 07:59:33.900: e/androidruntime(23355): java.lang.indexoutofboundsexception: replace (0 ... -1) has end before start 11-27 07:59:33.900: e/androidruntime(23355): @ android.text.spannablestringbuilder.checkrange(spannablestringbuilder.java:1009) 11-27 07:59:33.900: e/androidruntime(23355): @ android.text.spannablestringbuilder.replace(spannablestringbuilder.java:441) 11-27 07:59:33.900: e/androidruntime(23355): @ android.text.spannablestringbuilder.delete(spannablestringbuilder.jav

android - What is the most efficient way to check if two imageviews intersect? -

i working on android app have 1 fixed imageview in middle of screen , other imageviews moving towards it. implement method notify me 1 of moving images touches middle one. using right now: public void checkloss() { if(speklist.size() > 0) { for(spek spek : speklist) { final int[] position = new int[2]; spek.getlocationinwindow(position); final rect rect1 = new rect(position[0], position[1], position[0] + spek.getwidth(), position[1] + spek.getheight()); middle.getlocationinwindow(position); final rect rect2 = new rect(position[0], position[1],position[0] + middle.getwidth(), position[1] + middle.getheight()); if(rect.intersects(rect1, rect2)) { if (health == 1) { lost = true; gameover(); break; } else { health--; setmiddleimage(health);

renaming what is inside a list of folders using php -

in ftp have folder structure this: mainfolder - subfolder1 - something_01.jpg - something02.jpg - subfolder2 - 23123.jpg - 12345.jpg , on.. i trying rename every file inside subfolder first arranging files alphabitically renaming 1.jpg, 2.jpg, 3.jpg , on. here code deletes inside subfolders files when run it! missing something? $directory = 'mypath'; if ($handle = opendir('mypath')) { while (false !== ($entry = readdir($handle))) { if ($entry != "." && $entry != "..") { $dirfiles = array(); if ($handles = opendir($directory.$entry.'/')) { while (false !== ($file = readdir($handles))) { if ($file != "." && $file != "..") { $dirfiles[] = $file; } } closedir($handles); } sort

javascript - protractor js e2e tests, using multiple conditions on expect -

in current test i'm working on, need validate individual column on individual row, , check value accordingly, think expect(...) i'm getting wrong i'm not entirely sure, errors i'm getting are: typeerror: object [object object] has no method 'row' typeerror: cannot call method 'element' of undefined //function in page.js file: page.prototype.getsummaryinfo = function () { return element.all(by.repeater('accountssummary in accountssummaries')) .map(function (item, idx, rownumber) { return { index: idx, row: rownumber.element(by.repeater('accountssummary in accountssummaries')).get(rownumber), currency: item.element(by.binding('accountssummary.currency')).gettext(), totalbalance: item.element(by.binding('accountssummary.amount')).gettext(), totalaccounts: item.element(by.binding('accountssumm

date - When google calendar v3 API was officially release? -

please 1 tell me release date of calendar v3 api i'm not sure precise release date of v3, deprecation of v2 novermber 17th, 2014. consider november 17th official v3 enforcement date.

PushPlugin register goes to errorhandler showing 'Class not found' with cordova 4.0.0 for android platform -

i'm building hybrid app using cordova (version 4.0.0) android. i have added pushplugin ( https://github.com/phonegap-build/pushplugin ) project. while registering goes errorhandler , displays 'class not found'. i have tried various suggestion added plugin reference in xml. plugin reference there in config.xml file. directly install plugin using cli (tried cordova plugin add https://github.com/phonegap-build/pushplugin.git cordova plugin add com.phonegap.plugins.pushplugin) create new project etc. pushnotification.js added in html ( <script type="text/javascript" src="js/pushnotification.js"></script> ) , located in www/js/ but still i'm getting same message 'class not found' i have installed supporting plugins device, file, media used pushplugin please advice if has solution issue. code sample: document.addeventlistener("deviceready", ondeviceready, false); var pushnotification; function ondevi

angularjs - How to suppress the "Authentication Required" Popup from browser? -

Image
for invalid credentials getting "authentication required" popup. how suppress popup , let application handle 401 error case? if you're using php. depending on how end set, check if have: header('www-authenticate: basic realm="my realm"'); header('http/1.0 401 unauthorized'); this how should be: header('http/1.1 401 unauthorized', true, 401); see php header() docs .

apache - Redirect rule not fired in htaccess -

any thoughts why url example.com/hotelinfo.aspx?idhotel=2 not redirecting 1 example.com/new-url using following rule in .htaccess ? redirect 301 /hotelinfo.aspx?idhotel=2 http://www.example.com/new-url you cannot match query string using redirect directive, use mod_rewrite rules instead. you can use code in document_root/.htaccess file: rewriteengine on rewritecond %{query_string} ^idhotel=2$ rewriterule ^hotelinfo\.aspx$ http://www.example.com/new-url? [l,r=302,nc] once verify working fine, replace r=302 r=301 . avoid using r=301 (permanent redirect) while testing mod_rewrite rules.

Android External GPS device receiver -

i want create android application uses external device's gps coordinates (because mobile devices have less accurate gps). the device trying run trimble gps receiver pro 6t any suggestions how can data gps device , data mobile device? i've tried searching libraries , guides found nothing. the usual way case use nmea format. each gps reciever can set output in nmea format via serial com. parse socket, line line. searching nmea parser give src code.

xcode - iOS Triangular Image view -

so i'm making game , pretty when player (which triangular shaped rocket) hits object flying @ (a rock) game ends. have working problem rocket triangle yet image view in rectangle. if edge of image view touches rock game end though actual rocket didn't touch object. how can make rock image view not recognize parts of rocket image view empty? triangular shaped image view. thank help. let me know if need more info or want see code have them collide. you analytically present triangle 3 points , rock center , radius find , implement algorithm checking hit test between 2 shapes. or draw 2 shapes onto graphics context using appropriate blending , check overlapping pixels (for instance draw 1 red , green , if pixel both red , green exists) 2 image views having colors , .5f alpha added on 3rd invisible view need image view , iterate through pixels. in of cases check after corresponding view frames overlap.

java - Android: how to load specific document -

i trying load document https://nis.hzs.sk/?caaml&cron=true have not seen structure anywhere else. simple serialized array? how should load inside android? think way load html file, strip html tags (and little response window) , read lines using string parser. thanks in forward help you need make http request. see library can you. http://loopj.com/android-async-http/

vb.net - Read combo selectvalue with Forms.Control -

in vb.net read textbox line of code: me.groupbox1.controls("textbox" & i).text but if want read combobox with: me.groupbox1.controls("combobox" & i).selectedvalue i have error because selectedvalue not member of system.windows.forms.control what can read combobox dynamically? you need cast control combobox , can read properties normal: directcast(me.groupbox1.controls("combobox" & i), combobox).selectedvalue

objective c - Facebook like button iOS -

follow the docs ios like-button can create facebook's button app. code below: fblikecontrol *like = [[fblikecontrol alloc] initwithframe:cgrectmake(200, 110, 250, 250)]; like.likecontrolstyle = fblikecontrolstyleboxcount; like.objectid = @"https://openmerchantaccount.com/img/8a0e730c-bba3-43f4-9ea1-525c13917980-original.jpg"; [self.view addsubview:like]; then can page had objectid above. have question that, (like button) have value when image link above never post facebook page? , purpose of button when let users click button app?(sorry,it maybe naive question don't understand). from can understand of question. the purpose of button user "likes" image, seen page. facebook may display user's activity friends news feeds user's activity feed. you can use feature small widget on page show "x people page including a, b , c" x total number of likes objectid , a, b , c being friends of logged in user. helps facebook advertis

r - Creating a list/vector from first column od multiple data -

in total have 21 csv files load r. did: list_of_data = list.files(pattern="*.csv") tbl_met = lapply(list_of_data, read.csv) can't give dput because it's data... what want list off names in first column in datasets. combined 1 vector/list there 2 problems: first of columns in files separated ";" or without separation mark... have inside files , make them separated in same way ? second problem there might duplicates of names , i'd remove them list. do have idea how ? should provide more data ? if yes, let me know how that. i found solution. it's not easiest 1 works. first of had convert of csv files same pattern. easy task r. later: list_of_data = list.files(pattern="*.csv") tbl_met = lapply(list_of_data, read.csv) tbl <- rbindlist(tbl_met) ## binding of tables in list row vec_names <- tbl$locus ## name of column names interested in vec <- unique(vec_names) ## removing duplicates nicely done!

ios - EXC_BREAKPOINT in Swift -

Image
i set var tagtextfield: uitextfield in set method. later when call method want var tagtextfield: uitextfield , namely: var pos1 = tagtextfield.positionfromposition(tagtextfield.beginningofdocument, indirection: uitextlayoutdirection.right, offset: 0) i following error: thread 1: exc_breakpoint (code=1, subcode=0x1000e4280) i tried see if var tagtextfield: uitextfield == nil , same error. suggestions why is? if need more code, let me know. thanks in advance edit: here error. no breakpoint you set breakpoint on xcode (probably mistake when trying access specific line). breakpoints represented blue tabs , allow stop execution of code check variable states instance. click on again deactivate (it turn light blue).

Specman e: How to disable coverage of an instances / units? -

in verification environment under sys there instance of timer_sve . under timer_sve have 2 other instances: timer , ocp_master : extend sys { timer_sve : timer_sve_u instance; }; unit timer_sve_u { timer : timer_u instance; ocp_master : ocp_u instance; }; i need collect coverage timer . i've tried code (and many other variations of it) disable coverage of ocp_master : extend sys { timer_sve : timer_sve_u instance; setup() { // code disable ocp_master's coverage global.covers.set_cover_block("ocp_u", false); }; }; the code compiled , run continues collect coverage ocp_master ... how can disable collecting ocp_master coverage? appreciate help. the method set_cover_block(...) doesn't take unit input, module (i.e. file) in coverage elements defined. try changing take file in extend ocp_u coverage definitions. what disable coverage items/groups/etc. set when option false : extend some_struct { c

Setting image in android twitter integration -

i have app integrate android & twitter. application permission given while loading profile , fetching data profile, app stops responding. logcat shows nullpointerexception @ onpostexecution . so, have put image loading part of code under comments. can make change in comments app works image loading alongside it? here code profile fragment : public class profilefragment extends fragment { textview prof_name; sharedpreferences pref; bitmap bitmap; imageview prof_img,tweet,signout,post_tweet; edittext tweet_text; progressdialog progress; dialog tdialog; string tweettext; @override public view oncreateview(layoutinflater inflater,viewgroup container, bundle args) { view view = inflater.inflate(r.layout.profile_fragment, container, false); prof_name = (textview)view.findviewbyid(r.id.prof_name); pref = getactivity().getpreferences(0); prof_img = (imageview)view.findviewbyid(r.id.prof_image); tweet = (imageview)view.findviewbyid(r.id.tweet); signout = (ima

javafx - No events when drag target is removed from the scenegraph while dragging -

Image
javafx scene has object of class inherited region. object has handler of mouse_dragged event. when handler called, object's child nodes removed , new child nodes added. problem when children removed object, doesn't receive events anymore, because target of mouse_dragged event removed child node. how solve it? i cannot use setmousetransparent method, because elements inside object have mouse event handlers. ok, perhaps got question: a region has many children. if user left-clicks , dragges on these children, modified or removed. mouse-drag event 'locked' first child drag started, no other child receive further events if mouse dragged on of other children. you might benefit fact, mousedrag event passed parent region after removing child. possible register onmousedragged handler on th eparent regon receiving event. handler able 'pick' childs below mouse further actions using event.getpickevent(): void mousedragpop(pane region) { region.seto

SQL optimization on ORDER BY clause on varchar(max) column -

our c# application using sql database match tables eachother. have 1 table contains around 1 million rows. of datatypes varchar(900) , below. though there columns imported varchar(max) type. user able see whole table of 1 million records via c# application. reduce amount of memory used on local system use pagination algorithm. e.g. load 2 datatables of +- 15.000 rows each in memory. when user scrolling past these pages, furthest page updated new data database table, way can have large tables without running memory problems. we specific data database table use of row numbers. query retrieving data looks this: ;with selectrows as(select *, row=row_number() over(order mycolumn) mytable) select * selectrows row between 0 , 15000; on small tables isn't of problem regarding performance. large tables, when sort on column has no index (for example varchar(max) columns), executing slow. sorting on column index executing blazing fast, expected of course. in way possible sort large

How setup sbt for parallel package into jars? -

i have sbt project several modules need packaged jar archives. see in logs sbt packages each project jar sequentially: [info] packaging c:path\target\scala-2.11\projectfirst ... [info] packaging c:path\target\scala-2.11\projectsecond ... [info] packaging c:path\target\scala-2.11\projectthrird ... projects not depend of each other , can packaged in parallel. there possibility setup sbt package projects in parallel? in sbt documentation can find following sentence: by default, sbt executes tasks in parallel. i prepared experiment check this. created project 4 subprojects. code: main build.sbt: lazy val sub1 = project lazy val sub2 = project lazy val sub3 = project lazy val sub4 = project keys.`package` in compile <<= (keys.`package` in compile).dependson(def.task { }) sub1/build.sbt keys.`package` in compile <<= (keys.`package` in compile).dependson(def.task { for( <- 1 2){ thread.sleep(1000) println( "subproje

php - CakePHP call to undefined method stdClass::read() error -

i'm new cakephp , i'm still learning basics, through working in live project , taking cakephp documentations when necessary. currently, i'm having following problem : i've changed database table name , structure, forced change view, controller , model names. after changing names, whenever run index.ctp page, following error: fatal error: call undefined method stdclass::read() in c:\wamp\www\sdb\app\controllers \home_loan_distributions_details_controller.php on line 32 previously, view folder named home_loan_distributions , it's renamed home_loan_distributions_details . my previous controller name home_loan_distributions_controller.php , current name home_loan_distributions_details_controller.php . codes: class homeloandistributionsdetailscontroller extends appcontroller { var $name = 'homeloandistributionsdetails'; function index() { $user = $this->session->read('user'); $user_role = $user[

Google Chromecast: Unable to cast video/mp4 with captions from iOS getting Load metadata error -

i building ios app cast video content dlna/upnp media server chromecast. problem appears when add media track data captions. following works: ### media manager - load: { "type":"load", "i":false, "defaultprevented":false, "kb":true, "data": { "currenttime":0, "requestid":3, "autoplay":true, "media": { "metadata": { "title":"movie.mp4", "subtitle":"unknown", "images": [{ "url":"http://192.168.1.15:8895/resource/625/cover_image", "width":200, "height":100 }], "metadatatype":0 }, "texttrackstyle": { "windowroundedcornerradius":8, "windowtype":&quo

django - AttributeError: 'NoneType' object has no attribute 'tags' -

traceback (most recent call last):<br/> file "/home/rpmbuild/venv/build/pyi.linux2/mf/out00-pyz.pyz/cherrypy.wsgiserver.wsgiserver2", line 1353, in communicate<br/> file "/home/rpmbuild/venv/build/pyi.linux2/mf/out00-pyz.pyz/cherrypy.wsgiserver.wsgiserver2", line 868, in respond<br/> file "/home/rpmbuild/venv/build/pyi.linux2/mf/out00-pyz.pyz/cherrypy.wsgiserver.wsgiserver2", line 2267, in respond<br/> file "/home/rpmbuild/venv/build/pyi.linux2/mf/out00-pyz.pyz/cherrypy.wsgiserver.wsgiserver2", line 2477, in __call__<br/> file "/home/rpmbuild/venv/build/pyi.linux2/mf/out00-pyz.pyz/django.core.handlers.wsgi", line 206, in __call__<br/> file "/home/rpmbuild/venv/build/pyi.linux2/mf/out00-pyz.pyz/django.core.handlers.base", line 194, in get_response<br/> file "/home/rpmbuild/venv/build/pyi.linux2/mf/out00-pyz.pyz/django.core.handlers.base", line 229, in handle_

amazon web services - Getting Crash with AWSS3PutObjectRequest -

i using aws sdk way properties declaration : @property (nonatomic, strong)awsstaticcredentialsprovider *credentialsprovider; @property (nonatomic, strong)awsserviceconfiguration * configuration; @property (nonatomic, strong)awss3 *s3; @property (nonatomic, strong) awss3putobjectrequest *putrequest; and implementation way accesskeys * accesskeys = [ecsglobals sharedinstance].accesskeys; self.credentialsprovider = [awsstaticcredentialsprovider credentialswithaccesskey:accesskeys.accesskeyid secretkey:accesskeys.secretaccesskey]; self.configuration = [awsserviceconfiguration configurationwithregion:awsregionuseast1 credentialsprovider:self.credentialsprovider]; self.s3 = [[awss3 alloc] initwithconfiguration:self.configuration]; self.putrequest = [awss3putobjectrequest new]; nsarray *paths = nssearchpathfordirectoriesindomains(nsdocumentdirectory, nsuserdomainmask, yes); nsstring *documentsdirectory = [paths objectatindex:0]; nsstring *savedimagepath =

haskell - Parsec separator / terminator -

apparently i'm dumb figure out... consider following string: foobar(123, 456, 789) i'm trying work out how parse this. in particular, call = cs <- many1 letter char '(' <- many argument return (cs, as) argument = manytill anychar (char ',' <|> char ')') this works perfectly, until add stuff end of input string, @ point tries parse stuff next argument, , gets upset when doesn't end comma or bracket. fundamentally, trouble comma separator , while bracket terminator . parsec doesn't appear provide combinator that. just make things more interesting, input string can be foobar(123, 456, ... which indicates message incomplete. there appears no way of parsing sequence 2 possible terminators , knowing which one found. (i want know whether argument list complete or incomplete.) can figure out how climb out of this? you should exclude separator/terminator characters allowed characters function argumen

html - Why my input doesn't fit into the div? -

i wrote html , css codes: html <body> <div id="container"> <div id="containerheader"> <h1>seek & enjoy</h1> <h3>your movie seeker</h3> <div id="containerform"> <form class="form-wrapper cf"> <div id="inputplusbuttons"> <input type="text" placeholder="find movie" required> <div id="containerbuttons"> <button id="seek" type="submit">seek</button> <button id="reset" type="submit">reset</button> </div> </div> </form> </div> </div> <div id="results"> <p> </p> <div id="movielist"> </div>

python - Cannot compile .obj file into .exe... LINK : fatal error LNK1104: cannot open file 'python34.lib' -

i'm trying convert python program standalone without bundling. far have: converted script file .c file cython converted .c file .obj file using mvsc compiler my problem completing last step: converting .obj file .exe i've used following dos commands: @echo off :: load compilation environment call "c:\program files (x86)\microsoft visual studio 10.0\vc\vcvarsall.bat" :: invoke compiler options passed batch file "c:\program files (x86)\microsoft visual studio 10.0\vc\bin\cl.exe %* :: call mvsc compiler cl /c main.c /nologo /ox /md /w3 /gs- /dndebug -i"c:\python34\include" -ic:\python34\pc /main.c /link /out:"main.exe" /subsystem:console /machine:x86 /libpath:"c:\python34\libs" /libpath:"c:\python34\pcbuild" :: create main.exe out of main.obj cl main.obj -o main.exe i following error: /out:main.exe /out:main.exe main.obj link : fatal error lnk1104: cannot open file 'python34.lib'

xml - Why can't <some-name> be used in a python list? -

for example, can't manually enter in list: list = [<element1>, <element2>, <element3>...] which throws error: >>> list = [<dom text node "u'\n\t'">] file "<stdin>", line 1 list = [<dom text node "u'\n\t'">] ^ syntaxerror: invalid syntax whereas can put element xml parse elements list, doesn't cause syntax error. have listed xml elements in list: [<dom text node "u'\n\t'">, <dom element: apple @ 0x18a4648>, <dom text node "u'\n\t\n\t'">, <dom element: google @ 0x18a4968>, <dom text node "u'\n\t\n\t'">, <dom element: lenovo @ 0x18a4b48>, <dom text node "u'\n\t\n\t'">, <dom element: samsung @ 0x18a4be8>, <dom text node "u '\n'">] which works fine, when manually try feed list above elements, fails. can e

ios - Evenly space UIImageViews within UIScrollView -

i have uiscrollview in vc containing 9 image views size of 25px x 25 px on iphone 5s spaced in centre of scroll view. when ran on iphone 6 pushed on left, not stretching evenly across screen, due screen size. is there way can make them evenly spaced on both screen sizes? code below: // set scrollview nslog(@"%f", self.view.frame.size.width); uiscrollview *scrollview = [[uiscrollview alloc] initwithframe:cgrectmake(25, 200, self.view.frame.size.width - 50, 30)]; scrollview.alwaysbouncehorizontal = yes; nslog(@"%f", scrollview.frame.size.width); uiview *view = [[uiview alloc] initwithframe:cgrectmake(0, 0, scrollview.frame.size.width, scrollview.frame.size.height)]; [scrollview addsubview:view]; uiimage *star = [uiimage imagenamed:@"badge_star"]; uiimageview *imgview = [[uiimageview alloc] initwithimage:star]; imgview.frame = cgrectmake(2.5, 5, 25, 25); [view addsubview:imgview]; uiimage *target= [uiimage imagenamed:@"badge_target&quo

postgresql - How to create a self incremented sequence id for table -

i want table 2 columns id , name id name 1 peter 2 mary the functionality needed insert name table , id can created automatically in incremental order something like insert table values (jack) id name 1 peter 2 mary 3 jack i using postgresql 9.3 try this create table test ( id serial, name text ) since table need 1 column insert make function create or replace function insert_into_table(val text) returns void $$ insert test (name) values (val) $$language sql usage : select insert_into_table('anyname')

c# - Adlink PCI-7250 eventcallback -

i wrote simple c# eventcallback pci-7250 (data acquisition card) when of digital inputs go high. here code: public delegate void readdelegate(uint value) public void form1_load(object sender, eventargs e) { m_dev = dask.register_card(dask.pci_7250,0); readdelegate readnow = new readdelegate(functiontocall) dask.di_eventcallback((ushort)m_dev,1,(short)dask.dbevent,readnow) } private void functiontocall(uint int_value) { messagebox.show(int_value) } when run keep"s throwing random numbers during runtime , crashes. believe has eventtype (dask.dbevent). went through manual nothing more mentioned dask.dbevent. kindly please advise. since device doesn't have support callbacks in driver, adapt driver's api synchronous calls callbacks polling device in background thread. first, create class polls device physical event you're interested in responding to. then, in gui code, put polling work in background , respond callback in main thread

jquery - Loading image in FabricJs -

i working fabricjs in designing web template. have 1 requirement show loading image while canvas loading objects (multiple images , drawing objects). unable find event render after object loaded on canvas. please suggest me solution? thanks in advance. saloni you have 1 way achieve task can loop through json object , add them 1 one , after adding them canvas, don't call canvas.renderall() . have call canvas.renderall() after loop completed. way after:render fired once after objects loaded canvas. can fiddle : http://jsfiddle.net/a6zuy11q/8/

transactions - Spring method if annotated with @Transactional its not getting called -

controller code @autowired private adnetworkplacementservice adnetworkplacementservice; @post @produces("application/json") @consumes("application/json") public adnetworkplacement createplacement(@queryparam("pubid") long publisherid, adnetworkplacement placement) throws apiexception { return adnetworkplacementservice.createnonintegratedadnetworkplacement(116l, publisherid, placement); } method code @transactional(rollbackfor = exception.class) public adnetworkplacement createnonintegratedadnetworkplacement(long userid, long publisherid, adnetworkplacement placement) throws apiexception { } the method not called when added @transactional commenting works fine problem solved it problem context-component:scan need specify complete package structure

lucene - Index Metadata in a Numeric Field -

i trying index metadata in numeric field of lucene.net don’t know how it. built class find measures on descriptions, class returns list of measures in these form: “150{inch} 200{mm}” etc. , want index these values search them simultaneously, numeric value , measure unit. how can that? need create custom field? thank you. a couple of ideas (from lucene.net mailing list) store units of measure converted common unit. if user input feet, or meters, or inches, convert common unit , search store separate field unit type , measure. can search unit:mm , measure:100 or unit:feet , measure:[4 7]

kendo-ui grid foreign key column and mvvm -

Image
i struggling kendo-ui grid foreign key column , mvvm i able combine "foreign key column" example "mvvm" example my question is: "how data-bind values property of look-up field?" so kind of older post, had work around same issue , found while trying solve. figured i'd answer question posterity. the "values" property doesn't seem work 100% in kendo grid in mvvm. have worked around in 2 step process. tack "this.viewmodel" (where "viewmodel" whatever calling vm) in front of "loggerseverityvalues". give dropdownlist when editing field. utilize template functionality display correct value in grid. use little function make easier: gettext: function (matchvalue, valuesarray, text, value) { if (text === undefined) { text = 'text'; } if (value === undefined) { value = 'value'; } var rettext = "no value found";

c# - How can I refresh partial view and the main view at the same time? -

1) here controller method of main view: public actionresult predefpageload() { list<predefineviewsview> predefviewsviews = null; try { using (pansenseentities context = new pansenseentities()) { int userid = convert.toint32(session["loggeduserid"]); predefviewsviews = (from x in context.predefineviewsviews x.userid == userid select x).tolist(); } } catch (exception e) { console.writeline(e); } return view(predefviewsviews); } 2) main view displays web grid contains in each row id, name , amount of it's sub names , image icons add, edit and icon opens partial view displays name , of sub names : @{ var grid = new webgrid(model); } <div id="gridcontent"> <button type="button" id="createnewpredefinedview" style="margin-bottom: 20px;">@html.