Posts

Showing posts from January, 2010

html - How can you do this in CSS -

Image
what best way in css without using float property; i know how add icon i'm not sure how add icon before heading , paragraph. an html5/css3 approach use proper markup instead of 1999-style tables, , style them single flexbox reference: section { display:flex; } <section> <figure><img src="//placehold.it/150"></figure> <article> <h2>lorem ipsum</h2> <p>dolor sit amet etc. etc.</p> </article> </section> an added advantage of approach can add flex-direction:column in media query make responsive small screens.

mongodb - When is blocking code acceptable in node.js? -

i know blocking code discouraged in node.js because single-threaded. question asking whether or not blocking code acceptable in circumstances. for example, if running express webserver requires mongodb connection, acceptable block event loop until database connection established? assuming pages served express require database query (which fail if mongodb not initialized). another example application requires contents of configuration file before being initializing. there benefit in using fs.readfile on fs.readfilesync in case? is there way work around this? wrapping code in callback or promise best way go? how different using blocking code in above examples? it decide acceptable. , determining consequences of blocking ... on case-by-case basis. analysis take account: how occurs, how long event loop blocked, and the impact blocking in context have on usability 1 . obviously, there ways avoid blocking, these tend add complexity application. really, nee

batch file - How to close window with .bat script? -

i have ran slight problem while configuring keybinds mouse. the thing want achieve open program backround(open or closed window) , close again, not kill task(eqivalent x-button, keeps running in backround) i have set mouse start application called (which able of fast file system searches) i have figured out code: taskkill /f /im everything.exe which can run macro key can kill application. dont want kill application window, becase takes while index important files once have restart it. so heres question there way bring window/task front of screen or trigger x button event, without having kill entire process ? also mouse(g600) supports lua scripting, proabbly more harder way go it. minimizing window can done activating window (bringing foreground) using sendkeys() send alt + space , whatever letter locale has underlined "minimize" ( n in english windows). here's one of possibly dozens of examples of using vbscript. that sequence overused, in

java - Return value of filled JComboBox and using the values to fill JTextField -

i'm coding jframe opens joptionpane through jmenubar. joptionpane have combobox lot of different string values. after jcombobox there jtextfield. i want text select in jcombobox inserted next jtextfield , updated everytime select new string value in jcombobox. please help! class dateiadapter implements actionlistener { public void actionperformed(actionevent event) { jmenuitem change = (jmenuitem) event.getsource(); jcombobox allequest = new jcombobox(ah.getline(1)); //this combobox gets lot of different values different class // actionlistener actionlistener cbactionlistener = new actionlistener() { public void actionperformed(actionevent e) { string s = (string) allquest.getselecteditem(); //gets selected string of jcombobox system.out.println("\n" + s); // want use string s outside of here, } }; allquest.addactionlistener(cbactionlistener); jtextfield questions = new j

matlab - using singular value decomposition (svd) in quadratic regression -

in order quadratic regression on rather large data set solve following equation using svd(singular value decomposition): b(nx1)=a(nx3)*x(3x1) thinking use matlab that, tips? goal compute matrix x it seems call quadratic regression minimal square error regression. in case computation easy: 1) multiply both left sides a'(3xn) arriving to a'(3xn)b(nx1) = a'(3xn)a(nx3) x(3x1) 2) multiply both left sides inverse of a'(nx1) a(nx3) arriving to inv(a'(3xn)a(nx3))a'(3xn)b(nx1) = x(3x1) 3) use svd evaluate inverse above, see most efficient matrix inversion in matlab see minimizing error of formula in matlab (least squares?)

My SCCM 2007 SQL Web Report is not displaying results -

i created sccm sql report using sql management studio. created following prompts asset management office use on web report: publisher, display name, , version. the display name , version prompts both optional. i receive no syntax errors or anything, receive absolutely no results whatsoever when click on display button produce web report. here sql code: ================================================================================== select dbo.v_r_system.netbios_name0, dbo.v_gs_add_remove_programs.displayname0, dbo.v_gs_add_remove_programs.version0, dbo.v_gs_add_remove_programs.publisher0 from dbo.v_r_system inner join dbo.v_gs_add_remove_programs on dbo.v_r_system.resourceid = dbo.v_gs_add_remove_programs.resourceid where dbo.v_gs_add_remove_programs.displayname0 = @displayname , dbo.v_gs_add_remove_programs.version0 = @version , dbo.v_gs_add_remove_programs.publisher0 = @publisher order by dbo.v_g

php - Internal Server Error Ajax request on Laravel 5.2.10 project -

i'm working on laravel 5.2.10 project, trying fetch data via ajax i'm getting 500 error, , can't find i'm missing out. this part of routes.php route::group(['middleware' => 'web'], function () { route::auth(); route::get('/home', 'homecontroller@index'); route::get('/videos', 'videoscontroller@index'); route::post('/videos/fetch', array('before' => 'ajax_check'), 'ajaxcontroller@postfetch'); }); on 'ajaxcontroller.php' i've got function public function postfetch() { //process data , come $data return view('videos')->with('video_data', $data); } and js ajax call var request = $.ajax({ url: "/videos/fetch", method: "post", data: { url : url } }); request.fail(function( jqxhr, textstatus ) { alert( "request failed: " + textstatus ); }); methodnotallowedhttpexception i

asp.net mvc - How to extract JSON data received in controller in a String variable -

Image
could please let me know how extract json data received in string variable in controller. please see attachment.thanks. $("#btn1").on("click", function () { var = new array(); var j = 0; $("#sl1").multiselect("getchecked").map(function () { alert(this.value); i.push(this.value); //i[j] = this.value; //j++; }).get(); var postdata = { values: }; jquery.ajaxsettings.traditional = true; $.post('/todolist/searchdata', postdata, function (data) { alert(data.result); }); //$.ajax({ // type: "post", // url: "/todolist/searchdata", // data: postdata, // success: function (data) { // alert(data.result); // }, // datatype: "json", // traditional: true //}); }); controller code:- public void searchdata(string[] values) { //{ // java

scala - How to pass one RDD in another RDD through .map -

i have 2 rdd's, , want computation on rdd2 items each item of rdd1. so, passing rdd2 in user defined function below getting error rdd1 cannot passed in rdd . can know how achieve if want perform operations on 2 rdd's? for example: rdd1.map(line =>function(line,rdd2)) nesting rdds not supported spark, error says. have go around redesigning algorithm. how depends on actual use case, happen in function , it's output. sometimes rdd1.cartesian(rdd2) , doing operations per tuple , reducing key work. sometimes, if have (k,v) type join between both rdd work. if rdd2 small can collect in driver, make broadcast variable , use variable in function instead of rdd2 . @edit: for example's sake let's assume rdds hold strings , function count how many times given record rdd occurs in rdd2 : def function(line: string, rdd: rdd[string]): (string, int) = { (line, rdd.filter(_ == line).count) } this return rdd[(string, int)] . idea1 you c

ios - What permissions does the facebook app need in order to post on the timeline of the user who logged in using Facebook Login? -

i building ios app user takes photo, writes title, description , posts on his/her timeline. before actual posting takes place user has login using facebook , authorize himself/herself. our backend on ruby on rails , using koala gem. so, when user logs in using facebook , reaches authentication screen says "this app doesn't post on facebook" however, want do. so, confused permissions need facebook users can post on own timelines using app. it not user_posts. permissions need?

php - New Relic Error Reporting - Stop Catching E_NOTICE errors -

the issue have right is hard find actual bugs because many e_notices found. have 600 sites on our server complicated scripts, , i've done lot handle great deal of them, there still quite few. i receive email , text every time error percentage high, great prevent problems. i'm sure i'm not 1 encounter problem -- there recommended solution? i've tried setting error_reporting( e_all ^ e_notice ); hasn't stopped it. one possible solution i've thought of not setting new relic error handler, using own, , sending them error if it's not e_notice. haven't figured out how yet. new relics's php agent not trace e_notice errors unless you've explicitly used set_error_handler(newrelic_notice_error); if you'd new relic trace not uncaught exceptions, creating own error handler calls newrelic_notice_error make sense. there more information regarding in new relic documentation: https://newrelic.com/docs/php/the-php-api in cases, not

swift2 - Why doesn't map display anything? -

i have following in awakewithcontext(): let coord = cllocationcoordinate2d(latitude: 40.748433,longitude: -73.985656) let region = mkcoordinateregion(center: coord, span: mkcoordinatespanmake(10, 10)) mymap.setregion(region) mymap have iboutlet map nothing displaying. ideas i'm doing wrong? it works fine in ios app nothing on watch. just try set autoresizingmask : mymap.autoresizingmask = [uiviewautoresizing.flexiblewidth, uiviewautoresizing.flexibleheight] also, try disconnect , reconnect outlet.

asp.net mvc 4 - How display the last n of records in MVC -

i taking last 4 four comments , want display in tooltip, doing below code showing contents "system.collection.generic.list" var list = db.po_prd_comments.where(t => t.po_trgcal_id == item.id && t.reply == false).orderbydescending(t => t.po_trgcal_id).take(4).tolist(); list<string> comments = new list<string>(); if (list.count != 0) { foreach (var ts in list) { comments.add(ts.prdcomment); if (list.count == 1) { notify = list.singleordefault().notify; } else { notify = true; } } } <td> <a href="#" onclick="popup4(@countid)" title="@comments" <img src="~/images/comment.gif"/></a> </td> how display these 4 comments in tooltip. comments list of string. need convert single string , use

html - Margin issue only in a certain media query -

Image
i running strange issue throwing off whole page in media query range of @media screen , (min-width: 640px) , (max-width:840px) . reason looks getting margin-left applied first box-container have, in code there isn't margin-left set. tried apply start of div blue-box-container right after sibling above eliminate white-space, did not help. does have idea why getting white-space left of first blue box? if needs see live, can add website inside of comments. please comment if wanting it. .blue-box-container { width: 100%; height: 100%; } .dark-blue-box, .light-blue-box { height: 33%; width: 50%; display: inline-block; } .dark-blue-box:hover .box-description-hover, .light-blue-box:hover .box-description-hover { display: block; font-size: 1.1em; padding-top: 10px; } .dark-blue-box:hover .box-description-hover, .light-blue-box:hover .box-description-hover { display: block; font-size: .9em; padding-top: 5px; clear: both; } .dark

python - Compare linear probing with quadratic probing to see which one results in fewer collisions, given different load factors of the hash table -

i need implement insert function takes key, hash table, , probe function arguments , inserts key hash table, using probe function whenever collision occurs. insert function returns number of collisions occurred during insertion. below code coded not sure whether going in right direction or not. import random import math def linear_probe(random_list, m): hash_table = [none]*m count = 0 in random_list: stop = false hash = % m while not stop: if hash_table[hash] == none: hash_table[hash] = stop = true else: hash = (hash+1) % m count +=1 return count def quadratic_probe(random_list, m): hash_table = [none]*m count = 0 in random_list: j = 1 stop = false hash = % m while not stop: if hash_table[hash] == none: hash_table[hash] = stop = true else:

asp.net - MongoDB Driver C# trying to do basic math but don't understand aggregation -

i have collection of bsondocuments each have field named "engagement" (which number) , field named "color". total sum of cost bsondocuments "color" = "blue". so far i've found need this: var collection = db.getcollection<bsondocument>("collectionname"); var match = new bsondocument { { "$match", new bsondocument { {"sentiment", "positive"} } } }; var group = new bsondocument { { "$group", new bsondocument { { "sum", new bsondocument { {

Plone 4.2.5: Disallowed to paste item(s) -

today upgrade plone 4.1.4 latest 4.2.5 through buildout. everthing works except paste. when paste page folder, traceback shows: traceback (innermost last): module zpublisher.publish, line 126, in publish module zpublisher.mapply, line 77, in mapply module zpublisher.publish, line 46, in call_object module products.cmfformcontroller.fscontrollerpythonscript, line 105, in __call__ module products.cmfformcontroller.script, line 145, in __call__ module products.cmfcore.fspythonscript, line 127, in __call__ module shared.dc.scripts.bindings, line 322, in __call__ module shared.dc.scripts.bindings, line 359, in _bindandexec module products.pythonscripts.pythonscript, line 344, in _exec module script, line 33, in folder_paste - <fscontrollerpythonscript @ /keti/folder_paste used /keti/switch1> - line 33 exception: disallowed paste item(s). i need help. usually error thrown, if 'allowed content types add' restricted, doubt correlation of

explanation of d3.js transform and translate functions -

can explain transform , translate doing here: d3.transform(d3.select(tick[0]).attr('transform')).translate[1]; the tick in above xaxis , value might translate(0,280) . so can see picking out second value of translate function why need wrap in d3.transform ? d3.transform helper function. since there many transformations available eg. translate , rotate , scale , of value goes inside same value field difficult extract single transformation. <circle cx="10" cy="20" r="15" transform="translate(0,100)scale(2, 2)rotate(180)"></circle> but if wrap selected objects transform attribute d3.transform can access individual components d3.transform() functions methods. eg. var c = d3.select('circle'); var tx = d3.transform(c.attr('transform')).translate var scale = d3.transform(c.attr('transform')).scale var rotate = d3.transform(c.attr('transform')).rotate hope helpful.

android - Updating Eclipse SDK Error -

i updated sdk, , says need have sdk have. when check updates , try update options, this: an error occurred while collecting items installed session context was:(profile=profile, phase=org.eclipse.equinox.internal.p2.engine.phases.collect, operand=, action=). no repository found containing: osgi.bundle,com.android.ide.eclipse.adt,21.1.0.v201302060044-569685 no repository found containing: osgi.bundle,com.android.ide.eclipse.adt.package,21.1.0.v201302060044-569685 no repository found containing: osgi.bundle,com.android.ide.eclipse.base,21.1.0.v201302060044-569685 no repository found containing: osgi.bundle,com.android.ide.eclipse.ddms,21.1.0.v201302060044-569685 no repository found containing: osgi.bundle,com.android.ide.eclipse.gldebugger,21.1.0.v201302060044-569685 no repository found containing: osgi.bundle,com.android.ide.eclipse.hierarchyviewer,21.1.0.v201302060044-569685 no repository found containing: osgi.bundle,com.android.ide.eclipse.ndk,21.1.0.v201302060044-569685 no re

c# - Processing int to name of list -

i try write simple console application hanoi towers. stuck @ 1 point. in program ask person write tower wants put disk, but: have 3 lists towers, i'll ask number gamer , how can build "compare method"? because don't want copy same piece of code 6 times... class towers : disks { //public towers(int value, int whereitis) : base(value, whereitis) { } public list<disks> tower1 = new list<disks>(); public list<disks> tower2 = new list<disks>(); public list<disks> tower3 = new list<disks>(); public void compare(int dyskfrom, int dyskwhere) { } public void display() { foreach(var in tower1){ console.writeline("where: {0} | value: {1}", i.whereitis, i.value); } } public void build(int towerhigh) { (int = towerhigh; > 0; i--) { tower1.add(new disks {value = i, whereitis = 1 }); } } } class disks { public int value; /

javascript - store image src in a js variable so that it can be used to display background image -

how store image src of above image tag in javascript variable? <img class="preview" alt="styling bandana" src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/389177/bacon.jpg" onmouseover="update(this)" onmouseout="undo()"> i need url can enter in here document.getelementbyid("image").style.backgroundimage = "url(' + imgsrc + ')"; and background image jquery = .attr('src'); js = .getattribute('src');

Should I start using boost as a C++ Beginner? -

i have been learning c++ thinking in c++- bruce eckel , have take so's clear of doubts . of late, have been going through stuffs dealing smart pointers, postfix , prefic overloading , overloading other operators -> , ->* seemed hard nut me hold of. thus, while going through question dynamics of overloading ->* operator , came know lot smart pointers , new library called boost. now, feasible , constructive me start using library when getting hold of c++ knowledge because provides lot of different things shared_pointers etc aren't directly available in c++ standard libraries apart many other optimizations , functions or should stick stick basics of eckel , later go looking boost. know more boost library (the things , bad things involved in using it). in advance as pointed out others, take @ what's newly available in c++11 http://en.wikipedia.org/wiki/c%2b%2b11 . boost huge library depend on specific part of boost had planned make use of.

Ffmpeg show an image for multiple seconds before a video without re-encoding -

i've been looking around this. problem google searches end being creating video solely png files. i've found command job : ffmpeg -y -loop 1 -framerate 60 -t 5 -i firstimage.jpg -t 5 -f lavfi -i aevalsrc=0 -loop 1 -framerate 60 -t 5 -i secondimage.png -t 5 -f lavfi -i aevalsrc=0 -loop 1 -framerate 60 -t 5 -i thirdimage.png -t 5 -f lavfi -i aevalsrc=0 -i "shadowplayvid.mp4" -filter_complex "[0:0][1:0][2:0][3:0][4:0][5:0][6:0][6:1] concat=n=4:v=1:a=1 [v] [a]" -map [v] -map [a] output.mp4 >> log_file1.txt 2>&1 but seems reencode whole video, input video h.264 without cfr, seems me putting images before video shouldn't take long. because ends encoding whole thing, takes 2 hours video of 30 minutes on strong computer, while feel without encoding should able done quicker. how make sure doesn't re-encode while maintaining every image showing 5 seconds first? generate playervid.mp4 via ffmpeg -y -loop 1 -framerate 60 -t 5

Call dictionary in tableView of swift -

how call dictionary values in tableview.. getting error import uikit class viewcontroller: uiviewcontroller, uitableviewdatasource, uitableviewdelegate{ @iboutlet var tblview: uitableview! var animalname = ["e":["elephant","eee"","l":["lion","ll"],h":["horse",huh"]] var initial = array(animalname.alkeys) //error in line func numberofsectionsintableview(tableview: uitableview) -> int { return 1 } func tableview(tableview: uitableview, numberofrowsinsection section: int) -> int { return animalname.count } func tableview(tableview: uitableview, cellforrowatindexpath indexpath: nsindexpath) -> uitableviewcell { var cell = tableview.dequeuereusablecellwithidentifier("cell")! uitableviewcell cell.textlabel?.text = animalname[indexpath.row] //how call cell return cell } func sectionindextitle

jquery - Invoke download of a tag in html using javascript? -

currently have <a> tag has declared download attribute, this: <a href="123.png" download >download it!</a> which tag above, can download image url when clicking on link. have button on page, : <button>download using button!</button> is there way let user download not clicking on link clicking on button instead. my purpose making auto code can download image specified class on html page. using native javascript this: html: <a id="download-link" href="123.png" download >download it!</a> javascript: document.getelementbyid("download-link").click();

excel - find the same words into different cells -

find common words in title of books in excel, output : 'book common user_id physics physics 1 principles of plasma physics physics,plasma 2 fundamentals of plasma physics fundamentals,plasma,physics 3 fundamentals of thermodynamics fundamentals 4 ' so here's shot @ problem. aware code rather messy: i've been sloppy variable names, error handling , on, gives idea of how can done. i've created udf common() takes 4 arguments: rngtext: reference single cell containing text (in case book) want comare comparelist: range of cells compare first argument minoccurences (optional): definition of minimum number of occurences word should have considered "common". default vanue 2 exclusionlist (optional): range of cells containing text should excluded (e.g. words "a",

obfuscation - When compiling a Yguard Ant target in IntelliJ, there is an Error: The <yguard> type doesn't support nested text data ("") -

when compiling yguard ant target in intellij, there error: "the <yguard> type doesn't support nested text data ("")". on fixing cause of error appreciated. here yguard ant target: <target name="yguard"> <taskdef name="yguard" classname="com.yworks.yguard.yguardtask" classpath="yguard.jar"/> <yguard> <inoutpair in="/users/user/ideaprojects/java.jar" out="/users/user/ideaprojects/java_obf.jar"/> </yguard> </target> the solution seems to change encoding, remove invisible characters aren't being processed ide, come copying , pasting. pasted code komodo editor, changed encoding iso-8859-1, pasted build.xml , error went away. there more information on correcting error: convert dos line endings linux line endings in vim clean source code files of invisible characters https://superuser.com/questions/5

c# - Dynamically hiding web parts based on current user roles -

how can dynamically hide/show web-parts in asp.net. using this doing same , in article have hard coded roles on authorizationfilter attribute of control , instead want roles should assigned @ runtime. have tried alternate , have declare variable 'roles' in .cs file , @ runtime assigning values roles variable( , using authorizationfilter='<%# roles %>' ) doesn't work me each time getting value authorizationfilter blank* (if using text='<%# roles %>' * on label displays value value not assign authorizationfilter) . have tried if (user.isinrole("admin")) label2.visible = true; but still display web part title inside web part zone.

concatenation - How to concatenate rows together until a condition is met in Teradata 13 -

i have following table: id_clt steps inner rank 61081 round_sig_1 1 61081 ar_ok 2 61081 abs_ft 3 61081 round_sig_2 1 61081 tech_dispatch 2 61081 ar_ok 3 61081 ret_ft 4 61081 ret 5 61081 closed 1 i want concatenate steps until inner rank reset 1,in other words, want following output: id_clt steps inner rank 61081 round_sig_1 ar_ok abs_ft 1 61081 round_sig_2 tech_dispatch ar_ok reft_ft ret 1 61081 closed 1 concerning input table, simplified version of query use is: select alpha.id_clt , alpha.steps, rank() on (partition alpha.id_clt order alpha.rnk reset when (alpha.steps 'round%' or alpha.steps

How do I loop php arrays -

this product array - array ( [0] => array ( [0] => 'product1' [1] => [2] => [3] => [4] => 'product2' [5] => [6] => [7] => 'product3' [8] => 'product4' [9] => 'product5' ) ) and category array product - array ( [0] => array ( [0] => 'cat1' [1] => 'cat2' [2] => 'cat3' [3] => 'cat4' [4] => 'cat5' [5] => 'cat6' [6] => 'cat7' [7] => [8] => [9] => ) ) final output require in format - array ( 'product1' => array( [0] => 'cat1', [1] => 'cat2', [2] => 'cat1',

Matlab - URLREAD2 - User Agent and Cookies -

i'm @ loss @ how sample code working, , hoping if able review , assess assumptions mat wrong. problem : use matlab access webpage protected login screen. able use wget , works fine, know, wget not load ajax/javascript etc. embedded within page. therefore, have turned using urlread2 function available matlab file exchange. hereafter, examples based on function. example : i trying login financial website, upon testing other sites same error. therefore, example going use fitbit.com. mimimic behaviour of browser, pass following combined headers urlread2 (i have split code make easier see i'm doing): value = 'https://www.fitbit.com'; header = http_createheader('host',value); value = 'keep-alive'; header2 = http_createheader('connection',value); value = '278'; header3 = http_createheader('content-length',value); value = 'max-age=0'; header4 = http_createheader('cache-control',value); value = 'text/h

android - restore fragment in viewpager FragmentStatePagerAdapter -

i using viewpager fragmentstatepageradapter (which has many pages) causing memory issues. this works well, i'd able restore pages ( listfragments ) original position when fragment recreated. seems straightforward i'm not having luck achieving it. does have tips? @override public fragment getitem(int position) { // todo auto-generated method stub fragment fragment = new postlistfragment(); bundle args = new bundle(); map<string, string> categoryitem=categorylist.get(position); args.putstring("slug", categoryitem.get("slug")); fragment.setarguments(args); return fragment; } in postlistfragment calling web services posts based on "slug". @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { // inflate layout fragment bundle bundle=this.getarguments(); slug=bundle.getstring("slug"); log.v("po

jquery - How to trigger the html scroll when dynamic content is loaded inside the fancybox -

i have custom fancybox (fancybox2) in content loaded dynamically. has content grows box remains fixed in browser window , scrollbar html not triggered. however if run $.fancybox.update() adjusts , shows scrollbars. how can automate without running above line? my fancybox definition follows $.fancybox({ href : '#mycontainer' autosize : true, maxwidth : 760, fittoview: false, padding : 0, fixed : true, autocenter : true, beforeshow : function(){ $('.fancybox-overlay-fixed').css({'overflow-y':'auto'}); }, aftershow : function(){ $('.fancybox-overlay-fixed').css({'overflow-y':'auto'}); }, }); as per docs : $.fancybox.update() - auto-sizes fancybox height match height of content. autowidth : if set true, 'inline', 'ajax' , 'html' type content height auto determined. boolean; default value: false can try autowidth

c# - How to return IEnumerable type as object -

i have var (ienumerable) wanted return class. public myclass method(string str) { ................... var p1 = data; return ? } public class myclass { public string { get; set; } public string b { get; set; } public bool c { get; set; } ........................... } my intention return values through webapi. return webapi, created model class containts variable want return through webapi- 'myclass' actually, var not type, rather keyword, c# staticly typed mean compiler run on program , each var decide real type so question, know type of data need write return type (dont lazy :)) read bit more issue here

c++ - Compiling a .cpp file from the cmd line on windows, error "cannot open file 'python.lib" -

i've got .c file has python.h in , want compile it. this i'm entering cmd line @ moment cl -ic:\[...]\python35\include -ic:\[...]\python35\libs testfilepython.c which results in error: link : fatal error lnk1104: cannot open file 'python35.lib' i've found this seems perfect fit question, cannot figure out libpath s should include. me that? edit : okay i'm using cpp setup.py looks this: from distutils.core import setup cython.build import cythonize setup(ext_modules = cythonize( "testfilepython.pyx", # our cython source language="c++", # generate c++ code )) running python setup.py build_ext --inplace results in .cpp being created (.c before language option) now i'm trying compile .cpp. while searching i've come across idea need include embed option (this might solve no entry point problem), still trying see can that. testfilepython.pyx just: print("hel

sql - WHy doesn't my stored procedure work for same dates? -

why doesn't stored procedure work when pass same dates (i.e. , dates same) although have records these dates doesn't. why ? select audits.pk_audits_auditid, audits.fk_webusers_audits_userid, web_users.name username, districts.pk_districts_districtid, districts.districtname, orgs.pk_orgs_orgid, orgs.orgname, audits.auditsuseractivity, audits.auditsuseripaddress, audits.auditsusersystemmacaddress, convert(varchar, audits.auditsystementrydatetime, 113) auditsystementrydatetime audits inner join web_users on web_users.userid= audits.fk_webusers_audits_userid inner join orgs on orgs.pk_orgs_orgid= web_users.fk_orgs_orgid_webusers inner join districts on districts.pk_districts_districtid= orgs.fk_districts_orgs_districtid convert(varchar, dateadd(day, -1, audits.auditsystementrydatetime)) >= @fromdate , convert(varchar, audits.auditsystementrydatetime) <= @todate it doesn't wor

JScroll don't work in right panel JSplitPane - Swing Java -

can me problem? write layout bittorrent's client , don't have idea why jscroll doesn't work in right panel jsplitpane. more code here: https://github.com/niesuch/bittorrentclient/blob/nie_bittorrentclient/src/bittorrent.java in advance. /** * initialization information panel */ private void _initinfopanel() { jpanel formpanel = new jpanel(); formpanel.setborder(borderfactory.createtitledborder("informations")); jpanel form = new jpanel(new gridlayout(0, 2)); int = 0; (string formlabel : _formlabels) { form.add(new jlabel(formlabel)); _textfields[i] = new jtextfield(10); form.add(_textfields[i++]); } formpanel.add(form); _infopanel.add(formpanel); _infopanel.add(new jscrollpane(formpanel), borderlayout.center); } my minimal example program: import java.awt.borderlayout; import java.awt.gridlayout; import ja

XSLT subtraction -

i have problem following xsl code. it's simple subtraction, strange. know can use format-number , can explain me why 0.4299999999999997 instead of expected 0.43 ? <xsl:template match="/"> <root> <xsl:value-of select="36.98 - 36.55"></xsl:value-of> </root> </xsl:template> read floating - point arithmetic : http://en.wikipedia.org/wiki/floating_point

How to clone a eclipse instalation -

i have instalation of eclipse juno, mean directory know, in directory did final project of university in j2ee computer afected cryptowall 3.0 , files encrypted. new installation of eclipse juno, when compare both directories new don't have same files, specialy directory called eclipse\configuration\org.eclipse.osgi\bundles\ could give hand? probably eclipse installation corrupted, need reinstall fix.

ios - How to pass data between sequential Commands? -

i have client wants retrieve data based on combined effort of 2 commands. reason need 2 commands second command relies on data first command. question best way pass data first command second command? i'm using coordinating object delegate of first , second command - seems messy. resolvable in layer commands housed or require coordinating object? here's representation of client class: class viewcontroller: uiviewcontroller, coordinatordelegate { // ... @ibaction func didtouchbutton(sender: uibutton) { self.coordinator.fetchschoolid(firtname: "jane", lastname: "jones") } // mark: - coordinatordelegate func fetchschoolidsucceeded(id id: int) { self.updateuiwithschoolid(id) } func fetchschoolidfailed(error error: nserror) { self.displayerror(error) } } the coordinator object: protocol coordinatordelegate { func fetchschoolidsucceeded(id id: int) func fetchschoolidfailed(error err

javascript - NVD3 max value on inverted yAxis -

i'm trying simple linechart inverted y-axis , i'm sure problem easy solve somehow can't make work. my y-values ranks , "1" best should on top of chart. chart.ydomain([10,1]) does job ... in future might have data outside of domain , try maximum y-value directly data replace manually set "10". i played around with d3.max(data, function(d){ return d.rank; } ) and looked @ why domain not using d3.max(data) in d3? whatever try, can't make work. maybe can me out? it's first time i'm working nvd3 , i'm not familiar it. my fiddle here: http://jsfiddle.net/marei/w0385jj3/ thank much! you can use d3.merge .map d3.max(d3.merge(data.map(function(d){return d.values})), function(d) {return d.rank}); updated fiddle .

ruby on rails - How to use nested_attributes when processing JSON? -

i'm trying write update method processes json. json looks this: { "organization": { "id": 1, "nodes": [ { "id": 1, "title": "hello", "description": "my description." }, { "id": 101, "title": "fdhgh", "description": "my description." } ] } } organization model: has_many :nodes accepts_nested_attributes_for :nodes, reject_if: :new_record? organization serializer: attributes :id has_many :nodes node serializer: attributes :id, :title, :description update method in organizations controller: def update organization = organization.find(params[:id]) if organization.update_attributes(nodes_attributes: node_params.except(:id)) render json: organization, status: :ok else render json: organization, status: :failed end end private def node

php - fabric js or imagick remove white from image -

Image
i got situation hard me search on google , explain. our company prints photos on aluminium , give our customers 2 choices. the first choice print pictures on aluminium gave picture us, if picture has white background picture gets printed white background. easy that. the second option can print picture without using white. instead of "white values" (<- best can come explain) being printed leave transparent. i know there removewhite filter in fabric js can replace white areas transparent ones. not need. need fabric js filter, imagemagick thing or other php or js solution can turn "white value" of pixel transparent. know stuff may sounds vague guys, let me try explain way: if come across white pixel need make transparent. if come across grey pixel, need turn combination of white , black combination of transparent , black. if come cross coloured pixel, need turn "white value" makes light turn transparent. here before , after example of

java - Return empty JSON from spring controller for void response -

i'm using java 8, tomcat 8, spring-webmvc 4.2.2.release, fasterxml 2.6.3. i have following method in controller @requestmapping(method = requestmethod.post) @responsebody public void updatecurrentuserdetails(@requestbody final userdto userdto) { final userwithid user = securityutil.getcurrentuser(); this.useraccountservice.updateuserdetails(user.getuserid(), user.getusername(), userdto); } this method returns void resolves in empty (0 byte) response. clients connecting server expect json reponses even, if empty response. so configure spring/jackson return {} (2 byte) in case. i thought returning new object() everywhere in calls return void otherwise imo dirty soution , there must better. there shouldn't need that. can use 204 response code, made situation describing. don't need responsebody annotation, use: @requestmapping(method = requestmethod.post) @responsestatus(httpstatus.no_content) public void updatecurrentuserdetails(@requestbody

python - How to use many-to-many fields in Flask view? -

i trying create blog using flask. every post can have multiple tags every tag associated multiple posts. created many-to-many relationship. questions how save multiple tags when creating new post. , since every post can have different number of tags how show in form? also, how can create new tags along post , use tags other posts? models.py - postcategory = db.table('tags', db.column('posts_id', db.integer, db.foreignkey('posts.id')), db.column('categories_id', db.integer, db.foreignkey('categories.id')) ) class post(db.model): __tablename__ = 'posts' id = db.column(db.integer, primary_key=true) title = db.column(db.string) content = db.column(db.text) slug = db.column(db.string, unique=true) published = db.column(db.boolean, index=true) timestamp = db.column(db.datetime, index=true) categories = db.relationship('category', secondary=postcategory, backref='posts' ) d

regex - ORacle SQL Regular Expressions -

i'm looking create regular expressions code testing. in below have created constraint check email address. create table testemail (username varchar2(50) not null, password varchar(15) not null, constraint pk_usertest primary key (username), constraint un_emailtest check (regexp_like(username,'^([[:alnum:]]+)@[[:alnum:]]+.(com|net|org|edu|gov|mil)$')) is there better way have constraint check when new user creating account? also, i'm trying search user name of 'luke haire' below sql queries returns no results: select * customers regexp_like (name, '^([l(u|i|o)ke]+)[\][haire]$'); i don't understand first question. check constraint best way have check constraints. why databases support it. there worse ways, such triggers, typically best way using built-in, standard capability. your specific constraint seems constrained. email addresses commonly contain "." , "-" well. as second questi

xml - XSLT 1.0 build hierarchy from parent-child relationship -

i have following flat xml structure. <customui > <elements> <tab id="1" parent="0"/> <tab id="-1" parent="0"/> <group id="-2" parent="-1"/> <group id="2" parent="1"/> <group id="11" parent="1"/> <menu id="-27" parent="-26"/> <menu id="-24" parent="-4"/> <menu id="-18" parent="-4"/> <menu id="-11" parent="-9"/> <menu id="-10" parent="-9"/> <menu id="-3" parent="-2"/> <menu id="3" parent="2"/> <menu id="10" parent="65"/> <menu id="12" parent="11"/> <menu id="16" parent="11"/> <menu id="18" parent=&quo