Posts

Showing posts from April, 2015

Programmatically generated zip invalid on pc but not on android -

solved: ok stupid. couldn't open file because forgot install winrar or 7zip since pc newly formatted... works fine. sorry waste anyone's time. in app programmatically generate .zip file photos , .csv files in directory. it creates zip , sends email attachment without hickup. problem on pc can't extract .zip file because says it's invalid, on device using "winzip" can check .zip file , has suppose have. confusing me. here code: here check checkboxes have been checked zipping for(int = 0; < cbstates.size(); ++i) { if(cbstates.get(i)) { string zipfile = environment.getexternalstoragedirectory() + "/arcflash/" + listitems.get(i) + ".zip";//ex: /storage/sdcard0/arcflash/study12.zip string srcdir = environment.getexternalstoragedirectory() + "/arcflash/" + listitems.get(i); try { ...

vb.net - Is openCV only for C developers?...any openCV for VB developers? -

i looking function callable within vb.net measure how out of focus or blurry still video frame is. emgu cv works .net languages (naturally including vb.net). http://www.emgu.com/wiki/index.php/main_page there have been great discussion on stack overflow well, .net (dotnet) wrappers opencv? and links(with accepted answers) stackoverflow regarding how blurry frame is is there way detect if image blurry? detection of blur in images/video sequences

python - change pandas 0.13.0 "print dataframe" to print dataframe like in earlier versions -

in new version 0.13.0 of pandas, dataframe df printed in 1 long list of numbers using df or print df instead of overview, before, possible using df.info() is possible change default 'df' or 'print df' command show : in [12]: df.info() <class 'pandas.core.frame.dataframe'> datetimeindex: 4319 entries, 2010-02-18 00:00:00 2010-03-13 23:15:00 data columns (total 2 columns): qint 4319 non-null values qhea 4319 non-null values dtypes: float32(2) again instead of: in [11]: df out[11]: qint qhea 2010-02-18 00:00:00 169.666672 0.000000 2010-02-18 00:15:00 152.000000 -0.000000 2010-02-18 00:15:00 152.000000 -0.000000 2010-02-18 00:30:00 155.000000 -0.000000 2010-02-18 00:30:04 155.063950 -0.000000 2010-02-18 00:30:04 155.063950 -1136.823364 2010-02-18 00:45:00 169.666672 4587.430176 2010-02-18 01:00:00 137.333328 ...

mysql - Incremental variable names inside PHP loop -

i'm having read series of x , y values out of table plotting pchart....i know works single series i've been trying following code work several series while now. $pidresults output of search form used extract various x , y pairs table uses value foreign key. $pidresults = $_session['pidresults']; $pidsize = count($pidresults); // select plottable data sampleslave table ($i=0; $i<$pidsize; $i++) { $val = $pidresults[$i]; $sql="select * sampleslave masterid=$val , xaxisdata>=1 order xaxisdata"; $result = mysql_query($sql) or die('query failed: ' . mysql_error()); while ($row = mysql_fetch_array($result)) { $varnamex = "xdata$val"; $varnamey = "ydata$val"; $$varnamex[] = $row['xaxisdata']; $$varnamey[] = $row['yaxisdata']; } $mydata->addpoints($varnamex,"xpid$val"); $mydata->add...

java - Errors in RESTful web service implementation -

as beginner in web services, using this example start out restful web services. but, in case, have performed every action mentioned till 13th step. but, unable proceed further since, i'm not getting result have mentioned in it. i'm getting below error in firefox firefox can't establish connection server @ localhost:9999 can please me this?? check if java application acting server (calcreststartup) able run correctly. then check port bind 9999 (or if has chosen different 1 put port in ff url). if above seems ok, try telnet port, server stopped , again server running ( first telnet should fail, , second succeed). this output when failing: telnet localhost 9999 trying 127.0.0.1... telnet: unable connect remote host: connection refused this output when succeeding: telnet localhost 9999 trying 127.0.0.1... connected localhost. escape character '^]'. you can check how works running simple http server python with: python3 -m http.server 9999...

python - How can I loop over a dictionary and write the name of the key as the name of the output file? -

i want loop on dictionary , make output file each key in dictionary , use key name of output file. tried: for id, pos in pnposd.iteritems(): print id, 'id' print pos, 'pos' ofh = open("/home/",id,"_candmuts.txt") ofh.write("%d\n" % (pos)) and error message got line try open input file (in line 4): typeerror: file() takes @ 3 arguments (4 given) use str.format . should open file write mode ( w ) write file. for id, pos in pnposd.iteritems(): print id, 'id' print pos, 'pos' open("/home/{}_candmuts.txt".format(id), 'w') ofh: ofh.write("%d\n" % (pos))

sql - How do I retrieve all tuples from similar tables in a postgresql database? -

i've postgresql database nice property. tables within database have same schema. created using model query. create table tablex (s varchar(100), p varchar(100), o varchar(100)) now i'm interested on retrieving data these tables in 1 shot. can names using following query : select table_name information_schema.tables table_schema='public' but struggle return contain of tables ( name in result of above query). i've try following query select tab.s, tab.p, tab.o (select table_name information_schema.tables table_schema='public') tab but it's not working. , following error message pgadm3 error: column tab.s not exist line 1: select tab.s, tab.p, tab.o ^ ********** erreur ********** error: column tab.s not exist État sql :42703 caractère : 151 any idea how deal ?

java - How can I pass an AudioInputStream file to a Spectogram(Wave) constructor -

can please me call constructor spectogram() code below if (ae.getactioncommand().equals("play")) { try { ai = audiosystem.getaudioinputstream(file); c.close(); c = audiosystem.getclip(); c.open(ai); c.start(); // imagine these types not match. // how can convert line make workable?? spectogram sp = new spectogram(ai); } catch (exception e) { e.printstacktrace(); } } this constructor want call create spectogram , embed in wave player public spectogram(wave wave) { this.wave=wave; buildspectrogram(); }

How to load application.yaml config in spring-boot configuration for selenium testing -

i trying run selenium tests agains spring-boot app. want start app properties application.yml , application-test.yml define. however, default doesn't happen. i have tried dave syer suggested , have implemented applicationcontextinitializer reads application.yml , application-test.yml files using yamlpropertysourceloader. this doesn't seem have effect- setting server port 9000 in application-test has no effect. below test base class code: @contextconfiguration(classes = {testconfiguration.class}, initializers = {testapplicationyamlloaderapplicationcontextinitializer.class}) @shareddriver(type = shareddriver.sharedtype.once) @activeprofiles({"test"}) public abstract class integrationbase extends abstracttestngspringcontexttests { .... } below code applicationcontextinitializer: public class testapplicationyamlloaderapplicationcontextinitializer implements applicationcontextinitializer<configurableapplicationcontext> { @override public void initia...

ios - Setting UILabel text taking longer than expected iOS7 -

in view attempt display weather related info. use dispatch_async(dispatch_get_global_queue(dispatch_queue_priority_default, 0), ^{ make nsurl , other related things send nsurlrequest set 2 uilabels data nslog(show data retrieved) }); for reason, see nslog line 15-45 seconds before uilabel changes new text. new obj-c , lot of code comes using tutorial dont have greatest understanding of dispatch_async method. thoughts or suggestions appreciated. dispatch_async(dispatch_get_global_queue(dispatch_queue_priority_default, 0), ^{ nsurlresponse *response = nil; nserror *error = nil; nsdata *respdata = nil; nsurlrequest *forecastrequest = [nsurlrequest requestwithurl:currentforecasturl]; respdata = [nsurlconnection sendsynchronousrequest:forecastrequest returningresponse:&response error:&error]; [_responsedata appenddata:respdata]; nslog(@"response: %@", response); nslog(@"error: %@...

php - Doctrine using 2 databases -

so, have app uses doctrine 1.2. i have 2 databases, 1 read replica , 1 writes. i use read replica db on select queries , other other operations. i did research on couldn't find perfect way achieve this. i don't want initialize 2 connections when config auto loads. make slower. should lazy load when needed. any workarounds?

ide - How do I point CodeBlocks and Visual Studio Express 2008-2012 to custom Include and Lib directories? -

this tricky question... have put compilation of directx, opengl , windows sdk include , lib files single directory called, "allcode." inside lib , lib/x64 directories, , include directory. directx 7 in there. can check out page have on here: http://hi-techheadache.blogspot.com/p/blog-page.html the point of make easy compile , run code book. want codeblocks , visual studio express 2008-2012 pointed, were, allcode directory, anytime needs refer of files can. don't want errors missing files! want code book like, "programming multiplayer fps in directx" vaughan young , expect compile, link , run without issue! how set each ide this? btw i'm on windows 7 64-bit machine. drivers updated , installed. running latest version of codeblocks, visual studio express 2010 sp1 , visual studio express 2012. you can create empty project specifies required settings. want specify include directories, , add libraries passed linker. can save project somewhere, , ...

java - Tomcat starting failure due to timeout in Spring source -

the issue : i'm getting timeout errors when starting tomcat inside eclipse , doesn't start @ in debug mode. debug mode error : fatal error in native method: jdwp no transports initialized, jvmtierror=agent_error_transport_init(197) error: transport error 202: connect failed: connection refused error: jdwp transport dt_socket failed initialize, transport_init(510) jdwp exit error agent_error_transport_init(197): no transports initialized [../../../src/share/back/debuginit.c:741] normal mode error : server tomcat v7.0 @ localhost unable start within 45 seconds. if server requires more time... please not i'm starting tomcat without application deployed. i've checked ports , not used sure. any idea please? it seems jdwp not loading. here in this article can idea resolve problem. check answer jaikiran pai in post. says must use command line options load jdwp. -agentlib:jdwp=transport=dt_socket,address=8787,server=y,suspend=n hope can helps yo...

ios - Dropbox Sign in app icon -

Image
what needed done app's icon show in sign in screen? you need add icon dropbox app settings. go dropbox development site , edit details of app.

actionscript 3 - Call a function if String number is inferior to 0? -

i've got code in toolbar.as : var money = 9999; argent.text = string(money); trace(money); how do say if (money < 0){ callfunction(); } ? thank answers edit i've tried everything. here's did : var money:int = 9999; argent.text = money.tostring(); trace(money); stageref.addeventlistener("checkingmoney", checkmoney, false, 0, true); i've add eventlistner in order check money (as nothing triggering condition if money<0 before). and : public function checkmoney(event):void{ var money; trace("checking"); if (parseint(money) < 0){ trace("dangerous"); } } so function triggered (the trace "checking" on), number under 0 (-4600), trace "dangerous" not appear.. don't understand. i don't this, i'm posting second answer because edit drastically different posted. future reference, please post entire code relevant. seemed have mis...

Including all tokens in the term-document matrix in the R tm package -

i'm trying make term-document matrix termdocumentmatrix function of tm package in r , found words not included. > library(tm) > tdm <- termdocumentmatrix(corpus(vectorsource("the book of great importance."))) > rownames(tdm) [1] "book" "great" "importance." "the" here, words is , of have been excluded matrix. if corpus includes deleted words, gives following message. > tdm <- termdocumentmatrix(corpus(vectorsource("of of is"))) warning message: in is.na(x) : is.na() applied non-(list or vector) of type 'null' > rownames(tdm) null the message signals is , of deleted before matrix built, have not been able figure out why occurs , how can include tokens in corpus. any appreciated. use control argument of termdocumentmatrix require(tm) tdm <- termdocumentmatrix(corpus(vectorsource("of of is")), control = list(stopwords=false, wordlengths=c(...

php - Logged in user from session -

hey question on session. trying reflect logged on user's username in form in 1 of webpage. data reflecting person username database. how make reflect person logging on username on form? have necessary data in database. want reflect on form existing user logged in. <?php session_start(); ?> <? $con=mysqli_connect("","","",""); // check connection if (mysqli_connect_errno()) { echo "failed connect mysql: " . mysqli_connect_error(); } $result = mysqli_query($con, "select `name` `student_details` `name` = '" . $adminname . "';"); $row = mysqli_fetch_assoc($result); ?> <td height="170"> <table> <form method= "post" action=""> <tr> <td>student name</td> <td><input name="admin_no" type...

c# - Autofac Registration technique for this specific issue -

i have class: public class autofaceventcontainer : ieventcontainer { private readonly icomponentcontext _context; public autofaceventcontainer(icomponentcontext context) { _context = context; } public ienumerable<idomaineventhandler<t>> handlers<t>(t domainevent) t : idomainevent { return _context.resolve<ienumerable<idomaineventhandler<t>>>(); } } the ieventcontainer this: public interface ieventcontainer { ienumerable<idomaineventhandler<t>> handlers<t>(t domainevent) t : idomainevent; } now ieventcontainer used in class domainevents this: public static class domainevents { .................................... .................................... public static ieventcontainer container; public static void ra...

yii - Create a column with primary key using migrations -

i using migrations in yii create new column with. code works fine however, unsure how set primary key? this part migration file: public function up() { $this->addcolumn( 'competition_prizes', 'prize_id', 'int(11) unsigned not null first', ); $this->addprimarykey('pk1', 'competition_prizes', 'prize_id'); } i don't know, how make competition_prizes column primary key. after addcolumn function add line $this->addprimarykey('pk1', 'competition_prizes', 'prize_id') make sure there no primary key column in table.

asp.net - Html.actionlink open site in div -

i new entire asp .net mvc 4, sorry silly question:) after user logs in, want make left sidebar links. when user clicks on link want prevent opening in new page. instead of want open in same page in different div class, floated next it. is possible achieve without using ajax or jquery etc. ? not want use of these, because trying make website secure possible (i making own banking website, silly idea know). @html.actionlink("balance", "balance", "ebank")</li> @html.actionlink("transaction", "transaction", "ebank")</li> i want these actions loaded, opened in div class="bank-content" as per idea markpsmith can have following: <div class="row"> <div class="col-md-8" id="balance"> @html.action("balance","ebank") </div> <div class="col-md-4" id="transaction"> @html.action("tra...

javascript - How to implement show more button on my page using js/jquery show/hide -

i have page contains 40 items. don't want 40 stories displayed on 1 page @ time. don't have ajax knowledge. without using ajax how can implement show more functionality on page show 10 items @ time on page using pure jquery/js hide() or show() , not ajax? try: html: <div id="text1">text</div> <div id="text2">text</div> <div id="text3">text</div> <div id="text4">text</div> <br><br> <div id="button">show more</div> jquery: var count=2; $( "#button" ).click(function() { $( "#text"+count ).show(); count++; }); demo

wpf - Is there a way to know of what type is the property bound to my DependencyProperty? -

i know type bound dependencyproperty of control. there way know that? i have dependencyproperty this: public static readonly dependencyproperty myvalueproperty = dependencyproperty.register("myvalue", typeof(double?), typeof(mycontrol), new frameworkpropertymetadata { bindstwowaybydefault = true, defaultupdatesourcetrigger = updatesourcetrigger.propertychanged, propertychangedcallback = onmyvaluechanged }); public double? myvalue { { return (double?)getvalue(myvalueproperty); } set { setvalue(myvalueproperty, value); } } this property of control, , people can use like: <mynamespace:mycontrol myvalue="{binding theirproperty}"/> theirproperty can anything, know actual ...

html - How to modify "sign in" page using CSS? -

i trying modify regular sign in page. want input lines instead of boxes. posting link sign in page image have right now: http://prntscr.com/2o9n8z instead of boxes here, want email address, password , confirm password fields lines. my css code below: @charset "utf-8"; /* css document */ /* ---------- general ---------- */ /* body { background: #ffffff; color: #999; font: 100%/1.5em sans-serif; margin: 0; } */ { color: #999; text-decoration: none; } a:hover { color: #1dabb8; } fieldset { border: none; margin: 0; } input { border: none; font-family: inherit; font-size: inherit; margin: 0; -webkit-appearance: none; } input:focus { outline: none; } input[type="submit"] { cursor: pointer; } .clearfix { *zoom: 1; } .clearfix:before, .clearfix:after { content: ""; display: table; } .clearfix:after { clear: both; } #login-form { margin: 50px auto; width: 300px; } #login-...

javascript - setInterval De incrementing countdown does not stop at Zero -

i busy making red or blue clicking game can viewed here: http://www.ysk.co.za/red-blue problem countdown have made de incrementing var countdown stops when function key() run, , until run countdown goes negative values if more 12 seconds javascript is: var = 0; var seconds = 0; var countdown = 12; setinterval(function () { $("#counter").html(countdown.tofixed(2)); }, 10); function play() { $("#num").select(); } function key(e) { var code = e.keycode ? e.keycode : e.charcode; var random = math.random(); if (random <= 0.5) { $("#redblue").css("background-color", "red") } else { $("#redblue").css("background-color", "blue") } if (code === 86) { $("#red").css("background", "#ff4e00"); settimeout(function () { $("#red").css("background-color", "red") }, 50...

jquery - How to get all input fields with particular attribute? -

<input type="text" somecustomattr="value"></input> this code work not: $fields = $('input[somecustomattr="value"]','#contaners_id'); is ok? change somecustomattr="value" data-custom="value" . use $('input[data-custom="value"]);

java - Tomcat jdbc pool doesn't work -

i having slight problem using jdbc tomcat pool. have defined resource in context.xml, referring in web.xml. in database access method, somehow data source when user database. however, when type in: context initctx = new initialcontext(); context envctx = (context) initctx.lookup("java:comp/env"); datasource ds = (datasource) envctx.lookup("jdbc/testdb"); i error message "initialcontext cannot resolved type". problem here? be sure import initialcontext , sounds missing compiler.

jfreechart - Reduce size of iText generated PDF including time series bar chart -

adding time series bar chart large time span in pdf results in large file size 50 mb or more depending on data points. here code samples: adding chart pdf document document = new document(); pdfwriter writer = pdfwriter.getinstance(document, new fileoutputstream(result)); document.open(); pdfcontentbyte cb = writer.getdirectcontent(); float width = pagesize.a4.getwidth(); float height = pagesize.a4.getheight() / 2; pdftemplate bar = cb.createtemplate(width, height); graphics2d g2d2 = new pdfgraphics2d(bar, width, height); rectangle2d r2d2 = new rectangle2d.double(0, 0, width, height); getbarchart().draw(g2d2, r2d2); g2d2.dispose(); cb.addtemplate(bar, 0, 0); document.close(); creating chart jfreechart getbarchart() { timeseries series = new timeseries("data"); gregoriancalendar cal = new gregoriancalendar(); (int i=0; i<365*24; i++) { cal.add(calendar.hour, 1); series.addorupdate(new millisecond(cal.gettime()), math.random()); ...

javascript - Slideshow-banner (effect: easing images out through canvas border) -

i'm trying create banner such above mentioned swapping out 2 images , using them fillstyle (pattern) on buffer canvas. idea have image1 trail behind image2 many pixels width of canvas, , update position simultaneously on buffer canvas before drawing on canvas visible on page. , of course, when 1 image moves out of border, new source image set while x position set negative many pixels width of canvas. the values i'm using x_incr might seem mysterious, they're temporary, arbitrary values makes smooth, increasing speed haven't yet found better way simulate effect. i had working 1 image, added another, canvas black while script running. why happening? , going wrong? might better obtained/maintained css3 transformations? i'm pretty new of languages i'm using here, i've tried follow standards know. please let me know if parts of following code redundant in regards question. thanks in advance! javascript: var pattern1; var pattern2; var x1 = 0.1;...

java - JSF / RichFaces - How to call programatically an ActionEvent from HtmlAjaxSupport (a4j:support) -

i'm doing this htmlajaxsupport.setactionexpression(createmethodexpression( "#{questionariomb.visualizarquestoesfilhos}", null, new class[0])); the method public void visualizarquestoesfilhos() is called. but want call public void visualizarquestoesfilhos(actionevent event) because way, can component being clicked. what need set in htmlajaxsupport work? create actionlistener expression in jsf 1.2 or newer: facescontext context = facescontext.getcurrentinstance(); methodexpression actionlistener = context.getapplication().getexpressionfactory() .createmethodexpression(context.getelcontext(), "#{bean.actionlistener}", null, new class[] {actionevent.class}); uicommandcomponent.addactionlistener(new methodexpressionactionlistener(actionlistener)); to avoid lot of boilerplate code, can wrap nicely in helper methods (if necessary in helper/utility class), e.g.: public static metho...

c# - Dependency Inject Serialization Type -

i have been trying make application configurable possible. i using unity container , trying use interfaces everything. at point in application need serialize dtos xml , xml using dataaccess layer. however, had thought in mind. why should xml? shouldn't can configured in container? serialization type or that? i understand there xmlattributes can used tightly coupling serialization xml. thinking of using iserializable noticed ixmlserializable not implement iserializable . so know how use interface / base / abstract class allow configurable serialization can configured through di container? theoretically think outputformat-agnostic attributes possible, although depends on how (dis)similar output formats want support. example, xml , json both use field names json doesn't have distinction between attributes , elements xml has. binary serialization on other hand has no use field names because information stored positional. to honest though, i've ...

testing - Is there a way to make cucumber try a scenario again before moving on to the next scenario -

i'm trying clean our functional suite @ work , wondering if there way have cucumber repeat scenario , see if passes before moving on next scenario in feature? phantom headless webkit browser poltergeist driver. basically our build keeps on failing because box gets overwhelmed test , during scenario page won't have enough time render whatever we're trying test. therefore, produces false positive. know of no way anticipate test hang build. what nice have hook(one idea) happens after each scenario. if scenario passes great print results scenario , move on. however, if scenario fails try running again make sure isn't build getting dizzy. , print results scenario , move on next test. does have idea on how implement that? i'm thinking like after |scenario| if scenario.failed? result = scenario.run_again # made function know fact doesn't exist (see http://cukes.info/api/cucumber/ruby/yardoc/cucumber/ast/scenario.html) if !result ...

sql server - Where is the official documentation for T-SQL's "ORDER BY RAND()" and "ORDER BY NEWID()"? -

Image
i'm looking official t-sql documentation "order rand()" , "order newid()". there numerous articles describing them, must documented somewhere. i'm looking link official sql server documentation page this: http://technet.microsoft.com/en-us/library/ms188385.aspx clarification: what i'm looking documentation "order_by_expression" explains difference in behavior between nonnegative integer constant, function returns nonnegative integer, , function returns other value (like rand() or newid()). answer: appologize lack of clarity in original question. programming-related problems, solution problem figuring out question you're trying answer. thank everyone. answer in document: from: http://www.wiscorp.com/sql200n.zip information technology — database languages — sql — part 2: foundation (sql/foundation) 22.2 <direct select statement: multiple rows> includes <cursor specification>. at point have first half of...

facebook - FQL Query Returning Empty Attachment Array -

when run following query in graph api explorer , posts photo attachments return empty attachment array, instead of attachment data. other posts photos return attachment data expected. select post_id,attachment stream source_id=120696471425768 limit 20 i end in returned data: "attachment": { "description": "" }, i have verified these posts indeed have photos attached them. 1 thing have noted posts empty attachment data have type 'status' opposed 'photo', when should 'photo'. has else seen behavior? permissions issue, possibly posting user hasn't granted permission applications view photos? happens permissions selected. is there way around problem? any appreciated. thanks!

matplotlib - How to assign a plot to a variable and use the variable as the return value in a Python function -

i creating 2 python scripts produce plots technical report. in first script defining functions produce plots raw data on hard-disk. each function produces 1 specific kind of plot need. second script more batch file supposed loop around functions , store produced plots on hard-disk. what need way return plot in python. want this: fig = some_function_that_returns_a_plot(args) fig.savefig('plot_name') but not know how make plot variable can return. possible? so, how? you can define plotting functions import numpy np import matplotlib.pyplot plt # example graph type def fig_barh(ylabels, xvalues, title=''): # create new figure fig = plt.figure() # plot yvalues = 0.1 + np.arange(len(ylabels)) plt.barh(yvalues, xvalues, figure=fig) yvalues += 0.4 plt.yticks(yvalues, ylabels, figure=fig) if title: plt.title(title, figure=fig) # return return fig then use them like from matplotlib.backends.backend_pdf i...

python - Tkinter / ttk on Mac OS X Proper System Background Color (canvas) -

i set canvas background color same default system color frame above. how can determine correct background color used other widgets in tkinter/ttk on mac os x? use fixed value prefer way. not sure if ttk way go on os x @ all. this example tries background color frame , sets canvas different color frame (white instead of light grey). from tkinter import * ttk import * app = tk() s = style() t = frame(app) t.pack() b1 = button(t, text="y no right background color") b1.pack() b2= button(t, text="y") b2.pack() #bg = "green" #bg = "#eaeaea" bg = s.lookup("tbutton", "background") print bg s.configure('tframe', background=bg) c = canvas(app, background=bg) c.pack() mainloop()

c++ - IDL generated header file not found before compile -

i have multiple vc++ 2013 projects have idl files output generated header files shared directory (not project directory). of time, things build fine, enough ruin day, compilation fails because header not found. if open file referencing header, , go def - header there. , performing second build works fine. usually, performing rebuild works too, again, fails. so, obviously, between midl compiler , c++ compiler stages of build, there isn't enough time finish writing out header file output directory. is there can this? i did try output header local project directory , adding generated items project filter, , xcopy output dir, sucks because there's stuff being made nothing , have change on 100 projects this. note: problem happens within same project idl lives in it's not parallel compilation or project dependencies causing issue.

Microsoft word Database quick part - How to use a mergefield as a filter for the database query -

i using mail merge input data excel sheet. everthing works great , can access variables using «mymergefield» now need each letter generated excel file , query take «mymergefield» query filter select x field1 = «mymergefield» the way proceeding "inserting quick part" => "field" in word document. in quickpart dialog, choose "database", choose excel file. once data source chosen, there option change request parameters, click on , filter configuration popup can choose field (from excel sheet), operator ("equals" in case). there's compare field. in case not simple comparing string. comparing mail merge field. i tried following syntax: «myfield» mergefield myfield mergefield "myfield" {mergefield myfield} { mergefield myfield} none worked, complained did not find match did not insert database (of course not find match syntax if don't run mail merge) i did directly in openxml file of existing example (beca...

postgresql - Postgres - How to use psql to create a database with the -c command and password authentication? -

if run following: psql -h localhost -u admin -c "create database sales owner admin;" it returns: psql fatal: database "admin" not exist i need use password authentication , have setup .pgpass follows: localhost:*:*:admin:admin any ideas? by default, when connect user, database connected db of same name user. if want connect different db, must specify in psql command line. since in case you're trying create db, can't connect yet, must connect db (like template1 or postgres ) exists. e.g. psql -h localhost -u admin template1 -c "create database sales owner admin;" ^^^^^^^^^

html - border-radius appearing under image -

building gallery , border radius around anchors not cropping image. , can't see why. this html <div id="portfolio_page"> <div id="portfolio_wrapper"> <a class="thumb" href="img/image-2.jpg" data-lightbox="image-1" title="my caption"></a> <a class="thumb" href="img/image-2.jpg" data-lightbox="image-1" title="my caption"><img src="img/image-2.jpg" alt="" height="150px" width="150px"></a> <a class="thumb" href="img/image-2.jpg" data-lightbox="image-1" title="my caption"><img src="img/image-2.jpg" alt="" height="150px" width="150px"></a> <a class="thumb" href="img/image-2.jpg" data-lightbox="image-1" title="my caption"><img src="img/image-2.jpg...

c# - why i cannot clear the rows in the datagridview control? -

i doing test, need re-load datagridview data every 4 seconds , data coming database. so i'v created timer control code , added event handler tick event. in tick event void t1_tick(object sender, eventargs e) { datagridview1.datasource = null; datagridview1.rows.clear(); dt = product.getallproductsbasicinfo(); datagridview1.datasource = dt; } above code works when move datagridview1.rows.clear(); before datagridview1.datasource = null; it throw run time error saying rows cannot cleared, want know why throws error, typically clear() clears datagridview? thanks typically clear() clears datagridview? yes, unless has datasource, in case, does. so try clearing source of data instead: dt.rows.clear();

html5 - Anything wrong with using windows-1252 instead of UTF-8 -

i have test site has been using windows-1252 along. need/use symbols square root symbol. , have no need display in language other english. asked switch utf-8 because of security concerns. after changed utf-8 square roots , other symbols (which being pulled out of oracle db , passed through coldfusion) appear fine on resulting web page. however, if saved document again (post db, page refreshes) symbols transformed strange characters. if saved again more strange characters appear. so... if don't need other english there wrong sticking windows-1252? security/hacking issues? are there implications of not using utf-8 if using html5 (since default encoding html5)? if recommended should switch utf-8, how stored square root symbols (and other symbols) work? i've read these pages, still having little trouble grasping all. hoping here , clarify me. thanks! https://www.owasp.org/index.php/canonicalization,_locale_and_unicode excellent description of how utf-8 cam...

excel - Copying the entire row if the cell isn't one of four determined values -

edited code answers question dim integer = 1 sheet1.usedrange.rows.count if cells(i, "c") <> "q" sheet1.rows(i).entirerow.copy sheets("sheet2").cells(i, 1) end if next edit2 i'm facing minor problems great figure out what's wrong them. 1- code copying cells problem after pasting them in other sheet there gaps on place (they places of non-copied cells) dim integer = 1 sheet1.usedrange.rows.count if cells(i, "p") <> "q" sheet1.rows(i).entirerow.copy sheets("sheet2").cells(i, 1) end if next the fix problem add .end(xlup).offset(1, 0) after line copy , pasting. tried before used offset(1) , didn't work 2-this code causes excel hang , have force close when reopen copied cells there in new sheet(i kind of know problem, think it's because excel check cells since = 0 tried using same loop previous code kept getti...

Regex for matching Python multiline string with escaped characters -

i'm parsing python source code, , i've got regular expressions single , double quoted strings (obtained reading ridgerunner's answer this thread ). single_quote_re = "'([^'\\\\]*(?:\\\\.[^'\\\\]*)*)'"; double_quote_re = '"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"'; i'm trying handle python multiline strings (three double-quotes). s = '"""string one\'s end isn\'t here; \\""" it\'s here """ """string 2 here"""' # correct output findall should be: # ['string one\'s end isn\'t here; \\""" it\'s here ','string 2 here'] i tried messing around bit, still it's not right. multiline_string_re = '"""([^(""")\\\\]*(?:\\\\.[^(""")\\\\]*)*)"""' there's gotta way """ isn't preceded backslash ...

asp.net mvc - How to redirect a page that has moved? -

i have page in mvc asp.net project has gone away. we've renamed url entirely different. the problem other sites still link particular url. we blank out html url in question , meta refresh or javascript script call take them new page, doesn't fit our model. i add route, , let asp.net take care of it, hardcoding routes urls forwarded seems bad practice. edit asp.net page , use response.redirect, there's no real page in existence since light cms... how should redirect user url landing page different landing page using best practice? don't need user see "this page has moved" or part of requirement. it looks need return http 301 status code , moved permanently. this answer appears outline general approaches in asp.net mvc. for example: public actionresult page() { response.status = "301 moved permanently"; response.addheader("location","http://example.com"); } this result in returning mentioned h...

html - Header overlaps other text / images -

i want if people scroll on page, header keep showing (logo + navigation bar). css code i'm using: #header_bar { margin: 0 auto; width: 100%; background-color: #1f1d1e; height: 80px; position: fixed; top:0; } but happens now: http://puu.sh/6fixy.jpg as see header overlaps image, how can fix this? i've tried using margin-bottom / padding-bottom, margin nothing while padding makes background box larger. how can fix this? supposing html structure looks like <div id="header_bar">...</div> <div id="someotherdiv">...</div> add margin-top next element after #header_bar #someotherdiv { margin-top:80px; /* 80px because #header_bar taking 80px in height. */ } demo

multi select - How to hide jQuery UI MultiSelect Widget by default and how it when needed? -

i using jquery ui multiselect widget 1 my pick lists. problem having when use "display: none;" in select menu not hide default , being displayed. have header file have menu on pages want hide default , show when every need it. the problem "display: none;" not hiding it. how can multiselect widget not ignore display: none? thanks help <select style="display:none;"> not work. have 2 options assign class <select> , apply css-style class display:none or wrap <select></select> <div></div> , apply css-style display:none div

php - Making incorrect URL's default to database value -

imagine value in database - e.g. raquel_welch - represents page url (e.g. mysite/people/raquel_welch). imagine if types in url incorrectly, of following... mysite/people/raquel welch mysite/people/raquel_welch mysite/people/raquel welch in other words, url spelled correctly, letter case wrong and/or there's no underscore. rather fetch 404 error page, i'd url default proper url - mysite/people/raquel_welch does know how this? incidentally, wikipedia has similar feature; if type in url without underscore, default proper url, though doesn't appear work cases... http://en.wikipedia.org/wiki/raquel welch rather automatically capitalize first letter of each word, think i'd prefer have url default value in database. look key url case-and-underscore insensitively (this requires storing normalized version in db, instance lowercase , underscores), , if url doesn't match canonical version, send 301 redirect canonical path.

scala - Play 2.2 Filter in Subproject -

i'm trying intercept request in subproject , add request/block response. right i'm trying prove interceptor working , can't show println . based on reading, i've got this: package filters.edmoderator import play.api.mvc._ import scala.concurrent.future import scala.concurrent.executioncontext.implicits.global object requiremoderation extends filter { def apply(next: (requestheader) => future[simpleresult])(request: requestheader): future[simpleresult] = { val result = next(request) println("filter applied") result } } object global extends withfilters(requiremoderation) like said, println doesn't work. need in build.sbt, else? you need declare global object in global.scala in root package. put in other package have update application.conf accordingly. import play.api._ import filters.edmoderator._ object global extends withfilters(requiremoderation)

how to read input to perl program from c program -

this perl program print "enter username \n"; $user; chomp($user); if ($user =~ /[^a-za-z0-9]+/) { print "not matched"; } else { print "matched"; } print "enter password \n"; $pwd; chomp($pwd); if ($pwd =~ /[^a-za-z0-9@#$%^&*]+/) { print "not matched"; } else { print "matched"; } and c program int main() { char user[20],pwd[20], command[500]; printf("enter username: "); scanf("%s",user); printf("enter password: "); scanf("%s",pwd); strcpy(command, "/users/nitinsaxena/desktop/2.pl"); sprintf("command %s %s", user, pwd); system(command); return 0; } now when run c program asks username , password after showing bus error:10. want give input perl program c program. i'm doing wrong ? i hope doing kind of learning exercise rather serious attempt validate password... your call sprintf incorrect. sprintf requires it's ...