Posts

Showing posts from April, 2015

html - PHP include directory error cache -

error on remote server: "warning: include_once(../_includes/check_login_status.php) [function.include-once]: failed open stream: no such file or directory in /home/content/60/10824160/html/index.php on line 1" hey guys, i'm trying these directory errors fixed. basically, moved entire website folder different computer, , php include functions trying find "/home/content/60/10824160/html/index.php" doesn't exist on computer. my index.php in desktop/www/ , check_login_status in desktop/www/_includes/ i tried using php cache function not understand. need do? try this include_once($_server["document_root"]."/_includes/check_login_status.php"); also make sure file/directory names correct.

javascript - Bootstrap dropdown form width -

Image
i have dropdown form, width constrained width of link activating dropdown: i want form extend far needed put form elements on 1 line. how can that? current html code: <h1>time period: <div id="date-filter-dropdown" class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#"> <span class="primary">may 2013</span></a> <ul class="dropdown-menu" role="menu"> <li> <form class="form-inline"> <input type="text" class="input-mini filter-time-form" id="id_filter_form_year" maxlength="4" size="4" placeholder="yyyy" /> <span class="filter-form-date-dividers">&dash;</span> <input type=

php - Why I can't use sessions in a CodeIgniter hook -

i have code here: hooks/account.php: class account { public function checkiflogged() { if(!$this->session->userdata('logged') ){ $this->load->view('error/not_found'); exit; } } } and error: undefined property: account::$session i can confirm hook post_controller_constructor. can tell me going wrong? thanks. you should use: $this->ci = & get_instance(); if(!$this->ci->session->userdata('logged') ){ $this->ci->load->view('error/not_found'); exit; } it's matter of scope that's why use ci here way.

Android take photo on unlock secretly -

i trying build app captures photo everytime phone unlocked. user should not see photo has been taken. should behave anti-theft app. i have read should use dummy surfacetexture, preview not shown on screen, not able capture photo. here have written far. sample activity in touch camera object: package com.brushmate.chameleon; import java.io.ioexception; import android.graphics.surfacetexture; import android.hardware.camera; import android.os.bundle; import android.os.systemclock; import android.annotation.suppresslint; import android.app.activity; import android.util.log; import android.view.surfaceview; public class settingsactivity extends activity { private static final string tag = "chameleon wallpaper"; @suppresslint("newapi") protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_settings); log.d(tag, "activity created"); camera ca

ruby on rails - AWS S3 using s3_direct_upload Gem appears to process but nothing is uploaded to my s3 bucket -

i had followed given instructions using s3_direct_upload gem. when submit upload form attached image new 'upload' item created no image sent s3 (or display). i have user.rb model through devise model i'm using images upload.rb. here logs i'm getting in development mode when submitting image form. can see nothing appended new 'upload' item except creation date , id (everything else nil). side note - should seeing bucket name in here log (i don't)? additional info: in s3 console, removed bucket. still same output below. so, seems it's not sending info out s3? ideas cause that? started post "/uploads" 127.0.0.1 @ 2013-05-12 19:10:52 -0400 processing uploadscontroller#create / parameters: {"utf8"=>"√", "key"=>"uploads/1368400251964-ol9ja4ijq0110pb9-bf206 97a98bbff7c58a83d7bfaa84800/${filename}", "acl"=>"public-read", "awsaccesskeyid"

parsing - Calling a method on a new object in Java without parentheses: order of operations violation? -

according this table of java operator precedence , associativity , member access has higher precedence new operator. however, given class myclass , non-static member function myfunction , following line of code valid: new myclass().myfunction(); if . evaluated before new , how can line executed? in other words, why aren't parentheses required? (new myclass()).myfunction(); my guess since () shares precedence . , myclass() evaluated first, , compiler knows before evaluating new keyword myclass constructor 0 parameters being called. however, still seems imply first line should identical new (myclass().myfunction()); , not case. this because of how grammar of java language defined. precedence of operators comes play when same lexical sequence parsed in 2 different ways not case. why? because allocation defined in: primary: ... new creator while method call defined in: selector: . identifier [arguments] ... and both used here: expr

Appending a list of dicts as an element of another list (Python) -

i've 2 lists, in 1 store information of few celebrities, , list store awards information pertaining these actors. the problem trying solve combine these 2 lists 1 award information becomes attribute list of awards. , yes simple achieve. for actor in actor_info: award in award_list: if actor['personid'] == award['personid']: if not actor.get('awards', false): actor.update({'awards':[]}) actor['awards'].append(award) but if observe code above, iterates len(actor_info) * len(award_list) times not elegant solution. there other perspective problem, execution cycles less. note: to explain problem more clearly, i've described below data structure using. each element in actor_info , award_info list dictionary. actor_info = [] d = {} d['personid'] = 1210 d['firstname'] = 'robert , jr' d['lastname'] = 'downey' d['birthplace'] = &#

c++ - How to parse xml with qt? -

i'm trying parse html page qt using qtxmlquery, with: query.setfocus(qnetworkreply->readall()); but receive following error message: error fodc0002 in tag:trolltech.com,2007:qtxmlpatterns:qiodevicevariable:u, @ line 3, column 44: entity 'ndash' not declared. i think means html page i'm trying read malformed. how fix page ? first maybe check if ndash declared in xml: <!entity ndash "&#8211;"> <!-- en dash, u+2013 isopub --> <!entity mdash "&#8212;"> <!-- em dash, u+2014 isopub --> named entities, known internal entities in xml specifications, refer when talk "entities." declare them in either dtd or internal subset (that is, part of statement in document) , use them in document references. during xml document parsing, entity reference replaced representation. in plain english, these entities macros expanded when process document. example: <!doctype article public &quo

java - JavaFX BarChart Scrollable? -

how go making barchart scrollable? been trying use scrollpane barchart pane inside it. so far have: final barchart chartpane = chart.getgraph(); chartscrollpane.setcontent(chartpane); chartscrollpane.setfittowidth(true); the chartpane 1200px wide, , chartscrollpane 800px. just set width of barchart larger value. when chart embedded in scrollpane care scrollbars. for example: scrollpane scrollpane = new scrollpane(); scene scene = new scene(scrollpane, 800, 600); chartpane.setprefwidth(20000); chartpane.setminwidth(20000); scrollpane.setcontent(chartpane);

css - Hiding code from html validation wrecks formatting -

so grabbed twitter widget twitter site website. have twitter widget in html code so <div id="twitter"> <a class="twitter-timeline" href="https://twitter.com/twitternamehere" data-widget-id="331777195053809665"> tweets @twitternamehere</a> <script type="text/javascript" >!function(d,s,id){var js,fjs=d.getelementsbytagname(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getelementbyid(id)){js=d.createelement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentnode.insertbefore(js,fjs);}}(document,"script","twitter-wjs");</script> </div> the validation xhtml1.0 of course picks data widget id not valid. tired in html 4 also. decided wrap code inside cdata tag hide validation. so, <![cdata[ twitter widget + div ]]> this messes formatting widget supposed be #twitter{ overflow:hidden; position: absol

ruby on rails - SQL query for records that are substrings of input -

consider users table has column called name has following 3 rows. alice bob carl i construct query returns records in name substring of input. example, if query alice jackson, want alice. if search bobby, want bob. if search car, want no matches. sort of reversed like . can done? , can done using activerecord syntax? you ( sql server syntax ): select name users 'your query' + ' ' name + ' %'; the following find alice: select name users 'alice jackson' + ' ' name + ' %'; select name users 'alice' + ' ' name + ' %'; the following not find alice: select name users 'ali' + ' ' name + ' %';

php - Joining multiple SQL queries to display online friends list? -

i trying join 3 tables display list of table users taken table subscribers ip = ip in table online . subscribers table: (doesn't allow duplicates, type tells if or not other user subscribed back.) sender recipient 1 5 5 3 users table: id loginip 1 192.168.0.1 3 192.168.0.2 5 192.168.0.3 online table: ip 192.168.0.1 192.168.0.2 192.168.0.5 so query should grab id 's, find loginip of id 's , scan online table , return online users: (assuming userid = 5) sender recipient send_ip reci_ip 5 3 192.168.0.3 192.168.0.2 1 5 192.168.0.1 192.168.0.3 i need figure out way cut ip if user = 5, not display on list. can myself after 1 of fine people me out bit. :) my attempt, although poor: select f.sender friend1, f.recipient friend2, u1.loginip ip1, u2.loginip ip2 subscribers f inner join users u1 on u1.id = f.sender inner join users u2 on u2.id = f.recipient inner join onli

Custom Buttons in inline editing like we have in pagination div in jqgrid -

is possible add custom button in each row while using inline editing in jqgrid have provision add in pagination div using .navbuttonadd() function? if possible can 1 suggest how same... you can define "actions" column formatter. here jqgrid editactioniconscolumn events , here http://blog.anupamgupta.me/2010/05/enable-inline-editing-in-jqgrid/

java - How can I improve my algorithm for generating combinations of a multiset? -

how can optimize next() , hasnext() methods in following generator produces combinations of bounded multiset? (i posted c++ java because code c++-compatible , has no java-specific elements not convert directly c++. the specific areas of algorithm problematic entire hasnext() method may unnecessarily complicated, , line: if( current[xslot] > 0 ) aiitemsused[current[xslot]]--; which has if-statement think removed somehow. had earlier version of algorithm had of backtracking before return statement , consequently had simpler hasnext() test, not version work. the background of algorithm is difficult find. example, in knuth 7.2.1.3 merely says can done (and gives exercise prove algorithm possible), not give algorithm. likewise, have half dozen advanced texts on combinatorics (including papadimitriou , kreher/stimson) , none of them give algorithm generating combinations of multiset. kreher leaves "exercise reader". anyway, if can improve algorithm above or provi

java - How to make a runnable jar of my maven project? -

i want make jar file of project shows error when try make jar. till now , build jar executed using command , java -cp <jar file> <main class name> . i have done adding plugin in pom, <plugin> <artifactid>maven-assembly-plugin</artifactid> <configuration> <descriptorrefs> <descriptorref>jar-with-dependencies</descriptorref> </descriptorrefs> </configuration> </plugin> and running command , mvn clean , mvn install assembly:assembly . but want jar, run using command java -jar <jar file> for read this link , implemented also. shows below error, [error] failed execute goal org.apache.maven.plugins:maven-jar-plugin:2.4:jar (default-jar) on project threadpool: unable parse configuration of mojo org.apache.maven.plugins:maven-jar-plugin:2.4:jar parameter manifest: cannot find setter, adder nor field in org.apache.maven.archiver.manifestconfiguration 'addclasspath' -> [help 1]

java - Get parameter values of the calling method -

how parameter values of calling method? i have scenario there 2 classes viz., class , class b containing 2 methods mtha(in class a) , mthb(in class b). mtha calls mthb. want know in mthb parameters have been passed mtha. logging , handling exceptions. able class name of calling class i.e class , method name calling mthb i.e mtha. stuck @ getting parameters of mtha. thread.currentthread().getstacktrace()[1].getclassname() this gives me class name of calling method i.e class a. thread.currentthread().getstacktrace()[2].getmethodname() this gives me method name of calling method i.e mtha. if somehow can whole method can method parameters passed method using getparameters(). there's no easy way calling method's arguments values, (if can not change parameters of called method include , pass calling parameters values). using apis thread provides, can static info class/method name, not runtime info arguments values. 1 way store , manage kind of info somewher

Too many positional options error, Mongodb - mongoexport? -

i cannot figure out why im producing error when trying simple export of 3 fields .csv file mongodb. code follows: c:mongodb24\bin>mongoexport -db local -c pets -f type,name, color --csv -o c:\data\csc 451\spreadsheet.csv error: many positional options i'm wanting export type, name, , color data spreadsheet csv file. correct answer: c:mongodb24\bin>mongoexport -db local -c pets -f type,name,color --csv -o c:\data\csc451\spreadsheet.csv

javascript - org.apache.jasper.JasperException: java.lang.NullPointerException Repeatedly Occuring -

i keep having issue whenever try run program, comes error: http status 500 - type exception report message descriptionthe server encountered internal error () prevented fulfilling request. exception org.apache.jasper.jasperexception: java.lang.nullpointerexception root cause java.lang.nullpointerexception note full stack traces of exception , root causes available in glassfish server open source edition 3.1.2.2 logs. glassfish server open source edition 3.1.2.2 this code have: <%@page contenttype="text/html" pageencoding="utf-8" import="java.text.numberformat"%> <!doctype html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <title>jsp page</title> </head> <body> <% string strvalue, strlife; strvalue=request.getparameter("pvalue"); strlife=request.getparameter("plife"); dou

statistics - How to remove multiple outliers from a data.frame in R -

hi have 5 variables 1000 observations. 5 variables contain lot of outliers 10,11, 13, 1003, 10987, 1099 , contain missing values. want remove multiple outliers. please me.... in advance. you create condition extract relevant data , exclude outliers. example if dataframe called "df1" , want extract data in column (e.g: column "2") values between 1 , 5: condition1 <- df1[,2] >=1 & df1[,2] <=5 df1 <- df1[condition1,] i hope helps

vb.net - Fill datagridviews from stored querys on arrays -

i hope can me. accurate can. code: dim productoarray = new list(of products)() ' <-- global ' --button method--- dim db2 new coneccionanexteldatacontext dim [produ] product = db2.products.singleordefault(function(x) x.product_id = integer.parse(idproduct.text.trim())) if [produ] isnot nothing productoarray.add([produ]) showbill.datasource = vbnull showbill.datasource = productoarray showtotalbill.text = productoarray.sum(function(x) x.price).tostring() else messagebox.show("product id doesn't exits") end if im trying bill datagridview content. i'm doing declare array products(linq datacontext) type, after declaring array i'm using "filter" add products datagridview , 1 one using product_id, when execute , press corresponding button gives me following error: "specified cast not valid." on line dim [produ] producto = db2.products.singleordefault(function(x) x.prod

android - Toast is unable to draw -

i creating 1 broadcat receiver aplication. in getting following error the method maketext(context, charsequence, int) in type toast not applicable arguments (myphonecall, string, int) java code : package com.example.myphonecall; import android.content.broadcastreceiver; import android.content.context; import android.content.intent; import android.os.bundle; import android.telephony.telephonymanager; import android.util.log; import android.widget.toast; public class myphonecall extends broadcastreceiver { @ override public void onreceive(context context, intent intent) { bundle extras = intent.getextras(); if (extras != null) { string state = extras.getstring(telephonymanager.extra_state); log.w("my_debug_tag", state); if (state.equals(telephonymanager.extra_state_ringing)) { string phonenumber = extras .getstring(telephonymanager.extra_incoming_number);

jquery - Does the length of the selector affect the speed? -

so in cases better code readability use div#parent div.someclass a , can div.someclass a . version better , faster? it's important when using jquery consider selectors have converted native browser functions @ end of day. means should try use id or tag based selectors whenever possible. recommend using $("div#parent").find("div.someclass a") better performance this gives better performance since use optimized tag/id selector parent, , slower class based selector applied more limited set since applied descendants of specified parent.

java - javaw.exe/eclipse.exe cannot be killed -

sometimes eclipse randomly stop responding, seemingly no reason. process cannot killed through means, tries kill stop responding, , won't able killed either. prevents windows logging off. way kill hard shutdown computer. have tried task manager, logging off, , taskkill image name , pid. no idea what's causing this, need help. do have admin rights on computer? sure killing correct javaw.exe ? , tried killing launcher eclipse.exe too? i cant add comment yet did try installing anti malware? if infected might not let download program (anti malware bytes), there other boot time checkers too. also try resetting eclipse. how run eclipse in clean mode? , happens if so? make sure exe size correct - per version/ build - post size here (not size on disk size when see properties) or re install it

python - Asterisk Triangle -

i'm coming background in google's app inventor. i'm taking online class. task: make triangle out of asterisks nested while loop. triangle has base of 19 asterisks , height of 10 asterisks. here's am. num = 1 while num <= 19: print '*' num = num * '*' + 2 print num you can use 'center'-method string-objects: width = 19 num in range(1, width + 1, 2): print(('*' * num).center(width)) * *** ***** ******* ********* *********** ************* *************** ***************** *******************

jquery - How to make Jqgrid frozen column word-wrap -

i using latest jqgrid bundle 4.4.5. want make header column word-wrap. read oleg answer seem it's not working latest jqgrid. the error messages appear in firebug "$grid[0]._complete" undefined , when resize column error "this.grid undefined". is there solution make work? edit : after change $grid.jqgrid('setfrozencolumns'); $grid.triggerhandler("jqgridaftergridcomplete"); when resize column, frozen div column isn't resize too. note : change "this.grid" using local variabel. var grid = this.grid || this; here image link . starting version 4.3.2 jqgrid supports events allows register multiple callbacks (event handler). old internal callbacks _complete removed. instead of line in the demo $grid[0].p._complete.call($grid[0]); you can use now $grid.triggerhandler("jqgridaftergridcomplete"); updated : current version of jqgrid have bug in the line . used this instead of ts : if($.isfunc

shell - Effects of comment (#) lines before and/or after the comment-like #!/bin/sh line -

example one #!/bin/sh # purpose: print out current directory name , contents pwd ls example two # purpose: print out current directory name , contents #!/bin/sh pwd ls what difference – if make first line comment( # ), #!/bin/sh second line, happen? what meaning of #!/bin/sh ? what difference between 1st & 2nd shell scripts..? no difference in output. time execute both little different interpreter reads line 1 one. if give comment(#) in 1st line after #!/bin/sh in 2nd line happen ? any line started (#) except shebang(#!) treated comment in shell script. what meaning of #!/bin/sh ? its path(here - /bin/sh) interpreter used after shebang (#!) . shell try use interpreter language mentioned after shebang execute script.

Android Graphical Layout error -

for reason don't know graphical layout on eclipse stop working after test know probleme edittext i don't know why paste here edittext tell me if wrong <edittext android:id="@+id/input" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerhorizontal="true" android:layout_centervertical="true" android:ems="10" android:inputtype=""> <requestfocus /> </edittext> eclipse error log is: string index out of range: 0 just add android:inputtype="" type want "text".it work fine.

javascript - Kendo UI treeview current datasource post -

i need create folder structure in ftp similar of tree structure on view. want allow user edit tree structure before creating folders. i have treeview server binding: @model ienumerable<treeviewitemmodel> @(html.kendo().treeview() .name("pipelinestructuremajor") .bindto(model) .expandall(true) .draganddrop(true) ) the binding fine. client-side restructuring (appending/dragging/removing nodes), want post treeview (root node children recursively) action. public actionresult _createftp(treeviewitemmodel root) { //ftpclient in action : parsing whole tree , converting folder structure return partialview("_treemajor", <refreshed model>); } on client side, tried alert treeview data, shows root node text items empty. $('#createftpconfirmed').click(function () { //treeview data var treedata = $("#pipelinestructuremajor").data("kendotr

jsf - JSF2 + Primefaces : DataTable lazy loading issue -

i guess, java code proper, records not showing on datatable. please check below code. dont know made mistake. .xhtml <p:datatable value="#{userdetaillist.userdatalist}" var="user" rows="5" paginator="true" lazy="true" paginatortemplate="{rowsperpagedropdown} {firstpagelink} {previouspagelink} {currentpagereport} {nextpagelink} {lastpagelink}"> <p:column headertext="no"> <h:outputtext value="#{user.id}"></h:outputtext> </p:column> <p:column headertext="user name"> <h:outputtext value="#{user.username}"></h:outputtext> </p:column> </p:datatable> .java @postconstruct public void in

java - JUnit parameterized tests: how do I run only 1 specific test from IntelliJ/Eclipse? -

i have @parameterized junit test spawns 50 tests: @runwith(parameterized.class) public class nurserosteringsolveallturtletest ... { @parameterized.parameters(name = "{index}: {0}") public static collection<object[]> getsolutionfilesasparameters() { return ... // returns 50 files. } public nurserosteringsolveallturtletest(file unsolveddatafile) { ... } ... @test public void solvedatafile() { ... } } running takes hour (and it's impossible shorten time, integration tests). test 28 fails. how run test 28 alone, without running other 49 tests? without changing actual code, configuring -d or similar in intellij's (or eclipse's) run configuration. eclipse (as of mars m4 release) able run not single test parameterized test class kind of subtree. this can be: all methods single data set returned @parameterized-method all datasets single @test-method and mentioned, test can

sql - Many to Many relation query with dynamic where clause -

my tables : table emp:- empid, empname table empdepttrans:- empdeptid, empid, deptid table dept:- deptid, deptname business logic 1 employee can work in multiple department , 1 department can have multiple employees, many many relation. i need in forming sql query can put conditions like: (dept='engineering' , dept='account' ) , (dept ='library' or dept ='hr') my condition dynamic , can change based on requirement... as can understand question. have written condition in xml data. expression (dept='engineering' , dept='account' ) , (dept ='library' or dept ='hr') so need is. create plan query show employee , department relation. add complex filter condition desire. below declare @complex nvarchar(1000); set @complex = "(dept='engineering' , dept='account' ) , (dept ='library' or dept ='hr')" execsql query+' '+ @complex;

regex - Regular Expression URL ReWrite -

this first post on here , must admit knowledge of regular expressions minimal. we have upgraded our internal intranet sharepoint 2003 2010. during process broke down single site multiple site collections added /sites url different sites e.g. http_://intranet/global > http_://intranet/sites/global http_://intranet/workplaces > http_://intranet/sites/workpaces i have tried playing around regular expressions re-write static urls rewritten include /sites here attempt you should see last 2 records not being wr-written correctly. can me create correct rule? regex may use this: /^(http://[^/]+)?/(?!(?:sites|sitepages)/)(.*)$/mg with replacement \1/sites/\2 demo http://regex101.com/r/zh6dz5 results http://intranet/global > http://intranet/sites/global /sites/global > /sites/global /page/file.ext > /sites/page/file.ext /sites/other

asp.net mvc 3 - Data Annotation not working with IE8 and telerik grid -

the problem using telerik grid , ie8, when i'm editing field of grid that's customized data annotations wrong values i'm getting error 500 because it's going server action wrong parameters. i reading that's because versions of jquery validation have bug, can't solve updating plugins , libraries. the question i'll know version of each jquery should use in order solve problem, because maybe i'm not making plugin mixture. the code plugins: jquery javascript library v1.7.2 jquery validation plugin 1.8.1 unobtrusive ajax support library jquery the view: @( html.telerik().grid<zonedata>() .name("zonedatamodel") .toolbar(commands => commands.insert().text("add zone")) .datakeys(keys => keys.add(param => param.id)) .htmlattributes(new { style = "width: 520px;" }) .norecordstemplate("no existen resultados...") .databinding( databinding => databind

configuration - Tomcat 7 overrides the tomcat-users.xml when using Eclipse -

Image
i using tomcat 7 deploy web projects on. more comfortable when using eclipse interface start , stop tomcat, i've added in eclipse's servers , check "use tomcat installation" in server locations . 1 more thing use tomcat's web manager tool deploy/undeploy projects. know in order use manager/html tool have sign in. username , password authenticate set in tomcat-users.xml (in file): <role rolename="tomcat"/> <role rolename="manager"/> <role rolename="manager-script"/> <role rolename="manager-gui"/> <role rolename="standard"/> <role rolename="admin"/> <user username="tomcat-eclipse" password="tomcat-eclipse" roles="tomcat,manager,manager-script,standard,admin"/> <user username="root" password="toor" roles="manager-gui" /> everything works fine until moment in time (i'm not sure maybe

iphone - Dealloc of custom object -

i have class in project : @interface videoitem : nsobject <nscoding> { nsstring *name; nsstring *artist; int seconds; } @property (nonatomic, retain) nsstring *name; @property (nonatomic, retain) nsstring *imgurl; @property (nonatomic, retain) nsstring *artist; @end and how create object: videoitem *item = [[videoitem alloc] init]; item.name = name; item.imgurl = imglink; item.artist = artist; and dealloc: - (void)dealloc{ [name release]; [imgurl release]; [artist release]; [super dealloc]; } and want know if dealoc ok non-arc ? did need else because nsstring property? edit and if videoitem object create with: videoitem *item = [[videoitem alloc] init]; item.name = [nsstring alloc]initwithformat@"%@",name]; item.imgurl = [nsstring alloc]initwithformat@"%@",imglink]; item.artist = [nsstring

c# - How can i add optional directory for bmp.screenshotsave -

i need please. want implement ability choose folder before saving screenshots. working code have created: bmpscreenshot.save("c:\\test\\pictures\\scr_(" + pict_no + ").jpeg", imageformat.jpeg); pict_no++; it autoscreenshoter increments number of screenshot. folder constant. want create selection of folder before capturing auto screenshot. used this: public partial class form1 : form { public form1() { initializecomponent(); } public void tick(object stateinfo) { string s; s = textbox3.text+ "\\scr_(" + pict_no + ").jpeg"; // set bitmap object size of screen bmpscreenshot = new bitmap(screen.primaryscreen.bounds.width, screen.primaryscreen.bounds.height, pixelformat.format32bppargb); // create graphics object bitmap gfxscreenshot = graphics.fromimage(bmpscreenshot); // take screenshot upper left corner right bottom corner gfxscreenshot.co

c# - Error on using custom build task in Microsoft Build Framework -

i have implemented custom buildtask , set build engine in it. while executing code, getting exception method not found: 'void microsoft.build.utilities.task.set_buildengine(microsoft .build.framework.ibuildengine)'. what can possible cause of this? you may using 2 different versions of microsoft build framework (microsoft.build.framework). check version numbers in item properties make sure they're not different (e.g. issue - version 4.0.0.0 , version 14.0.0.0)

javascript - How do I access the multipart_params values on the server with Plupload? -

i have assigned arbitrary data plupload instance's multipart_params so: multipart_params: { 'username': 'bob','id': some_value } how can access these values on server within upload.php script called when files uploaded? you can try $_request variable (php side, of course): $_request['username']; $_request['id'];

database - What frontend softwares are available to use MySql in Mac OS (other than Base and Filemaker)? -

i using mac os 10.7. wondering if "forms" (i.e. layout entering data includes fields values retrieved via lookup based on data entered in other fields on same layout) created in mysql workbench? how mysql supposed used? here's image of kind of layout want create data entry. http://imgur.com/e7jwuqa left hand side fields invoice table , right hand side fields invoice details table linked via relationship field based on invoice id. (ps: not want use filemaker) mysql database engine. can store , retrieve data to/from mysql database. mysql workbench nothing more friendly user interface in front of it. cannot create forms or layouts in directly. can enter data 1 table @ time, using built-in user interface. if need develop customer data entry forms, need use 1 of multitude of programming languages write program this. alternatively, there may frameworks out there capable of being customised needs. when dealing more 1 table, it's straight away more comp

HTTP proxy server - need to handle dynamic client -

i have developed serve-client model based on udp. client connected server on random basis. mean number of clients alive @ time not fixed. new client can communicate time. means, there 1 live client or 100 clients or number of clients. now in such model, need add http requests. browser send request server , server forward of client based on identification. there method or readymade server(like nginix or lighttpd), can use requirement. my big worry that, destination client not fixed, keep changing. of server (nginix or lighttd) have static entries destination address. i visualize scenario multiple sensors connect servers when have say, , send request , wait answer. i visualize want somehow administer such modules want access them via http. you leave new configuration items on regular server upon update connection response include (in piggy-backed fashion) changes node. or server mark somehow interest in accessing node, , then, when connects, server notify interest

ubuntu - Best Practices for Error and Access Log Files -

i got server has @ moment lot of access , error logs. i'm using ubuntu 12.04 , nginx. my question best practices keep files under control not loose track of going on? best balance? should use ubuntu crons or nginx can handle itself? indicate documentation? a option use third-party service store , parse logs (for example logentries.com). if want preserve privacy on log's content , worried content sent don't know, can self-host similar tool logstash.net if manage them in old-fashion way can configure syslog push logs on remote machine confortable check them. speaking nginx log little trick configure access , error log on per-server basis, if have nginx serving foo.com , bar.org store them in /var/www/foo.com/logs/ [for foo.com domain] /var/www/bar.org/logs/ [for bar.org domain] in way have them separated , can check happening on each domain independently

java - Search for text in PDF files -

i have list of words (86 words), , pdf files. search words pdf files , return values ​​tell me if exist. during research solutions in tutorials meet 2 problems: is i'm forced convert pdf file file ?? what simple bibilotheque allows me realize problem, because i'm stuck there's lot of examples (pdfbox, appach lucense, itext, pdftron ....) is i'm forced convert pdf file file pdf file file. so, not have convert it. have able read it. can use 1 of available java pdf parsers (e.g. pdfbox mentioned). what simple bibilotheque allows me realize problem... as far have 86 words , 1 document not need indexing tool lucene. if want build application supports different targets , different documents (especially if need real free text search ) need lucene (or solr) perform indexing of documents first , performing search using index.

Site results redirect to Google -

a site i'm working on has been hacked. cms (which didn't build) accessed , files (e.g. "km2jk4.php.jpg") uploaded in image fields. have since deleted them (a week ago). now, when search site on google, click result, either: a) redirects me google search page or b) download dialogue appears asking me download zip file, source domain gb.celebritytravelnetwork.com clearly site's been compromised. if type url in address bar, site loads fine. happens when click through google results. there no .htaccess file on server, , not virus on computer, since many other people have reported same thing happening, this question not relevant. any ideas please? thanks. your source files have been changed. check files included in index page. might header , footer pages. and try using : fetch google bot.

c# - How to get number at the end of string? -

i want retrive number sequence @ end of string. e.g. string contentdbindex = regex.match("ab56cd1234", @"\d+").value; gives me result 56 want result 1234 . how should ? you can use end anchor ( $ ) this: string contentdbindex = regex.match("ab56cd1234", @"\d+$").value;

database - Store a 2D array in redis -

i have 2d array store in redis , see 2 solutions: storing json string or storing 1 hash per line. way better? i faced same question when designing application. opted on side of simplicity. i'm going assume 2d array of data represents database row. json encode , store using set . allows me use mget , mset when want handle multiple objects using 1 redis command. if data gets updated in database, del key. me easier trying update redis hash. hashes in redis has advantages. take less memory because of "ziplist" encoding redis uses. can avoid serialization well, pretty significant apps. here's sample use case hash me. let's want username given user id. hget user.usernames 1234 . give me username user id 1234. if there miss, query db , set , since data never changes, never expire hash. allows quick common piece of data rather pulling entire user, unserialize, , return needed field. for prospective massive lookup table, use algorithm pur

android - Zxing's barcode scanner is not able to scan the barcode, is there any other option -

i need develop android app scan barcode alphanumeric, have installed barcode scanner app zxing, not able scan type of barcode. have integrated same android app, there way resolve this? that code 39 barcode, or trying be. looks corrupted image resizing; bars stretched wrong widths. edit: no, it's insufficient quiet zone / white space -- see comment. don't know real required minimum is, anyone? i sent http://www.onlinebarcodereader.com/ , did not decode. did @ http://www.online-barcode-decoder.com/ ideally use better source barcode, since rejected heuristics in zxing. modify code more lenient, although @ point create false positives.

c# - Java Base64 encoded string vs. .NET Base64 encoded string -

problem: have .net http handler taking http post of xml originating, believe, java system. 1 element contains base64 string encoded document (current test file pdf). when take original pdf , generate base64 string .net, there discrepancies between , corresponding text in supplied xml. there number of places 1 of 3 things occurs: the xml file places single space .net places plus similarly, xml file has pair of consecutive spaces inserted vs. .net's plusses pgplbmrv ymoknsaw vs. pgplbmrv++ymoknsaw sometimes xml file has pair of consecutive spaces inserted vs. .net's plusses and additional spaces added nearby in xml's version 3kups 85qzwyaw bsmnals vs. 3kups 85qzwyaw++bsmnals source xml have 4 spaces (display below looks 2 spaces) vs. .net's has pair of consecutive plusses vgdmkej gnjeok vs. vgdmkej++gnjeok also, there no plusses in source (java created?) data. questions: can identify cause these discrepancies might be? pre

c# 4.0 - Powershell v3 Remoting from C# using Enter-PSsession -

i trying use enter-pssession c# enable , use powershell remoting run commands remotely. here code runspace remoterunspace = runspaces.runspacefactory.createrunspace(); remoterunspace.open(); powershell.runspace = remoterunspace; pscommand command = new pscommand(); command.addcommand("enter-pssession"); command.addparameter("computername", "remotehostname"); command.addparameter("credential", vmmcredential); powershell.commands = command; powershell.invoke(); i cmdletinvocationexception. here details same. system.management.automation.cmdletinvocationexception unhandled message=the method or operation not implemented. source=system.management.automation wasthrownfromthrowstatement=false stacktrace: @ > system.management.automation.internal.pipelineprocessor.synchronousexecuteenumerate(object input, hashtable errorresults, boolean enumerate) @ system.management.automation.internal.pipelineprocessor.synch