Posts

Showing posts from June, 2012

java.lang.NumberFormatException: null -

i'm facing error: `unable load properties file multiwordnet exception in thread "main" java.lang.numberformatexception: null @ java.lang.integer.parseint(integer.java:417) @ java.lang.integer.<init>(integer.java:660) @ org.itc.mwn.mysqldictionary.<init>(mysqldictionary.java:85)` this property file mysqldictionary.java trying read: #------------------------------------------------------------ #properties file properties multiwordnet api #hostname of mysql server mwn_hostname=localhost #user mwn_user=root #password mwn_passwd= #database name mwn_db=wordnet #cache of entity cache_capacity=1000 and,finally, part code fails: public mysqldictionary() { try { connectionparameters = new properties(); connectionparameters.load(new fileinputstream(new file("./conf/multiwordnet.properties"))); } catch (java.io.ioexception ioee) { system.err.println("unable load properties file multiwordnet"); }

javascript - simple jquery string count not working -

here code below... var mymonth=new date().getmonth(); console.log((mymonth).length); i getting error undefined in console.. have tried.. console.log((new date().getmonth()).length); but still same error...iam supposed length of month 1 whats issue this??? mymonth numerical value not have length property, try var mymonth=new date().getmonth(); console.log((''+ mymonth).length); or use numerical comparison below check whether month of 2 digits or not mymonth < 10

java - System.out.println always outputs HASH(0x........) -

the system.out.println statement below outputs logcat hash reference "hash(0x....)" whether or not specify variable printed "line" or "line.tostring()". how print actual string value? url object=new url(url); httpurlconnection con = (httpurlconnection) object.openconnection(); con.setdooutput(true); con.setdoinput(true); con.setrequestproperty("content-type", "application/json"); con.setrequestproperty("accept", "application/json"); try { con.setrequestmethod("post"); } catch (protocolexception e) { e.printstacktrace(); } outputstreamwriter wr; try { wr = new outputstreamwriter(con.getoutputstream()); wr.write(json.tostring()); wr.flush(); } catch (ioexception e) { e.printstacktrace(); } int httpresult = con.getresponsecode(); if (httpresult == httpurlconnection.http_ok) { bufferedreader br = new bufferedreader(new inputstreamreader(con.getinput

javascript - jQuery hide().slideDown() does not work when I have CSS animations enabled -

i'm new this. i used jquery make 3 divs (buttons) slidedown @ page load. made them expand little (downwards) when mouseover'd. worked in safari not in firefox. changed around few things. now have css animations make them expand on hover , jquery function make them slidedown on load. slidedown doesn't seem work properly. html: <div class="header"> <div class="button_container"> <a href = "../index.htm"><div class="header_button home_button">back home</div></a> <a href = "../projects/projects.htm"><div class="header_button projects_button">projects</div></a> <a href = "../resume/resume.htm"><div class="header_button resume_button" >resume</div></a> </div> </div> css: .header_button { display: inline-block; height: 130px; line-height: 130px;

javascript - jQuery how to select the first non-hidden select option -

the following behaves differently between jquery 1.9 , 1.10+: <select id="s1"> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> </select> $('#s1 option[value=1]').hide(); $('#s1').val(''); the idea behind code select first non-hidden option, after hiding options, including selected one. since jquery 1.10+ $('#s1').val(''); no longer selects first non-hidden option, while .val(<some proper value particular select box>) works ok. trying following approaches not because both selectedindex , .first().val() consider hidden options: $("#s1").prop("selectedindex", 0); $('#s1 option').first().prop('selected', true); next thing comes mind (also suggested c-link ) not work, because :visible selector not work select options. $('#s1 option:visible'

data structures - Maximum number of node in a binary tree -

given binary tree having l leaf node ,what maximum number of node in tree.nothing has been said type of binary tree ,just binary tree. if full binary tree, total number of nodes equal (2*l - 1).

google chrome - is there "main" gyp file? -

there many gyp & gypi files in chromium source code. 1 sort of "main" gyp hold crucial information? there documentation can refer? $chrome_src/build/all.gyp , $chrome_src/build/common.gypi

count - SQL query to retrieve number of keys in database -

how can retrieve total number of primary keys, , secondary keys, unique indexes table in database? there function in sql allow me this? i using sql server 2012 database this query against sys.indexes system catalog view might give need (or @ least it's starting point): select indexname = i.name, tablename = object_name(i.object_id), i.index_id, i.type_desc, i.is_unique, i.is_primary_key, i.is_unique_constraint sys.indexes it lists indexes tables in current database, , show index name, table name, index type (clustered or non-clustered), , flags primary key, unique index etc. you can read lot more sql server catalog views , information might have on msdn!

sql server - SQL Join from multiple tables from a reference lookup into one view -

im in middle of report creation. came through these table structure wierd , complicated. im not able create view out of it. i have 2 tables structure dbobjecttype ------------- typeid, description and dbobassign ---------- id referenceobtype referenceobid targetobtype targetobid the table populated : dbobjecttype table: +--------+-------------------+ | typeid description | +--------+-------------------+ | 1 account | | 2 tfn | | 3 vdn | | 4 skill | +--------+-------------------+ dbobassign table +----+-------------+---------+---------+--------+ | id refobtype refobid tgtobtype tgtobid | +----+-------------+---------+---------+--------+ | 1 1 12 2 23 | => refer tfn table | 2 1 12 3 12 | => refer vdn table | 3 1 23 4 1 | => refer skill table | 4 1 23 2 45 | => refer tfn table

c - Get the location of a memory in NUMA -

i working on numa system 2 nodes. got pointer pointing memory, not know node in. there way can node number of memory? (the reason getting node mask of current thread not work that, memory of node full, thread affined current node, may still allocate memory on adjacent node. therefore, seeking direct way memory location.) you may want check numa api: http://linux.die.net/man/3/numa . cursory look, numa_alloc_onnode() , numa_get_run_node_mask() stand out useful. may combination of functions in api can address reason why want know node number.

c# - MVVM - DependencyProperty - Binding a String to Textbox - PropertyChanged event only fired up if mouse clicks on another element -

i playing first mvvm apps.. and found crazy behavior, did not know how solve it. when start test app, button enabled. now click in textbox, delete text in it.. button still enabled. click anywhere else, nothing changes.. click on button, button changes disabled cause canexecute false ! click in textbox , enter text, button still disabled.. in case button never come enabled cause cannot click on other element??! here xaml : <window x:class="tests.view" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:my="clr-namespace:tests" title="view" height="109" width="156" > <grid> <button x:name="btn" content="refresh" horizontalalignment="left" margin="10,10,0,0" verticalalignment="top" width=&

Push rejected, failed to compile ruby app -

currently @ chapter 3 of michael hartl's tutorial , keep running problem: c:/users/huihui/sutdweb/spec/spec_helper.rb:82:in `block in <top (required)>': u ninitialized constant capybara (nameerror) this gemfile.rb: source 'https://rubygems.org' ruby '1.9.3' gem 'rails', '4.1.1' gem 'sqlite3-ruby', '1.3.1', :require => 'sqlite3' group :development, :test gem 'sqlite3' gem 'rspec-rails' end group :test gem 'selenium-webdriver', '2.35.1' gem 'capybara', '2.3.0' end gem 'sass-rails', '4.0.1' gem 'uglifier', '2.1.1' gem 'coffee-rails', '4.0.1' gem 'jquery-rails', '3.0.4' gem 'turbolinks', '1.1.1' gem 'jbuilder', '1.0.2' group :doc gem 'sdoc', '0.3.20', require: false end group :production gem 'pg', '0.15.1' gem 

Creation of table in mySQL -

when going fire query creating table in mysql 5.0 got following exception java.sql.sqlexception incorrect information in file frm please give me solution this? create table if not exists tmp_vpedutech (srno int(10) not null, thegroup varchar(50) null, make varchar(50) null, model varchar(50) null, description varchar(255) null, quantity varchar(50) null, modelnotknown boolean null ); java.sql.sqlexception: incorrect information in file: './erp_vpedutech/tmp_vpedutech.frm' it's working fine in mysql 5.1

c# - Download a file using URL in WPF Application without opening browser -

this question has answer here: how download file website in c# [closed] 7 answers is possible download file using download link url using c# wpf application without opening browser? example: link - http://example.url.com when typed address bar of browser automatically downloads file. how can download file upon button click in wpf application (c#) without opening browser? tia. you can use webclient.downloadfile , if want download specific file , store on machine: using (webclient client = new webclient()) { client.downloadfile(remotefilename, localfilename); ... } or webclient.downloadstring , if want page's content string : using (webclient client = new webclient()) { string reply = client.downloadstring (address); ... }

optimal algorithm strategy for a 2 player game -

this question came across in 1 of online coding contests: this 2 player game . there 2 breeds of warriors start off " a " , " b ". given n cities , each city i has w[i] number of warriors (which can either of breed or b) . each warrior j in city has strength s[j] . the first player has choose breed of warrior . second player gets other breed .in turn , player must choose city , warrior in city of choosen breed. one player choose breed of warrior , city start game . warrior kill every other warrior of city less strength him irrespective of breed . @ end die. next , second player choose city , breed , same. continues until there no more moves left. the first player has decide breed of warrior choose wins or if there no way him win if opponent plays optimally. what optimal algorithm strategy first player win. example - let there 1 city (c1) 2 warriors- w1 of strength 10 , breed a , w2 of strength 15 , breed b . the first player chose breed

c++ - Use of edje_cc in cmake file -

i tried add custom target in cmake file compile .edc file edje_cc automatically on build mentioned here . part of efl project. but error on compiling: [ 1s] [ 0%] [ 50%] #### compile edc files #### [ 1s] make[2]: edje_cc: command not found [ 1s] make[2]: *** [cmakefiles/edje] error 127 [ 1s] make[1]: *** [cmakefiles/edje.dir/all] error 2 [ 1s] make[1]: *** waiting unfinished jobs.... can please tell me edje_cc compiler found @ compiling? it seems edje_cc not installed on machine. modify cmakelists.txt add check finding edje_cc. project("edje") find_program(edje_cc edje_cc) if (not edje_cc) message(fatal_error "edje_cc missing.") endif()

Mirror Video in android using mp4Parser? -

how can create mirrored value of video using mp4parser. if possible value matrix work. please me.. the matrix is: -1 0 0 0 1 0 0 0 1 this code sets matrix first track in file: isofile isofile = new isofile("input.mp4"); trackheaderbox tkhd = (trackheaderbox) path.getpath(isofile, "/moov[0]/trak[0]/tkhd[0]"); tkhd.setmatrix(new matrix(-1, 0, 0, 1, 0, 0, 1, 0, 0)); fileoutputstream fos = new fileoutputstream("output.mp4"); isofile.getbox(fos.getchannel()); but aware not players support matrix tranformations. have here see how make videoview respect matrix .

Events passing in python with kivy -

i new python , kivy, trying clear widgets in host when button pressed, code follows: from kivy.uix.button import button kivy.uix.gridlayout import gridlayout kivy.uix.boxlayout import boxlayout kivy.uix.popup import popup kivy.uix.label import label spots={} class spot(button): ''' classdocs ''' def __init__(self, **kwargs): ''' constructor ''' super(spot,self).__init__(**kwargs) self.ismine=false if 'text' in kwargs: self.text=kwargs['text'] else: self.text="x" def on_press(self, *args, **kwargs): #return button.on_press(self, *args, **kwargs) game.spottouched(self, self.text) class game(boxlayout): def __init__(self,**kwargs): super(game,self).__init__(**kwargs) self.m=minesholder(rows=25, cols=25) self.add_widget(self.m) self.attachtogrid() def a

java - Saving large text in CLOB with Wicket -

i want store large text in database. created clob field description in table , added hibernate like: @column private byte[] description; in wicket added textarea this: add(new textarea<object>("advisor.descriptionclob")); when click on ajaxsubmitlink nothing happens (no code @ gets executed), bit confusing me, since wicket shouldn't care database type use? has idea what's going on here , how fix this? i use wicket 6.9.1, hibernate 4.1.7 , mysql database

linux - Remove git-annex repository from file tree -

i tried installing git-annex yesterday backup files. ran git annex add . in root of repository tree , git commit . far fine. what didn't know git-annex doing turning entire file tree whole bunch of symlinks. every single file in whole tree symlinked .git/annex/objects ! messing application depends on files not being symlinks. my question is, how rid of git-annex , restore file system original state? normal git repo rm -r .git , i'm afraid won't job in git-annex. in advance. okay, stumbled upon docs git-annex , , give 2 commands achieve wanted do: unannex [path ...] use undo accidental git annex add command. can use git annex unannex move content out of annex @ point, if you've committed it. not command should use if intentionally annexed file , don't want contents more. in case should use git annex drop instead, , can git rm file. uninit use stop using git annex. unannex every file in repository, , remove of git-annex

Retrieving related model's data CakePHP -

here database tables in question: companies: ____________________ | id | name | ____________________ | 1| unimex| | 2| solomex| users: ________________________ | id | name | company_id _________________________ | 1| john | 1 | 2| ricky| 2 events: _____________________________________ | id | user_id | details | date| _____________________________________ | 1| 1| null | 2014-04-01 | 2| 1| null | 2014-04-15 | 3| 2| null | 2013-04-01 | 4| 1| null | 2014-04-02 what retrieve list of users(based on company's id) , related events range of dates. have tried following: $users = $this->user->find('all', array( 'conditions' => array( 'company_id' => cakesession::read("auth.user.company_id") ), 'contain' => array( 'event' => array( 'conditions' => array(

version control - Git branch -f versus soft reset -

does git command: git branch -f master master^ have same effect as: git reset --soft master^ is so? theoretically yes, practically no. first option not work if master current branch. cannot force-update current branch branch command. should on branch, not identical either: the first option moves master branch , leaves current branch alone the second option moves current branch 1 before master, , leaves master alone.

geolocation - How to determine location in browser of non supporting html5 mobile device? -

i have html5 web page displays specific advert depending on mobile device's geo/location. how determine location on handset doesn't support html5 (older nokias , blackberrys) inside (old) browser? you'll have server side based on ip address, using libraries such geo::ip. it's lot less accurate (especially in case of mobile devices), if browser won't give location there's no way guess it.

mysql - how to disable submit button after being used 1 time -

what trying following. a user.rb can answer.rb several application.rb 's created company.rb . user can answer once per unique application. i've disabled in model can't figure out how in view. my answer controller: class answerscontroller < applicationcontroller before_action :authenticate_user! def show @application = application.find(params[:id]) @answer = answer.new end def create @answer = answer.new(answer_params.merge(:user_id => current_user.id)) if @answer.save flash[:notice] = "you've applied" redirect_to root_url else flash[:alert] = "you've applied" redirect_to root_url end end private def answer_params params.require(:answer).permit(:answer_1, :answer_2, :answer_3, :application_id) end end in answer model have user_id stored. thinking @ current answer :id , check if current_user.id present in it, if disable button. haven't been able turned out successfully. the show.html.erb lo

java - Pig: Regular Expression syntax -

i using string comparison using regular expression in pig script. i know regular expression in pig same java. the problem facing is: need remove character contain white space @ trailing end ? my regular expression this: (name matches '!\\s+$') sample script----- raw_data = load '$input' using pigstorage(',') (fname:chararray); filter_data = filter raw_data (fname matches '!\\s+$'); dump filter_data; sample input----- abcd ,123 pqrs,234 xyz ,234 lmn,2345 it not writing on stdout , should have written "pqrs" , "lmn" . i don't know pig , in java 1 syntactically-correct regex match pqrs,234 , lmn,2345 , be: ^\s+$ assuming in multiline mode. in java escape backslashes, turns ^\\s+$ in java can turn on multiline (?m) regex (?m)^\\s+$ see demo .

c# - DataContractJsonSerializer serialization error: Consider using a DataContractResolver or add any types not known statically to the list -

i extending object being serialized system.runtime.serialization.json.datacontractjsonserializer 2 additional properties strings (not complex types) inheritance. .net version used .net 4. serialization mechanism works fine base object fails object 2 additional properties seems peculiar me. using [datacontract] attributes on both base , inherited object , properties on both of them have [datamember] attributes names. both objects internal don't see how affect serialization of child object. while debugging have observed base object step in try block , serialized, , child blow on line serializer.writeobject(ms, sourceobject); adding known type attribute [knowntype(typeof(onthemovebusinesscomponentjavascriptinitobject))] on inherited object results in same error in same place. why can't substitute base object inherited one? childobject: namespace onthemovelibrary.datacontrols { [datacontract] [knowntype(typeof(onthemovebusinesscomponentjavascriptinitobj

Setting value of a parameter in html by calling javascript function -

is there way this? <'param name = "ticket" value = "getticket()"> getticket() javascript function. whatever function returns, should value of parameter tag. i cant set explicitly using javascript "document.getelem...." because want value loaded @ time of page load. or, while parameter being set. for further info, trying tableau trusted authentication . are using server-side scripting? isn't more using request/response ways? like directly using <%=ticketvalue%> (asp way) or ${ticketvalue} (jsp way)?

ruby on rails 4 - How to clear Heroku releases? -

i have deployed in rails application in heroku. and on heroku $ heroku releases === my_app releases v34 deploy b18bae5 user@example.com 2014/06/23 13:21:52 v33 deploy 433982b user@example.com 2014/06/23 12:24:31 v32 deploy 028406a user@example.com 2014/06/23 09:53:50 v31 rollback v29 user@example.com 2014/06/23 17:45:47 v30 deploy ffead56 user@example.com 2014/06/22 17:04:51 v29 deploy gghjk21 user@example.com 2014/05/24 12:19:43 v28 deploy b18bae5 user@example.com 2014/05/20 14:52:19 v27 deploy 8b72be3 user@example.com 2014/05/20 13:56:48 i want remove particular release only, example want remove v29. how do? i don't think possible without destroying app , recreating. why want that? trying achieve?

objective c - How to read, separate, and use input data -

i'm trying develop ios app act gui telnet session. have gotten nsstream coding work (mostly) , i'm trying figure out how create events based on code results. think way examine results , run "predicate" on them. simple example below: i press button sends command, example command: "info" the server sends response (which i'm snagging , writing in nslog ): version: 1.1.1 model: xyzabc whatever: whatever etc: etc.. how able pull information, read it, , take "1.1.1" or "xyzabc" , add label in vc? i don't need basics of how add label, how strip correct information , stick values nsstring. thanks in advance, chuck (total ios coding noob) (edit, code added): if (nil != output) { nslog(@"%@", output); [self messagereceived:output]; _txtlabel = output; -(void)messagereceived:(nsstring *)message { [_messages addob

java - How to run a class in the test package that is not junit or testNG with gradle -

our build setup such have runnable classes executed during our development , not during live production code. these runnable classes housed in test directory our junit tests , property files. sourcesets { ... test { java.srcdirs = ['src/test/java'] } ... } one such file embedded jetty web server, run command line. run file in debug mode boot local runnable copy of project. possible run file, in debug mode- gradle, without having include in main source sets? we prefer not use jetty plugin gradle.

Referencing mixed Fortran & C in doxygen -

my situation: file_api.h /*! \brief blabla \params ...description of many parameters.. */ int api_function(...very long parameter list ...); file_api.c int api_function(...very long parameter list ...) { return api_function_(...very long parameter list ...); } file_api.f !> \copydoc ????what put here??? integer function api_function(...very long parameter list ...) problem fortran , c functions have same name, way can reference c function via full function declaration: !> \copydoc api_function(...very long parameter list ...) which exceeds size of fortran line (132 characters) , makes code bit ugly read. my questions: is there possibility split autolink more lines? like: !> \copydoc api_function(...very long !! long parameter list ...) is there way how use filename+function name in autolink instead of param list? like: !> \copydoc file_api.h::api_function() set custom link object , not use autolink? (so can set c func

css - empty box wont resize responsively correctly -

i creating responsive template. of page contains images resize nicely. however there 1 box empty want resize in proportion images. however, when move smaller screen sizes width responds box collapses have no height. i realise use jq height required seems using hammer crack nut. here's css /*full width*/ .moduletable_homesmposition007 width: 213px; height: 119px; background-color:#e9abaf; border:1px solid #d1d3d4; /*inside media query*/ .moduletable_homesmposition007 { box-sizing:border-box; max-width:48%; height:auto; width: auto\9; }

android - detect a sim card change using alarm manager -

i developing android app detect sim change in device on clicking button. want app execute checksimstate() method every 5 minutes using alarm manager. using getsimserialnumber() , getsubscriberid() detect old sim , new sim. where should call method checksimstate() gets executed every 5 minutes? it not idea check sim state every 5 minutes. instead can listen action_sim_state_changed broadcast receiver , write code detect sim changed or not.

postgresql - I need to combine 2 queries postgis -

i have 2 queries: 1st query : select st_astext( st_makeline(sp) ) (select st_pointn(geom, generate_series(1, st_npoints(geom))) sp -- extract individual linestrings (select (st_dump(st_boundary(geom))).geom geometriess ) linestrings ) segments; in table there : "polygon((0 0,1 0,1 1,0 1,0 0))" after query there : "linestring(0 0,1 0,1 1,0 1,0 0)" and 2nd query : line (select geom geometries) select st_x(st_pointn(geom,num)) x, st_y(st_pointn(geom,num)) y line, (select generate_series(1, (select st_numpoints(geom) line)) num) series; it splits linestring points x , y. i need combine them, don't know how. the following test table creates 2 polygons, different numbers of points, combines them together, , grabs each point of boundary using generate_series st_npoints iterate through each polygon. create table test (id serial, geom geometry); insert test (geom) values (st_geomfromtext('polygon((0 0, 0 1, 1

asp.net - How to add and retrieve rows elements from List in c# -

i using entityframework , in application have defined class in have set properties , values.as there step wise process have declared class list need add rows or properties values @ each step. //i have declared class list below list<processsteps> objsteps = new list<processsteps>(); // step 1 processsteps obj = new processsteps(); obj.id= 1; obj.name= "v2k"; obj.step=1; objsteps.add(obj); // step 2 processsteps obj = new processsteps(); obj.id= 2; obj.name= "vvk"; obj.step=2; objsteps.add(obj); so @ point need access both id 1 , 2 i'm nnot able objsteps because each time objsteps overwrite previous one. , on debugging shows me count 1. you should consider asp.net page life cycle, every time application gets request recreate new instance of class (code behind) doesn't matter if have field on class level, redefined each request. so can preserve state ? there viewstate

database - Grouping Sales Detail Report in Crystal Reports Visual Studio -

Image
hello guys, i'm kinda having hard time generating sales detail report combining 2 database tables. on screenshot lve the table 1: represents sales invoice information, who's customers , cashier on particular transaction. table 2: represents details containing sales invoice how many item or purchases. i've been toying out in crystal reports visual studio no luck. is there on crystal reports don't know how group it? procedure or screen shot helpful. thanks.

css - input padding cutting out text in firefox -

in firefox when use bootstrap form-control input element, if pad input element cuts out text padding inwards rather around text. seems have effect in firefox. jsfiddle demonstrates problem: http://jsfiddle.net/v76xb/ form input html: <input id="name" type="text" class="form-control join-form" placeholder="enter username"> css: .join-form { padding: 24px; /*comment out see effect of padding */ margin: 12px 0px; font-size: 16px; letter-spacing: 0px; font-weight: 300; } this specific can replicate error. i'm half hoping it's browser quirk related me, can't check being i'm working individually , have 1 machine. the bootstrap form-control class gets fixed height default. add height: auto; .join-form selector(to keep flexibility), , change padding original effect, padding: 14px 20px; see here: http://jsfiddle.net/x78bh/

java - would system properties set in one web app contradict another app in the same server? -

if server started property java.awt.headless=true and if set system property in web application context,say "/web_app1" , like system.setproperty("java.awt.headless","false"); and web app context "/web_app2" , if call system.getproperty("java.awt.headless"); would true or false ..? the answer question if web_app2 started while system property of jvm set true still true after web_app1 has executed setproperty method. system properties in scope of process , not leave boundary of jvm. key-value mappings of jvm , it's environment. this article ibm knowledge center explains well. looking @ api system.setproperties might helpful.

Android Studio Layout Screenshot Issue -

can't able take screenshot of layout before in android studio 0.8.0 unexpected error while obtaining screenshot: com.intellij.openapi.actionsystem.anactionevent@4965fc96 can please fix this? your suggestions welcome..

diacritics - SQLCMD batch to generate table contents in a CSV - Format issue -

we trying generate contents of tables sqlcmd in csv file, commas instead of accents. here have tried: 1/ trying change output format -f o:1252 sqlcmd -d environment -u user -p pwd -s; -w -q "select iqid,iqdeleted,... " 1>vctruc.csv -f o:1252 2/ trying change output format 65001 sqlcmd -d environment -u user -p pwd -s; -w -q "select iqid,iqdeleted,... " 1>vctruc.csv -f 65001 3/trying change output format unicode sqlcmd -d environment -u user -p pwd -s; -w -q "select iqid,iqdeleted,... " 1>vctruc.csv -u we get: "priv‚e" instead of "privée" or "f”renings" instead of "förenings" would know how can avoid this? thanks,

Is it possible to change the style of an Android L TimePickerDialog? -

Image
i testing app on android l emulator, , noticed timepickerdialog has changed this: this doesn't fit theme of app, , wanted know if possible old timepickerdialog style when running on android l. you can use timepickerdialog constructor theme parameter specify theme. timepickerdialog(context context, int theme, timepickerdialog.ontimesetlistener callback, int hourofday, int minute, boolean is24hourview)

javascript - Node.js Abort chain in Q in different point -

i have pretty long chain of check in q, , interrupt when error rise: i have looked how abort failing q promise in node.js , other answers on so, seems impossible me, can't exist nothing else. example ` q().then(function(){ return q.ninvoke(myobject, 'save'); }).fail(functon(err){ // if error res.status(400).send(err.message);// duplicate key }).then(function(){ add object object db referenced myobject }).fail(functon(err){ // if error res.status(400).send(err.message);// connection error }).then(function(){ somethinng else }).done() ` obviously, if can't save first object, not go on through other steps, exit without throwing error , blocking execution of server without sending message client. i tried add 2 function done(ok, rejected), ok() called. avoid chunking code in 3 different functions if possible. as far can gather, don't need particularly tricky, understand how success , failure propagate through .then chain, ex

javascript - scrollTop not working when page scrolled half way down -

i developing app iphone , have problem. using scrolltop() navigate top of page when side panel opened. if page scrolled down as side panel can bee seen little bit wont scroll top, when can not see panel scroll top. here html: <div data-role="page" id="home" align="center"> <div data-role="panel" id="popuppanel" data-position="left" ontouchmove="event.preventdefault()" data-display="reveal"> <h3 id="username2" class="blocktext2"></h3> <ul data-role="listview" data-theme="b" style="margin-top:10px;"> <a data-icon="false" data-role="button" data-shadow="false" data-corners="false" data-theme="b" id="seeyourprofile" href="#yourprofile" data-transition="slide" class="contentlink">profile</a>

c++ - Could this templated syntax be improved? -

i have template method: template <class somelhs, class somerhs, resulttype (somelhs::*callback)(somerhs&)> void add() { struct local { static resulttype trampoline(baselhs& lhs, baserhs& rhs) { return (static_cast<somelhs&>(lhs).*callback)(static_cast<somerhs&>(rhs)); } }; _back_end.template add<somelhs,somerhs>(&local::trampoline); } currently i'm calling this: tracker.add<quad, multi, &quad::track>(); tracker.add<quad, singl, &quad::track>(); tracker.add<sext, multi, &sext::track>(); ... it working fine, don't have repeat 2 times name of class somelhs . there way avoid that? for people may have recognized it: yes, related basicfastdispatcher of alexandrescu, in particular i'm writing front end operate member functions. i don't think can't improved particularly, unfortunate i'd love find way this. template type deduction possibl

delphi - Reading Pixels and finding specific RGB -

i load image, , read pixels find rgb, check next pixels across make sure match, , @ right position of bitmap. i know below code wrong, not sure how go correcting it. know pixels not fastest way read pixels. thanks guys! procedure rgb(col: tcolor; var r, g, b: byte); var color: $0..$ffffffff; begin color := colortorgb(col); r := ($000000ff , color); g := ($0000ff00 , color) shr 8; b := ($00ff0000 , color) shr 16; end; procedure tform1.button1click(sender: tobject); var x,y : integer; colorn: tcolor; r, g, b: byte; begin y := 0 image1.picture.bitmap.height -1 begin x := 0 image1.picture.bitmap.width -1 begin inc(i); colorn := image1.canvas.pixels[x, y]; rgb(colorn, r, g, b); //memo1.lines.append('line: '+inttostr(i)+' y: '+inttostr(y)+' x: '+inttostr(x)+' r: '+inttostr(r)+' g: '+inttostr(g)+' b: '+inttostr(b)); if (inttostr(r) = '235') , (inttostr(g) = '235'

java - Getting null while using interface method -

i have created async task background task.in async task class have made interface method finish.it used let me noe background task over.but when ever using interface getting null async class public static class searchjobsasync extends asynctask<string, string, string> { string response; boolean value; context c; finished finished; public searchjobsasync(context c, searchjobsasync.finished finished,boolean value) { this.c = c; this.finished = finished; this.value=value; } public static interface finished { void finish(boolean finish); } searchjobsasync(context c, boolean value) { this.value = value; this.c = c; } @override protected string doinbackground(string... strings) { if (spyears.getselecteditemposition ()

mysql - Select data where have DateTime from some minute ago until now? -

i ask how query select data having datetime minute ago until ? ex : result data 5 minute ago (field: input_time) until .. this query select * operasi timestamp(input_time) <= timestamp(now()) , order input_time desc limit 0,10 you should query as: select * operasi input_time <= now() , input_time >= date_sub(now(), interval 5 minute) order input_time desc limit 0, 10; this structure allow query take advantage of index on input_time . if wrap column in function, less likely.

Error in eclipse with ATG plugin -

Image
i not know caused this, atg plug-in stopped working giving following error. yes, perspective set atg i think atg root directory should correctly set, there no other error in atg development tasks. i noticed 1 thing later 1 of tab(out of 3) of plugin not working rest working fine. enough me now, not worried 1 tab now.

HTTP GET gives 400 bad request (telnet, arduino) -

for school project i'm building small arduino based weather station. station sends data php page (using cc3000) puts mysql database. code have worked few days ago , somehow stopped working now. problem 400 bad request server. code use follows while (!client.connected()){ connect(); } client.fastrprint(f(" ")); client.fastrprint(page); client.fastrprint(f("?sensor=")); client.fastrprint(sensor); client.fastrprint(f("&&unit=")); client.fastrprint(unit); client.fastrprint(f("&&value=")); client.fastrprint(charbuffer); client.fastrprint(f("&&pass=")); client.fastrprint(f(" http/1.1\r\n")); client.fastrprint(f("host: ")); client.fastrprint(server); client.fastrprint(f(":80\r\n")); client.fastrprint(f("\r\n")); client.println(); now of code comes sample functions of adafruit. strange thing when use telnet send same request http 40

html - Table thead and first tbody column stays fixed in scrollable div -

Image
i'm trying make fixed table fields in scrollable div . html part: <div class="scroll"> <table> <thead> <tr> <td>title #1</td> <td class="second">title #2</td> </tr> </thead> <tbody> <tr> <td>name #1</td> <td>description</td> </tr> <tr> <td>name #2</td> <td>description</td> </tr> </tbody> </table> </div> css part: table { width: auto; } table > thead > tr > td { min-width: 100px; max-width: 100px; padding: 10px 20px; border-right: 1px solid #666666; background-color: #cccccc; } table > thead > tr > td.second { min-width: 300px; max-widt