Posts

Showing posts from February, 2010

seo - How can I keep my doctype with htmlunit + the page.asXml method -

when run page.asxml() htmlunit lose page's doctype. there work around? note: intent serve dom google. try calling p.getwebresponse().getcontentasstring() instead of p.asxml() i tried against http://google.com , , in former case "<!doctype html>" remained in output.

osx - How do I search for all my git repositories on my Mac? -

i'm curious i've scattered git repositories across mac. i'm trying figure out how search find them can organize life bit. how can this? find friend. .git folder exist in each of repositories finding location of them give repos. find /users/username -name ".git" -print

java - How do I pass a primitive data type by reference? -

how can pass primitive type reference in java? instance, how make int passed method modifiable? there isn't way pass primitive directly reference in java. a workaround instead pass reference instance of wrapper class, contains primitive member field. such wrapper class extremely simple write yourself: public class intref { public int value; } but how pre-built wrapper classes, don't have write our own? ok: the apache commons-lang mutable* classes: advantages : performance single threaded use. completeness. disadvantages : introduces third-party library dependency. no built-in concurrency controls. representative classes : mutableboolean , mutablebyte , mutabledouble , mutablefloat , mutableint , mutablelong , mutableobject , mutableshort . the java.util.concurrent.atomic atomic* classes: advantages : part of standard java (1.5+) api. built-in concurrency controls. disadvantages : small performance hit when used in single-threaded setting.

c# - Windows Forms TabIndex not following the Indexes -

i have windows forms application , on 1 of forms there tabcontrol , inside 1 of tabs have multiple textboxes each of them having tabindex set values 1->9. when form loaded, 1 of textboxes (with tabindex 5) given focus , textbox tabindex 6 disabled. when user fills out first field , hits tab focus not go next textbox instead goes save button outside tabcontrol , has tabindex of 13. can't figure out why textbox (with index 7 below , left of 1 index 5) doesn't focus. when have form in design mode, in 'view' menu, there option 'tab order' allows set tab order clicking on controls in sequence like. helps in visualising tab order controls in other containers (like controls in panel). this way can not see if controls have right order if thet have right parent (container) too. vijay

iphone - Creating an array from a text file read from a URL -

i reading text file url , want parse contents of file array. below snippet of code using. want able place each line of text next row of array. there way identify carriage return/line feed during or after text has been retrieved? nsurl *url = [nsurl urlwithstring:ktexturl]; textview.text = [nsstring stringwithcontentsofurl:url encoding:nsutf8stringencoding error:nil]; when separating newline characters it's best use following procedure: nscharacterset *newlines = [nscharacterset newlinecharacterset]; nsarray *linecomponents = [textfile componentsseparatedbycharactersinset:newlines]; this ensures lines separated either cr, cr+lf, or nel.

C# Remove URL from String -

this seems easy 1 try doesn't seem work say have following string: string mystring = "http://www.mysite.com/folder/file.jpg"; how can process remove url , leave "file.jpg" string value? thanks! kris you can use system.io.path methods string mystring = "http://www.mysite.com/folder/file.jpg"; string filename = path.getfilename(mystring); // file.jpg if want process more complex uris can pass thought system.uri type , grab absolutepath string mystring = "http://www.mysite.com/folder/file.jpg?test=1"; uri uri = new uri(mystring); string file = path.getfilename(uri.absolutepath);

WCF transactions -

i imagine following wcf service usage: (of cash acceptor) service consumer 1 service consumer 2 cashacceptorservice.begintransaction(); cashacceptorservice.stopdevice(); //this should throw exception: device locked / used in transaction cashacceptorservice.acceptmoney(); cashacceptorservice.endtransaction(); service consumer 1 , 2 use same wcf single instance. wonder if functionality implemented. wcf transactions offer this? how see done? if following true: the service interacting transactional object (eg database) the service has transaction flow enabled then wcf indeed offer this. the client can use transactionscope class. transactions initiated on client flow through service automatically. using(transactionscope transactionscope = new transactionscope()) { // stuff service here cashacceptorservice.acceptmoney(); //

mysql - Subqueries in Doctrine for Having field -

i dealing several bus routes. want fetch 2 points closest departure , destination points. : $q = doctrine_query::create() ->select('r.*') //d1 , d2 distance between p1 , p2 points , dest , depa points. ->addselect("(6371 * acos(sin(radians($depa_lat)) * sin(radians(p1.lat)) + cos(radians($depa_lat)) * cos(radians(p1.lat)) * cos(radians(p1.lng) - radians($depa_lng)))) d1") ->addselect("(6371 * acos(sin(radians($dest_lat)) * sin(radians(p2.lat)) + cos(radians($dest_lat)) * cos(radians(p2.lat)) * cos(radians(p2.lng) - radians($dest_lng)))) d2") ->from('route r') ->innerjoin('r.points p1') ->innerjoin('r.points p2') //this select points close enough depa , dest point ->andwhere('p1.lat >= ?',$depa_lat - $eps_lat) ->andwhere('p1.lat <= ?',$depa_lat + $eps_lat) ->andwhere('p1.lng >= ?',$depa_lng - $eps

Scripting Linux to install several programs at once -

i've been installing step step video conversion codec , tools few hours now, , plan annoying. possible design script load in linux commands in sequence 1 after another? absolutely. create plain text file, put #! /bin/bash @ top, write commands in file. save it, "chmod +x yourfile", run calling ./yourfile. if installs more intricate, i'd need see example more how shell script.

Change value of a variable in JSP -

i new jsp , learned create variable this <%string abc="1"; %> if want change value of abc used <%= abc = "2" %> //is right way?? but value shown on jsp page how make not show in jsp page. the short answer question remove = . <%= %> evaluates , prints contents. between <% %> standard java code. so, want <% string abc = "1"; %> ....some stuff.... <% abc = "2"; %>

Wrapper class for WIA/TWAIN for a C# application? -

is there wrapper class somewhere wia/twain functionality in c# application? every search make points same old 2001 codeproject page, there has new out there, right? maybe i'm not looking in right place. :p i need simple, like: image myimage = wiawrapper.getimagefromscanner(); done , done. any guidance? twaindotnet i've wrapped code thomas scheidegger's article ( codeproject: .net twain image scanning ) github project . i've cleaned api bit, added wpf support , several people have added other improvements. i've tried keep api simple still bit more complicated you've got there. also question has other options: .net scanning api

titanium - how begin with appcelerator for desktop (and use the API's) -

i've bit experience qt+ , creating not complex web pages, don't know how begin titanium...when run default app work...i can change index.html web page...i can include javascript code , jquery too...very nice...but when try run api functions don't know how include these...all examples talk iphone , app.js file...i'm trying make desktop app , don't appear .js...i can create these don't work ...in docs read things these: var win = ti.ui.createwindow(); var view = ti.ui.createview({backgroundcolor:"red"}); win.add(view); win.open(); i don't know i've put code...i try put inside javascript inside html (bad practice!) don't work...i put inside function onload don't work neither.....there "convention" names files work?...i think create dynamic web page don't know how work api....i see example "kitchen something" wasn't clear mee...i see examples this: http://mobile.tutsplus.com/tutorials/appcelerator/appce

http status code 404 - Httpwebrequest retrieve large data from Exchange public folder -

i having trouble retrieving data larger 200mb exchange public folder: return "http error 500 internal server error", tried change timeout , size limit in iis , exchange server still not working. have ideas? here code: using system; using system.collections.generic; using system.linq; using system.text; using system.net; using system.io; namespace httpgetitem { class program { static void main(string[] args) { string url = "https://pdc/public/-flaturlspace-/5526a9cc936bd54d93ee89bab89f8ff4-36249d11180/5526a9cc936bd54d93ee89bab89f8ff4-3e1f32ef73e"; int timeout = 3600000 * 2; string = httppost.getresponseasstring(url, timeout); } } public class httppost { static public string getresponseasstring(string url, int timeout) { // httpwebrequest webrequest = (httpwebrequest)system.net.webrequest.create(url); httpwebrequest webrequest = (system.net.httpwebrequest)httpwebrequest.create(url); if (url.to

javascript - document.elementFromPoint returning null on IE -

i using document.elementfrompoint getting selected element dragging it. returns null. when debug same , re run same code, object returned. following code: function getzonefrompoint(x, y, prtdrag, elemibeam,evnt) { if (x == null || y == null || prtdrag == null || elemibeam == null) alert("null in getzone"); var prtdragzindexold = prtdrag.style.zindex; var elemibeamzindexold = elemibeam.style.zindex; prtdrag.style.zindex = -1; elemibeam.style.zindex = -1; var zone; zone = document.elementfrompoint(x, y); prtdrag.style.zindex = prtdragzindexold; elemibeam.style.zindex = elemibeamzindexold; if (zone == null) { zone = document.elementfrompoint(x, y); if (zone == null) { debugger; zone = event.rangeparent; } } if (zone == null) { alert('null'); return null; } if (x < 0 || x > document.body.clientwidth || y < 0 || y > docum

database - SQL server scalability question -

we trying build application have store billions of records. 1 trillion+ a single record contain text data , meta data text document. pl me understand storage limitations. can databse sql or oracle support data or have other filesystem based solution ? options ? since central server has handle incoming load many clients, how parallel insertions , search scale ? how distribute data on multiple databases or tables ? little green database specifics such scaled environment. initally fill database insert load high, later database grows, search load increase , inserts reduce. the total size of data cross 1000 tb. thanks. 1 trillion+ a single record contain text data , meta data text document. pl me understand storage limitations i hope have big budget hardware. big in "millions". a trillion documents, @ 1024 bytes total storage per document (very unlikely realistic when text) size of 950 terabyte of data. storage limitations means tal

c++ - How to pass display output to serial port under Linux? -

Image
we have 2 computer. fist computer's operating system linux( version( not important me) ) , operating system windows( version, don't care). connected via 9 pin serial port. i want know how can change linux's default display output serial port instead of it's own monitor. want view linux outputs( first word of boot time ) via hyper terminal in windows xp. btw it's research future uses ! know there no easy solution doing this. maybe should compile linux again ! don't know. please give me suggestions. it's feasible. easiest way put "getty" process on serial terminal, done editing /etc/inittab (there examples in there) , see login prompt via serial terminal , use (command-line) programs normally. historically, unix machines did primary way of working. another option use "serial console", involves passing boot-time parameters kernel; required if want see startup messages on serial port. edit: on newer linux distribution

java - Is += more efficient than concat? -

this question has answer here: string concatenation: concat() vs “+” operator 10 answers i've been reading code produced other developers on team, seem favor using += string concatenation, whereas prefer using .concat() feels easier read. i'm trying prepare argument why using .concat() better, , i'm wondering, there difference in efficiency between two? which option "should" taking? public class stuff { public static void main(string[] args) { string hello = "hello "; hello += "world"; system.out.println(hello); string helloconcat = "hello ".concat("world"); system.out.println(helloconcat); } } since string immutable in java, when + , += or concat(string) , new string generated. bigger string gets longer takes - there more copy , more ga

multithreading - Android: OpenGL in several threads -

i having opengl surfaceview. needs updated external event coming on networksocket, networksocket running in external thread, since needs listen time on port incoming traffic, when traffic arrives new opengl object should created , shown on screen. far understand opengl stuff, can't change objects outer thread, queueevent() have chance. code looks following, unfortunatelly isn ot working: public class gamemain extends activity { protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); glview=new gameview(this); setcontentview(glview); } } public class myglsurfaceview extends glsurfaceview{ public myglsurfaceview(context context) { super(context); renderer = new openglrenderer(); this.setrenderer(renderer); } public void do(serversocket ss){ try{ while(true){ try { ss.setsotimeout(500); socket s = ss.accept();

richfaces - How do you render html text formatted using rich:editor in seam pdf -

how render text formatted via rich:editor using seam pdf p:paragraph tags? did try <h:outputtext escape="false" value="#{yourbean.yourstring}" />

python - Threading and Signals problem in PyQt -

i'm having problems communicating between threads in pyqt. i'm using signals communicate between 2 threads, sender , listener. sender sends messages, expected received listener. however, no messages receieved. can suggest might going wrong? i'm sure must simple, i've been looking around hours , not found anything. in advance! from pyqt4 import qtcore,qtgui import time class listener(qtcore.qthread): def __init__(self): super(listener,self).__init__() def run(self): # stay alive, waiting messages print 'listener started' while true: print '...' time.sleep(2) def say_hello(self): print ' --> receiver: hello world!' class sender(qtcore.qthread): # signal no arguments signal = qtcore.pyqtsignal() def __init__(self): super(sender,self).__init__() # create , start listener self.listener = listener() self.listener.sta

javascript - Opera: trouble with adding 'list' attribute -

today i've decided add html5 datalist input via user script. here's code. problem list attribute isn't added. if change different list , lst - it's there. is supposed so? such behaviour set specification or browser? ok, did research on this. spec says input.list returns related datalist object, not attribute value. should use setattribute('list','edit-subject-themes') on input, works fine . seems jquery issue. with problem solved, i'll sure use technique in user javascript lot :)

java - Anybody tried scala with stripes framework -

is possible integrate stripes , scala such controllers written in scala , views in jsp. yes, is. scala compiles jvm bytecodes. long keep interfaces framework expects every thing works fine.

java - Sonar Maven plugin - fail the build on violation -

is there way configure sonar or sonar maven plugin make build fail when violation of priority (blocker, critical) detected? you have define alert thresholds on number of blocker/critical violations (>0 case) in quality profile , install build breaker plugin (category "integration" in update center of sonar 2.4).

Trying to delay a jQuery post -

i have post code inside loop (while i<10) , trying delay each post 5 sec instead doing delaying 5 sec , sends 10 posts @ once is there way interval or delay each post in jquery or ajax inside loop? $(document).ready(function() { settimeout(function(){ $.post("trigger.aspx", { phone: phoneval, sms: smsval }, function(data) { $('.result').html(data); }); },5000); return false; }); as far remember jquery's ajax call has beforesend function maybe addressed problem

c++ - Closing editors of QAbstractItemView -

i'm using qabstractitemview manipulate queue. problem editor doesn't close , update value in model when user hits send button. causes frustration. i've gone through qt docs, can't seem find simple way of closing editor , committing changes. how should go this? this used void projectexplorerview::closecurrenteditorifopen(bool commit) { qwidget* w = indexwidget(currentindex()); if (w != nullptr) { if (commit) { commitdata(w); closeeditor(w, qabstractitemdelegate::submitmodelcache); } else { closeeditor(w, qabstractitemdelegate::revertmodelcache); } } }

How to import the properties of the object to user-control using C#.net? -

i have user control , want assign properties of object user control. example: system.globalization.cultureinfo ci = new system.globalization.cultureinfo(); ci.datetimeformat.getalldatetimepatterns(); i must able access method getalldatetimepatterns() using usercontrol. can please me c# coding? i don't understand issue - if have code posted above in user control, have access getalldatetimepatterns() method.

iphone - Changing colours of a UIToolbar + it's buttons when presented in a Popover Controller on the ipad -

on both iphone , ipad have need present 2 buttons on right hand side of navigation bar. i'm doing following snippet of code: uitoolbar *rightbarbuttons = [[uitoolbar alloc] initwithframe:cgrectmake(0, 0, 92, 44.01)]; uibarbuttonitem *send = [[uibarbuttonitem alloc] initwithbarbuttonsystemitem:uibarbuttonsystemitemaction target:self action:@selector(send)]; [send setstyle:uibarbuttonitemstylebordered]; uibarbuttonitem *add = [[uibarbuttonitem alloc] initwithbarbuttonsystemitem:uibarbuttonsystemitemadd target:self action:@selector(addrecipe:)]; [add setstyle:uibarbuttonitemstylebordered]; nsarray *buttons = [[nsarray alloc] initwithobjects:send,add,nil]; [send release]; [add release]; [rightbarbutt

c++ - Is this code thread-safe? -

let's have thread-safe compare-and-swap function like long cas(long * dest ,long val ,long cmp) compares dest , cmp , copies val dest if comparison succesful , returns original value of dest atomically. so ask if code below thread-safe. while(true) { long dummy = *destvar; if(dummy == cas(destvar,value,dummy) ) { break; } } edit: dest , val parameters pointers variables created on heap. interlockedcompareexchange example out cas function. edit. edit question means of isn't relevant. still, i'll leave concerns in c# case carry c++ case, c++ case brings many more concerns stated, it's not entirely irrelevant. yes, but... assuming mean cas atomic (which case c# interlocked.compareexchange , things available use in c++ libraries) it's thread-safe in , of itself. however destvar = value thread-safe in , of (it in c#, whether in c++ or not implementation dependent). in c# write integer guaranteed atomic. such,

jboss5.x - Error deploying JBoss EAP 5.1 -

i trying deploy jboss eap 5.1 on rhel 5 , i've gone through documentation install, yet still seeing following errors in server.log file. able hit web, admin, , jmx console, these errors still appear , jmx console telling me messaging component unavailable. missing here? relevant parts of log (the errors) listed below: 2010-12-01 08:21:51,885 error [org.jboss.kernel.plugins.dependency.abstractkernelcontroller] (main) error installing configured: name=securitystore state=configured java.lang.exception: error calling callback passwordregistrationadvice target context securitystore @ org.jboss.dependency.plugins.abstractlifecyclecallbackitem.install(abstractlifecyclecallbackitem.java:91) @ org.jboss.dependency.plugins.abstractcontroller.handlelifecyclecallbacks(abstractcontroller.java:1589) @ org.jboss.dependency.plugins.abstractcontroller.handleinstalllifecyclecallbacks(abstractcontroller.java:1554) @ org.jboss.dependency.plugins.abstractcontroller.increments

Can Windows Sharepoint Services be integrated with a ASP.NET MVC Content Management System? -

i want build cms asp.net i'd use things wss. have things document approval i'd build because read wss can handle workflows. don't know how it, haven't got clue, know i'd implement it. if build cms around asp.net mvc, wss can have on 1 of pages in cms or wss "stuff" have in own set of web pages? also, php site, on windows, instead of asp.net? thanks thoughts. the closest have seen site sharepoint used edit pages standard asp.net application used display, using sharepoint api data sharepoint pages library - process running on server in sharepoint farm can use full sharepoint api, though wouldn't want try outside of .net. a similar approach work full cms app storing data in sharepoint, seems more work worth - sharepoint great when need sharepoint features little customization, if need complete customization gets in way.

c# - How to get all parameter choices in Revit? -

there element's parameter has 5 choices (combobox's style). know how current selected one, there way retrieve 4 other choices? they stored in similarobjecttypes elementset . foreach (element elem in elemset) { parameter param = elem.get_parameter(paramname); if (param != null) { var similar = elemparam.similarobjecttypes; foreach (element choice in similar) { string choicename = choice.name; } } }

html - Force a line break in a URL -

i've got twitter feed on blog. it's working great, there's issue long urls in tweets. long urls break layout extending past width of container. my code looks this: <ul id="twitter_update_list"> <!-- twitter feed --> </ul> <script type="text/javascript" src="http://twitter.com/javascripts/blogger.js"></script> <script type="text/javascript" src="http://twitter.com/statuses/user_timeline/username.json?callback=twittercallback2&amp;count=3"></script> the blogger.js script contains callback function takes data twitter request , populates <li> elements predefined <ul> . i'm using following css automatically break line (for browsers support it): #twitter_update_list li span { word-wrap: break-word; } i know <wbr> tag , trying use jquery function looked this: $(document).ready(function(){ $("#twitter_update_list li span a"

sql server - How to write IF(expr1,expr2,expr3) in mssql -

there if(expr1,expr2,expr3) in sql. how accomplish in ms sql? you can use case expression : case when expr1 expr2 else expr3 end by way, syntax isn't sql server specific - works in mysql , other databases.

Amazon EC2 consideration - redundancy and elastic IPs -

i've been tasked determining if amazon ec2 should move our ecommerce site to. use amazon s3 lot of images , files. cost go $20/mo our host costs, sell our server few thousand dollars. came because right there no procedures in place if happened our server. how reliable amazon ec2? redundancy good, don't see in faq , it's problem on our current system i'm looking solve. are elastic ips beneficial? sounds point dns ip , on amazon's end, reroute ip address ec2 instance instance , running if first 1 failed. i'm aware of scalability, it's redundancy , reliability i'm asking about. at work, i've had 20-40 instances running @ times on year. think we've had 1-3 alert emails come amazon suggesting terminate , boot instance (presumably because detecting possible failure in underlying hardware). we've never had instance go down suddenly, seems rather good. elastic ip's amazing , part of solution. other part being able rapidl

Javascript / Jquery functions -

not sure if being totally wrong here want this: have external js page (on external server) include page - ok easy etc... have jquery function on external page - many functions call functions directly onto page. all bit this: external js page: $(document).ready(function() { function testit() { $('#test').load('page.php'); } function testit_1() { $('#test_1').load('page_1.php'); } function testit_1() { $('#test_2').load('page_2.php'); } }); then on actual page call: <script type="script/javascript"> testit(); </script> <div id="test"></div> am wrong or should not work? your functions local scope of anonymous function passed argument $(document).ready() . here's simple example showing behaviour you're seeing: (function() { function foo() { alert("it shouldn't alert this..."); } })(); foo(); to fix it, move functio

quotes in vb.net links -

i want make link user filepath given openfiledialog. can't quotes in right places doctextbox.text = "<a href=" & openfiledialog1.filename & "target=_"blank">" & titletextbox.text & "</a>" doctextbox.text = "<a href=""" & openfiledialog1.filename & """ target=_""blank"">" & titletextbox.text & "</a>"

android - How to send an intent to an activity and read extras from it? -

there's service runs , listens events, push them log someday. display events in main actvity when it's running, how send event details activity? don't receive intent itself, when send activity context.startactivity() , can't retrive data intent.getxxxextra() . (the activity "subscribe" , "unsibscribe" events in onstart() , onstop() intent sent service, events wouldn't open activity if it's not in foreground) or there other way send data (20-30 characters long string) service intent? issue broadcast service , implement private broadcastreceiver in activity.

c# - WPF - cascading ComboBoxes, dependent ones don't update -

i have 3 comboboxes such c's items list dependent on selected item in b , b's items list dependent on selected item in a. have observablecollection s of particular classes itemssource on each combobox, , want name property of selected item pushed property in class. example: observablecollection<aclass> items => itemssource of cbo_a combobox and selectedinstanceofaclass.name should pushed data.aclassname property. problem have when choose value in combobox first time, b combobox gets appropriate items based on selected item in a, expected. same when select item in b first time--c gets right items. however, when choose different value in a, items in b updated selected value of b stays same, , when try select new value in b new items, selection doesn't change--it stays same selected value selected in b. here's xaml have right now: <combobox x:name="cbo_a" itemssource="{binding path=lists.aitems, mode=oneway}" dis

branch - Git: Dealing with .class files and other compiled objects -

lets have couple branches different code: brancha , branchb. assume i'm on brancha , run build. suppose build dumps .class files , other compiled objects directories within work tree. when run diff, see directories have changed because have new compiled objects within. if switch branchb , deploy code, i'm deploying objects compiled brancha's code base, since git maintained floating changes (new compiled objects) across branch switch. mistake. there few ways avoid this, 1 being cleaning non-versioned files whenever switch branches, there more fool-proof way of taking care of issue. i'd rather not put compiled object version control. what do use .gitignore exclude compiled files repo make clean , compile part of deployment process.

How can I access my Sqlite database after changing package name in Android? -

in order publish android app had change package name com.example.project had used during development. although, after changed package name cannot access sqlite database longer. tried accessing through .adb, , works old package-name not new one. how can access db in order put under new package? have copy of old un-altered project file. many thanks! ak is on emulator or phone? if developing on phone , have built db want: if phone rooted - use file explorer (or ddms views file explorer) , /data/data/com.example.prackage/databases , place in new package folder. if phone isn't rooted - if have original package code, create backup script copy sqlite file folder /data/data/com.example.prackage/databases - need know db file name too. in new package create reverse of code copy file sdcard new packages db folder. if on emulator - use ddms views file explorer file database folder. this link may backup , restore: backup / restore sqlite sdcard update one metho

php - FWRITE() Saving file to a specific location using XAMPP -

i realize there similar questions regarding saving files on linux servers or external windows servers. have script on local machine (running xampp) under c:/ drive. once script run, save file z:/ drive on computer network unable make happen. is possible have script run say: c:\xampp\htdocs\folder\script.php and save .pdf file generated sent to: z:\foldername2 edit while able run script , store file anywhere on c drive, issue placing on network shared drive (the z drive). when run, following error: warning: fopen(z:\form.pdf) [function.fopen]: failed open stream: no such file or directory in c:\xampp\htdocs\folder\fpdf\fpdf.php on line 1157 fpdf error: unable create output file: z:\form.pdf assuming directory writable should able use f option in output method.

jQuery metadata, how to get the value? -

Image
i'm having tough time getting value of key in data attribute. i'm using jquery metadata plugin. jquery: jquery.metadata.settype("attr", "data"); $('ul li').each(function () { console.log($(this).metadata()) }); html <ul> <li data="{somekey:'somevalue',anotherkey:'anothervalue'}">some list item</li> <li data="{somekey:'somevalue2',anotherkey:'anothervalue2'}">some list item 2</li> <li data="{somekey:'somevalue3',anotherkey:'anothervalue3'}">some list item 3</li> </ul> i outputting object, have no idea how @ value. i've tried $(this).metadata().somekey , $(this).metadata('somekey') , grasping straws. looks want this: mymeta = $(this).metadata(); then can access mymeta.somekey or mymeta.anotherkey - whatever meta keys have set.

visual studio 2010 - Calling .net4 from SSIS -

we've done work on .net 4.0 project, , looing using ssis tasks. ssis not supported in vs2010, far can see, i'm sort of ok using vs2008 ssis. how can call exsiting .net4 code ssis @ best running on .net 3.5? do have wrap c# code web service or there other options? the version of .net application depends on main executable. if use dtexec run ssis, .net 3.5 because dtexec.exe configured use .net 3.5. but if build own application (a simple console app functionality similar dtexec) .net 4.0 - .net 4.0. finally, there of course hack change dtexec use .net 4.0 - controlled dtexec.exe.config, can edit, unsupported microsoft , recommend against it.

java - Hibernate: mapping many-to-many to Map -

i developing application deals 2 following entities: products (let's name x, y, z) , materials (a, b, c, ...). it's known every product has recipe indicates materials required making product. example, produce 1 x need 2 a, 6 c , 4 d (x = 2a + 6c + 4d). that's how reflects in database tables: products id int name varchar ... materials id int name varchar ... recipes product_id int material_id int count int the "count" field in third table coefficient materials of same kind (2, 6, 4 example). so want compose product class way: public class product { ... private map<material, integer> recipe; // how many units of each material need? ... } is way fetch necessary data recipe map using hibernate? separate configuration approach (without annotations) preferred. since nobody posted solution without annotations, i'll show solution jpa 2.0 @elementcollection annotation: @elementcollection @collectiontable(name = "re

SQL Server: Easiest way to copy users from dev -> prod -

what easiest way move (copy) users dev database prod database? select "users" node in object explorer, bring "object explorer details" view menu. select all, right click, "script user as..." review script , change logins required refer logins on production server.

collections - Java - Simple way to put LinkedHashMap keys/values into respective Lists? -

i have linkedhashmap < string, string > map . list < string > keylist; list < string > valuelist; map.keyset(); map.values(); is there easy way populate keylist map.keyset() , valuelist map.values(), or have iterate? most collections accept collection constructor argument: list<string> keylist = new arraylist<string>(map.keyset()); list<string> valuelist = new arraylist<string>(map.values());

asynchronous - What is AsyncCallBack in Android? -

can give me clear description of asynccallback? exist in latest android version? because directed asynctask when search asynccallback.... these both same? have example? thanks in advance. there no class named asynccallback in android. think looking asynctask way run piece of code on thread ui won't blocked, , receive it's results on ui thread. example, want talk server on internet in response user clicking in ui, receive result server, , update ui. asynctask makes doing easy compared doing regular threading code because threading lifecycle , communication ui thread handled you. bonus there support canceling background task, have write code handle when cancel called. doesn't without work on side.

c++ - Qt Creator - how to set application icon for ubuntu linux? -

i have seen original question qt-creator-how-to-set-application-icon but did not me because building app in ubuntu , qt`s documentation not clear me.. is there anynone, has done it? whats method? thanks in advance. linux not have standard reading embedded resources, there no way embed icon in application binary , have display in menu , launcher. have install icon in appropriate pixmaps directory , .desktop file in appropriate apps directory pointing application , respective icon. the qt documentation quoted refers icon theme specification , describes files should installed. installing application icons towards end summary of needs done. you have install files in "install" target of build system (qmake or cmake or use) , possibly create debian package on top of that. qt creator unlikely these.

python - 'hover over' popup with Tkinter -

i have implemented informational popup in python app using tkinter menu widget. have text widget on canvas in root window. created menu widget has root parent. when detect mouse hover on text widget post popup menu menuwidget.post(). when leave event text widget intention have popup disappear calling menuwidget.unpost(), popup menu not disappear until click elsewhere outside text widget. first, sane method implementing informational popup? , can tell me why popup menu won't disappear? this not right way informational popup. on mac , on windows machines menus native controls. because of unpost command doesn't work because tk cedes control system event loop in order platform-specific behavior. what want use instead toplevel window overrideredirect flag set. lets display borderless window anywhere want. upside aren't limited simple text -- can put want in toplevel -- text widget, canvas, buttons, etc.

floating point - Asp.net MVC decimal symbol issue -

i have asp.net mvc application particular view has model float property. my server locale says , decimal symbol , works fine when edit model , enter instance 7,5 in text box , post server. default model binder able bind value expected seven , half . but when display same value using <%= this.model.floatvalue %> , decimal symbol converted . means <%= %> ignores server locale settings. so. how solve problem then? locale should used? server system locale says decimal symbol , or browser locale setting that's set en-gb , means . decimal symbol. anyway. want work reliably. some code: my controller actions: public actionresult settings() { settings result = this.service.getactivesettings(); return view(result); } [httppost] [handlemodelstateexception] public actionresult settings(settings data) { if (!this.modelstate.isvalid) { throw new modelstateexception(); // custom exception isn't important here } settings res