Posts

Showing posts from February, 2013

Changing a language in the middle of a python program -

i have program processes text using pyhook. since use hebrew tried seeing happen if type in hebrew. seems if when program starts pc on hebrew if change language understand hebrew , vice-versa english. looked @ ascii value hebrew letters comes out , seems wrong hebrew ascii , unicode numbers.. can me solve problem please? def onkeyboardevent(event): global start global text print text text += chr(event.ascii) print event.ascii the prints there checking up thank you

c# - Xamarin Android Crash on Start "Got a SIGSEGV" -

i have xamarin forms app, i'm going publish app, found bug, meets on old(2.3.7 , 4.0.4) xperia devices or emulators, app crashes soons clicked on app icon in menu, here see in output: 06-10 12:46:18.344 e/mono-rt ( 2885): stacktrace: 06-10 12:46:18.344 e/mono-rt ( 2885): 06-10 12:46:18.344 e/mono-rt ( 2885): @ <unknown> <0xffffffff> 06-10 12:46:18.344 e/mono-rt ( 2885): @ (wrapper managed-to-native) object.wrapper_native_0x8235c890 (intptr,intptr,string,string) <il 0x00054, 0xffffffff> 06-10 12:46:18.344 e/mono-rt ( 2885): @ android.runtime.jnienv.getmethodid (intptr,string,string) [0x00042] in /users/builder/data/lanes/monodroid-mavericks-monodroid-5.1-series/d419c934/source/monodroid/src/mono.android/src/runtime/jnienv.g.cs:158 06-10 12:46:18.344 e/mono-rt ( 2885): @ android.runtime.jnienv.createinstance (intptr,string,android.runtime.jvalue*) [0x00000] in /users/builder/data/lanes/monodroid-mavericks-monodroid-5.1-series/d419c934/source/monodroid...

java - Converting string to json object using json.simple -

i using org.json.simple.jsonobject , want convert string json object.i have tried no success. have been trying string value=request.getparameter("savepos"); jsonobject jsonobject = (jsonobject) jsonvalue.parse(value); please in advance. try this: jsonparser parser = new jsonparser(); jsonobject json = (jsonobject) parser.parse(stringtoparse);

python - generating custom colorbar: match data with color scheme -

Image
i have 3d bar chart, generated 3d discrete-dataset( x,y,z ). used code plot on canvas: bar_chart_3d =fx.bar3d(x, y, z, dx, dy, dz, color=cmap.to_rgba(dz), alpha=0.4,linewidth=0.5) but, i'm not being able attach colormap on canvas based on dz value plotted. tried using: #adding color-bar... fig.colorbar(cmap.to_rgba(dz), shrink=0.6, aspect=8) but invoking attributeerror: 'numpy.ndarray' object has no attribute 'autoscale_none' . thank you. from bar3d docs , color applied each face, color can be: an array of colors of length n bars, color each bar independently. i guess facecolor, not assumed convey information , bar3d not return anything. things contour return scalarmappable can used specify colorbar. looks cmap (which assume cm.scalarmappable ?) doesn't contain norm , autoscale required colorbar. as work around can draw colorbar between limits in example fig.subplots_adjust(bottom=0.25) ax1 = fig.add_axes([0.05,...

html - how to apply css class and also change css attribute dynamically in angularjs using ng-class? -

i want apply css class 'headerstyle' change color attribute defined in 'headerstyle' when user choose color color picker this. catch want use ng-class. possible able using ng-class, have done same thing using mixture of class , ng-style wish using ng-class only. html code : <input colorpicker type="text" ng-model="headercolor"> i tried not working - header div : <div ng-class="[headerstyle:true, {'background-color' : headercolor}]"> and this- <div ng-class= "{headerstyle:true, 'background-color' : headercolor}"> here css class headerstyle - .headerstyle { font-family: helvetica, arial, sans-serif !important; padding-top: 4px; font-size: 15px; color: #ffffff; text-align: center; text-shadow: #666666 1px 1px 1px; line-height: 16px; border: none; } thanx in advance <div class= "...

linux - Processes started with systemd are logging to /var/log/syslog and /var/log/daemon.log -

i'm running couple of python scripts on beaglebone black, both started @ init systemd. noticed yesterday emmc flash full, , reason had 1.8 gigs of log files. seems standard output of these scripts (they generate amount of data debugging purposes) being logged both /var/log/syslog , /var/log/daemon.log. also, /var/log/messages has ton of entries "rate-limiting". now, assume fix disabling standard output on these scripts. however, rather preserve capability , somehow tell systemd not log data. however, i've been unable find information on this. here example of current .service file: [unit] description=description of process after=network.target [service] type=simple execstart=/opt/myprocess [install] wantedby=multi-user.target i should note had syslog.target "after" target, because example following had it. have since removed , doesn't seem solve problem. any or insight problem appreciated. edit: may have found answer here: http://w...

use sass transformer in intellij dart -

when use dart plugin , "javascript debug" run/debug configuration ( idea config site ) , use sass transformer ( sass package ) transformer not called. running pub serve executes transformer correctly. how tell intellij use transformer? there nothing in intellij. maybe ensure don't enable sass watcher in intellij well, might collide. might bug in sass transformer or pubspec.yaml.

angularjs - How to get Webshim's updatePolyfill called for elements added by an Angular "ng-if" -

i have angular app webshim added principally add date pickers in older browsers. i'm using this: $scope.$on('$viewcontentloaded', function(target) { settimeout(function() { $('#partials').updatepolyfill(); }, 0); }); to dom updated when view changed. but have several pages internally contain sections ng-if used show fields if other fields in particular state, , sections not in dom when "$viewcontentloaded" happens polyfills not added. ng-if logic driven model changes, ideal if there way generate "afterallmodelchanges" event above technique used irrespective of specific ng-if logic present. is there? or there better approach solving problem? after few hours of googling , experimenting i've ended with. have in index page: $.webshims.polyfill('es5 forms forms-ext'); and have added directive project: eepdirectives.directive('input', function() { return { restrict: 'e...

Excel 2010 - Lookup multiple values on other sheets in response to clicking a cell -

i trying take specific information 1 sheet, , have show in according specific cell showing. what have far: when click cell in work sheet, shows information given row in d3-i3. what want: take information f3 , i3 , reference prices in sheet (price sheeet), , show them in e4-e7. way can update price page, , show price on inventory sheets. want them change click around, same code already. code im using far. private sub worksheet_selectionchange(byval target range) if target.row > 0 , target.column > 0 range("d2").value = cells(target.row, 4).value range("e2").value = cells(target.row, 5).value range("f2").value = cells(target.row, 3).value range("g2").value = cells(target.row, 7).value range("h2").value = cells(target.row, 8).value range("i2").value = cells(target.row, 10).value end if end sub i rearranged want prices show, , how in image linked below. (...

excel - VBA converting csv Files in a folder to xlsx Files -

i have code. this code converts xlsm files. i want convert xlsx files. how? i tried changing wbook.saveas xlsfolder & replace(fname, ".csv", ""), thisworkbook.fileformatto wbook.saveas xlsfolder & replace(fname, ".csv", ".xlsx") it didn't worked. private sub commandbutton2_click() dim csvfolder string dim xlsfolder string dim fname string dim wbook workbook csvfolder = "c:\csv\" xlsfolder = "c:\charts\" fname = dir(csvfolder & "*.csv") while fname <> "" set wbook = workbooks.open(csvfolder & fname, format:=6, delimiter:=",") wbook.saveas xlsfolder & replace(fname, ".csv", ""), thisworkbook.fileformat wbook.close false fname = dir loop end sub using macro recoder, file format xlsx workbook fileformat:=xlopenxmlworkbook so here code : private sub commandbutton2_click() dim csvfolder string, _ ...

Access Navigation form stop requerying forms -

in ms access 2013 application, using navigation form top layer connect subforms. how stop access requerying subforms whenever change tabs (forms) ?! (basically want use navigation tabs way switch other forms remain open hidden) this seems basic feature cant't seem figure out. thank in advance! unlike tabs, navigationforms has menu , subform control "target forms" "loaded". every time when click navigation button, target form "loaded/opened" subform control. it means not re-querying forms unloading , loading. for purpose might use normal tabs.

jQuery Animate spans in a div one by one -

i'm building type of one-bar jquery chart, goes except filling animation, script sections animate in same time. want make each section animate, complete, wait 0.1 sec pass the next. $('#chart .chart-item').each(function() { $(this).animate({ width: $(this).data('w') + '%' }, 1000); }); .chart { width: 100%; margin-top: 40px; background: #eee; } .chart-item { display: inline-block; width: 0; height: 40px; border-left: 1px solid #fff; } .chart-item:first-child { border-left: none; } .chart-item:first-child { background-color: #0d47a1; } .chart-item:nth-child(2) { background-color: #1565c0; } .chart-item:nth-child(3) { background-color: #1976d2; } .chart-item:nth-child(4) { background-color: #1e88e5; } .chart-item:nth-child(5) { background-color: #2196f3; } .chart-item:nth-child(6) { background-color: #42a5f5; } .chart-item:nth-child(7) { background-color: #64b5f6; } .c...

Spring MVC Themes Not working -

Image
i trying execute spring mvc application uses spring mvc theme feature. following example https://www.youtube.com/watch?v=oiqql85qsos somehow not working, here project structure in sts i have homecontroller @controller public class homecontroller { @requestmapping("/") public string gethomepage(){ return "home"; } } here web.xml <?xml version="1.0" encoding="utf-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemalocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="webapp_id" version="3.0"> <display-name>springmvcthemes</display-name> <servlet> <servlet-name>config</servlet-name> <servlet- class>org.springframework.web.servlet.dispatcherservlet</servlet-class> <load-on-startup>1</load-on-...

mysql - Query to find duplicates in different fields -

i have searched , found refers duplicates of same field on record. database using stores computer hardware , among fields en0 , en1 contain ip addresses. need find records duplicate ips exist in either field. simplicity here sample table: id serial_no en0 en1 1 0000001 10.200.5.102 10.200.5.103 2 0000002 10.200.6.102 10.200.6.103 3 0000003 10.200.5.110 10.200.5.102 i need query return records 1 and/or 3. getting either duplicate ok, best return both. thanks you can use following query: select distinct id, serial_no, en0, en1 mytable inner join (select ip ( select id, serial_no, en0 ip mytable union select id, serial_no, en1 ip mytable ) t group ip having count(*) > 1) t on t.ip = en0 or t.ip = en1 the above return all records containing duplicate ips. fiddle demo here the following subquery: select...

Optaplanner Logger should also show customer id for each move -

i using trace in logback.xml , , have different classes derived selectionfilter . when moves traced related locations ids of customers. internally possible use in addition/instead customer ids , find out happens during moves? best regards, milenko upgrade 6.3.0.beta1 or later. logging has been improved show entity's tostring(), old planning value tostring() , new planning value tostring().

html - CSS Works in Chrome but not Firefox -

i've been working on school project , i've made layout , have no idea why layout works on chrome crashes completly in firefox! have idea be? here site: www.demo.filipsukic.com for quick fix, add class "clearfix" section tags.

c# - Trigger Apache Nutch Crawl Programatically -

i'm trying create asp.net web api trigger crawl event happen. can't seem cygwin process of commands give it. thing can open terminal. once terminal open i'd have redirect pwd location , trigger command want. process p = new process(); processstartinfo info = new processstartinfo(); info.createnowindow = false; info.redirectstandardinput = true; info.useshellexecute = false; info.filename = "c:\\cygwin64\\bin\\mintty.exe"; p.startinfo = info; p.start(); streamwriter sw = p.standardinput; if (sw.basestream.canwrite) { sw.writeline(@"cd c:\users\uname\desktop\apache-nutch-2.3-mongodb\runtime\local\"); sw.writeline("bin/autocrawl"); } sw.close(); p.waitforexit(); i've tried many approaches, last 1 i've tried nothing. there way launch crawl .net application? i've looked nutchapi creating new job type of crawl i'm not sure if applies here or not. i ended figuring out how use nutchapi answer question.

sql - Memory consumption of having a column LONGTEXT in MySQL database -

i'm creating log table in mysql database. 1 of field used in approximately 5% of logs , contains stack traces , others lengthy informations developers. considering using longtext field wondering if using make database grow quickly, if column empty in 95% of rows. so question in clear, there memory consumption of having longtext column when column empty in of rows? example, if use text instead , truncate strings long, save lot of space on database. it's important add there lot of logs on time. thanks! although varies 1 difference of mysql another, in general terms blob-type columns longtext inherently variable length , take no storage when not used. space needed them isn't allocated in case of null value. as concerns scaling, there's 1 way find out: generate gigantic amount of log data test schema you're intending use. push full dies, , metrics on how can handle. that'll give idea of how viable approach is.

linux - Is it possible to run gitk in cloud9 -

i following when trying run gitk in cloud9-ide application-specific initialization failed: no display name , no $display environment variable error in startup script: no display name , no $display environment variable while executing "load /usr/lib/x86_64-linux-gnu/libtk8.6.so tk" ("package ifneeded tk 8.6.1" script) invoked within "package require tk" (file "/usr/bin/gitk" line 10) gitk visual git tool , cloud9 doesn't have gui, terminal. unfortunately they're not going work together. try using tig, visual works cloud9 terminal.

sql - Count non null values in multiple columns with LINQ -

the following sql query counts non-null values of multiple columns in single query (as in this answer ): select count(id) total, count(column_1) column_1_non_null_count, count(column_2) column_2_non_null_count, count(column_3) column_3_non_null_count, ... mytable is there corresponding linq query executes sql query similar 1 (without subquery each column count)? counting null values instead of non-null values ok. i'm not sure exist way entity framework, think better raw sql. but assuming want entity framework, may 1 way creating several queries using futurecount method ef.extended library. using future methods ef.extended, queries postponed until accessed result of 1 of queries , data retrieved in 1 round trip database server. var querycolumn1 = mydbcontext.mytable.where(q => q.column1 == null).futurecount(); var querycolumn2 = mydbcontext.mytable.where(q => q.column2 == null).futurecount(); ... int countcolumn1 = querycolumn1.value; ...

ruby on rails - Display value from associate table -

i've made voting system app user can vote once post call "idee". here association : vote belongs_to :idee belongs_to :user user has_many :votes, dependent: :destroy idee has_many :votes, dependent: :destroy vote controller def user = params[:user_id] idee = params[:idee_id] if vote.exists?(:user_id => user) && vote.exists?(:idee_id => idee) redirect_to :back, :notice => "vous avez déjà voté pour cette idée" else vote.create({ idee_id: idee, user_id: user}) redirect_to :back, :notice => "merci d'avoir voté" end end view <div class="upvote col-lg-2"> <div class="heart-black hidden-xs"> <p class="like"><%= @idee.vote_id %></p> <%= link_to "up", {controller: "vote", action: "like", user_id: @current_user, idee_id: @idee}, :class => "upvote-link" %> ...

Python/Flask deployment without pip -

i've deployed flask applications simple fabric script put source on target machine, used pip install dependencies, fired uwsgi necessary settings , off went. however, have new issue new security settings in our environments have blocked access outside network trying use pip install our dependencies fails. looked using python setup.py sdist create package thinking build down on developer machine upload .tar.gz deployment machine , install still trying contact pip dependencies. is there way compiled package dependencies , use deploy server? there sdist setting can use? assuming build machine binary-compatible target, or don't need compiled extensions, can use pip wheel compile project , dependencies wheels, copy files server, , pip install wheel directory only. # on build machine cd myproject pip wheel --wheel-dir wheelbase . scp -r wheelbase me@target.example.org # on target machine pip install --no-index --find-links=wheelbase myproject you should able...

xml - XSD unique element XPath limitations -

in order allow element appear multiple times restrict element values being allowed once, i'm applying unique element. i've got working in inefficient manner due xpath limitations within xsd 1.0 though. xsd 1.1 unfortunately not option me. below simplified version of xsd: <?xml version="1.0" encoding="utf-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/xmlschema" elementformdefault="qualified"> <xs:simpletype name="deliverymethod"> <xs:restriction base="xs:string"> <xs:enumeration value="post"/> <xs:enumeration value="digitalarchive"/> </xs:restriction> </xs:simpletype> <xs:complextype name="mailpack"> <xs:sequence> <xs:element maxoccurs="unbounded" name="deliverymethod" type="deliverymethod"/> </xs:se...

mysql - Node.js security -

i building basic app using node.js , mysql , getting hang of it, secure api,like allow people access data, maybe passing token each time user requests information, tried searching tutorials used node.js , mysql database , security, confused security measure use, read json web tokens din't find proper tutorial that.please point me in right direction. edit what meant was, authenticated users allowed access data in api, when random visitor tries access url shouldnt alowed without proper authentication,what looking when user authenticated user should sent token of sort gets access private data,i don't know how go whole thing.would glad if clear me. i @ implementing oauth2 server in app. found article useful: http://blog.papersapp.com/oauth-server-in-node-js/

javascript - Trying to add more jQuery to my page but when I add in more link/script tags, the previous functioning jQuery ceases to run. Can somebody help me? -

what had working? .................................................................. <head> <title>#</title> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script> <script src="sss/sss.min.js"></script> <link href='http://fonts.googleapis.com/css?family=lato:400,700' rel='stylesheet' type='text/css'> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script> <script src="sss/sss.min.js"></script> <link rel="stylesheet" href="sss/sss.css" type="text/css" media="all"> <script> jquery(function($) { $('.slider').sss(); }); </script> </head> what not working?,................................................... <head> <title>#</title> <link href='http://fonts.googleapis...

c# - Roslyn ImportAdderService doesn't visit trivia -

the microsoft.codeanalysis.editing.importadderservice.addimportsasync method visits non-trivia syntax nodes, , therefore doesn't add namespace imports them. leads results, cref's in xml documentation comments cannot simplified short names, when using microsoft.codeanalysis.simplification.simplifier . the biggest problem have this, simplification can lead inconsistent results. assume have multiple cref's, , 1 cref, have namespace import (introduced due type, used in non-trivia node). then, 1 cref's gets shortened, , others don't. for clarification. before applying importadderservice , simplifier : namespace namespace { /// <summary> /// <see cref=""system.collections.ienumerable"" /> /// <see cref=""system.collections.generic.ienumerable{t}"" />. /// </summary> internal class mydeclaration { system.collections.ienumerable field; } } after applying importadderservice , s...

html - Dynamic population of a div from SPServices with javascript -

i want insert values query of spservices populate existing formatted div. or create divs on fly float left on page. close having issues append statement info in divs. here have far. in advance... function getnewsitems() { var newsid = 0; var count; var method = "getlistitems"; var mylist = "placardimages"; var fieldstoread = "<viewfields>" + "<fieldref name='title' />" + "<fieldref name='caption' />" + "<fieldref name='name' />" + "<fieldref name='id' />" + "<fieldref name='linkfilenamenomenu' />" + "</viewfields>"; var query = "<query>" + "<where>" + "<neq>" + "<fieldref name='id'/><value type='number'>0</value>" + ...

php - How to split string on multiple delimiters keeping some delimiters? -

i'm looking way split string in several words, based on delimiters. for example string word1&word2 !word3 word4 &word5 should give me array following words: word1 &word2 !word3 word4 &word5 how reach that? tried several solution str_replace() cannot figure out best way obtain need. maybe solution using regular expressions, not know how use them. try this: $src='word1&word2 !word3 word4 &word5'; $arr=explode(' ',$src=preg_replace('/(?<=[\w])([&!])/',' $1',$src)); echo join('<br>',$arr); // present result ... first change occurence of group consisting of single character of class [&!] preceded 'word'-character ' $1' (=itself, preceded blank) , explode() the string using blanks separators. if need deal multiple blanks separators between words of course replace (faster) explode(' ',...) slighty more "refined" preg_split('/ +/',...) . ...

Compact implementation of logical AND in x86 assembly -

hi , x86 assembler geeks! i have interesting problem test assembler programming skills. i'm author of problem, know correct answer. your task implement logical and in x86 assembly , satisfy following 5 conditions: condition #1 boolean values encoded in 16-bit words in standard way: 0x0000 = false 0x0001..0xffff = true condition #2 operation "logical and" 16-bit values looks following: logical_and(value1,value2) == 0 if (value1 == 0) or (value2 == 0) logical_and(value1,value2) != 0 if (value1 != 0) , (value2 != 0) you must give correct result 16-bit value1 , value2 . please note free choose nonzero value "true" result, not 0x0001 or 0xffff . example, allowed have logical_and(0xdead,0xbeef) == 42 condition #3 should write 16-bit code x86 real mode. input parameters in ax , bx , result in ax : ; registers on entry: ; ax = value1 ; bx = value2 (your code goes here) ; registers on exit: ; ax = logica...

calendar - Adding reminder to event fails in Android -

i have method adds reminder event, fails: fatal exception: main android.database.sqlite.sqliteexception @ android.database.databaseutils.readexceptionfromparcel(databaseutils.java:184) @ android.database.databaseutils.readexceptionfromparcel(databaseutils.java:140) @ android.content.contentproviderproxy.insert(contentprovidernative.java:420) @ android.content.contentresolver.insert(contentresolver.java:864) @ de.appwege.droid.medwege.navigationdrawer.terminfragment.insertreminder(terminfragment.java:848) the method in question: public long insertreminder(long eventid, int minutes){ contentresolver cr = getactivity().getcontentresolver(); contentvalues values = new contentvalues(); values.put(calendarcontract.reminders.minutes, minutes); values.put(calendarcontract.reminders.event_id, eventid); values.put(calendarcontract.reminders.method, calendarcontract.reminders.method_alert); uri uri = cr.insert(calendarcontr...

java - Load strings from sharedpreferences in EditText (two classes) -

i have 2 different activity's. first 1 showed user first time - store phonenumber inside sharedprefs. think problem load prefs method in case leave here make more relevant future users. looks in both activitys "mobilnummer" saved - having problem display them. the idea overwritten if user updates - think method that? onstartup.java public static final string prefs_name = "mobilenumbersaved"; @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); mobilnummer = (edittext) findviewbyid(r.id.mobilnummer); final button button = (button) findviewbyid(r.id.ntonboarding);} public void savetomobile(view v) { if (mobilnummer.gettext().tostring().length() >= 8) { fragmenteduser.savemobile(mobilnummer.gettext().tostring()); // saves parse.com (this works) sharedpreferences settings = getsharedpreferences(prefs_name, 0); sharedpreferen...

Capturing eclipse error log -

i'm looking capture-- write file contents of error log in eclipse. how done? it's error log shown in screen-shot in q . note: i've seen eclipse pde logging , how can add "error log" section in eclipse? among other discussions. tia.

sql server - SQL - How to use the output from an insert to update a table -

question info detailed question the best way can explain question explain desired outcome. i'm trying take set of offices, insert data dbo.deliverylocation table, take output inserted.deliverylocationid , update corresponding office's deliverylocationid field id. desired outcome example office data before officeid | deliverylocationid ----------------------------- 1 | null 2 | null 3 | null run sql statement office data after officeid | deliverylocationid ----------------------------- 1 | 5 2 | 6 3 | 7 delivery location deliverylocationid of 5 created data of office officeid of 1 delivery location deliverylocationid of 6 created data of office officeid of 2 delivery location deliverylocationid of 7 created data of office officeid of 3 the problem per current sql script below, can see have first part (inserting office data delivery location table) complete. second part (updating office correspondin...

c# - How to use more than 1 Model on a page by using asp.net mvc 5? -

i want use 2 models. first on index.cshtml page, , second on _layout.cshtml page in controller contains action public actionresult index(){...} , declare values , return view(). this: public actionresult index() { homepageviewmodel model = new homepageviewmodel(); // something... return view(model); } and in myprojectname.models , write classes check login account , put on page _layout.cshtml . this: on page _layout.cshtml : @using myprojectname.models @model myprojectname.models.loginmodel @if (model.loginaccount != null) { foreach(account acc in model.loginaccount) { @html.actionlink(@acc.email, "someaction", "somecontroller", null, new { id = "loginemail" }) @html.actionlink("logout", "someaction", "somecontroller", null, new { id = "logout" }) } } the code on page _layout.cshtml doesn't work. said that: have returned model ( homepageviewmodel model ), values w...

PowerShell - Remote Start-Process - "This command cannot be run due to the error: This operation requires an interactive window station." -

i trying start smartbear's testexecute program remotely through powershell , i'm getting error when trying call start-process . this command cannot run due error: requested operation requires elevation. + categoryinfo : invalidoperation: (:) [start-process], invalidoperationexception + fullyqualifiederrorid : invalidoperationexception,microsoft.powershell.commands.startprocesscommand + pscomputername : myclient.ourdomain.local i can't figure out how around this. how make work? here's script: # $testexecutelocalsource directory of testexecute.exe on remote machine # $testprojectsuite directory of project suite on remote machine # these paths local (relative remote machine) function starttestexecute { $rs = get-pssession $script = {param($testexecutelocalsource, $testprojectsuite); cd $testexecutelocalsource start-process .\testexecute.exe -nonewwindow -argumentlist $testprojectsui...

visual studio - msbuild set path to CL -

i'm trying take couple of projects compiled on windows microsoft c++ , compile them clang instead. on upside, there exists clang-cl.exe designed drop-in replacement cl.exe. however, when copy clang-cl.exe current directory cl.exe, msbuild still in cases calls microsoft's cl.exe. is there way tell msbuild 'here, when executing task cl, use cl.exe instead of usual one'? msbuild's commandline options don't contain obvious in direction. also, there way tell supply or override commandline parameters cl without changing project file? this easy either command line or project file. properties need configure $(cltoolexe) , $(cltoolpath) . from command line: msbuild myproj.vcxproj /p:cltoolexe=clang-cl.exe /p:cltoolpath=c:\whatever\path\to\the\tool alternatively, inside .vcxproj file: <propertygroup> <cltoolexe>clang-cl.exe</cltoolexe> <cltoolpath>c:\whatever\path\to\the\tool</cltoolpath> </propertygroup>...

python 3.x - Checking if a variable contains spaces and letters -

i trying make program asks name reject input if doesn't contain letters/spaces. however, seems reject spaces numbers , symbols. print("welcome basic arthmetics quiz.") print("what name?") name=input() if not name.isalpha()or name not in(str(" ")): print('please enter letters name!') while not name.isalpha()or name in(str(" ")): v=1 print('please enter name again.') name=input() if name.isalpha()or name not in(str(" ")): v=0 else: v=1 where have gone wrong? this looks awful lot homework. your test name not in(str(" ")) , should written name not in " " , tests whether name 1 of {"", " "} . it easiest test name 1 char @ time, per-char condition like char.isalpha() or char == ' ' combine all , generator expression test chars of name . the actual implementation, proper code fl...

java - What does it mean by <provided> with <exclusion>? -

let's consider example <groupid>com.abc.3rdparty</groupid> <artifactid>abc-gsb-scala</artifactid> <version>${gsbscalaversion}</version> <scope>provided</scope> <exclusions> <exclusion> <groupid>com.abc.3rdparty</groupid> <artifactid>safebrowsing2_2.9.1-0.2.5.jar</artifactid> </exclusion> </exclusions> as understand, <provided> means container provide jar right? so <exclusion> means? 1 of jar within provided project/application? i confused well, build, hunch correct, exclusion won't because left out anyway. if you're using ide pulls in dependencies you, exclude transient dependencies while develop. make sense?

Python: writing an entire row to a CSV file. Why does it work this way? -

i had exported csv nokia suite. "sms","sent","","+12345678901","","2015.01.07 23:06","","text" reading pythondoc , tried import csv open(sourcefile,'r', encoding = 'utf8') f: reader = csv.reader(f, delimiter = ',') line in reader: # write entire csv row open(filename,'a', encoding = 'utf8', newline='') t: = csv.writer(t, delimiter = ',') a.writerows(line) it didn't work, until put brackets around 'line' i.e. [line]. so @ last part had a.writerows([line]) why so? the writerows method accepts container object. line object isn't container. [line] turns list 1 item in it. what want use instead writerow .

ios - UISearchController searchResultsController disappears when searchbar text is empty -

i have uisearchcontroller displays it's searchresultscontroller (which view controller) when searchbar tapped. using uisearchcontroller delegate method: -(void)presentsearchcontroller:(uisearchcontroller *)searchcontroller { dispatch_async(dispatch_get_main_queue(), ^{ searchcontroller.searchresultscontroller.view.hidden = no; }); } however, time searchbar's text empty, whether manually deleting text or tapping little x button, searchresultscontroller view disappearing until start typing text again. ideas why may happening? there method or delegate method being triggered when searchbar.text empty? so after fiddling around while yesterday, solution found ended working. figured i'd post in case else has same problem! -(void)presentsearchcontroller:(uisearchcontroller *)searchcontroller { //forces searchresultscontroller appear when searchbar tapped dispatch_async(dispatch_get_main_queue(), ^{ searchcontroller.search...

algorithm - Polynomial multiplication in M2(R)? -

i trying implement fft-based multiplication algorithm in m2(r). algorithm gets input 2 polynoms elements given matrices, , builds product polynom. however, though algorithm should work, looks identical version wrote earlier on regular number, doesn't. coefficients off little. i have not found articles on roots of unity in m2(c), have found(on paper) choosing eps = ((cos(2pi/n) , sin(2pi/n)) , ( sin(2pi/n) , cos(2pi/n))), nice cycle. is there wrong in approach? here code: struct fft { polyc to, aux[17][2], res[17][2], ac, bc, resc, resd, arga, argb; void fft(polyc v, var depth, var n, polyc to, matc step) { if(n == 1) { to[0] = v[0]; } else { matc eps = matchelper.i2; //we "split" poly in 2 for(var i=0; i<n; i++) aux[depth+1][i&1][i>>1] = v[i]; //we recursively apply fft components fft(aux[depth+1][0], depth+1, n/2, res[depth+1][0], ...

aggregate - ElasticSearch: scoped aggregation -

my understanding can apply aggs scope of query. if run query only, brings 21k hits. however, when add aggs it, comes empty. doing wrong? thank you, { "query": { "bool": { "must": [ { "term": {"app.raw": "me"} } ,{ "term": {"cat.raw": "iv"} } ,{ "term": {"sub.raw": "act"} } ] } } , "aggs": { "distinct_users": { "cardinality": { "field": "login", "precision_threshold": 1000 } } } } because request elasticsearch has "aggs" parameter, "size" parameter defaults 0 , query results not returned, aggregation results. add "size" field whatever value want topmost object in query return search hits, e.g. { query: { ... }, size: 42, aggs: { ... } }

php - Drupal print breaks when rendering a region -

i've come across bit of stumbling block <?php print render ($page['pages_machine_name']); ?> code in drupal site. issue started when moving 7.33 7.36. what happens is, rather display content of page, in instance <ul> , puts several wrapping <div> s , <span> s round <ul> , it's content. fine, happens is, render out incomplete links , such, break rest of page: <a href="http://www.domain.co.uk&lt;div class=" field="" field-name-field-link-three-url="" field-type-text="" field-label-above"="">"&gt; <div class="field field-name-field-link-three-name field-type-text field-label-above"><div class="field-label">link 3 | name:&nbsp;</div><div class="field-items"><div class="field-item even">our people</div></div></div></a> as can see, end of website's domain ma...

reporting services - SSRS Add Parent Group to Entire Tablix -

i've created table ssrs show data current quarter, end users want show previous quarters, when appropriate. request simple if had been given start, need group of rows inside of "quarter" group. table created , using multiple mixes of groups , blank rows, can't figure out how add parent group entire existing format. ideally, solution through design view, i'm thinking have done modifying underlying xml code. using designer, right click on outer group , choose add parent group. adding group in xml code messy, , not recommended. added parent group can use custom expression if needed.

javascript - First steps wiht AJAX - can't find mistakes -

i'm doing first steps ajax , php, following book ("ajax & php: building responsive web aplicattions"). tried similar 1 of first exercises on own. first time runned code didn't work. checked out , didn't find mistakes. compared both codes line line, , looked same me. couldn't find difference. problem first code works; divmessage changes content @ same time you're writting in input, doesn't happen code, , can't figure out why, because both codes practically same me. original code (html): <!doctype html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <script type="text/javascript" src="quickstart.js" language="javascript"></script> </head> <body onload='process()'> server wants know name: <input type="text" id="myname"></input> <div id="divmessage"></div...

apache - Internal error 500 when editing htaccess -

when edit .htaccess file, server retunrs 500 error i'm sure .htaccess good. test, i've add row @ end of file , when i've uploaded it, i've had 500 error. have ideas ? my .htaccess file : #url rewriting options +followsymlinks rewriteengine on rewritebase / rewritecond %{http_host} ^www.example.com$ [nc] rewriterule ^(.*)$ http://example.com/$1 [r=301,l] ############################################### #rediriger tout le monde sauf une ip vers la page d'attente - dé-commenter en cas de maintenance #rewritecond %{request_uri} !uploads/(.*)$ #rewriterule .* maintenance.html [l] ########################################################### ### retrait du / si mis la fin url ### rewritecond %{request_filename} !-d rewriterule ^(.+)/$ /$1 [r=301,l] ######################################## ### redirection vers la page des textures ### rewriterule ^textures$ pages/textures.php [l] rewriterule ^textures/gerer/([a-za-z0-9-]+)$ pages/textures.php?page=gerer&...

c++ - Are new and delete still useful in C++14? -

given availability of make_unique , make_shared , automatic deletion unique_ptr , shared_ptr destructors, situations (apart supporting legacy code) using new , delete in c++14? while smart pointers preferable raw pointers in many cases, there still lots of use-cases new / delete in c++14. if need write requires in-place construction, example: a memory pool an allocator a tagged variant binary messages buffer you need use placement new and, possibly, delete . no way around that. for containers want write, may want use raw pointers storage. even standard smart pointers, still need new if want use custom deleters since make_unique , make_shared don't allow that.