Posts

Showing posts from January, 2011

winscard - Getting the "name" of the smartcard for SCardGetCardTypeProviderName() -

in order crypto context cryptacquirecontext() , need know provider name smartcard in slot. according documentation, scardgetcardtypeprovidername() this, param 2 card name, , can't see how determine non-interactively. documentation/examples i've seen either harcode name or rely on scarduidlgselectcard() , displays ui. similarly reading around scardlocatecards() , although takes list of smartcard names (for i'm populating scardlistcards() , doesn't seem pass identifies name of smartcard inserted. i suspect i'm missing obvious, can't see what. i missing something. scardlocatecards returns part of strucutre atr of smartcard, can used in scardlistcards : scard_readerstate smartcardstate[maximum_smartcard_readers]; result = scardlocatecards (context, cardslist, smartcardstate, readercount); if (result == scard_s_success) { int i; (i = 0; < readercount; i++) { if (scard_state_atrmatch & smartcardstate[i].dweventstate)

c# - Mixing two linq statement into one? -

i have 2 linq statements, both of them working. wondering if possible mix them 1 , proper list after 1 linq. var result = list3.where(srodek => list4.any(x => x == srodek.srodek.category1) && (srodek.srodek.source.device == _text || srodek.srodek.id.device == _text)) .tolist(); var list666 = list3.select(obj => new { obj, dt = datetime.parseexact(obj.leftcolumn, dateformat, cultureinfo.invariantculture) }) .where(x => x.dt >= czas11 && x.dt <= czas22) .select(x => x.obj).tolist(); one list: var result = list3.where(obj => { var dt = datetime.parseexact(obj.leftcolumn, dateformat, cultureinfo.invariantculture); return (list4.any(x => x == obj.srodek.category1) && (obj.srodek.source.device == _text || obj.srodek.id.device == _text)) ||

android - Addview does not working -

i have code: linearlayout linear = (linearlayout) findviewbyid(r.id.parameterslayout); layoutparams b = new layoutparams( layoutparams.wrap_content, layoutparams.wrap_content); textview view = new textview(this); view.setlayoutparams(b); view.settextcolor(color.black); view.settext("test"); linear.addview(view); when use code dont see textview . the linearlayout xml code: <linearlayout android:id="@+id/parameterslayout" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@+id/parameterschoose" android:orientation="vertical" > </linearlayout> but if run code again can see new textview added , previous textview aswell. so previous textview becomes visible. i use logs: log.i("c

python - numpy on cluster via ssh -

for studies have use cluster logged on via ssh. want use python script using numpy modules. unfortunately numpy version seems to old , doesn't include needed modules. how can access newer numpy without sudo rights? if pip installed on cluster, install numpy under home directory on cluster: pip install --user numpy

image - Lync 2013 Profile picture extension -

our company switched lync 2013 , noticed under "settings/my profile picture" there no longer option specify profile image. in lync 2013 @ least set picture less 30kb hosted on webserver. funny thing can use lync 2013 server account old lync 2010 client , i'm still able set profile picture (tested & woks). seems microsoft killed feature in client not on server (lol!?!?). i write tool able set picture without having install old lync 2010 client. hints, solutions or read? update of 12/11/2013 the latest lync update ( lync client cu3 (november update) ) has option set photo added gui. link kb article link download article explanations , screenshots can found here: lync client cu3 (november update) – show picture website! . original answer this question comes more often. it's indeed user interface change between lync 2010 , 2013 clients, option set image url has been removed. underwater option still available though, , can publish photo ur

Windows Forms Application C# Style -

Image
i developing windows form application in visual studio 2008 (c#) , want add style items. i have been investigating few ideas have not found example how it. possible? my app looks like: but want add more style in buttons, textboxs , other items have: my boss insists on using visual studio 2008. to without purchasing else, create own custom button , text box controls, either scratch or controls derived existing windows forms controls , overriding onpaint etc. take @ what's been done here: http://dotnetrix.co.uk/button.htm you investigate third party options. or, use wpf if that's possibility others have said. i'd push wpf! if there's existing winforms code base can host wpf elements in winforms. see: walkthrough: hosting windows presentation foundation control in windows forms

Relating two models through associated foreign keys with ruby on rails -

i'm having trouble setting relationships , queries. here simple explaination of want accomplish. have 3 models: drawings, changes, , revisions. a drawing has many revisions a change has many revisions a change has many drawings through revisions the drawings have fields primary key string: drawing_number unique each drawing. when create new change , have nested form creates new revisions within change. have 1 of fields in new revision drawing_number though foreign key drawing_id . there way set enter drawing_number in form, finds drawing_id matches drawing_number , , adds drawing_id drawing_id column in revisions table. in other words, want relate revisions drawings using associated field not foreign key. for example: have drawing_id = 7 , drawing_number = a7114b1 i create new change has revision form nested in it. enter drawing_number a7114b1 form, revision model has drawing_id column, not drawing_number column. logic find drawing_id matches drawin

dns - Is it possible to use native characters in subdomains? -

is possible use characters such åäö in subdomains? know can use åäö in regular domains http://åberg.se can åäö.foo.se? sure can. have punycode name , use that. e.g. åäö.foo.se converts xn--4cab6c.foo.se use funny xn-prefixed names in dns configurations. browsers supporting internationalized domain names should not care use non-ascii characters, should convert non-ascii input punycode , internally use encoded names.

processbuilder - unable to open exe application using java -

i'm trying open prom (process mining tool) using java. doesn't have effect @ all. try { new processbuilder("c:\\program files\\prom\\prom.exe").start() ; } catch (exception e) { system.out.println(e); e.printstacktrace(); } this code doesn't have effect. but when open uninst.exe in same folder same code, works perfectly try { new processbuilder("c:\\program files\\prom\\uninst.exe").start() ; } catch (exception e) { system.out.println(e); e.printstacktrace(); } i don't know why happen. there solution? did java unable load heavy application? you should check program output via process.getinputstream() , process.geterrorstream() , program issuing warning or error messages, don't lead exception. these errors or warnings missing paths, environment variables, permissions on files , folders, or missing arguments. process proc = n

jquery - jScrollPane not workng at all -

i'm having hard time (as always) trying jscrollpane work. reading doc website seems easy going but... i know link jsfiddle doesn't have includes needed assume it's i'm going wrong html. which looks this. <ul class="grid scroll-pane"> ..... .... ........ . </ul> jsfiddle try <ul class="grid scroll-pane-before">

equality - equal sign with haskell literals -

what happens in ghci when load file line says: 0=1 ? i expecting give error doesn't seem @ all. anything? i assume it's equivalent in ghci saying "let 0=1". do? the 0 in let binding pattern match on literal 0 . wasn't sure going on @ first too, can confirm using strict pattern matching so: prelude> :set -xbangpatterns prelude> let !0 = 1 in 0 *** exception: <interactive>:13:5-10: non-exhaustive patterns in pattern binding

Confused about imports and evals -- Python -

say have 2 scripts, script1 , script2. script1 defined as: class foo(object): def __init__(self, name): self.name = name class bar(object): def __init__(self, name): self.name = name def test(givenstring): return eval(givenstring) and script2 defined as: from .script1 import test x = "foo('me')" print test(x) script2's print statement test(x) tells me have foo object, doesn't make sense me because imported test script1, not foo . looked @ eval documentation didn't clear me. how possible foo object created when never imported class foo ? eval() uses globals of module executed in. test 'lives' in script1 global namespace, expression executed eval() uses same namespace function , can resolve foo , bar , test . importing function not alter namespace; globals test don't change merely being called script2 . if did, imports in script1 also need imported script2 , each , every functio

c# - How to remove windows mail signature while charm sharing in windows 8 xaml? -

i share 1 url windows mail app using charm search application default getting sent windows mail signature coming in mail body. if share text mail app sent windows mail signature coming @ bottom is there way position mail signature @ bottom? no, cannot control this. person can remove mail signature user. sorry.

emscripten llvm-link sanity test error -

i trying install emscripten , have installed clang,node when running emcc command showing error cannot find /usr/bin/llvm-link, check paths in ~/.emscripten . have installed llvm-3.2 , has created llvm-link-3.2 file in /usr/bin directory still error coming . i think llvm-link hardcoded in code not able find is. i have created required ~/.emscripten file. my os ubuntu 12.04 for have add llvm_add_version = "3.2" ~/.emscripten file.

activemq - Determining destination of JMS Message with AspectJ -

i've created following pointcut calls javax.jms.messageproducer.send(..): pointcut calljmssend(message message): (call(void javax.jms.messageproducer.send(javax.jms.message))) && args(message); which works fine. have both before , after advice pointcut (amongst other things) reads jmsdestination property. before(message message): calljmssend(message) { // null pointer exception string queuename = message.getjmsdestination().tostring(); } after(message message): calljmssend(message) { // works string queuename = message.getjmsdestination().tostring(); } reading javadoc getdestination() reveiled property set after send() called. gets destination object message. jmsdestination header field contains destination message being >sent. when message sent, field ignored. after completion of send or publish >method, field holds destination specified method. is there other way can access jmsdestination within before advice? e

java - Android LibGDX Particle System is fixed on screen -

i have 3d scene runs on libgdx(android). want use particle system. when create 1 using tutorials/examples found online (e.g. particle system libgdx ) particle system works fine. except 1 thing: fixed on screen. when move camera around particle system stays on same place on screen (like fixed hud element or so). maybe it's because of sprite-nature of particleeffect . the other issue related particleeffect.setposition() method takes values not in world coordinates in screen pixels. correct? can calculate new on-screen coordinates in pixels , update particleeffect position every frame. seems hack me. is there more " right " way make particle system behave other objects in 3d scene , not fixed on screen? the particle system working in 2d system. it's not 3d particle system thats why wont world. that's why it's inside of g2d package (graphics 2d). thats reason why take 2d cords , not 3d cords. also feature list says it's inside of 2d hig

visual studio - How to apply parent group for multiple datasets in SSRS VS2008 -

i have been battling issue days without success. have tricky format of report need achieve main thing datasets need grouped 1 parent. i'll attempt explain... say have dataset1, dataset2. both have accountnumber common field(parent). i need both datasets used in format/layout of report grouped accountnumber, this. [report header data] [accountnumber group] dataset1 dataset2 [end accountnumber group] what best way achieve this? format of report has been major road block on grouping making me split data multiple datasets, group them accountnumber , create custom format per dataset in report. flow of report may this [report header data] [accountnumber group] [tablix1] dataset1 [tablix1] [tablix2] dataset2 [tablix2] [end accountnumber group] looking forward discussion on this! there multiple ways achieve effect, , best situation depends on details of report. i'll give of techniques i've used in past: join 2 datasets one joining datasets 1 in q

jquery - Unable to use $.parseJSON on string variable constructed with array variable -

i'm able parse variable manually initialized json using jquery's '$.parsejson();' cannot parse variable identical json format constructed using array. javascript var questionstype = []; var questionshtml = []; var questionsquestion = []; //store questions, types, , html each fieldset 3 separate arrays for(var i=1;i<=formpreviewid;i++) { questionsquestion.push($("#formelement_"+i + " legend").text()); questionstype.push($("#formelement_"+i).attr("class")); questionshtml.push($("#formelement_"+i)[0].outerhtml); }; //alert(questionsquestion[1] + questionstype[1] + questionshtml[1]); //format values each fieldset values format in mysql var questionsvalues = []; var index = 0; for(var i=1;i<=formpreviewid;i++) { questionsvalues.push('{"question":"'+questionsquestion[index]+'","type":"'+questionstype[index]+'","html":&quo

android - How can I calculate phone's width and height in density pixels -

for instance, have galaxy tab 2 http://www.gsmarena.com/samsung_galaxy_tab_2_10_1_p5100-4567.php has display size 800 x 1280 pixels how can calculate , height in dp? want use relevant values in resource folder names values-sw600dp galaxy tab 2 has 10.1" display , 800 x 1280. for sw (smallest width): 800 / (141/160) = 800 / 0.88125 = 907.8 dp -> fits example sw600dp. 141 - dpi of screen 160 - dpi of mdpi screen 800 - pixels in width basicaly sw-600dp fits 7" tablets , sw-720dp fits 10" tablets.

spring - Environment variables are not getting expanded in servlet.xml under JBoss -

problem: when embed environment variables in context xml, expanded when run locally. when deploy on openshift not. resolve null. configuration: web.xml: <context-param> <param-name>contextconfiglocation</param-name> <param-value>/web-inf/springapp.xml</param-value> </context-param> springapp.xml: <bean id="datasource" class="org.apache.commons.dbcp.basicdatasource" destroy-method="close"> <property name="driverclassname" value="com.mysql.jdbc.driver"/> <property name="url" value="jdbc:mysql://#{systemproperties['openshift_mysql_db_host']}:#{systemproperties['openshift_mysql_db_port']}/prepare?characterencoding=utf-8"/> <property name="username" value="aaa"/> <property name="password" value="bbb"/> </bean> pom.xml: spring vers

CSS: Hover a HTML submit button -

i'm trying style html submit button in css: html: <input type="submit" value="yes" id="popupyes">" css: #popupyes { width: 60px; height: 30px; background-color: black; } #popupyes:hover { background-color: white; } the basic style works background not change color on hover. your original code works me. sure don't have other conflicting styles inherited submit button.

php - Delete an image after it has been seen by a visitor -

i want show visitors images in folder , after have seen it, want files deleted! this tried, won't work. think it's because php generating html file tells browser must first image different place html file removed. <?php foreach (glob("files/*.*") $prevpic) { echo '<img src="' . $prevpic . '" />'; } foreach (glob("files/*.*") $file) { unlink($file); } move_uploaded_file($_files["file"]["tmp_name"], "files/" . $_files["file"]["name"]); ?> you can ... <?php foreach (glob("files/*.*") $file) { echo '<img src="data:image/' . pathinfo($file, pathinfo_extension) . ';base64,' . base64_encode(file_get_contents($file)) . '" />'; unlink($file); } ?> ... writing image data html, , discarding image.

c# - How to query Active Directory for a user whose name contains a dollar sign ($)? -

i have code snippet searches locally-defined windows user : using (principalcontext context = new principalcontext(contexttype.machine)) { using (principal queryfilter = new userprincipal(context) { name = accountname }) { using (principalsearcher searcher = new principalsearcher(queryfilter)) { var principal = searcher.findone(); ... } } } the code works fine if accountname contains normal alphanumerics, (eg "testuser"). however, if name contains dollar sign (eg "test$user"), findone() returns nothing. i suspect $ being interpreted kind of metacharacter. there way of preventing happening, interpreted literally? if you're looking single entry - try this: userprincipal user = userprincipal.findbyidentity(context, "test$user"); maybe works?

How to convert a binary representation of a string into byte in Java? -

as title says, how do it? easy convert string -> byte -> string binary, how convert back? below example. output : 'f' binary: 01100110 294984 i read somewhere use integer.parseint not case :( or doing wrong? thanks, :) public class main{ public static void main(string[] args) { string s = "f"; byte[] bytes = s.getbytes(); stringbuilder binary = new stringbuilder(); (byte b : bytes) { int val = b; (int = 0; < 8; i++) { binary.append((val & 128) == 0 ? 0 : 1); val <<= 1; } binary.append(' '); } system.out.println("'" + s + "' binary: " + binary); system.out.println(integer.parseint("01100110", 2)); } } you can use byte.parsebyte() radix of 2: byte b = byte.parsebyte(str, 2); using example: system

regex - Duplicate fn:analyze-string() output using xsl:analyze-string? -

is possible generate output identical fn:analyze-string (xpath 3.0) using xsl:analyze-string (xslt 2.0)? some examples input string abcdefg : regex="^a((b(c))d)(efg)$" <s:analyze-string-result xmlns:s="http://www.w3.org/2009/xpath-functions/analyze-string"> <s:match>a<s:group nr="1"> <s:group nr="2">b<s:group nr="3">c</s:group> </s:group>d</s:group> <s:group nr="4">efg</s:group> </s:match> </s:analyze-string-result> regex="^((a(bc)d)(.*))$ <s:analyze-string-result xmlns:s="http://www.w3.org/2009/xpath-functions/analyze-string"> <s:match> <s:group nr="1"> <s:group nr="2">a<s:group nr="3">bc</s:group>d</s:group> <s:group nr="4">efg</s:group> </s:group>

c++ - Set member to same value in all instances of templated structure -

i have following struct: template <typename t> struct avl_tree { t data; int balance; struct avl_tree <t> *link[2]; int (*comp)(t, t); }; what point comp function pointer valid function @ runtime, have instances of struct avl_tree<t> able access function. int compare(int a, int b) { return ( - b ); } is possible can like: avl_tree<int> tree(new avl_tree<int>); tree = insert(tree, 9); std::cout << tree->comp(tree->data, 9) << '\n';//should print 0 finally got answer this. solution: in struct avl_tree: typedef int (*compare)(t, t); static compare comp; above main: template <typename t> int (*avl_tree<t>::comp)(t, t);//initialise pointer in main: avl_tree<int>::comp = compare;//set static member function pointer function use in response previous question, here how can use it: avl_tree<int> tree(new avl_tree<int>); tree = insert(tree, 9); std::cout <

android - How to place NavigationDrawer behind layout? -

i sorry english using navigation drawer , want navigation drawer behind layout in facebook. here code, more want drawer listview under framelayout. please. thanks. public class mainactivity extends activity { private drawerlayout mdrawerlayout; private listview mdrawerlist; private actionbardrawertoggle mdrawertoggle; private charsequence mdrawertitle; private charsequence mtitle; private string[] mplanettitles; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); mtitle = mdrawertitle = gettitle(); mplanettitles = getresources().getstringarray(r.array.planets_array); mdrawerlayout = (drawerlayout) findviewbyid(r.id.drawer_layout); mdrawerlist = (listview) findviewbyid(r.id.left_drawer); // set custom shadow overlays main content when drawer opens mdrawerlayout.setdrawershadow(r.drawable.drawer_sh

php - How do I get the average from a mysql column minus highest and lowest value -

i'm stumped. want average "clicks" "posts" throw away highest value typically high skews threshold when want display posts clicks above average. want discard lowest value same reason. code is: //get sum of clicks posts $gettotalsum = mysql_query("select sum(clicks) click_total posts clicks > '0' "); $clicksum = @mysql_fetch_array($gettotalsum); //get number of posts have clicks $postcount = mysql_query("select postid posts isactive = 'y' , clicks > '0' "); $clickcount = mysql_num_rows($postcount); i suspect 2 queries above need modify filter highest , lowest click values - how? and here's rest of code fwiw: //multiply average, round off $average = $clicksum['clicks'] / $clickcount; $average = round($average); //display posts equal or above average $getposts = mysql_query("select postid, posturl, posttitle, clicks posts clicks >= $averag

javascript - jQuery object array get an item as jQuery object -

i have array contains jquery selectors : var aa = $('a'); when line fires, contains of aa object array filled [object htmlanchorelement] , want object aa as jquery object without using : var mynewelm = $(aa[index]); is possible ? i know can use specific selector object jquery object have use aa . use eq() : var mynewelem = aa.eq(index);

Fluent NHibernate - How to do Additional Processing when Converting from SQL to C# type? -

i'm using fluent nhibernate data access layer, , need every time value in sql mapped datetime type: var newdatetime = datetime.specifykind(olddatetime, datetimekind.local); in code above, newdatetime represents value should returned sql c# conversions, , olddatetime represents default converters nhibernate automatically convert to. besides issue fluent nhibernate documentation bleak, i've tried searching around internet conventions let me this, iusertype heavy (and haven't been able find comprehensive explanation of how implement methods derived iusertype), , ipropertyconvention seems offer ways modify how c# being converted sql (not other way around, need in scenario). can please point me in right direction? and/or provide quality links read on conventions? none of wiki pages explain in detail please refrain linking those. thank you. nhibernate (not fluent) supports setting, distinguishing how handle datetime stored in db (regardless of db support off

Subtract boolean from float in python -

this question has answer here: is false == 0 , true == 1 in python implementation detail or guaranteed language? 4 answers anyways when debuging code found statement subtracted boolean float . then tried following in python console: >>> 15.0 - true 14.0 >>> 15.0 - false 15.0 can explain me: why subtracting booleans numeric types legal (the docs state can and , not , or on boolean values: http://docs.python.org/3/library/stdtypes.html#boolean-operations-and-or-not ) has practical use? http://docs.python.org/3/library/stdtypes.html#boolean-values boolean values 2 constant objects false , true. used represent truth values (although other values can considered false or true). in numeric contexts (for example when used argument arithmetic operator), behave integers 0 , 1, respectively. not nowadays, can write resul

python - Errors in terminal when deploying to heroku -

i''m brand new stuff , trying deploy simple website using python heroku. i following error: at=error code=h10 desc="app crashed" method=get path=/ host=arcane-lake-2908.herokuapp.com fwd="71.20.1.73" dyno= connect= service= status=503 bytes= 2013-09-03t09:47:58.419844+00:00 heroku[router]: at=error code=h10 desc="app crashed" method=get path=/favicon.ico host=arcane-lake-2908.herokuapp.com fwd="71.20.1.73" dyno= connect= service= status=503 bytes= i see sees "reason worker failed boot". the last 2 commands ran were: scale web=1 heroku open your procfile incorrect. you have like web: gunicorn hello:app you should replace hello name of app

android - java.net.UnknownHostException(Unable to resolve host "play.googleapis.com": No address associated with hostname) -

full error message below. occurs when running app in emulator uses urban airship , google cloud messaging. not see on device. java.net.unknownhostexception(unable resolve host "play.googleapis.com": no address associated hostname) btw, ua guys how shut off ua? commenting out ua.takeoff() leads null point exceptions! way go! thats way end on stackoverflow! most common reason unknownhostexception missing internet-permission. check androidmanifest.xml <uses-permission android:name="android.permission.internet"></uses-permission> update: later comment says, internet connectivity allowed , works on device. it's emulator issue. possible solutions: use ip instead of hostname (for test) re-create avd check min-sdk seetings against avd sdk version

vb.net - PDF from PS through Shell with gswin32c -

i trying produce "c:\output.pdf" existed , formed "output.ps" file vb.net , shell gswin32c.exe in current directory. but can't write shell command properly: if lcase(p_printer).contains("ghostscript") ' not show old 1 io.file.delete(outputpdf) if io.file.exists(inputps) dim commandstring string = """gswin32c.exe -sdevice=pdfwrite -dnopause -dbatch -dsafer -dquiet -soutputfile=" & outputpdf & " " & inputps & """" debug.print(commandstring) shell(commandstring, appwinstyle.normalfocus) if io.file.exists(outputpdf) , bln_showpdf 'show pdf start(outputpdf) end if else msgbox(inputps + " not exists.", msgboxstyle.critical) end if end if from cmd window command regularly produce "output.pdf" what incorrect , how working? dim inputps string = "c:\te

sql - sqlite changing a value using joins -

i have table called: recipes name | key abc | 2 and second table called: monday cell_id | recipe_id | recipe_name 4 | | abc how set recipe_id column in monday key value other table name , recipe name in both tables same? i'm using sqlite. you can use correlated subquery key value corresponding name: update monday set recipe_id = (select key recipes name = monday.recipe_name)

accelerometer - Unexpected false return value from android.hardware.SensorManager.registerListener in Android 4.3 -

used lg nexus 4, android 4.3 the return value false , don't understand why. documentation says: "true if sensor supported , enabled." what strange no examples i've seen testing return value sensormanager.registerlistener. strange if ignore false value returned works expected! documentation: http://developer.android.com/reference/android/hardware/sensormanager.html android.hardware.sensormanager, android.hardware.systemsensormanager my code: sensormanager sensormgr = (sensormanager)_context.getsystemservice(context.sensor_service); if (sensormgr == null) { log.w(tag, "200410::sensors not supported"); return false; } sensor sensor = sensormgr.getdefaultsensor(sensor.type_proximity); result = sensormgr.registerlistener(this, sensor, sensormanager.sensor_delay_normal); if( result == false) { // should done here // since false return value indicated registration failed. // found it's better doing nothing since registrat

installation - Invalid directory for Ruby Development Kit -

i'm trying install ruby development kit http://rubyinstaller.org/downloads run problems @ command prompt. after running c:\ruby\devkit>ruby dk.rb init got following success response: [info] found rubyinstaller v2.0.0 @ c:/ruby/ruby200-x64 initialization complete! please review , modify auto-generated 'config.yml' file ensure contains root directories of installed rubies when run 'ruby dk.rb install'. then ran c:\ruby\devkit>ruby dk.rb review , got success response: based upon settngs in 'config.yml' file generated running 'ruby dk.rb init' , of customizations, devkit functionality injected following rubies when run 'ruby dk.rb install'. c:/ruby/ruby200-x64 finally, ran c:\devkit>ruby dk.rb install line, seems working fine until point. unfortunately, keep getting message: [error] skipping invalid directory 'c:/ruby/ruby200-x64' i don't know do! kindly help. i had same

core data - CoreData Using Sqlite and Unicode Strings Fetch Not Working -

i have application storing japanese text in coredata sqlite database. populating data seems work ok (as far can tell), when search on string field returns no records. if search on 1 of integer fields does. the string data unicode (ie, japanese characters), question core data not work unicode? seems unlikely. special have done search (fetch) work? code populate data looks this: wordprogress *newwordprogress = [nsentitydescription insertnewobjectforentityforname:@"wordprogress" inmanagedobjectcontext:progresscontext]; newwordprogress.kanji = kanji; newwordprogress.kanji = kana; newwordprogress.senseindex = [nsnumber numberwithint:senseindex]; newwordprogress.skilltype = [nsnumber numberwithint:skilltype]; newwordprogress.leitnerdeck = leitnerdeck; newwordprogress.datelastshown = lastshowndate; code test fetch, looks this: nspredicate *pred = [nspredicate predicatewithformat:@"kanji = %@", @"å½¼"]; nsfetchrequest *testrequest = [[nsfetchreques

android - cannot be resolved or is not a field WebView object -

does know what's problem here? webview wv = (webview) findviewbyid(r.id.webview1); gives me webview1 cannot resolved or not field, don't know why. here's xml: <webview android:id="@+id/webview1" android:layout_width="match_parent" android:layout_height="match_parent" /> </linearlayout> i want simple line of code executed: wv.loadurl("http://www.cinicraft.com/pick.html"); do have automatic build can check? also, try cleaning project, fixes these kinds of errors me.

google analytics goal - visit 2 pages not one after another on same site -

i struggling setting goal in ga. have goal page , page x want part of funnel. not possible visitor go directly page x goal page. can take amount of time. me ii important measure how many visitors visited page x visited goal page well. understand funnel in ga - ordered list of pages 1 after another. tried setup goal url destination , funnel 1 step seems google thinks of step page directly before goal page. can point me right solution? thank you. it seems me did right. put down steps did in order set funnel. worked me. need to: click admin in top right corner. choose account , property , click goals. click create goal choose custom in goal setup , click next step fill in name of goal , choose destination option list , click next step. goal details: a) fill in url of goal page in field destination equals chosen in drop-down list. b) check funnel option on. c) set step1 name "page x" , screen/page url of "page x". d) guess it's better

HTTP If-Modified-Since with milliseconds -

let's object rest web service , object has time stamp. time stamp has milliseconds component. next time request same object don't want returned unless has changed, use if-modified-since header. date in header not supposed have milliseconds. if round time stamp down, i'll object if it's modified. if round risk missing updates. if-modified-since header useless me in case, or missing something? a service sends time stamp milliseconds not http-compliant. last-modified must sent http-date §3.3.1 specifies clearly: http-date = rfc1123-date | rfc850-date | asctime-date rfc1123-date = wkday "," sp date1 sp time sp "gmt" rfc850-date = weekday "," sp date2 sp time sp "gmt" asctime-date = wkday sp date3 sp time sp 4digit date1 = 2digit sp month sp 4digit ; day month year (e.g., 02 jun 1982) date2 = 2digit "-" month "-" 2digit ; day-month-year (e.g., 02-jun

python - Pip doesn't install packages to activated virtualenv, ignores requirements.txt -

i attempting setup development environment on new dev machine @ home. have installed ubuntu , attempting clone remote repo our web-server , install dependencies can begin work. so far have manually installed virtualenv , virtualenvwrapper pypi , edited bash.rc appropriately source virtualenvs when start terminal. cloned repo ~/projects/project-name/websitename.com . used virtualenvwrapper mkvirtualenv env-name ~/projects/project-name/websitename.com . reflects file-structure/setup of web-server cloning from. far good. i logged dev server , activate virtualenv there , use pip freeze -l > req.txt render dependencies list , scp local machine. activate virtualenv on local machine, navigate ~/projects/project-name/websitename.com , execute pip install -r path-to-req.txt , runs through of dependencies if nothing wrong. however, when attempt manage.py syncdb error not finding core django packages. hell? figure somehow django failed install, run pip install django==1.5.1

javascript - Set an option in an iframed page -

i have page has iframed site in it. it's service subscribe customers. have end customers site myname.serviceisubribeto.com prefer send them myowndomain.com. forward or iframe. iframe let's me add other things page seo purposes. so question have can set option iframed page offers default when mydomain.com loaded? the page requires key code 1 option fill out form on page. has linked text says " no key code " , changes form address field. done via javascript. can set address option default when page loads? this service doesn't offer option want default yet, in future not enough. no, can not manipulate iframed page different domain via js. security reasons.

database - recover data using ibdata1 file mysql -

how can recover data when have ibdata1 file backup. i have tried instruction @ following link looks missing. http://blog.shiraj.com/2012/10/extract-data-from-mysql-ibdata1-data-file/ started mysqld-nt recovery option c:\program files (x86)\mysql\mysql server 5.0\bin>mysqld-nt.exe --standalone --c onsole --innodb-force-recovery=6 innodb: user has set srv_force_no_log_redo on innodb: skipping log redo 130904 6:02:29 innodb: started; log sequence number 0 0 innodb: !!! innodb_force_recovery set 6 !!! 130904 6:02:29 [note] mysqld-nt.exe: ready connections. version: '5.0.90-community-nt' socket: '' port: 3306 mysql community edition (gpl) opened new console see of databases. doesn't show database looking for. guess 3 databases showing default one. c:>mysql -u root -p enter password: **************** welcome mysql monitor. commands end ; or \g. mysql connection id 2 server version: 5.0.90-community-nt mysql community edition (gpl) type '

java - Values getting modified in the class during the runtime -

i trying loop around value got populated in registration class. have put breakpoint in getinstance() method in registration class. when cursor reaches below loop code. for (final registration.holderentry entry : registration.getinstance()) { // other things.. } i f5 on that. , gooes getinstance() method of registration class (below class). , when inspect on instance variable @ point, see values populated in listofbundles list good. but if keep on pressing f5 again, @ point comes iterator method in registration class , if inspect on listofbundles list , don't see values in list not able understand why happening this. no other code running might change value of listofbundles . public class registration implements iterable<registration.holderentry> { private list<string> listofbundles = new linkedlist<string>(); private final map<string, holderentry> bundlemapper = new hashmap<string, holderentry>(); private regist

java - listener port and serving port in server -

i planing write 1 customized http server in java. thought of using 1 listener port listen incoming calls. whenever incoming call come, accept , pass socket object in thread. thread responsible serving response. when response completed, closed. problem think if request comes @ time no more port available. thinking of having fixed number of serving port , reuse sending response back. can suggest how can in java? you don't want limit ports as want limit threads, that's why many servers use threadpool contains way less threads amount of available ports.

html - How does browsers render iframe with different encoding of parent page? -

i have web page encoded in utf-8, need include subpage iframe encoded in gbk. so wonder how browsers(ie/chrome/ff) render characters of whole page ? browsers treat iframe page standalone page , use own encoding charset ? thanks ! in general, browser treat iframe page standalone page if being rendered in separate tab or window. there is, however, issue some versions of internet explorer content of iframe not set encoding through content-type, , picks parent window's encoding on initial load.

jquery - Selecting top layer element with .hover() -

is there way select top layer element on hover? for example, let's have 2 divs. in first 1 top layer span.mytext1, if hover off span remain in div, div top layer hover over. similar example applies second div, except has more layers. i .addclass('outline ') top layer only. css .outline { outline: 5px solid #66ff66; } html <div class="divs"> <span class="mytext1">some text</span> </div> <div class="mydiv2"> <div style="width:300px"> <span class="mytext2">some text <button value="mybutton"></span> </div> </div> i think .hover() way go not sure how. $(mytoplayer).hover( function() { $(this).addclass('outline'); }, function () { $(this).removeclass('outline'); } ); update - misunderstood question; previous answer doing opposite o

c++ - Safe Bool Idiom - did I find a simpler way, or did I miss something? -

i needed find safe bool idiom solution. know drill, i'm using vs 2012, xcode, gcc, llvm, various platforms, support c++11 explicit conversion operator , don't. needed portable. i found several, devised seems simple have ask, missing here? background (brief): several examples 1 web provide either highly intrusive methods (essentially putting required inside given class), or generic approach using crtp, based on pointer member function (which of wildly unpredictable size , performance penalty). then read boost::spirit::classic safe bool, tried it, examined it, etc. liked spirit's implementation depended upon pointer member data rather pointer member function (with compiler workaround 'obscure' versions). so thought, doesn't matter type pointer member based upon, implementations working because, among other things, these pointers members of other objects we're use. so, tried kind of thing (and i'm wondering if i'm way off or ok this)

How to fix Assertion Failure Opencv Programming - Visual C++ 2008 Express -

i made windows form based program load image using opencv in visual c++ 2008. but, following code failed load image, , got assertion failure. private: system::void buttoncitra_click(system::object^ sender, system::eventargs^ e) { if (openfiledialog1->showdialog() == system::windows::forms::dialogresult::ok) { //error detected here variable citra citra = cv::imread(marshalstring(openfiledialog1->filename)); pictureboxcitra->image = iplimagetobitmap(&(iplimage) citra); this->width = pictureboxcitra->image->width+33; this->height = pictureboxcitra->image->height+85; } } when compile , build it, nothing happened, , form appeared properly. when chose image using openfiledialog in directory file, got dialog box titled "microsoft visual c++ debug library" contains assertion failure,as follow : "debug assertion failed! program: .....try.exe file f:\dd\vctools\crt_bld\self_x86\crt\sr

html - Safari Background Image Quirk -

so seems safari (latest version) not following code involving background image: div.nav_element.pdf { background-image:url("/images/pdf_icon.png"); background-position: right 19px bottom 50%; background-repeat:no-repeat; } <div class="nav_element pdf"> <a class="nav_link" href="#">summary of product characteristics</a> </div> it tells me background-position property invalid via little yellow exclamation point box. has seen before? not relative sizing? because background-position property invalid. have 2 values, not 4. read this

python - Running Tkinter dependent code alongside mainloop without GUI freeze -

i writing simple image viewer lets user flip through tens of thousands of images, 100 @ time. images files on disk. in order viewer function, must continuously preload images ahead of user's current 1 (or viewer unusably sluggish). the basic recipe i'm using display images in grid of tkinter labels, following (this has been tested , works): def load_image(fn): image = image.open(fn) print "before photoimage" img = imagetk.photoimage(image) print "after photoimage" label.config(image=load_image("some_image.png") i need imagetk.photoimage instance display image on label. have implemented 2 different approaches, each associated problem. first approach: launch separate thread pre-loads images: def load_ahead(): fn in images: cache[fn] = load_image() threading.thread(target=load_ahead).start() top.mainloop() this works quite on linux machine. however, on machine (which happens running windows, , compiled p

What are Alternatives to `java.net` and `java.nio` in terms of performance? -

i looking hpc networking library can more permanent standard java networking libraries. i have checked out netutils , rocksaw not sure whether maintained more. not community behind them. there many alternatives rather depends on requirements. i suggest kernel bypass adapters low latency, in cause current libraries supported, hardware (and drivers) changes, not library. if concerned throughput, system should able make full use of 1 gb line , can use 10 gb line tuning of software (again library won't help) what library lower level access, packet sniffing, sending/receiving packet types not supported. where libraries can handing large number of connections. plain io can handle on 1000 connections easily, , nio can handle on 10k connections if need 100k connection may struggle. if need 1+ million connections, need custom c library. @ point suggest having more machines can't 1 millionth of machine each user. in short, if want high performance, @ hardwar