Posts

Showing posts from August, 2013

oracle - Fetch all parents and children with "connect by" query for a particular input in sql -

i have table com_customer_mst, contains customer_id , parent_customer_id, need fetch parents , children particular customer_id input. 1 customer_id have single parent have multiple children. i have run query: select customer_id, customer_code, parent_customer_id sbsa_axia.com_customer_mst start customer_id = 154 connect prior customer_id = parent_customer_id; but giving children. customer_id parent_customer_id 61 12 18 12 111 12 250 12 14 15

ios - Why does navigation bar logo not display in master view -

Image
i'm writing ios 7/8 app , want display logo in center of nav bar. started master/detail project. added code change titleview logo (see following code). logo displays on detail page not on master page (the master page title displayed). i've tried putting code in navigation controller , view controller same result. there else needs set in storyboard or navcontroller code? var logo = uiimage(named: "logo_sm.png") var logoview = uiimageview(image: logo) self.navigationitem.titleview = logoview or in view controller var logo = uiimage(named: "logo_sm.png") var logoview = uiimageview(image: logo) self.navigationcontroller?.navigationitem.titleview = logoview edit found way make work. in uiviewcontroller changed code to: self.navigationitem.titleview = logoview this references view's navigationitem rather navigation controller's navigationitem. the first snippet works fine. think problem didn't add i

mysql - How to set a variable in where clause of Select query in php -

while executing below query i'm not getting sucess value $name=qwe; $result = mysql_query("select *from user name = $name"); instead of above query if put below, can able appropriate ans: $result = mysql_query("select *from user name = 'qwe'"); can give solution first query?? close variable in quote , concatenate string query $name= "qwe"; $result = mysql_query("select *from user name = '".$name."'"); one more note please use mysqli security purposes. thanks

Android - Using SimpleCursorAdapter in AutoCompleteTextView gives CursorIndexOutofBoundsException when user selects 3rd suggestion onwards -

sorry mouthful of title, have cut down because exceeded 150 character limit. i have autocompletetextview (actv) , using simplecursoradapter since normal actv searches user input @ start of each substring (substring separated whitespaces) , not within substrings. example, having list adipose , bad wolf , searching ad show adipose , not bad wolf . made adapter shown below: //create actv here autocompletetextview search = (autocompletetextview) findviewbyid(r.id.actvcataloguesearch); search.setthreshold(1); string[] = { "name" }; int[] = { android.r.id.text1 }; simplecursoradapter cursoradapter = new simplecursoradapter(this, android.r.layout.simple_dropdown_item_1line, null, from, to, 0); cursoradapter.setstringconversioncolumn(1); filterqueryprovider provider = new filterqueryprovider(){ @override public cursor runquery(charsequence constraint) { // todo auto-generated method stub string constrain = (string) constraint;

Locale not set Programatically in Android 5.0 Lollipop -

my application set locale according selected language in application. kitkat code works fine. after update lollipop locale not set. here paste code set locale.. locale locale = new locale("de_de"); locale.setdefault(locale); configuration config = new configuration(); config.locale = locale; getbasecontext().getresources().updateconfiguration(config, null); you have change way of locale initialization. this: locale locale = new locale("de_de"); to this: string language = "de"; string country = "de"; locale locale = new locale(language , country); check out full response here https://stackoverflow.com/a/27490553/2659558 cheers!

How to Display a message box in excel vba when value in a cell exceeds another? -

i need message box appear when value in cell g27 exceeds value in cell k13 . require show cell g27 filled. have tried following macro, not working. private sub worksheet_change(byval target range) if range("g27") > range("k13") msgbox "error" end if end sub any highly appreciated! is trying? ( untested ) understood have code in sheet code area , not module :) private sub worksheet_change(byval target range) on error goto whoa application.enableevents = false if not intersect(target, range("g27")) nothing _ if range("g27").value > range("k13").value msgbox "error" letscontinue: application.enableevents = true exit sub whoa: msgbox err.description resume letscontinue end sub more worksheet_change here

c++ - Precompiled header error -

i have simple program 3 files(excluding precompiled header). have included precompiled header in .cpp files yet giving these 2 errors don't seem understand : 1>d:\practice\operatoroverloading\oopinheritance\oopinheritance\commisionemp.h(4): warning c4627: '#include ': skipped when looking precompiled header use 1> add directive 'stdafx.h' or rebuild precompiled header 1>d:\practice\operatoroverloading\oopinheritance\oopinheritance\commisionemp.h(35): fatal error c1010: unexpected end of file while looking precompiled header. did forget add '#include "stdafx.h"' source? ========== rebuild all: 0 succeeded, 1 failed, 0 skipped ========== here codes: oopinheritance.cpp // oopinheritance.cpp : defines entry point console application. // #include "stdafx.h" #include <iostream> #include <iomanip> #include "commisionemp.h" using namespace

sublimetext3 - PHP build system error in sublime text 3 -

Image
system configuration: ubuntu 14.04 ( 64 bit ) + xampp installed ( /opt/lampp ) + sublime text 3 (build 3065 ) i trying create php build system inside sublime text 3 of this interesting post failed do. please see work , issue far create new build via tools > build system > new build system ... , save as php.sublime-build { "cmd": ["php", "-l", "$file"], "file_regex": "php$", "selector": "source.php", "working_dir": "${project_path:${folder:${file_path}}}" } now when press ctrl + b or f7 on .php file gives below error [errno 2] no such file or directory: 'php' [cmd: ['php', '-l', '/opt/lampp/htdocs/wish/make.php']] [dir: /opt/lampp/htdocs/chrome] [path: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games] [finished] it seems php path issue , added php path in file

java - Swing - Issue with lists not working inside paintComponent method -

i'm trying render positions of multiple fighters onscreen. relevant code follows: public void run() { double ns = 1000000000.0 / tps; double delta = 0; int frames = 0; int updates = 0; long lasttime = system.nanotime(); long timer = system.currenttimemillis(); while (running) { long = system.nanotime(); delta += (now - lasttime) / ns; lasttime = now; while(delta >= 1) { update(); updates++; delta--; } frame.getcontentpane().repaint(); frames++; if(system.currenttimemillis() - timer >= 1000) { timer += 1000; frame.settitle(title + " | " + updates + " ups, " + frames + " fps"); frames = 0; updates = 0; } } stop(); } private void update(

c# - Round robin pub/sub with StackExchange.Redis -

i know redis not natively support round-robin distribution of messages clients. i'm wondering if there can achieve stackexchange.redis? in other words: wan't published messages channel evenly distributed among subscribing clients. i guess poll blocking list pop? or better subscribe channel(for blocking) , right pop work list? thanks, bj se.redis does not support blocking pops . if need genuine round-robin, suggest doing @ client rotating channel-name/key-name between known clients. if need people work when ready, polling pop pub/sub immediacy works well.

c# - Could not load file or assembly 'System.Web.Http.WebHost' -

after deploying mvc webpage iis following error: could not load file or assembly 'system.web.http.webhost, version=4.0.0.0, culture=neutral, publickeytoken=31bf3856ad364e35' or 1 of dependencies. system cannot find file specified. i've done following changes prevent issue: set copy local = true webhost added webapi 2.2 nuget the system.web.http.webhost exist bin folder my web.config has following dependentassembly: code: <dependentassembly> <assemblyidentity name="system.web.http.webhost" publickeytoken="31bf3856ad364e35" culture="neutral" /> <bindingredirect oldversion="0.0.0.0-5.1.0.0" newversion="5.1.0.0" /> </dependentassembly> i still error, doing wrong? you may need check web config in "views" folder if have 1 make sure has proper binding redirect have in main web config.

vb.net - How to check for empty file in the folder? -

i have code updates sql database using files in folder , delete them after update giving me exception whenever blank file found in folder. gives error " object reference not set instance of object" . want before processing each file need check each file if blank delete otherwise process it. code : any appreciated. dim dirinfo5 directoryinfo dim allfiles5() fileinfo dirinfo5 = new directoryinfo("e:\update\") allfiles5 = dirinfo5.getfiles("*.csv") thread.sleep(1000) if allfiles5.length <> 0 try each fl5 fileinfo in allfiles5 'msgbox(fl.fullname.tostring()) dim con sqlconnection = new sqlconnection(sql_con2) dim sr streamreader = new streamreader(fl5.fullname) dim line string = sr.readline dim value() string = line.split(microsoft.visualbasic.chrw(44)) dim

error handling - Python try / except issue with SMTPLib -

i've written simple smtp client using python's smtplib. trying add error handling - in instance, when target server connect unavailable (eg, wrong ip specified!) currently, traceback looks this: traceback (most recent call last): file "<stdin>", line 1, in <module> file "smtplib_client.py", line 91, in runclient try: file "/usr/local/lib/python2.7/smtplib.py", line 251, in __init__ (code, msg) = self.connect(host, port) file "/usr/local/lib/python2.7/smtplib.py", line 311, in connect self.sock = self._get_socket(host, port, self.timeout) file "/usr/local/lib/python2.7/smtplib.py", line 286, in _get_socket return socket.create_connection((host, port), timeout) file "/usr/local/lib/python2.7/socket.py", line 571, in create_connection raise err socket.error: [errno 111] connection refused so clearly, it's "create_connection" in socket.py going bang. has i

How to set Windows environment variable from Tcl script -

i have tcl script generates value store in windows environment variable. know cannot done directly within script. what planning output value stderr: puts stderr $var how use stderr channel set environment variable in calling batch file? is there more convenient way set environment variable tcl script? the easiest way use tcl script write batch file known name contains environment variable setting, env.bat : set f [open env.bat w] puts $f "set foo=bar" close $f then can make real batch file call environment variable definition it: call env.bat this method going easiest make work in way non-surprising. it's going pretty easy debug, since can @ env.bat in text editor , figure out if things in sensible. (i'm assuming run in same directory , code has permission write there; that's definitely easiest way it. it's possible write temporary file somewhere else , pass name around, that's rather more complex make function correctly.)

css - Parent menu item hover while hovering submenu -

i have site http://jointviews.com/ header menu. header menu items , digital marketing has submenus under each. when hover dropdown submenu item parent menu background changing default one. should in hover position because here in submenus of particular menu item. i tried giving li.current-menu-ancestor { color: #fff; background: #f29919; } but didn't work please help. thanks. edit: code <ul id="menu-main" class="menu"><li id="menu-item-24" class="menu-item menu-item-type-custom menu-item-object-custom current-menu-item current_page_item menu-item-home menu-item-24"><a href="http://jointviews.com/">home</a></li> <li id="menu-item-25" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-has-children menu-item-25"><a href="http://jointviews.com/about-us/">about us</a> <ul class="sub-menu"> <li id=&q

selenium webdriver - How to create multiple excel files in Java -

i trying below code intended create 2 excel files @ @afterclass. string strtablepathr2 = "--path--"; string filename2 = strtablepathr2 + "results-1" + functions.getdateandhour() + ".xls"; hssfworkbook wb = new hssfworkbook(); hssfsheet sheet = wb.createsheet("new sheet"); hssfrow row = sheet.createrow((int)0); row.createcell((int)0).setcellvalue("helloworld"); fileoutputstream fileout = new fileoutputstream(filename2); wb.write(fileout); fileout.flush(); fileout.close(); //---------------------------------------------- string filename3 = strtablepathr2 + "results-2" + commonfunctions.getdateandhour() + ".xls"; hssfworkbook wb1 = new hssfworkbook(); hssfsheet sheet1 = wb.createsheet("new sheet1"); hssfrow row1 = sheet1.createrow((int)0); row1.createcell((int)0).setcellvalue("helloworld1"); fileoutputstream fil

android - How to put swipe tab views inside one of navigation drawer option -

updated code: @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { view rootview = inflater.inflate(r.layout.fragment_home, container, false); viewpager = (viewpager)view.findviewbyid(r.id.base_pager); fragmentmanager manager = getchildfragmentmanager(); viewpager.setadapter(new myfragmentpageradapter(manager)); return rootview; } class homefragment extends fragmentpageradapter { public homefragment(fragmentmanager fm) { super(fm); // todo auto-generated constructor stub } @override public android.support.v4.app.fragment getitem(int item) { // todo auto-generated method stub android.support.v4.app.fragment fragment = null; if (item == 0) { //mapfragment.message("map"); fragment = new mapfragment(); } else if (item == 1) { //savedlocationsfragment.message("locations");

qt - Why does editing in QTreeView get initiated by other triggers than the one I have enabled? -

i have enabled selectedclicked edit trigger in qtreeview , item editing (via edit method) still getting triggered other reasons (e.g., currentchanged ). why other triggers active? see program below example, when clicking tree items should see editing gets triggered several different reasons: from pyqt5.qtcore import * pyqt5.qtwidgets import * pyqt5.qtgui import * class treeview(qtreeview): def __init__(self): super().__init__() self.setedittriggers(self.selectedclicked) self.__model = qstandarditemmodel() self.__model.appendrow([qstandarditem('item 1')]) self.__model.appendrow([qstandarditem('item 2')]) self.setmodel(self.__model) def edit(self, index, trigger, event): print('edit index {},{}, trigger: {}'.format(index.row(), index.column(), trigger)) return false app = qapplication([]) w = treeview() w.show() app.exec_() edit called, whatever edittrigger use. howeve

php - Yii2 autoload Youtube API -

i trying include youtube api in controller. have unzipped google youtube api in path app\components\google now should include google youtube api files. when create object of google_client says google_client class not found . know file not including when try include via require(yii::$app->basepath.'/components/google/client.php) again same error comes class not found idea ? i've found way use it, added repository url in composer.json . "repositories": [ { "url": "https://github.com/google/google-api-php-client.git", "type": "git" } ], after ran command of composer update , composers copies repo in vendor folder. can use use \google\client namespace use it.

javascript - get $.height() of an Element with Images in it when Image maybe not loaded yet -

i insert html code after ajax call , in ajax-callback need height of added div. problem is, in html ajax call elements images , other elements have laoded first. i did simple example of problem in jsfiddle: http://jsfiddle.net/qbwd663s/3/ can see when add code console says 36, if click div says 242 (cause image loaded). works if image allready in cache, test reload page cleared cache. what need $(document).ready() elements got called ajax. have idea how that? $("div *").one("load", function() { alert($("div").height()); }); fiddle: http://jsfiddle.net/aravi_vel/qbwd663s/6/ use load function suggested harry this function handle other kind of elements have listed (iframe etc.)

ibm mobilefirst - Worklight JsonStore Error When Using FireFox Developer Edition -

i'm developing mobile web app using eclipse / worklight v6.2. app uses local json store data storage. when run app using firefox v33.1 , clear json store function within app works expected. however, if use firefox developer edition v35.0a2 when invoke same function, local json store not cleared , following error: "main :: localstoreclear :: attempting destroy json store..." uncaught exception: typeerror: meta null @ (compiled_code):1751" worklight.js:4886 wl.logger</__log() worklight.js:4886 wl.logger</</public_api[priority]() worklight.js:5240 wl.logger</window.onerror() worklight.js:5202 typeerror: meta null jsonstore.js:1751 this function within app calling: /** * destroy local json store , reinitialise */ function localstoreclear() { wl.logger.info("main :: localstoreclear :: attempting destroy json store..."); wl.jsonstore.destroy() .then(function() { wl.logger.info(&quo

Better way of defining similar variables at once (Python 2.7) -

i'm solving problem requires me convert each alphabet of 9 letter string variable. this current code number = input("enter nine-digit number here \n") string = str(number) d1 = string[0] d2 = string[1] d3 = string[2] d4 = string[3] d5 = string[4] d6 = string[5] d7 = string[6] d8 = string[7] d9 = string[8] is there better way of defining of these variables? it felt there should couldn't think of how. since string sequence can perform sequence unpacking on it'll still force use several variables. a = str(1234) b,c,d,e = >> b >> '1' >> c >> '2' and forth.

python gtk - How to define the size of gtk.textview? -

Image
i have constructed texview this: #textview self.fd = gtk.scrolledwindow() tableau2.attach(self.fd, 0, 2, 0, 4, xpadding=10, ypadding=5) self.fd.set_policy(gtk.policy_automatic, gtk.policy_automatic) self.textview = gtk.textview() self.textview.set_editable(false) self.textview.set_wrap_mode(gtk.wrap_word) self.textview.set_cursor_visible(true) self.textview.set_justification(gtk.justify_left) self.buffertexte = self.textview.get_buffer() self.edition = self.textview.get_editable() self.iterdebut = self.buffertexte.get_end_iter() self.buffertexte.set_text("") self.fd.add(self.textview) self.fd.show() self.textview.show() but height little in unity3d: how modify size? thanks you can call set_size_request on textview: self.textview.set_size_request(-1, desired_min_height)

How to set session variable in jsp -

edit file web.xml session timeout value <session-config> <session-timeout> 30 </session-timeout> </session-config> to set variable in session , need not edit web.xml httpsession session = request.getsession(); string al="am session variable" session.setattribute("al", al); and access , can ${sessionscope.al} read how store java objects in httpsession?

python - Running parallel iterations -

i trying run sort of simulations there fixed parameters need iterate on , find out combinations has least cost.i using python multiprocessing purpose time consumed high.is there wrong implementation?or there better solution.thanks in advance import multiprocessing class iters(object): #parameters iterations iters['cwm']={'min':100,'max':130,'step':5} iters['fx']={'min':1.45,'max':1.45,'step':0.01} iters['lvt']={'min':106,'max':110,'step':1} iters['lvw']={'min':9.2,'max':10,'step':0.1} iters['lvk']={'min':3.3,'max':4.3,'step':0.1} iters['hvw']={'min':1,'max':2,'step':0.1} iters['lvh']={'min':6,'max':7,'step':1} def run_mp(self): mps=[] m=multiprocessing.mana

Cannot understand how to convert integer to IP in Android and Java -

i building small application android phone. background in not on computer science familiar c/c++ , development concepts. trying display ip address of phone. , according android references used getipaddress() method returns integer. then looking in stackoverflow saw solution posted here: android ip address java posted paul ferguson , copying here: string ipstring = string.format( "%d.%d.%d.%d", (ip & 0xff), (ip >> 8 & 0xff), (ip >> 16 & 0xff), (ip >> 24 & 0xff)); the ip variable of type int contains ip address. can please explain me how works? note java skills quite introductory. thanks comments @joop eggen lets have ip address integer of -926414400 here how code works: ip fileds <1> . <2> . <3> . <4> done using bitwise (and) operation means operations made vertically bit bit field <1> ipint = 11001000 11001000 00001001 11000000 0xff = 00000000 00000000 00000000 11111111 -

javascript - Disable submit button if dijit.form.DateTextBox is invalid -

when user types input in dojotype="dijit.form.datetextbox" "abcd" shows value entered not valid.but allowing user submit form without issues. wanna disable submit button if invalidmessage attribute of datetextbox shown up. i m trying implement function using below code; still m not able acheive functionality datatextbox.on not triggering.i m new dojo.kindly me on this. function validatesubmit(){ alert('validate'); var datetextbox = dijit.byid("fromdeddate").get('value'); alert('datetextbox value '+datetextbox); var datetextboxid = dijit.byid("fromdeddate"); alert('datetextbox id '+datetextboxid); var submitbutton = document.getelementbyid('search'); alert('submitbutton '+submitbutton); datetextbox.on('change', function(e){ var result = datetextbox.validate(); alert('result'); }

c# - Certificate issue using WCF with SSL -

i'm trying connect service 3rd party company publishing. authentication part, use 2 certificates, 1 public key , 1 private key. i've made console application test certificates in differente stores, following possibilities: location: current user; store: personal location: local machine; store: personal (installed admin user. don't have admin permissions) it working until i've changed computer week. i've tested on other machines , it's working on both configurations. mine works when try 'current user location'. why? application needs use 'local machine location'. the possibility can think kind of permission. i'm not finding clue on web. similar links bindings, wrong certificates, overriding servicecallback, etc. someone knows if permission needed use certificate localmachine? obs: application can find certificate, when uses got following error: could not establish trust relationship ssl/tls secure channel authority 'na

python - subprocess.Popen() read a file -

i'm trying use subprocess read file stored in remote server. import subprocess import sys ssh = subprocess.popen(['ssh', 'hjh:passwd@myserver', 'cat', 'data/test.txt'], shell=false, stdout=subprocess.pipe, stderr=subprocess.pipe) result = ssh.stdout.readlines() if result == []: error = ssh.stderr.readlines() print >>sys.stderr, "error: %s" % error else: print result now running results in error traceback (most recent call last): file "c:/users/hjh/desktop/try.py", line 15, in <module> stderr=subprocess.pipe) file "c:\python27\lib\subprocess.py", line 710, in __init__ errread, errwrite) file "c:\python27\lib\subprocess.py", line 958, in _execute_child startupinfo) windowserror: [error 2] system cannot find file specified does error mean file on server cannot found? or there error in subprocess? google wasn't o

r - Allocate rows to columns from different data frames (lapply operations) -

i know how can allocate given row of data frame given column of data frame without merging, aggregating, etc. example, making row 1 of df1 associated column 1 of df 2, operations carried on column 1 of df 2 take values row 1 of df 1. let´s create df1 (i.e. v) , df2 (i.e. m): v<-data.frame(a=c(2,1),b=c(4,2),c=c(6,3)) m<-data.frame(v1=rep(1,10),v2=rep(2,10)) #> v b c v1 2 4 6 v2 1 2 3 #> m v1 v2 1 1 2 2 1 2 3 1 2 4 1 2 5 1 2 6 1 2 7 1 2 8 1 2 9 1 2 10 1 2 and let´s create list of functions pass on m taking values v funs<-list( f1<-function(x,a,b,c) a*x+b*x+c*x, f2<-function(x,a,b,c) a*x-b*x-c*x ) now want pass list of function on m, (but "ideally" i'd use values stored in row 1 column 1 , ones in row 2 column 2, , unfortunately haven´t found how. res1<-list(data.frame(matrix(,10,2)),data.frame(matrix(,10,2))) for(i in seq_along(v[,1])){ res1[[i]]<-lapply(funs,function(f) f(m,v[i,1],v[i,2],v[i,3

ios - Swift Spritekit Scrolling Background -

i trying find best method vertically scrolling background in swift, without using update method. background 1 image should loop infinite. image should in middle of screen (full-size), moving down, , on top of image should image spawned. however, mine doesn't work quite right, spawns 2 images, , after delay pop , start actions again. also, breaks down 30 fps 26, want avoid. hope somebody, more swift can me. let background = sktexture(imagenamed: "background.png") background.filteringmode = .nearest let backgroundmove = skaction.movebyx(0, y: -self.frame.size.height, duration: 10) let backgroundreset = skaction.movebyx(0, y: self.frame.size.height, duration: 0.0) let backgroundmoveandresetforever = skaction.repeatactionforever(skaction.sequence([backgroundmove,backgroundreset])) var i:cgfloat = 0; < 2.0 + self.frame.size.height / (background.size().height * 2); ++i { let sprite = skspritenode(texture: background) sprite.size

To simplify MySQL query? -

i have 3 table in mysql db follow `users(id_user - 99911, username - heman, status - manager) service(id_service - 11, service_name - blabla) auth_service(id_user - 99911, id_service - 11) all these 3 table not relational. want in php code. have tried queries display services authorised user manager. select s.service_name service s inner join auth_service on s.id_service = a.id_service inner join users u on a.id_user = 99911 order s.service_name , u.status='manager'; but displays multiple times of same records has been sorted. problem? how avoid repeated display of same records? the following query give services authorized users manager. select distinct s.service_name, a.id_user service s inner join auth_service on s.id_service = a.id_service a.id_user in (select id_user users status = 'manager') order s.service_name

android - sharing user's location with other users -

in app have map should contain connected users. every time user connects app draw marker represents user. problem every user can see himself on map need find way share users current location in order draw on every phone connected users. ideas? thanks, nirel. use baas-provider storing locations of connected users - every user connect cloud-base , retrieve locations of other users. instance use enter link description here or enter link description here have special classes store location data

excel - Why do some methods/properties require a certain sheet to be active while others do not? -

why of of methods , properties use in vba require sheet active while others not? the following example works no matter if wks active or not: wks.range("a1").value = 1 the following example works if wks active otherwise error thrown: wks.range("a1:a70").insert edit: thought had insert function judging gary's students answer did not. exact code triggered me ask question is: 'cut range source row dim lsourcerow long dim lsourcestartcolumn long dim lsourceendcolumn long lsourcerow = t.row lsourcestartcolumn = losource.range.column lsourceendcolumn = losource.range.column + losource.listcolumns.count - 1 wkssource.range(wkssource.cells(lsourcerow, lsourcestartcolumn), wkssource.cells(lsourcerow, lsourceendcolumn)).cut 'select target worksheet insert method wkstarget.activate 'insert range target row dim ltargetrow long dim ltargetstartcolumn long dim ltargetendcolumn long ltargetrow = lotarget.databodyrange.row + lotarget.listrows.count

html - Rails - turn off autocomplete for text_field and password -

i give up. have remembered password , login phpmyadmin on www.xxx.com/phpmyadmin like: root asdfasfsdfs then on aplication on www.xxx.com/model/new , have <%= form_for @model |f| %> <%= f.text_field :city, :placeholder => 'write city' %> <%= f.password_field :password, :placeholder =>'set password' %> <% end %> why browser put in text_field city "root" , in password - password root of phpmyadmin? how can remove autocomplete of fields? try: autocomplete => 'off' autofocus => false :value => '' $('#field').val('') nothings work... peoples not see placeholder text, because fields filled ... answer: ok, make jquery, this: $(window).load(function(){ $('.div_class input').val('') }); so fields filled after load done jquery clear them. just change syntax little. worked me :autocomplete => :off <%= f.text_field :city, :place

android - How to pass information to an anonymous class in java ? -

i have following code : @override public void onreceive(context arg0, intent arg1) { string blabla = "blabla"; handler connectionstatushandler = new handler() { @override public void handlemessage(message msg) { //do blabla; } }; } unfortunatly doesn't work because of way java handles closures, can't make blabla final. so thought maybe can this @override public void onreceive(context arg0, intent arg1) { string blabla = "blabla"; handler connectionstatushandler = new handler() { @override public void handlemessage(message msg) { //do localblabla; } public string localblabla; }; connectionstatushandler.localblabla = blabla; } but doesn't work because handler doesn't have member called localblabla . technically can create not anonymous class inherits handler , add there members want, before wonder

javascript - jQuery overall index from parent element with specific class -

how can use jquery index() method find index of parent element class related whole document click on link inside element? the following code not work , returns -1 , know index of div element class "navi" in document... javascript $('.navi').on('click', 'a.link', function(event) { var parent = $(this).closest('.navi'); var index = $(document).index(parent); console.log(index); return false; }); html <html> ... <body> ... <div class="navi"> ... <div class="anotherdiv"> ... <a href="#" class="link"></a> ... </div> ... </div> ... <div class="navi">...</div> ... </body> <html/> try this: $('.navi').on('click', 'a.link', function(event) { var parent = $(this).closest('.navi'); var index = $('.navi').index(parent[0])

solr - How to find documents where value exist in one field (product) but not in the other (companyName)... -

...and show companyname documents returned. current example of search performed: product:toys , not companyname:toys what expect list of documents contain term "toys" in product field not in companyname field. @ point believe happening returned results not contain companyname. using wrong syntax? current results: companyname: {} product: children toys companyname: {} product: toys expected results: companyname: xyz ltd. product: children toys companyname: abc ltd. product: toys solr fields must stored values returned in results.

How to change an images size in c++, SDL -

how can change images size in code below: const int xhome = 10, yhome = 10; const int whome = 50, hhome = 50; . . . sdl_surface* image = sdl_loadbmp(address); sdl_rect destrect; destrect.x = whome * x; destrect.y = hhome * y; destrect.w = whome; destrect.h = hhome; sdl_blitsurface(image, null, mainscreen, &destrect); sdl_freesurface(image); when put image in mainscreen sdl_surface , it's bigger 50*50. possible resize image ? thank you. this happens when set whome , hhome, 50*50. since have 5 reputation, can't post images. see image please click here . but when set them original images size, see: here according sdl_blitsurface documentation: only position used in dstrect (the width , height ignored). i highly recommend switching sdl 2 many reasons (hardware acceleration being big one); task become trivial texture , sdl_rendercopy . if you're somehow stuck using sdl 1, can either scaling surfaces manually, or use library sdl_gfx ,

java - Adding item to the quizQuestion ArrayList -

hey guys have method public void addquestion(question question) { } i have created arraylist in class section private arraylist<question> quizquestion; and have initialised arraylist in constructor typing quizquestion = new arraylist<question>(); what type in method above can add questions question arraylist . :) public void addquestion(question question) { quizquestion.add(question); }

c++ - How do I compile RHEL5 compatible shared library from RHEL6 machine with GCC 4.4.6? -

note: i'am c# windows developer entering c++/linux world. i have boost based cross platform c++ code need compile shared library for: windows rhel6 rhel5 and solaris i have windows , rhel6 machines , have built those. solaris build not important. according this: can use shared library compiled on ubuntu on redhat linux machine? my rhel6 compiled shared library won't run on rhel5, because following command: readelf -s /path/to/your/library.so | egrep 'glibc_2.([6-9]|10)' returns glibc2.7 dependency: 143: 00000000 0 func global default und eventfd@glibc_2.7 (14) 9069: 00000000 0 func global default und eventfd@@glibc_2.7 i wondering if there way build rhel5 through rhel6 machine? or other proposal do. thanks. you can link shared library -wl,-rpath,'$origin' , provide required libraries in same directory. however, if there in library headers use types c++ standard library, asking troubles. users of li

java - Wicket IRequestCycleListener getting feedback messages -

is possible implement listener using irequestcyclelistener added in application init() method or anywhere else, , job fetching feedback messages appication(for specific page , componenets). don't know , how can information, in method write code (maybe onrequesthandlerresolved)? or not possible @ all? thanks in advance

ios8 - Unable to see UIImage once stored and sent to Server form CoreData? -

the first part of code camera button pressed not before checking if textfield has been filled, checks camera type. normal here me thinks.once picture has been taken resize image of smaller size convert nsstring nsstring data stored in coredata , sent off server shown on screen. //this camera press button -(ibaction)takepicture:(uibutton*)sender{ if (printedname.text.length ==0){ uialertview*alert=[[uialertview alloc]initwithtitle: @"please enter name"message:@""delegate:self cancelbuttontitle:@"dismiss"otherbuttontitles:nil];[alertshow];return; } uiimagepickercontroller *picturetaker = [[uiimagepickercontroller alloc] init]; picturetaker.delegate = self; if ([uiimagepickercontroller issourcetypeavailable: uiimagepickercontrollersourcetypecamera]) { picturetaker.sourcetype = uiimagepickercontrollersourcetypecamera; } else if([uiimagepickercontroller issourcetypeavailable: uiimagepickercontrollersourcetypesave

What is the simplest and/or best way to send data between routes in node.js express? -

my setup this: i data omdb using omdb lib github, whole parts looks this: router.post('/search', function(req, res) { var omdb = require('omdb'); var title = req.body.title; omdb.get( {title: title}, true, function(err, movie){ if(err) { return console.log(err); } if(!movie) { return console.log('no movie found'); } //console.log('%s (%d)', movie.title, movie.year); result = movie.title+movie.year+movie.poster; console.log(result); res.redirect('/result'); }) }); and want use result post request in route: router.get('/result', function(req, res) { res.render('result', { title: title}); }); what best , simplest approach this, consider node.js noob.. :) assuming you're using express.js, use session middleware: router.post('/search', function(req, res) { var omdb = require(

c# - Unique pair collection -

i want store 2 strings in collection combination should unique eg '1','2' '2','1' '1','2' -> not allowed '2','3' which collection should use if want both strings keys? use hashset of keyvaluepair<string, string> . for example: hashset<keyvaluepair<string, string>> set = new hashset<keyvaluepair<string, string>>(); set.add(new keyvaluepair<string, string>("1", "2")); set.add(new keyvaluepair<string, string>("1", "2")); this produce 1 entry in set. for reference: keyvaluepair class hashset class

java - Creating a sqlite-file within appengine -

im struggeling gae filesystem restrictions. creating tool can export datastructur lot of different output-files (json, xml...) 1 of them sqlite-database-file. have ideas how can done in restricted environment? i tried creating inmemory database without success: drivermanager.getconnection("jdbc:sqlite::memory:"); i tried use file-storage bucket: drivermanager.getconnection("jdbc:sqlite:gs://"+bucketnameü+"/sqllite"); neither of them worked. i'm afraid not possible @ :( dont want start compute engine instance in order create sqllite file. are there other frameworks out there possible create database file on fly. here whole code: connection c = null; try { class.forname("org.sqlite.jdbc"); c = drivermanager.getconnection("jdbc:sqlite:gs://"+bucketnameü+"/sqllite"); statement statement = c.createstatement(); statement.setqueryt