Posts

Showing posts from May, 2010

Excel nested If and VLOOKUP statement -

i making function following: if information in cell equal information stored in list (in worksheet in same workbook) add cell + cell, if false display false or else. i'm new excel decade ago did course on visual basic , remember basic principles of of these functions. tried number of different ways have not come works. i've tried nesting vlookup within if statements hlookup , lookup had no success. rolledsteel product list. list worksheet contains rolledsteel (plus other lists). invoice worksheet contains functions link rolledsteel or list . functions have tried had no success with: =if(n10=list!$a$2:$g$13,w10+w10,false) =if(n10=rolledsteel,w10+w10,false) =if(n10=vlookup(n10,rolledsteel,4,false),w10+w10,false) i have few more questions ahead resolve issue. appreciated. i'm thining easiest way using match() function if(isnumber() follows: =if(isnumber(match(n10,rolledsteel,false)),w10+w10,"false") basically, you're sa

String replacement in MongoDB? -

i have collection has number of documents title contains encoded & characters ( & ) , convert these back. i'm wondering if possible string replacement on value based on it's original value. for example document below: { title: "this & that" } is possible replace & normal update statement? tried this: db.questions.update({title: /&/}, {title: title.replace(/&/g, "&")}); but threw following error: referenceerror: title not defined can done using update statment? if not, best way find/foreach/update on each document? i'm wondering if possible string replacement on value based on it's original value....can done using update statment? currently, not possible update field's value in mongodb accessing , modifying original value in single update statement. but threw following error: referenceerror: title not defined this error occurs, because mongodb not

python - What is the point of indexing in pandas? -

can point me link or provide explanation of benefits of indexing in pandas? routinely deal tables , join them based on columns, , joining/merging process seems re-index things anyway, it's bit cumbersome apply index criteria considering don't think need to. any thoughts on best-practices around indexing? like dict, dataframe's index backed hash table. looking rows based on index values looking dict values based on key. in contrast, values in column values in list. looking rows based on index values faster looking rows based on column values. for example, consider df = pd.dataframe({'foo':np.random.random(), 'index':range(10000)}) df_with_index = df.set_index(['index']) here how row df['index'] column equals 999. pandas has loop through every value in column find ones equal 999. df[df['index'] == 999] # foo index # 999 0.375489 999 here how lookup row index equals 999. index, pandas uses ha

PHP SQLite PDO returns empty json array -

i'm new(ish) php , in particular pdo. can me understand why returning empty array json_encode? the sql query runs fine , returns results. when pass multi-step query via pdo, i'm not getting i'd expect. i've looked @ similar questions on , tried reconcile php documentation without insight. what correct way submit multi-stage (somewhat complex) query via pdo sqlite , pass results json_encode() ? pointers appreciated. updated: code example updated/cleaned helpful comments @darren, @phill, @mike below. $dbh = new pdo('sqlite:livedb2.sqlite'); $sth = $dbh->prepare(' create temporary table tmpnodesa select source, location, count(*) value [emergencydept(sankey)] group source, location union select location, destination, count(*) value [emergencydept(sankey)] group location, destination; create temporary table tmpnodesb select source, location, value tmpnodesa order value desc; create temporary table tmpnodesc select sou

ios - RoboVM app crashes on ptr.get() -

is there kind of magic required ptr.get() work? reason following code crashes app: audiostreambasicdescription asbd = new audiostreambasicdescription(msamplerate, mformatid, mformatflags, mbytesperpacket, mframesperpacket, mbytesperframe, mchannelsperframe, mbitsperchannel, 0); audiofileptr outaudiofile = new audiofileptr(); file f = file.createtempfile("ptt", ".caf"); audiofileerror afe = audiofile.createwithurl(new nsurl(f), 1667327590, asbd, 1, outaudiofile); system.out.println(afe.name()); system.out.println(outaudiofile.get()); it returns audiofile.createwithurl no errors (error code: no), crashes try java instance. i'm experiencing same type of crash in section of code instantiate audioqueueptr queueptr , pass in audioqueue.newinput , try call queueptr.get() . there i'm missing here? there's no stack trace in java, here's xcode organizer device log: incident identifier: 2eeff4f0-9031-4798-80e7-69f55bb7057

android - crashlytics "Answers" crashes when app starts -

i added crashlytics feature app got following nullpointerexception at: com.crashlytics.android.answers.answers.doinbackground(answers.java:102) the app not crash @ least app safe... wondering if had same issue thanks

html - Search text file in a web page and import the data in that text file into excel using vba -

i have web page , there text file in web page. text file name keeps changing every week. how search text file in web page , download content excel sheet. pointers start? know how navigate webpage using given url. the problem dont know url of text file( since keeps changing every week), how can know ? http://usda.mannlib.cornell.edu/mannusda/viewdocumentinfo.do?documentid=1048 here link web page. need download txt file here (crop progress, 11.24.2014 [txt]) . please me out here. recorded macro : sub macro4() activesheet.querytables.add(connection:= _ "url;http://usda.mannlib.cornell.edu/usda/current/cropprog/cropprog-11-24-2014.txt" _ , destination:=range("$a$1")) .commandtype = 0 .name = "cropprog-11-24-2014" .fieldnames = true .rownumbers = false .filladjacentformulas = false .preserveformatting = true .refreshonfileopen = false .backgroundquer

vba - how to use a constant as a range index -

i want use construct option explicit public const celllocation string = "5, 7" ... . data = range1(celllocation ).value my code works data = range1( 5, 7 ).value but not data = range1( celllocation ).value how can specify cell location constant not sure can't use "offset" here. set celllocation = cells(5,7)

perl - Remove quotes from regex result -

i have following code: $source = '<value_date spot_date="2014-11-24" tenor="today">2014-11-20</value_date>'; #get tenor $source=~ /tenor=\s*(.*?)\s*>/; print $1; this prints result of "today" (double quotes part of result). remove double quotes start , end. eg, result of today. can done in regular expression extract tenor? alternatively, what's next best way remove first , last characters, or replace " whitespace? thanks help. modify pattern " s not part of capturing group: $source =~ /tenor="(.*?)">/;

How to check if mysql database exists -

is possible check if (mysql) database exists after having made connection. i know how check if table exists in db, need check if db exists. if not have call piece of code create , populate it. i know sounds inelegant - quick , dirty app. select schema_name information_schema.schemata schema_name = 'dbname' if need know if db exists won't error when try create it, use (from here ): create database if not exists dbname;

python - TypeError: 'int' object is not iterable shape drawing -

hey trying learn python , trying write program draw different shapes. working except part define drawshapes @ end error: traceback (most recent call last): file "/users/seanrose/desktop/homework 4-1.py", line 126, in <module> drawshapes(nick, allshapes[i]) file "/users/seanrose/desktop/homework 4-1.py", line 121, in drawshapes in (numberofside): typeerror: 'int' object not iterable can help? http://imgur.com/9zvmtx4,5ztqcrx sorry here image code or here part isnt working wn = turtle.screen() nick = turtle.turtle() nick.color(penco) nick.pensize(penwid) wn.bgcolor(bcco) def drawshapes(t, typeofshape): totaldegrees = typeofshape[0] numberofside = typeofshape[1] lengthofsides = typeofshape[2] whatkindofshape = typeofshape[3] t.write(whatkindofshape) in (numberofside): t.forward(lengthofsides) t.left(totaldegrees/numberofside) in range(len(allshapes)): drawshapes(nick, allshapes[i]) from err

mysql - Database table relationship design -

Image
i trying write out database design include following relationships, have tried work them out top down, hierarchically, relationships seem better connected way, cannot see, or express how. (this comes fouo system work, names have been changed reflect classification, that's why names may odd.) each branch 1:n functional areas , each building 1:n groups , each group 1:n units , each functionalarea 1:n checklists , each checklist 1:n items , and each unit 1:n checklists , this solved re-evaluating relationships without concern size or data type hold. 1:n relationships used in lieu of n:n. when designing database need specific relationships. example need mention things "a functional area can belongs 1 branch only". these determine either going have 1:1 relations or 1:n or else. however have come answer.

spring cloud - Error when getting the Info from Config Server -

i configuring eureka client app, registered port result in 80. the server config obtained eureka auto-discovery enabled, when auto-discovery disabled port registered correctly. the port of app assigned command line (--server.port=8080) , deleted in other properties files (app.yaml, boostrap.yaml , in config server git repo) i have notice in code: eurekaclientconfiguration.java if (port != 0 && instanceconfig.getnonsecureport() == 0) { instanceconfig.setnonsecureport(port); } the instanceconfig.getnonsecureport() never 0, due this, nonsecureport property never changed. i have register port property in other place? edited add detail: i mean bootstrap.yml has following lines: cloud:config:discovery:enabled: true the yml config in github repository , doesn’t have port assigned the app running in port 8082 app param --server.port=8082 when registered in eureka port 80 instead of 8082 <port enabled="true">8082</port>

python - Line graph using the COL parameter -

Image
new using seaborn, , specify simple , pretty(why im using seaborn) line graph. particularly i'm using seaborn because understanding can supply column name seaborn col= parameter , create graph each unique value in column. seaborn documentation month_name contains month names such jan, feb, mar error: "could not convert octoberjunejulyaugustseptember numeric" my code plot graph each of occurances of month_name i.e. jan, feb, etc where person_name on x axis, , revenue earned y axis. therefore since there thwelve months expect below generate 12 graph grid (6x6). sns.lmplot("person_name", "revenue", df, col="month_date", palette="set1", fit_reg=false); update the error now: valueerror: first argument must sequence 5 blank graphs in row left right nothing in them. assume first argument refers x varaible --> "person name"? how 1 make column (person_name) sequence?

c# - Pass javascript "this" parameter when calling javascript function via web-browser control -

i'm trying run simple javascript function via c# application using web-browser, issue javascript function uses "this" parameter onclick="submit(this);" and full html button code: <input type="submit" name="nextbutton" value="done" onclick="onsubmit(this);" id="nextbutton" class="btn"> how can use function via c# is, understanding, maintained executing javascript. possible? if so, how can go doing it? here line i'm using: browser.document.invokescript("onsubmit", new string[] { "#nextbutton" }); thanks everyone!

Excel VBA matching data across 2 sheets. need help repeating the code -

my code below pulls first , last names worksheet 1 , pastes them worksheet 2 when "white" (meaning martial arts white belt) listed next name , pastes them below headings @ row "x". need repeat code next belt level being "pro yellow". first , last name headings need pasted @ row 78 , names pasted row 79 down. sub pastetoadult() dim lr long, lr2 long, r long set sh1 = thisworkbook.worksheets("adult members cut & past") set sh2 = thisworkbook.worksheets("adult sign on sheet") sh1.select sh2.cells(6, 5).value = "last name" sh2.cells(6, 6).value = "first name"** lr = sh1.cells(rows.count, "b").end(xlup).row x = 7 r = 2 lr if range("i" & r).value = "white" sh2.cells(x, 5).value = sh1.cells(r, 2).value sh2.cells(x, 6).value = sh1.cells(r, 3).value x = x + 1 end if next r sh2.select end sub the following code iterate through each belt co

javascript - OrhographicCamera fails to render the whole scene -

i trying render scene using three.js , webgl in isomorphic way. came across articles mention orthographiccamera achieve this. added , noticed weird results. part of scene black , seems if not being painted. see jsbin: http://jsbin.com/vefohapido/3/edit?js,output when change camera perspective one, whole ground visible. thank help. the position of camera close origo (the center point of scene) , line parts on frustum near plane. try this: camera.position.x = 300; camera.position.y = 400; camera.position.z = 300;

html - JavaScript function Not Working with onchange attribute of input tag -

i have been trying replicate duncan donut example head first javascript , function subtotal() never triggered onchange event , when html reference , did not find onchange event in list provided. duncan.html <html> <head><title>duncan online donut's service</title></head> <script type="text/javascript"> function subtotal(){ document.write("working"); const taxrate = 0.095; const donutrate = 0.5; var tax = 0; var subtotal = 0; var total = 0; var cakedonut = parseint(document.getelementbyid("cakedonut").value); var glazedonut = parseint(document.getelementbyid("glazedonut").value); if(isnan(cakedonut)) cakedonut = 0; if(isnan(glazedonut)) glazedounut = 0; subtotal = (cakedonut + glazedonut)* donutrate ; ta

xml - XSLT Return variable from Template -

so have been given fix , have limited knowledge of xslt. want retain variable template run. <xsl:template name="repeatable"> <xsl:param name="index" select="1" /> <xsl:param name="total" select="10" /> <xsl:if test="not($index = $total)"> <xsl:call-template name="repeatable"> <xsl:with-param name="index" select="$index + 1" /> </xsl:call-template> </xsl:if> </xsl:template> the above template want return variable "$total" from. below template template call above template from. <xsl:template match="randomtemplate"> <xsl:call-template name="repeatable" \> </xsl:template> so essentially, want "total" variable returned me or in way accessible randomtemplate. cheers this may not actually need, can change repeatable template output va

mysql - Retrive data from database and display in table using php -

i have 2 table named item , price. these fields , data of both table table : item item_id | item_name 1 | abc 2 | xyz,jkl,qwe table : price id | item_price | item_id 1 | 50 | 1 2 | 60 | 2 3 | 100 | 1 where item_id reference of item table. need create table in php display data item table. item_name have multiple value seperated coma. need explode them , use drop-down(select) in table.my expected outputt given below. item_id | item_name | item_price note : item_name must have select option (dropdown) use below query records database select a.item,b.item_price table1 a,table2 b a.item_id=b.id; and on front end(php), try below $results=mysqli_query($db,"select a.item,b.item_price table1 a,table2 b a.item_id=b.id"); if(mysqi_num_rows($result) > 1 ) { echo "<table><tr><th>item_id </th><th>item_name</th><th>item_price</th><

.select2 and json.parse() not working in IE -

$(".test").select2( { placeholder: 'enter name', data: json.parse(data_val) }); using .select2 , json dropdown. in other browser working fine except in ie. giving error "script5007: unable value of property 'attr': object null or undefined select2.min.js?token=, line 21 character 2751" any workaround helpful. thanks

xcode - iOS 8 Navigation Bar Not Accessible in Second ViewController on Storyboard -

Image
i new ios development , have not tried programmatically yet. prefer working in storyboard. i'm following outdated tutorial xcode 4.5 in xcode 6.1 create series of views connected 1 navigation controller. http://youtu.be/rgd6mcuzlec once create second view controller, unable double click navigation bar change name , unable add bar button it. i have segue going bar button "item" view 1 2. notice in "view controller scene" there no navigation item. if add elements view controller fall under "view" , not under "view controller", unlike view controller 1 falls under "one". is limitation on xcode? using wrong segue (show)? there hidden setting or customization i'm missing? i have working 2 view controllers , failing 3rd in separate project don't know did i'm pretty sure it's possible cannot reproduce.. edit: workaround instead of new adaptive show segue, use deprecated push segue, add bar button items,

postgresql - Interleaving the rows of two different SQL tables, sorting by date -

in postgres i've got 2 different tables have nothing in common, save fact both have creation date. i'd use creation date in order display instances of both of models on timeline. that, imagine need first somehow select of created_at timestamps both of tables in 1 statement, sort them in descending order, paginate resulting set, , go through , detect model each of rows corresponds in order display data. any idea if possible? maybe smth this select created_at, 'a' tab_name table_a union select created_at, 'b' tab_name table_b order created_at

php - How to split the time from a timestamp from a nested array of result? -

i have been doing project in php , nested array have extract values. here array have time timestamp i.e [arrtime] , [deptime] [segment] => stdclass object ( [wssegment] => stdclass object ( [deptime] => 2014-12-10t15:40:00 [arrtime] => 2014-12-10t18:25:00 [eticketeligible] => 1 [operatingcarrier] => hw ) ) i have being trying apply implode function on timestamp not working me . try one: $depttime = date('h:i:s',strtotime($yourobject->segment->wssegment->deptime)); $arrtime = date('h:i:s',strtotime($yourobject->segment->wssegment->arrtime));

protocol buffers - Organize proto files into folder in Google Protobuf -

currently, have more 100 proto files define message , put in same "prototypes" folder. bit of mess, want organize proto files folder, below: before organization: prototypes/protocmd1.proto prototypes/protocmd2.proto prototypes/protocmd3.proto prototypes/protomsg1.proto prototypes/protomsg2.proto prototypes/protomsg3.proto after organization: prototypes/cmd/protocmd1.proto prototypes/cmd/protocmd2.proto prototypes/cmd/protocmd3.proto prototypes/msg/protomsg1.proto prototypes/msg/protomsg2.proto prototypes/msg/protomsg3.proto the problem after organization, cmd-proto no longer see msg-proto, impossible import msg-proto. there anyway overcome this? far google, there no result, maybe i've overlooked something? appreciated. all.

Compatiblity of Material Design to versions below Android 5.0? -

is possible use material design themes versions below android 5.0? according this link , not case: material design comprehensive guide visual, motion, , interaction design across platforms , devices. android includes support material design apps. use material design in android apps, follow guidelines defined in material design specification , use new components , functionality available in android 5.0 (api level 21) , above. you can use support library have of features in older versions mentioned in below link:- https://developer.android.com/training/material/compatibility.html also mentioned below can visit link well:- http://android-developers.blogspot.in/2014/10/appcompat-v21-material-design-for-pre.html

java - Running scala application for linux on windows 8.1 -

i trying run scala application built linux on windows 8.1. building , initial run successful when trying further operations failing. reason not able find location of few files defined on linux file system location (such as: \var\log\myapplog\app.log or \tmp\keys.mykey). there way can run application without redefining file location windows file system? way can simulate linux file system? thanks

c++ - ZeroMq PUB/SUB pattern not working properly -

my requirements : high throughput, atleast 5000 messages per second order of delivery not important publisher, obvious, should not wait response , should not care if subscriber listening or not background : i creating new thread every message because if dont, messages generation part out-speed sending thread , messages lost, thread each message seems right approach problem: the problem somehow threads started send out zmq message not being terminated (not exiting/finishing). there seems problem in following line: s_send(*client, request.str()); because if remove threads terminate fine, line causing problems, first guess thread waiting response, zmq_pub wait response? here code: void *sendhello(void *threadid) { long tid; tid = (long) threadid; //cout << "hello world! thread id, " << tid << endl; std::stringstream request; //writing hex request sent server request << tid; s_send(*client, request.str(

wordpress - 503 Over Quota Every morning -

Image
every morning between 8 , 9 cet site shows error: error on quota application temporarily on serving quota. please try again later. although billing enabled , site has been running many months now. on old billing status page, there's setting maximum daily budget (set handle peak traffic , buffer against sudden traffic surges.) set $0.00, if change e.g. $10.00, still shows 503 error, seems has nothing it. the new billing page looks this: it happens every morning between 7 , 8 cet, around midnight pst @ least indicate still might have billing? here's how external monitoring system shows outages, i.e. multiple outages every morning , no problems rest of day. the google developers console overview page errors status code shows 503 error in green. if @ monitoring logs of 503 errors between 7 , 9am following pages: / /wp-cron.php and there 500 errors, e.g. @ 8 08:07:08.092 ... [26/nov/2014:23:07:08 -0800] "get / http/1.1" 500 0 - "ping

java - How to remove an element and add it at the end of an ArrayList? -

i'm beginner in java. i'm trying create shuffle method poker game java code. it's supposed return 52 cards, shuffled. instructions tell me remove card using math.random , return @ end of arraylist, , 500 times shuffle it. i'm confused how can add back. have far... thanks! public void shuffle() { int x = (int)(52 * math.random()); mydeck.remove(x); } by way, mydeck arraylist name. arraylist<card> mydeck; you need store result of remove() : card card = mydeck.remove(x); then add again, automatically places @ end of list: mydeck.add(card);

Coding in C# for complex number -

how normalize complex numbers in c#?when have saved text file of complex number in notepad.then want use these complex numbers in c# code.and can read text file of complex number in c#? current code used: using (textreader reader = file.opentext("a.txt")) { var linecount1 = file.readlines("a.txt").count(); x1 = new double[linecount1, 512]; (int = 0; < linecount1; i++) { (int j = 0; j < 512; j++) { string line = reader.readline(); string[] bits = line.split(' '); x1[i, j] = double.parse(bits[j]); } } } its not working.!!! error in last line. perhaps should have this: static void main(string[] args) { var lines = file.readalllines("a.txt"); var complexes = new complex[lines.length]; (int = 0; < complexes.length; i++) { complexes[i] = parse(lines[i

android converting activities to fragments -

i have made nice app whole bunch of activities , needed navigation drawer , found out need have 1 activity whole app , individual different screens should fragments inserted @ runtime. my question : how convert entire app use fragments instead of activities ? (eg: how preserve activity hierarchy , show main activity when user opens app , different actionbar each screen , etc...) there no magic converter, need convert manually each activity extended fragment , add few must methods oncreateview fragment instead of setcontentview of activity. regarding actionbars, sits on main activity need create callback events each fragment main activity in order control action bar.

.net - AForge.net - BlobCounter get different "zones" between 2 images -

i'm trying write accept 2 images , return array (or kind of collection), , each element represent difference between images. for example if have photo of background , man standing on right in source image, , same photo difference first photo man standing on left have collection of 1 returned me xy coordinates change starts , width , height of change. i found aforge has blobcounter class such purpose couldn't understand i'm supposed give - in example ( http://www.aforgenet.com/framework/docs/html/d7d5c028-7a23-e27d-ffd0-5df57cbd31a6.htm ) in documentation see processing of 1 image - not comparison. couldn't find better example. what missing here (i'm new image processing). found solution post here: aforge blob detection along blobcounters here's solution: // create filter thresholdeddifference filter = new thresholdeddifference(60); // apply filter filter.overlayimage = currentimg; bitmap resultimage = filter.apply(_lastimg); // create in

replace - Replacing a file with a new file of the same name but different content in TFS via C# -

i´m working on programm updates templates on our companies team foundation server. having new templates locally on disk , want replace existing ones on server. trying different approaches , newest version. problem either the new file "in use" when accessing through coding in c#(while not in use when try replace in runtime using normal explorer). the replacement not appearing in pending changes, pendingchanges array initial. using (var tfs = teamfoundationserverfactory.getserver("myserver")) { var versioncontrolserver = tfs.getservice(typeof(versioncontrolserver)) versioncontrolserver; // create new workspace authenticated user. var workspace = versioncontrolserver.createworkspace("temporary workspace", versioncontrolserver.authorizeduser); try { // check if mapping exists. var workingfolder = new workingfolder("$serverpath", @"c:\tempfolder");

cordova phonegap android 5 time picker missing Set button Cancel and Clear buttons only -

cordova 3-6-3, android 5 lollipop tap on time input pops time picker set button missing. got email user screenshot showing in app (jquerymobile 4.0 ui), android 5 (lollipop on nexus device) time picker comes cancel , clear buttons only. set button missing, there no way change time, while 4.2.2 there no issue. to test further did following tests: 1) made clean webpage (not app, web html page) time input field , ask user try it. prompted correct popup cancel, clear, set buttons. so, android 5 lollipop ok on clean html page loaded in browser. 2) created helloworld basic cordova app (no jqm plain cordova app) time input in main page , sent user. installed , reported same issue, sent screenshot showing same problem: set button missing cancel , clean button only. any ideas workaround or how fix this? one solution use regular text input , limit input 0123456789: chars only, dunno if option. you can solve problem using crosswalk instead on default webview cordova use

Best practice on how to bundle tomcat with my application using install4j -

i trying create installer using install4j application. have requirement need ship tomcat it, such tomcat can installed service once application gets installed. please can suggest best way same. you can add tomcat files distribution tree. as service, have create generated launcher mimics behavior of catalina.bat.

linux - Spawning Multiple Jobs for building a kernel on Quad Core processor? -

if kernel's makefiles have correct dependency information, to spawn mutliple jobs, should use this $make -jn n = number of jobs spawn if use quad core machine i7 4700mq 8 gb ram, should ideal , maximum value of n ? grep '^processor' /proc/cpuinfo | wc -l it should give number of cpu's in system (as seen os). can use number. +1 number usualy won't hurt (it depends on project building, scheduler in use, etc.).

c# - Inject current user to OWIN Self-Host Web API 's service -

i using services business logic in owin self-host web api, , want inject current user services. this identityservice currentuser property: public class identityservice : iidentityservice { private readonly usermanager<user, int> usermanager; public identityservice(usermanager<user, int> usermanager) { if (usermanager == null) { throw new argumentnullexception("usermanager"); } this.usermanager = usermanager; } public user currentuser { { var identity = thread.currentprincipal; if (identity == null || identity.identity == null || !identity.identity.isauthenticated) { if (httpcontext.current == null || httpcontext.current.user == null) { return null; } identity = httpcontext.current.user; } var user = this.usermanager.findbyname

c# - mask password string -

i'm creating c# windows forms app logs me in servers single click using mstsc. have admin name , password in code in plain text , wondered there way mask/hide password? store code in dropbox , prefer wasn't readable. private void runasadmin(string server) { process rdcprocess = new process(); rdcprocess.startinfo.filename = environment.expandenvironmentvariables(@"%systemroot%\system32\cmdkey.exe"); rdcprocess.startinfo.arguments = "/generic:termsrv/192.168.0.217 /user:" + "administrator" + " /pass:" + "mypassword"; rdcprocess.start(); use function encrypt , decrypt password. public function convertpassword(byval spassword string) dim stempchar string dim icount integer icount = 1 len(spassword) if asc(mid$(spassword, icount, 1)) < 128 stempchar = ctype(asc(mid$(spassword, icount, 1)) + 128, string) el

awk - Using pipe character as a field separator -

i'm trying different commands process csv file separator pipe | character. while commands work when comma separator, throws error when replace pipe: awk -f[|] "nr==fnr{a[$2]=$0;next}$2 in a{ print a[$2] [|] $4 [|] $5 }" ofs=[|] file1.csv file2.csv awk "{print nr "|" $0}" file1.csv i tried, "|" , [|] , /| no avail. i'm using gawk on windows. i'm missing? try escape | echo "more|data" | awk -f\| '{print $1}' more

how to pass the dialogue box buttons name as variable in jquery dialogue -

here want dialogue box button values 'yes','no' variable.i want pass variable butt1 buttons . var button ='yes' $("#modal_confirm_yes_no").dialog({ bgiframe: true, autoopen: false, minheight: 200, width: 350, modal: true, closeonescape: false, draggable: false, resizable: false, buttons: { 'yes': function(){ $(this).dialog('close'); callback(true); }, 'no': function(){ $(this).dialog('close'); callback(false); } } }); var button ='yes' $("#modal_confirm_yes_no").dialog({ bgiframe: true, autoopen: false, minheight: 200, width: 350, modal: true, closeonescape: false, draggable: false, resizable: false, buttons: [

javascript - AngularJS Securing Service values -

in angularjs application when user logs in roles stored in loginservice, have found values editable user through console. how can secure that? what csrf handling? i have many other security concerns angular/easyrest application, useful link appreciated. 1) if worried editing stored values, can make them private: https://developer.mozilla.org/en-us/docs/web/javascript/guide/closures think best can do, possible edit value if set breakpoint in function have access value. should use server-side checking anyway. 2) if have user data in links, should use $sanitize service before adding data page. https://docs.angularjs.org/api/ngsanitize/service/ $sanitize

How can I close a window using Javascript in google Chrome (v38 and above) /firefox (v33 and above)? -

following options doesn't work - 1) window.close(); 2) window.open('','_self','');window.close(); window.close() should work if window opened parent window. if trying open window directly desktop , run window.close() , not close window.

javascript - When is it recommended to pass a parameter as a query string and when should they be passed in the URL's path? -

are there best practices when parameter should passed via url's path instead of query string? /test/foo vs /test?id=foo here asp.net routing informative tutorial question. url routes , every url can't mapped route if not following pattern site. , benefit of route ease of readability nothing else.

ios - Can not perform swipe-to-delete on UITableView if it is in UIScrollView -

i have created uitableview can perform swipe-to-delete on table cells in normal cases, when put uitableview uiscrollview can horizontally scrollable, outer scrollview swallow swipe event, swipe-to-delete not workable. i'm sorry tell you have give 1 function since 2 functions rely on same gesture. if want keep swipe-delete, set outer scrollview.scrollenabled = no . think help. if not, have button start tableview edit mode. make delete cell scrollview can slided.

arangodb - Foxx apps debugging workflow? -

what recommended workflow debug foxx applications? i working on pretty big application , seems me doing wrong, because way proceeding not seem maintanable @ all: do changes in foxx app (eg new endpoints). upload foxx app arangodb. test changes (eg trigger api calls). check logs see if went wrong. go 1. i experienced great time savings, shifting more of development workflow terminal client 'arangosh'. when debugging more complex endpoints, can isolate queries , functions , debug each individually in terminal. when done debugging, merge code in foxx app , mount it. require modules in foxx, enter variables arguments functions or queries. you can use arangosh either directly terminal or via embedded terminal in arangodb frontend. you may save time switching dev mode, allows have changes in code directly reflected in mounted app without fetching, mounting , unmounting each time. additional flexibility costs performance, make sure switch production mode on

Parsing XML Using XPATH for Python -

i new python - few days old - , appreciate help. i want write python code parse below xml below:- servingcell----------neighbourcell l41_nbr3347_1----------l41_nbr3347_2 l41_nbr3347_1----------l41_nbr3347_3 l41_nbr3347_1----------l41_nbr3349_1 l41_nbr3347_1----------l41_nbrea2242_1 <ltecell id="l41_nbr3347_1"> <attributes> <abspatterninfotdd><unset/></abspatterninfotdd> <additionalspectrumemission>1</additionalspectrumemission> <additionalspectrumemissionlist><unset/></additionalspectrumemissionlist> <ltespeeddependentconf id="0"> <attributes> <treselectioneutrasfhigh>ldot0</treselectioneut <treselectioneutrasfmedium>ldot0</treselectione </attributes> </ltespeeddependentconf> <lteneighboringcellre

debugging - NetBeans and Zend Framework debug -

i need debug zend project netbeans it's not work. my configuration in php.ini: ; xdebug extension zend_extension = "c:/wamp/bin/php/php5.5.12/zend_ext/php_xdebug-2.2.5-5.5-vc11-x86_64.dll" ; [xdebug] xdebug.remote_enable = off xdebug.profiler_enable = off xdebug.profiler_enable_trigger = off xdebug.profiler_output_name = cachegrind.out.%t.%p xdebug.profiler_output_dir = "c:/wamp/tmp" xdebug.show_local_vars=0 these not work: xdebug.remote_enable = on xdebug.profiler_enable = on xdebug.profiler_enable_trigger = on {...} any suggestions? there 2 php.ini in wamp server 1 reside in apache folder , other 1 reside in php folder . have apply changes on both php.ini .

ios - UITableview Cell animation -

if inserting 1 one row animation working bottom top animation. , make condition when scroll top bottom @ time not animation, want stop animation after 1 time animation bottom top. in willdisplaycell of tableview method : if (tempindex == nil) { cgrect myrect = [tableview rectforrowatindexpath:indexpath]; //instead of 568, choose origin of animation cell.frame = cgrectmake(cell.frame.origin.x, cell.frame.origin.y + 568, cell.frame.size.width, cell.frame.size.height); [uiview animatewithduration:0.3 delay:0 options:uiviewanimationoptioncurveeaseinout animations:^{ //instead of -30, choose how want cell "under" cell above cell.frame = cgrectmake(myrect.origin.x, myrect.origin.y , myrect.size.width, myrect.size.height); } completion:^(bool finished){

Soundcloud oembed not working on mobile devices -

when using soundcloud oembed widget on android devices urls of form http://soundcloud.com/oembed.json?auto_play=true&maxheight=166&url= ... getting redirected http://m.soundcloud.com/oembed.json?auto_play=true&maxheight=166&url= .... unlike http://soundcloud.com/oembed.json responses, m.soundcloud.com responses not include following header: access-control-allow-origin:* this causes errors such following: xmlhttprequest cannot load http://soundcloud.com/oembed.json?auto_play=true&maxheight=166&url=https%3a%2f%2fsoundcloud.com%2fplasticworld%2fsavoir-eternal. request redirected 'http://m.soundcloud.com/oembed.json?auto_play=true&maxheight=166&url=https%3a%2f%2fsoundcloud.com%2fplasticworld%2fsavoir-eternal', disallowed cross-origin requests require preflight. ultimately leads oembed fail. is possible this, please? thanks, simon this should fixed now. report. arbo

html - Django - Use variables from included template -

i have following setup: base.html ... {% block main-content %} {% endblock main-content %} ... admin.html {% extends "base.html" %} {% load staticfiles %} {% block main-content %} {% include users.html %} {% endblock main-content %} the file users.html uses tags '{{ users }}' because renders view returns several variables. right now, if call admin.html can see template of users.html (basic html, css) without variables. don't think template rendering views.py. is there anyway can obtain variables view returning? note: base.html , admin.html in same django app, while users.html in different one. thank you! this seems common misapprehension. templates not belong views. relationship view may (or may not) render template: template may rendered 1 or many views, , has no actual knowledge of of them. when "include" template inside admin template, there no relationship other view might render it; if need variables in v

c# - Updating Field in RavenDB Document -

good day, i have ravendb json document in 1 field ("info") contains string looks this: "{\"value1\":\"9\", \"value2\": \"dog\", ....}" i remove escaping "\" characters recognized json list ravendb. however, have tried updating documents newstring = oldstring.replace("\\", "") , newstring = oldstring.replace(@"\", "") and newstring = oldstring.trim(new char[] { @"\" }) but not work. after applying these above mentioned methods string looks unchanged. please see below full code: while(true) { var result = session.query<documents>() .take(1000).skip(i) .tolist(); if (result.count == 0) break; foreach (var r in result) { string rinfo = r.info.tostring();

Convert SNMP traps from v1 to v3 -

i'm trying convert snmp v1 traps v3. i've followed this discussion it's vague. i've looked here without success. to more clear: have centos 6 station, net-snmp 5.5 on it. need generate v1 traps, receive them, convert them v3, forward them. regarding first guide, managed far: master: snmpd -lo --master=agentx --agentxsocket=tcp:192.168.58.64:42000 udp:1161 listen: snmpwalk -v3 -u snmpv3user -a snmpv3pass -a md5 -l authnopriv 192.168.58.64:1161 later edit: i have made progress, able run snmpd master, connect snmptrapd agent it, have v1 traps mechanism functional. i did following: in order snmptrapd connected subagent snmpd need following: ###1 edit /etc/hosts.allow , add snmpd: $(your_ip) smptrapd: $(your_ip) important because snmptrapd fails silently if rejected tcp wrap. ###2 edit /etc/snmp/snmpd.conf , add @ bottom of other com2sec directives. com2sec infwnet $(your_ip) your-community add these lines group myrogroup v1

android - No visual response (highlight) on touching a menu item -

there not visual response selecting menu item. example, within menu, on clicking settings, settings activity opens without visual response clicking settings item. how solve this. also, how add ripple using 3rd party library? this library i'm using , , i've managed add ripple other buttons, doesn't work on menu items. here's code menu: <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" app:showasaction = "ifroom"> <item android:id="@+id/action_settings" android:title="@string/action_settings" android:orderincategory="1"/> <item android:id = "@+id/quit" android:title = "@string/quit_app" app:showasaction="never" android:orderincategory="2"/> </menu>

angularjs - What are best practices for documenting MEAN stack web applications? -

i java programming background. know how documentation there. can document each method , each attribute of class in java environment. since last year, have been working on web application using mean stack. @ first, added single-line comments own understanding. think there should standard way of documenting web applications. roughly, have following code: angularjs controllers angularjs routes angularjs services mongodb collections defined on server side (node) expressjs configuration code expressjs routes , handlers rest api socket.io code in short, want this: documentation inside code in form of comments (standard way) make separate documentation word file or html file edit i don't mean want similar type of code documentation done in java. want understand how in mean based applications in standard way. use mean boilerplates know there separate folders client side code , server side code. within them, there separate folders configuration, route handlers,

BI Publisher in Word buttons don't work -

i've imported xml file , buttons in word became available, when press neither works. code isn't important here. problem solved. word application wasn't registered. when registered everithing works.

Why doesn't my connection to neo4j work (through Javascript) -

i trying make interaction local neo4j dataset through javascript. error: uncaught syntaxerror: unexpected token : (13:20:43:754 | error, javascript) @ http://localhost:7474/?callback=jquery111107695061936974525_1417522841327& {%22statements%22:[{%22statement%22:%22match%20(n)%20return%20count(n)%22}]}&_=1417522841328:2 success (13:20:43:958) @ public_html/index.html:34 i.e. want sent , receive queries web application. code now: <head> <title>todo supply title</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <script language="javascript" type="text/javascript" src="js/jquery-1.11.1.js"></script> <script type="text/javascript"> var body = json.stringify({ statements: [{ statement: 'match (n) return count(n)' }]

redis - What are leading zeroes in regards to HyperLogLog? -

i reading antirez.com , wikipedia , other sources understang hll , how works, each time term " leading zeroes " used stumble. please explain means when talk hyperloglog. leading zeroes number of 0s before first 1 in binary representation of hash. equivalent computing most significant bit . hyperloglog algorithm not depend on computing these leading zeroes, needs check known prefix in binary representation of hash. happens computing significant bit fast on hardware implementations.

XSLT XPath first note with attribute -

i want select first column without @type='hidden' in first <xsl:if> , , other nodes without @type='hidden' in second <xsl:if> . want give a in first <xsl:if> class. xml: <row type="header"> <column type="hidden">href</column> <column type="hidden">mnr</column> <column type="number">vnr</column> <column type="text">description</column> <column type="text">document</column> <column type="date">date</column> </row> wanted output: <tr> <th> <a class="sortingarrow" onclick="sort(this)"> vnr </a> </th> <th> <a onclick="sort(this)"> description </a> </th> <th> <a onclick="sort(this)"> document </a> </th> <th> <a onclick="sort(

css - Text align doesnt work with span -

i need below alignment.i can achieve using table want solution without using table. sub total $596.00 shipping $35.00 tax $63.11 order total $694.11 when dont use table looks below though use text-align:right first span element. sub total $596.00 shipping $35.00 tax $63.11 order total $694.11 you use inline-block , first-child align , add padding . something this: #container > div > div { display:inline-block; min-width:75px; } #container > div > div:first-child { text-align:right; padding-right:10px; } <div id="container"> <div> <div>sub total</div> <div>$596.00</div> </div> <div> <div>shipping</div> <div>$35.00</div> </div> <div> <div>tax</div> <div>$63.11</div> </div> <

windows - Batch Script to Open TXT doc - My Documents path for any user -

hello! hopefully easy one can input path text file within batch script recognise path regardless of windows user executes it? e.g. i've tried: @echo off path c:\documents , settings\%user%\my documents start test.txt exit any appreciated! replacing %user% %username% should trick.

ios - Is the design of being able to push indefinite view controllers on a navigation stack acceptable? -

if inside app, can push (a, b , c represent view controllers): -> b -> c -> b -> c -> b ....., can go forever, acceptable design pattern? this may seem silly , obvious question have app called "taobao" (china's biggest, famous online shopping app) alibaba group (owned china's richest man), described above. in app can go -> b -> c -> b -> c -> b .....then if need go need go many times go deeper, means view controllers pushed on stack during navigation. since alibaba group trusty tech company believe navigation pattern there reason. common sense tells me not pattern want hear experienced guys. thanks! generally can push makes sense app. there 1 (pretty obvious condition) - not push controller on top of stack. but there big but! if stack can infinite have keep in mind navigationcontroller stack stored in memory! adding more , more controllers on stack without releasing of them end up, sooner or later, memory crash. that

javascript - Ajax and json_encode echoing text instead of json in Firefox -

i have small script returns shipping costs html , php/codeigniter. here's php code, example data array: public function atualiza_frete_ajax() { $response_array = array( 'html_select_frete' => "<form><select><option></option></select></form>" ); header("content-type: application/json", true); echo json_encode($response_array); } and js/jquery function atualizar_frete_ajax() { var $form = $("#form-cep"); $(".loading").fadein(); $.ajax({ type: $form.attr("method"), url: $form.attr("action"), datatype: "json", data: $form.serialize() }).done(function(data){ $(".frete-valor").html(data.html_select_frete) $(&q

scala - How to serve files generated by sbt-js using spray-can -

this basic thing, can't work. spray-template project have added sbt-js plugin. when run js command finds , processes js files in src/main/[resources]/web/js/ , places them in target/scala-2.11/resource_managed/[main]/resources/web/js/ (the [ ] marks directories shows resource directories in intellij). i try serve js files this, works unprocessed file: trait jscontent extends httpservice { val jsroute = path("js1") { getfromresource("web/js/test.js") // unprocessed js file loads fine. } ~ path("js2") { getfromresource("resources/web/js/test.js") // how locate generated file? } } the directory containing processed files listed when doing show resourcedirectories in sbt console, not included in jar produced when running package. so how point out sbt want use managed js resources?

c# - Restrict Panning in specific border -

i need bound path or canvas in boundary. want is, when click mouse-left-button, holding , move panning. should not move when mouse pointer reach boundary border. i'll add code here please me out xaml code: <border x:name="outmoastborder" height="820" width="820" cliptobounds="true" borderthickness="2" borderbrush="black" block.ishyphenationenabled="true"> <border x:name="clipborder" height="810" width="810" borderthickness="2" borderbrush="black" cliptobounds="true"> <canvas x:name="canvaspanel" height="800" width="800" background="beige"> </canvas> </border> </border> <grid> <button content="original size" height="23" name="btn_original" width="75" click="btn_original