Posts

Showing posts from July, 2012

c++ - deque.push_front() giving error "expression must have class type" -

i trying initialize deque pointers user defined struct, tile, in order eliminate unnecessary copying. my code looks this: tile *start = new tile(0,0,0, 'q', nullptr); deque<tile*> search(); search.push_front(start); the above code located in main.cpp. the tile struct looks this, , contained in hunt.h: struct tile { int row; int col; int farm; char tile; tile * added_me; tile(int f, int r, int c, char t, tile * a) : farm(f), row(r), col(c), tile(t), added_me(a){} }; the layout of program follows: main.cpp: includes "io.h" io.h: includes "hunt.h", various standard libraries hunt.h: includes vector, deque, tile struct however, getting error in main.cpp when try push_front(start): expression must have class type." wasn't sure if possible fault in #includes causing error, please let me know if case. otherwise, not entirely sure how fix error. thanks in advance! when write deque<tile*&

java - develop eclipse plugin for existing desktop application -

i want develop eclipse plugin on top of existing desktop application. desktop application has been developed in java swing , want create eclipse plugin use existing desktop application use existing eclipse features refactoring etc. so far, have found following resources, book eclipse plug-ins eric clayberg eclipse 4 plug-in development example beginner's guide other resources include eclipse, rcp, plugin , osgi development vogella http://www.ibm.com/developerworks/library/os-eclipse-plugindev1/index.html http://www.onjava.com/pub/a/onjava/2005/02/09/eclipse.html i want start developing eclipse plugin not sure how start. start read vogella tutorial talking eclipse rcp not sure need or not? if can provide me direction , give me starting point, thankful. an eclipse plug-in runs part of eclipse rcp. eclipse (very large) rcp can develop plug-in run part of eclipse, or can write own rcp scratch.

eclipse - Debugging on an Android device after first release -

now android app released on google app store, continue developing , debugging on device. i have few options: delete app device , install new version during development. this has disadvantages. lose local files saved released app, and, when time comes next release, not share same experience users while upgrading. introduce minimal change by, say, renaming package. 2 apps distinct , can co-exist on device. this introduces superfluous change in souce tree, headaches that entails. if have avoided these difficulties, approach have taken when continued develop after release? i recommend switching android studio , gradle . using build types (which can't link because n00b , have no reputation), can switch between debug , release builds, , set build file have both on device @ same time without changing in source or manifest. the 1 big gotcha failed understand , bit me in butt several times until got in build variants tool window, selected build variant controls

Javascript revealing module pattern and variables -

my question precisely same 1 javascript revealing module pattern, public properties in thread, answer given not "why". here's same question restated own example: myapp.user = function () { var firstname = 'default', lastname = 'default'; function setfirstname(name) { firstname = name; } function setlastname(name) { lastname = name; } function getfirstname() { return firstname; } function getlastname() { return lastname; } return { getlastname: getlastname, **getfirstname: getfirstname**, setlastname: setlastname, setfirstname: firstname }; }; in scenario, user().getfirstname evals "default" -- if change other value via setfirstname function. if replace setfirstname like: return { getlastname: getlastname, **getfirstname: getfirstname**, setlastname: setlastname, setfirstname: firstname }; i

git - How to update pull-requesting site after pull request has been merged? -

let's github repo b sends pull request github repo a , , suppose pull won't go through without resolving conflicts , merging. therefore, in order accept changes proposed b , owner of a makes pull request offline repo, performs merge, , pushes merge a . a @ least 1 commit ahead of b . how b update in sync a ? can done entirely within github web interface? (i imagine 1 answer first question owner of b pull contents of a repo, , push resulting state b repo, wondering if there's way update b repo directly github web interface.) as far know way achieve using github's web interface creating reverse pull request. comes @ cost of additional merge commit not desirable sums , new pull requests b a include unneccesary commits. it possible use „git data“ api merge branches, easier , safer on command line. the strategy recommend others one: never ever modify master or whatever mainline branch called base pull request branches on master whe

javascript - Assets not found with sails.js -

i started sails project (with sails new project --linker ) , working correctly until today. now 404 error of javascripts, , noticed each time launch server ( sails lift ) .tmp/public folder deleted. didn't modified gruntfile or core files , there no errors displayed on console. the .tmp folder deleted every time issue sails lift . sails stores public dir http server. if remember correctly, v0.10 has linker enabled default. try running sails new project without --linker , see shows in assets/ there should linker folder. if not, create folder , add appropriate tags ejs file. you can see docs v0.10 here more information specificy a

sql - access 2010 append data into table without overwriting existing records -

sorry long question/post need i've been searching several days havent found helps. seems should easy but..here goes i have table1 in (access 2010) database has exising records. have table2 after run query, first deletes data in table 2, imports new records table. run import table 2 on semi regular basis have yet copy records table 1 successfully. i need copy records table 2 table 1 if records don't exist in table1. so, each time query or vba code run, continuing grow table 1 without duplicating existing data. to clarify further, it's data outlook gal each time table2 imports data (lname,fname,phone,email) needs added table1, if doesn't exist in table 1. i have small start of sql cannot work because i'm not sure how add other fields sql statement (unfortunately don't know whole lot sql or creating append query): insert [current] ( firstname ) select distinct tblglobaladdresslistimport.first tblglobaladdresslistimport left join [current] on tblgloba

wso2 - ws02 jms transport for websphere MQ -

after looking couple of day have problem consume message form ibm mq. followed documentation still failing smothing working fine. i'm using 4.8.0 , mq 7.5.0.2 error [2014-02-06 01:06:14,341] error - jmslistener unable continue server startup seems jms provider not yet started. please start jms provider now. [2014-02-06 01:06:14,342] error - jmslistener connection attempt : 1 jms provider failed. next retry in 20 seconds [2014-02-06 01:06:34,364] error - jmslistener unable continue server startup seems jms provider not yet started. please start jms provider now. [2014-02-06 01:06:34,365] error - jmslistener connection attempt : 2 jms provider failed. next retry in 40 seconds root@sandbox:/opt/wso2esb-4.8.0/ffdc# more jmscc0001.fdc ----------------------------------start ffst------------------------------------ /opt/wso2esb-4.8.0/ffdc/jmscc0001.fdc pid:5897 jms common client first failure symptom report product :- ibm websphere m

java - How do you add a jFrame to your main class in Netbeans? -

so have made jframe lot of elements , buttons , things in it, new using netbeans. upon creating java application main class.java created , upon adding jframe jframe.java created. how main class open, read, , run jframe.java? can upload specific code if need be. thanks in advance to call method class, must first create new object class, this: jframe frame = new jframe(); frame.setvisible(true); //or whatever method in jframe.class maybe rename actual class name jframe frameone . i've heard naming classes same classes in java api cause trouble. or, put in 1 class, either 2 separate methods or put in main method. if doesn't help, please paste exact code on pastebin.org , give link.

java - Programmatic and declarative Constraint declaration -

i'm validating beans through kind of code: validator validator = validation.builddefaultvalidatorfactory().getvalidator(); validator.validatevalue(class, propertyname, value); my classes this: public static interface primitive { public primitive setstring(string s); @notnull public string getstring(); } this working fine far. seems it's not possible plain hibernate validator constraint definitions/mapping given class , add additional constraints described here . looks constraint mapping manual, don't todo. on other side beandescriptor validator.getconstraintsforclass(class) seems not usable constraintmapping. this have in mind: constraintmapping mapping = new constraintmapping(); mapping .type(order.class).getconstraints()/*reads constraints declared on bean*/ .property("customer", elementtype.field)/*add additional constraints*/ .constraint(notnulldef.class); validator validator = validation .byprovider(

ruby on rails - Either login form on every page or form that redirects to page -

in rails app, there lot of pages don't require signed in view. example, profile page of user. current session logic redirects previous page if page requires signed in. if doesn't though, profile page, , click sign in , sign in, takes url specified in sessionscontroller action. brings me crossroads. either need modal on every page (in layouts/application.html.erb ) has sessions form user can click sign in, model open, , when sign in refreshes page pretty user can stay on current page. however, i'm trying , getting few errors. other option have individual login page no matter page come within app, redirect to. unfortunately, i'm not sure how write code this. here code have i'm trying have session form on every page through modal. **sessionscontroller #create action** def create user = user.find_by(email: params[:session][:email].downcase) if user && user.authenticate(params[:session][:password]) sign_in user redirect_back_or request.origin

eclipse - Java - sending POST -

i'm trying make java make new addition url shortener, here's have: private void sendpost() throws exception { string url = "http://shmkane.com/index.php?"; url obj = new url(url); httpurlconnection con = (httpurlconnection) obj.openconnection(); con.setrequestmethod("post"); con.setrequestproperty("user-agent", user_agent); con.setrequestproperty("accept-language", "en-us,en;q=0.5"); string urlparameters = "url=testingthis"; con.setdooutput(true); dataoutputstream wr = new dataoutputstream(con.getoutputstream()); wr.writebytes(urlparameters); wr.flush(); wr.close(); int responsecode = con.getresponsecode(); system.out.println("\nsending 'post' request url : " + url); system.out.println("post parameters : " + urlparameters); system.out.println("response code : " + responsecode); bufferedreader in = new b

regex - How to group strings with whitespace, using sed? -

suppose text file following strings: apple foo foobar banana foo foobar1 abc b c orange barfoo pear foo how group strings comes after apple , banana , orange , , pear ? i apple , wouldn't work rest of text files. sed 's/\([^ ]*\) \([^ ]*\) \([^ ]*\)/\2 \3/' i want output this: foo foobar foo foobar1 abc b c barfoo foo is there general case can print these strings after first whitespace? sed -r 's/^[^ ]+[ ]+//' in.txt (gnu sed; on osx, use -e instead of -r ). update : as @jotne points out, initial ^ not strictly needed in case - though makes intent clearer; similarly, can drop [] around second space char. the above deals spaces separating columns (potentially multiple ones, final + in regex), whereas op more mentions whitespace . generalized whitespace version : note: in forms below, \s , [:space:] match kinds of whitespace, including newlines. if wanted restrict matching spaces , tabs, use [ \t] or [:blank:] . sed -

c# - solution and sqlite for stand alone client files to install -

i finished application stand alone user automate filling of excel spread sheet. application in c# , database sqlite. have install solution in client pc. reading site , have done recommendations. example, installed system.data.sqlite x86 , x64. have question yet: files have copy folder i'm going use install solution in client pc. i have copy .exe vs creates when compiles c# solution. .net framework 4.5 sqlite database please, other files have add folder?

random - Keep getting 0 as an output in C# division -

i'm trying divide random number generated 13. can range 1, 53. need divide random number 13 whole number (to determine suit in deck of cards). need suit out of 1-4. random number: value = myrandom.next(1, 53); division: suit = value / 13; face = value % 13; the suit keeps generating 0 way. i'm going take stab in dark you're asking. i'm guessing you're getting non-zero values suit , you're getting zero. main issue here, in case, boils down 0-based vs 1-based indexing. what need do generating/computing 0-based indexing, , add 1 shift 1-based indexing. (alternatively, use 0-based indexing) example code: value = myrandom.next(0, 52); // notice values inclusively between 0 , 51 suit = (value / 13) + 1; // between 1 , 4 face = (value % 13) + 1; // between 1 , 13

arrays - Issue with using extract() PHP -

i have dynamically created array , want extract array , put each item own variable. here's php: $bar = $_post['foo']; extract($bar); echo $1; foo array form made. whenever run script error: parse error: syntax error, unexpected '1' (t_lnumber), expecting variable (t_variable) or '$' in /application/... when change code to: $bar = $_post['foo']; extract($bar, extr_prefix_all, "bar_"); echo $bar_1; i undefined variable error. please me. update: my first code informational, person might come across question problem not knowing what's wrong. second piece of code actual code. m intention input each array item different field in mysql table. haven't written full code yet since extract() thing doesn't seem working. update 2: $_post['foo'] array of checkbox values variables in php cannot start numbers: echo $1; that's invalid , throw error. you're using extract improperly in

jquery - fading out a Javascript error message -

i have error message pops whenever form element not validate. however, reason error message not fade out. html: <div class="span6"> <p id="error-message"></p> </div> javascript: if (response.error) { $('#error-message').addclass('alert alert-success').html("the charge successful. choosing somii!"); $("#error-message").fadeout(3000); } once error message fades out, never seen. have make visible again. $("#error-message").show(); see test fiddle at: http://jsfiddle.net/johnnyworker/sc7zm/ . press "fire" trigger. it working on chrome , ie10.

java - Check BitmapDescriptor for null -

i want check bitmapdescriptor null. the documentation bitmapdescriptorfactory.fromasset states that: returns bitmapdescriptor loaded asset or null if failed load. bitmapdescriptor bd = bitmapdescriptorfactory.fromasset("markerimages/filename.png"); if (bd == null) { // dosomething... } despite this, unable catch bitmapdescriptor in null state - when pass filename not exist, fromasset method not return null. it may fromasset method doesn't return null, perhaps returns same defaultmarker() returns. (i.e. documentation wrong) i'd check whether value (presumably non-existent) asset either '==' or .equals defaultmarker(). how detect non-existent asset.

unix - How to correctly use the "grep" command -

i new linux , commands. understand "grep" command. but not understand following command, do, how type command correctly. grep -r -e examples use correctly welcome. calling grep flags mean search recursively in specified directory , it's children lines match regex . grep -r -e /p.t/ . should find lines p , t has single character in between in current directory or of it's children. -e pattern, --regexp=pattern use pattern pattern; useful protect patterns beginning -. -r, -r, --recursive read files under each directory, recursively; equiv- alent -d recurse option. http://unixhelp.ed.ac.uk/cgi/man-cgi?grep

pointers - LOC() for user defined types gives different results depending on the context -

i'm trying debug code in members of user defined object mysteriously change addresses, , while doing realized user defined objects well. here's small example of querying object address function created , member function: module foo_module type foo_type contains procedure :: foo end type foo_type contains subroutine foo(this) class(foo_type) :: print *, &#39;inside foo is&#39;, loc(this) end subroutine foo end module foo_module program trial use foo_module type(foo_type) :: object print *, &#39;object address&#39;, loc(object) call object%foo() end program trial a sample output is: object address 4452052800 inside foo 140734643354880 why getting 2 different addresses same object? doing wrong? or there loc comes play don't understand? i'm using ifort under osx. loc extension. behaviour specified compiler vendor. what behaviour

Does Go allow a function to use another function as a parameter? -

the problem happening @ line 17 in go code. below program in python , go can see i'm attempting do. python works, go attempts have failed. read golang.org back, , google turned nothing, well. def my_filter(x): if x % 5 == 0: return true return false #function returns list of numbers satisfy filter def my_finc(z, my_filter): = [] x in z: if my_filter(x) == true: a.append(x) return print(my_finc([10, 4, 5, 17, 25, 57, 335], my_filter)) now, go version i'm having troubles with: package main import "fmt" func filter(a []int) bool { var z bool := 0; < len(a); i++ { if a[i]%5 == 0 { z = true } else { z = false } } return z } func finc(b []int, filter) []int { var c []int := 0; < len(c); i++ { if filter(b) == true { c = append(c, b[i]) } } return c } func main() { fmt.println(finc([]int{1, 10, 2, 5, 36, 25, 123}, filte

google app engine - Why are my JSON property names being folded to lower case? -

i have cloud endpoint app, rest json looks this { "first_name": "robert" } and mapped jdo object, thus private string first_name the problem have fails, gce code fails recognise first_name . looked @ api explorer, , generated endpoint expects first_name . when create test client generate json first_name works fine. sadly however, client generate json in production outside of control, can't change fact sending first_name in capitals. any suggestions?

asp.net - Linkbutton inside update panel doesnot enable from code behind -

in usercontrol have update panel contains ajaxfileupload control , link button view file being uploaded ajaxfileupload control. ascx page is: <asp:updatepanel runat="server" id="updatepanelupload" updatemode="conditional"> <contenttemplate> <asp:panel runat="server" id="pnluploadfile"> <div class="button-action-row"> <h2> <asp:label id="lbluploadheader" runat="server" text="upload file"></asp:label> </h2> </div> <div class="button-action-row"> <asp:ajaxfileupload id="ajaxfileupload1" runat="server" contextkeys="one" onuploadcomplete="uploadcomplete" /> <span class="right">

c# - Combining latest from an observable of observables -

suppose have set of uris monitoring availability. each uri either "up" or "down", , new uris monitor may added system @ time: public enum connectionstatus { up, down } public class websitestatus { public string uri { get; set; } public connectionstatus status { get; set; } } public class program { static void main(string[] args) { var statusstream = new subject<websitestatus>(); test(statusstream); console.writeline("done"); console.readkey(); } private static void test(iobservable<websitestatus> statusstream) { } } now suppose in test() want reactively ascertain: whether uris down (as bool ) which uris down (as ienumerable<string> ) so test end creating observable iobservable<tuple<bool, ienumerable<string>>> bool indicates whether uris down , ienumerable<string> contains

ocaml - opam upgrade wants to downgrade a bunch of packages -

i tried 'opam upgrade' , got (the final summary): 1 install | 59 reinstall | 3 upgrade | 34 downgrade | 0 remove want continue ? [y/n] downgrading 34 packages makes me nervous. why want this? some examples of packages wanted downgrade: downgrade llvm.3.2 3.1 downgrade ocamlfind.1.4.0 1.3.3 [required bitstring, camltc, ezjsonm, fat-filesystem, google-drive-ocamlfuse, merlin, mirage-block-xen, mirage-console-xen, mirari, utop] downgrade spoc.130624 121217 downgrade bitstring.2.0.4 2.0.3 downgrade camlzip.1.05 1.04 [required google-drive-ocamlfuse] downgrade ezjsonm.0.2.0 0.1.0 downgrade gapi-ocaml.0.2.1 0.2 [required google-drive-ocamlfuse] downgrade merlin.1.5 1.3 downgrade utop.1.10 1.9 of course, makes me kind of nervous, answered 'n'. anyway fix this? opam version 1.1.0. edit: figured may post whole result: $ opam upgrade *the brute-force exploration algorithm timed-out [108 states, 5s]. might need add explicit version constraints request

sql server - Fast Way To Export DataSet To Excel in VB.Net -

i need export lot (nearly million) of data everyday sqlserver excel. data being processed through stored procedure put them on dataset , tried export using code: ` private sub exporttoexcel(byval dttemp system.data.datatable, byval filepath string) dim strfilename string = filepath dim _excel new excel.application dim wbook excel.workbook dim wsheet excel.worksheet wbook = _excel.workbooks.add() wsheet = wbook.activesheet() dim dt system.data.datatable = dttemp dim dc system.data.datacolumn dim dr system.data.datarow dim colindex integer = 0 dim rowindex integer = 0 each dc in dt.columns colindex = colindex + 1 wsheet.cells(1, colindex) = dc.columnname next each dr in dt.rows rowindex = rowindex + 1 colindex = 0 each dc in dt.columns colindex = colindex + 1 wsheet.cells(rowindex + 1, colindex) = dr(dc.columnname) next next wsheet.column

javascript - Drawing circle/ellipse on HTML5 canvas using mouse events -

Image
i want ellipse option in paint drawing on canvas. have achieved partially. problem not able radius of circle, have hard coded 15. want draw ellipse(same paint) not exact circle. code drawing circle on canvas using mouse events.please me code achieve above mentioned requirements. function tool_circle() { var tool = this; this.started = false; this.mousedown = function (ev) { tool.started = true; tool.x0 = ev._x; tool.y0 = ev._y; }; this.mousemove = function (ev) { if (!tool.started) { return; } context.fillstyle = 'red'; var distance = math.sqrt(math.pow(tool.x0 - ev._x, 2) + math.pow(tool.y0 - ev._y)); context.beginpath(); context.arc(tool.x0, tool.y0,15, 0, math.pi * 2, false); context.stroke(); context.fill(); }; this.mouseup = function (ev) { if (too

python: how to use/declare variables in a class -

so i'm trying best learn how use python , wrote create button functionality using pygame gaming library. in using function push error of "global name 'next' not defined": button: class button(object): def __init__(self,x,y,dimx,dimy,color,phrase): self.is_clicked = false self.has_next = false self.next = none self.x=x self.y=y self.dim_x=dimx self.dim_y=dimy self.e_x=x+dimx self.e_y=y+dimy self.color=color self.color2=color self.phrase=phrase def mypush(self,btn): if not (self.has_next): self.next=btn self.has_next=true else: next.mypush(btn) """ === right here === """ def checkhit(self,x,y): if ((x>= self.x) or (x<=self.e_x)): if((y>= self.y) or (y<=self.e_y)): self.is_clicked = true self.color = (255,25

How to add struts2 tags in spring jsp page? -

i want use struts-jquery-tags in spring jsp page or suggest other spring tags. usage of sj:div action targets other div. add relative tlds , library files in classpath , refer them jsp. works tag may want use inside jsps

How to check if a Month/Year is greater than current Month/Year in Javascript -

i want check if 08/2014 greater 02/2014.. how can in javascript?? me please... currently check future year. here code snippet. this.isdategreaterthancurrent=function(b){ return parseint(b)>parseint(new date().getfullyear()); }; date objects can compared each other. instead of parsing them can date object itself. function isdategreaterthantoday(b) { var ds = b.split("/"); var d1 = new date(ds[1], (+ds[0] - 1)); var today = new date(); if (d1 > today) { return "d greater"; } else { return "today greater"; } } console.log(isdategreaterthantoday("08/2014")) jsfiddle

Python: How to get every combination in list -

i have large amount of lists of lists. here few: l1=(['g', 'c', 'a'], ['t', 'c'], ['t', 'c']) l2=(['t', 'c'], ['t', 'c'], ['t', 'c']) i need lists this: (so every repeat list list) l1=['gtt','ctt','att','gcc','ccc','acc','gtc','ctc','atc','gct','cct','act'] l2=['ttt','ctt','tcc','ccc','tct','ctc','ttc','cct'] using itertools.product : >>> [''.join(x) x in itertools.product(*l1)] ['gtt', 'gtc', 'gct', 'gcc', 'ctt', 'ctc', 'cct', 'ccc', 'att', 'atc', 'act', 'acc'] >>> >>> [''.join(x) x in itertools.product(*l2)] ['ttt', 'ttc', 'tct', 'tcc',

c# - is it possible to bind hiddenfield to dropdownlist? -

<asp:dropdownlist id="ddlpackage" runat="server" cssclass="ddlpackage" height="24px" width="250px"> </asp:dropdownlist> <cc1:listsearchextender id="ddlpackage_listsearchextender" runat="server" enabled="true" targetcontrolid="ddlpackage"> </cc1:listsearchextender> <asp:label id="lblpackage" runat="server" cssclass="errormsg" style="color: red; display: none;"></asp:label> <asp:hiddenfield id="hdnnewoldtype" runat="server" value='<%#bind("newoldtype") %>' /> is possible bind hiddenfield dropdownlist? if have 3 columns in datatable : code name type and if want check type based on selected code can use selectedindexchanged event of drop down list mention below : code dropdown list : <asp:dropdownlist id="ddlpackage" runat="s

ios - Method to check all points within a closed path -

i have 4 or more points make closed path. want each point in image within closed path. if there method this? - (bool)ispointcontain:(nsarray *)vertices point:(cgpoint)test { nsuinteger nvert = [vertices count]; nsinteger i, j, c = 0; cgpoint verti, vertj; (i = 0, j = nvert-1; < nvert; j = i++) { verti = [(nsvalue *)[vertices objectatindex:i] cgpointvalue]; vertj = [(nsvalue *)[vertices objectatindex:j] cgpointvalue]; if (( (verti.y > test.y) != (vertj.y > test.y) ) && ( test.x < ( vertj.x - verti.x ) * ( test.y - verti.y ) / ( vertj.y - verti.y ) + verti.x) ) c = !c; } return (c ? yes : no); } nsarray *vertices = [nsarray arraywithobjects: [nsvalue valuewithcgpoint:cgpointmake(10, 40)], [nsvalue valuewithcgpoint:cgpointmake(30, 48)], [nsvalue valuewithcgpoint:cgpointmake(50, 80)],

sql - php look in database for data not working -

i'm making quiz webpage connected datbase, code isn't working. have code: $query = "select `question` `questions` `id` = '1'"; $result = mysql_query($query) or die($query."<br/><br/>".mysql_error()); $question = mysql_result($result, 0); echo $question; it should in table question id 1 , echo question, possible answers , correct answer. column names are: id, question, a, b, c, d , correct here how looks in phpmyadmin, since im not allowed post images, here link image. http://i.stack.imgur.com/tnjkd.png can me??? try this $query = "select `question` `questions` `id` = '1'"; $result = mysql_query($query) or die($query."<br/><br/>".mysql_error()); $question = mysql_result($result, 0); echo $question['question'];

Change Date into Month Name and Date with Year in C# -

i want convert date different. give input date, convert format. my code var dt = erd.startdate.value.toshortdatestring(); var format = string.format("{mmm/d/yyyy}", dt); here showing error input string not correct format. help me find out issue? simply rewrite (i'm assuming erd.startdate.value datatype datetime) string result = erd.startdate.value.tostring("mmm/dd/yyyy"); or using "d" equivalent "dddd, mmmm d, yyyy" string result = erd.startdate.value.tostring("d");

java - Failed to Execute Simple "Select" Query using SQLITE in Android? -

here select query.every time getting error : select mf.id, mf.field_type_id, mf.field_label, mf.field_values mf_values, mf.is_required, sfv.field_value sfv_value menu_fields mf left outer join site_field_values sfv on mf.id=sfv.menu_fields_id , sfv.proposal_id=100000 mf.menu_id=2; here logcat : 02-06 22:36:05.010: e/sqlitelog(27524): (1) near "mf": syntax error 02-06 22:36:05.015: d/androidruntime(27524): shutting down vm 02-06 22:36:05.015: w/dalvikvm(27524): threadid=1: thread exiting uncaught exception (group=0x41bdf2a0) 02-06 22:36:05.030: e/androidruntime(27524): fatal exception: main 02-06 22:36:05.030: e/androidruntime(27524): android.database.sqlite.sqliteexception: near "mf": syntax error (code 1): , while compiling: select mf.id,mf.field_type_id,mf.field_label,mf.field_values mf_values mf.is_required, sfv.field_value sfv_value menu_fields mf left outer join site_field_values sfv on mf.id=sfv.men

Is there the concept of a wiki in Visual Studio 2013 online? -

i've had browse around visual studio 2013 online capabilities can't see wiki such. wiki mean somewhere capture enduring product related info e.g. info on how support product xyz, how setup new dev workstation, how workaround annoying "msshrtmi.dll" azure bug continually crops up. stuff that. currently using google sites wiki awful! unfortunately visual studio online not support wiki project now. miss feature too. can vote feature on uservoice accelerate development. update: issue completed on 9 january 2015. developers , voted. more information, see http://blogs.msdn.com/b/bharry/archive/2014/12/18/improved-welcome-wiki-experience.aspx

php - Need help to import file.DAT into public/uploads folder using Laravel -

i'm trying import file.dat in public/uploads folder. didn't succeed. error appear call member function getclientoriginalname() on non-object. here's code controller <?php class importcontroller extends basecontroller { /* |-------------------------------------------------------------------------- | default import controller |-------------------------------------------------------------------------- | | may wish use controllers instead of, or in addition to, closure | based routes. that's great! here example controller method | started. route controller, add route: | | route::get('/', 'importcontroller@index'); | */ public function showimport() { return view::make('import'); } public function handleimport() { $file = input::file('file'); // file upload input field in form should named 'file' $destinationpath = '

sphinx - min_infix_len and extended query, not work together? -

after setting infix in sphinx 2.1 sphinx config file search stop working. my query : select * ca_sac_persons match('@fullname("^john$" | "^joseph$" | "^jose$" | "^josh$" | "^robs$")') limit 0,100; my updates in sphinx config file min_infix_len = 3 infix_fields = fullname, enable_star = 1 may know wrong ? or min_infix_len , complex extended query not work ?

php - taking safe input from url and making my input hacking safe -

i have following method in php crud class: //secure search method function secureinput($ary = array()){ $this->connect(); $securedarray = array(); //print_r($ary); foreach($ary $val){ //echo($val.'<br />'); $val = str_replace("'","",$val); $val = str_replace("#","",$val); $val = str_replace("~","",$val); $val = str_replace("!","",$val); $val = str_replace("%","",$val); $val = str_replace("*","",$val); $val = str_replace("drop","",strtolower($val)); $val = str_replace("show","",strtolower($val)); $val = str_replace("insert","",strtolower($val)); $val = str_replace("create","",strtolower($val));

python 2.7 - invalid literal for int() with base 10: '16:00:00' -

dic = dict() open('c:\\users\\aman\\documents\\dataval.txt', 'r') fh: l in fh.readlines(): try: lines = l.split() date, sub, num = lines[0], lines[1], [int(x) x in lines[2:]] dic.setdefault(date, {}) dic[date][sub] = num except exception er: print er print dic can help? giving me error saying invalid literal int() base 10: '16:00:00' .how rid of it? information '16:00:00' first column in table in txt file 16:00:00 maths 100 95 65 32 23 45 77 54 78 88 45 67 89 17:00:00 science 45 53 76 78 54 78 34 99 55 100 45 56 78 18:00:00 english 43 45 56 76 98 34 65 34 45 67 76 34 98 i changed int(x) str(x), please try. if thats error. dic = dict() open('c:\\users\\aman\\documents\\dataval.txt', 'r') fh: l in fh.readlines(): try: lines = l.split() date, sub, num = lines[0],

oop - What are the pros and cons of creating a new class? -

this basic question, it's 1 i'm running i'm learning more actionscript 3 in particular. however, first question general: when appropriate put functionality in new class rather new function in same class? according java tutorial , focuses on basic object-oriented principles, class supposed "blueprint of object". understood mean functionality or behavior object use should contained within class. however, according single responsibility principle , each class should have 1 reason change. example, should have 1 class compile report , 1 class print rather single report class. can guys me understand pros , cons creating new class? costs splitting object multiple classes? there compile-time or performance costs keeping related functionality in same class, or splitting two? there perhaps times want split things out, while might want keep them other times? as far remember, there isn't big difference between having 1 class can or several classes can same

ios - Getting Error Domain=kCFErrorDomainCFNetwork Code=-1000 or NSCocoaErrorDomain Code=3840 -

first of want tell duplicate question, have tried ways possible - link have searched--> bad url when requesting nsurl ios develoment: why nsurlconnection failing "bad url" error users? bad url when requesting nsurl i sending request server -> always getting bad url error i.e request failed error: error domain=nsurlerrordomain code=-1000 "bad url" userinfo=0xcbf0680 {nsunderlyingerror=0xc9ad8e0 "bad url", nslocalizeddescription=bad url}, { nslocalizeddescription = "bad url"; nsunderlyingerror = "error domain=kcferrordomaincfnetwork code=-1000 \"bad url\" userinfo=0xc96dc30 {nslocalizeddescription=bad url}"; } code-> nsstring *imgurl = [nsstring stringwithformat:@"https://graph.facebook.com/%@/picture", fbid]; nsstring *urlstring = [nsstring stringwithformat:@"%@url=register_user.json&username=%@&email=%@&dob=%@&by_socialnetwork=\"1\"

Android delete selected items listview using contextmenu actionbar -

so far i've tried: private string[] data = {"one", "two", "three", "four", "five", "six", "seven", "eight", "nine","ten"}; private selectionadapter madapter; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); madapter = new selectionadapter(this, r.layout.row_list_item, r.id.textview1, data); setlistadapter(madapter); getlistview().setchoicemode(listview.choice_mode_multiple_modal); getlistview().setmultichoicemodelistener(new multichoicemodelistener() { private int nr = 0; @override public boolean onprepareactionmode(actionmode mode, menu menu) { // todo auto-generated method stub return false; } @override public void ondestroyactionmode(actionmode mode) { // to

visual studio 2012 - (Windows 8 Javascript) WinJS.xhr does not reflect changes from api -

i developing app, access photos slr via wifi-sd-card. right now, trying retrieve html response particular location on camera , retrieve images' file names. went okay, retrieving html response; however, not update. receiving same response on , on again (even if delete or take new photos). been stuck problem days now. hope me out. here's code: function retrieveimgfilenames() { var url = "http://my-sd-card-host:port/path"; winjs.xhr({ url: url, responsetype: "text" }) .done(function (r) { var doc = document.createelement("html"); doc.innerhtml = r.response; var links = doc.getelementsbytagname("a") var imgs = []; var imgcount = 0; var notimg = []; (var = 0; < links.length; i++) { var filename = links[i].getattribute("href"); if (filename.substring(filename.length - 3, filename.length) == 'jpg') { imgs.pus

osx - Determine OS X keyboard layout ("input source") in the terminal/a script? -

i determine os x keyboard layout (or "input source" os x calls it) terminal can show in places tmux status bar. so want know if current layout "u.s." or "swedish - pro" example. googling turns nothing me. possible? note: @marksetchell deserves credit coming fundamental approach - [start to] , tools use. after further investigation , , forth in comments thought i'd summarize solution (as of os x 10.9.1): do shell script "defaults read ~/library/preferences/com.apple.hitoolbox.plist \\ appleselectedinputsources | \\ egrep -w 'keyboardlayout name' | sed -e 's/^.+ = \"?([^\"]+)\"?;$/\\1/'" the selected keyboard layout stored in user-level file ~/library/preferences/com.apple.hitoolbox.plist , top-level key appleselectedinputsources , subkey keyboardlayout name . defaults read ensures current settings read (sadly, of osx 10.9, otherwise superior /usr/libexec/plistbuddy sees cached versio

visual studio 2008 - Adding Qt moc file to project -

is there way force recompile other projects moc file? use visual studio, , got 1 qt project, added other project class interface , signals/slots (let thing.cpp , thing.h , ui_thing.h (has been included generated files folder), moc_thing.cpp in generated files\debug (because of main projects in debug mode), and thing.ui form files ) it working ok until decided made changes, add slot/signals stuff. can guess included moc file not recompiles. decided change properties of thing.h . i copied parameters main projects files in command line part there "$(qtdir)\bin\moc.exe" "$(inputpath)" -o ".\generatedfiles\$(configurationname)\moc_$(inputname).cpp" -dunicode -dwin32 -dqt_largefile_support -dqt_thread_support -dqt_core_lib -dqt_gui_lib -dqwt3d_dll -dqt_dll -dqt_svg_lib -dqt_script_lib -dqt_multimedia_lib "-i.\parsers" "-i$(qwtdir)\include" "-i.\productionhistory\generatedfiles" "-i.\productionhistory&

sony - Alpha 7 Camera API Shutter Speed -

i trying implement long exposure timer sony alpha 7 using remote camera api. possible set shutter speed using api bulb? also, possible control exposure time within app when shutter set bulb? i hope sony implement these features, otherwise api kind of useless many scenarios. here interesting article demand: http://blog.programmableweb.com/2013/09/10/new-sony-camera-remote-api-leaves-developers-wanting-more/ i happy know if features implemented in future. knowing start developing apps otherwise makes no sense...

logic - vb.net powerscan m8300 write to display -

i trying write data(prompts) m8300 barcode scanner, having few issues. device serial , getting data it, using backgroundworker pull data me. however, can't seem able find way write data device. know device capable of doing says in manual. however, have following code: private sub button5_click(sender system.object, e system.eventargs) _ handles button5.click serialport1.write(chr(18) & chr(27) & "[2jsay name" & vbcr) end sub however, not work consistently. has had experience writing similar device? i must admit, totally forgot one. turns out chr 18 , 27 command params device; 2 needed commands, wasn't needed. the issue having communication protocol on device, though directions required 2-way communication enabled on it, turns out needed 1-way communication. found out when reset device factory settings , sent out data , worked without issues. goes show you, not believe in manuals.

compiling java file from another java class -

import java.io.bufferedreader; import java.io.inputstreamreader; public class executeshellcomand { public static void main(string[] args) { executeshellcomand obj = new executeshellcomand(); string classname = "str.java"; string command = "javac " + classname; string output = obj.executecommand(command); system.out.println(output);// prints output of executed command } private string executecommand(string command) { stringbuffer output = new stringbuffer(); process p; try { p = runtime.getruntime().exec(command); p.waitfor(); bufferedreader reader = new bufferedreader(new inputstreamreader(p.getinputstream())); string line = ""; while ((line = reader.readline()) != null) { output.append(line + "\n"); } } catch (exception e) { e.printstacktrace(); }