Posts

Showing posts from August, 2014

php - Conditional Check -

i trying make conditional code dependent on if user has left or right bar disabled. have following <?php $left_sidebar = 'off'; $right_sidebar = 'on'; if ($left_sidebar == 'on' || $right_sidebar == 'on') { $left_sidebar_width = 'four_columns'; $right_sidebar_width = 'four_columns'; $center_width = 'eight_columns'; } else if ($left_sidebar == 'on' || $right_sidebar == 'off') { $left_sidebar_width = 'four_columns'; $right_sidebar_width = 'disabled'; $center_width = 'twelve_columns'; } else if ($left_sidebar == 'off' || $right_sidebar == 'on') { $left_sidebar_width = 'disabled'; $right_sidebar_width = 'four_columns'; $center_width = 'twelve_columns'; } else { $left_sidebar_width = 'disabled'; $right_sidebar_width = 'disabled'; $center_width = 'sixteen_columns'; } echo $left_si...

c# - Why is this throwing a string format exception -

i can't see wood trees. why throwing string format exception? private const string googleanalyticsformat = @"<script type=""text/javascript""> var _gaq = _gaq || []; _gaq.push(['_setaccount', '{0}']); _gaq.push(['_trackpageview']); (function () { var ga = document.createelement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; ...

c++ - Printf-Style Assertions using CPPUnit -

does cppunit have functionality allow me printf -style assertions? example: cppunit_assert("actual size: %d", p->getsize(), p->getsize() == 0); i know not valid cppunit_assert - using example. i found cppunit_assert_message(message,condition) takes string , condition evaluate no luck getting value assert. you should able this: #define cppunit_assert_stream(msg, condition) \ { \ std::ostringstream oss; \ cppunit_assert_message(\ static_cast<std::ostringstream &>(oss << msg).str(), \ condition); \ } while (0) cppunit_assert_stream("actual size: " << p->getsize(), p->getsize() == 0); the above macro can combined boost.format : cppunit_assert_stream(boost::format("actual size: %d") % p->getsize(), p->getsize() == 0);

android - Implement zbar scanner in already existing layout -

im trting place camera preview of zbar scanner existing layout, place im trying put stays black , dosn't start camera read qrs. if don't use custom layout 1 thats in example(it starts scanner in new activity , takes screen size) fine. means have no problems permissions or this. codes i'm using now: import net.sourceforge.zbar.config; import net.sourceforge.zbar.image; import net.sourceforge.zbar.imagescanner; import net.sourceforge.zbar.symbol; import net.sourceforge.zbar.symbolset; import com.dm.zbar.android.scanner.camerapreview; import com.dm.zbar.android.scanner.zbarconstants; import com.dm.zbar.android.scanner.zbarscanneractivity; import android.os.bundle; import android.os.handler; import android.app.activity; import android.content.intent; import android.content.pm.packagemanager; import android.hardware.camera; import android.text.textutils; import android.view.menu; import android.view.view; import android.view.window; import android.view.windowmanager; im...

html - how do I to retrieve the value of a hidden input[type=submit] from my servlet -

as title says, how retrieve value of hidden input[type=submit] servlet ? i've tried line, wouldn't work me, modifpost servlet: public void dopost(httpservletrequest request, httpservletresponse response) throws servletexception, ioexception { string type = (string) request.getattribute("type"); } knowing have in jsp : <form method="post" action="<c:url value="/modifpost"/>" class="sansretourligne"> <input type="text" disabled style="visibility: hidden;" class="sansretourligne" name="type" value="p" /> </form> web.xml : <servlet> <servlet-name>modifpost</servlet-name> <servlet-class>com.forum.servlets.modifpost</servlet-class> </servlet> <servlet-mapping> <servlet-name>modifpost</servlet-name> <url-pattern>/modifpost...

http - How to disable chunked encoding in Mule cxf:proxy-client -

i'm using mule 3.3.2 cxf:proxy-client call third-party soap service way: <outbound-endpoint address="https://www.xyz.biz/dms/call.aws" mimetype="text/xml" connector-ref="https.connector" responsetimeout="100000"> <cxf:proxy-client payload="envelope" enablemulesoapheaders="false"> <cxf:ininterceptors> <spring:bean class="org.apache.cxf.interceptor.loggingininterceptor" /> </cxf:ininterceptors> <cxf:outinterceptors> <spring:bean class="org.apache.cxf.interceptor.loggingoutinterceptor" /> </cxf:outinterceptors> </cxf:proxy-client> </outbound-endpoint> by default, message transmitted chunked unfortunately server cannot handle that. how can disable chunking in proxy-client instead of transfer-encoding: c...

php - using left join on mutiple tables with conditional statement -

i have problem mysql can solved using inner join not with, have 4 tables. table 1: classrooms classroomid, name, ....... table 2: teachers fname, mname, lname, ....... table 3: subjects subjectid, name, classroom_id, ..... table 4 teachers_subjects teacher_id , subject_id i want query me class names (classrooms.name) , subjects name (subjects.name) subjects.classroom_id = classrooms.classroomid i want names of teachers (teachers.name) teachers_subjects.subject_id = subjects.subjectid , teachers_subjects.teacher_id= teachers.teacherid. i using query : select classrooms.name, subjects.name, concat(teachers.fname,' ',teachers.mname,' ',teachers.lname) teachers_name classrooms, subjects, teachers, teachers_subjects subjects.classroom_id=classrooms.classroomid , teachers_subjects.teacher_id=teachers.teacherid , teachers_subjects.subject_id=subjects.subjectid i want want classes , corresponding subjects if not on table teachers_subjects. lis...

sql - Force MySQL To Evaluate One Condition Before The Other -

what best way rewrite query: select myfield myprefix.mytable myfield2 in (?) , get_lock(concat('action:',myfield3), 0) = 1 limit 1 myfield2 has index on it. right now, mysql evaluates in operation first (because knows there index on it), , pipelines get_lock operation. how can sure case, , not switch other way around across mysql upgrades/etc. aka, question is, how can make sure get_lock never evaluated first. keep in 1 query. it depends on kind of optimizer database using. does order of clauses matter in sql i not sure below solution optimized way if want 'get_lock' executed after checking 'myfield2' can try this: select t.myfield (select * myprefix.mytable myfield2 in (?) ) t get_lock(concat('action:',t.myfield3), 0) = 1 limit 1

Using FBEvents activateApp on IOS and phonegap doesn't post to Facebook Insights -

i'm looking integrate facebook sdk application track mobile app installs using "activateapp" method. ( integration referencepage ) able working on android, after discovering must have facebook native application installed , logged-in in order use it. try might unable ios make same call , registered on facebook developer app page "last mobile install". here code i'm using: (the app id listed in example code intentionally wrong, 1 have in running application copy/paste of app id on facebook app page) - (void)applicationdidbecomeactive:(uiapplication *)application{ [fbsettings setdefaultappid:@"123456789123456"]; [fbsettings setloggingbehavior:[nsset setwithobjects:fbloggingbehaviorappevents, nil]]; [fbappevents activateapp];} after activeapp call made see log statement in console 2013-08-19 08:50:45.776 myapp[258:907] fbsdklog: fbappevents: recording event @ 1376920246: { "_eventname" = "fb_mobile_activ...

php - HTML Entities Conversion -

i storing data in mysql follows test &lt;br&gt;&lt;br&gt;asdadsfdasfsafsaf&lt;br&gt;&lt;br&gt;test&lt;b&gt;sadasdsadsads&lt;font color=&quot;#553333&quot;&gt;sadfsafdasfsafsaf&lt;/font&gt;&lt;/b&gt;&lt;br&gt; i want show in browser using php.i used html_entity_decode($sql[0]); result got is test<br><br>.............. expected result should : test sahjgjhgjh

Why pow(-1, 0) returns 1 instead of -1? -

as google suggests -1 0 =-1. , understand pow() function in javascript, python , c should return same result. it's not true. why? python: >>> pow(-1, 0) 1 it's precedence thing. google thinks (-1) 0 = 1 , python: >>> (-1)**0 1 any nonzero number raised exponent 0 1.

css - adding line break on pseudo element -

Image
after each h2 want append , style dash , after line break. i tried following: h2:after { content: '\a\2014'; white-space: pre; font-size: 70px; } it work in general, when in- or decrease font-size, space both on , under dash change, instead of dash-size. i tried adding line-height: 0.6em; seems move around. at moment i'm getting this: i want this, being able change space: here fiddle why don't use borders? h2 { border-bottom: 4px solid #000; } and adjust padding on bottom of h2: h2 { padding-bottom: 15px; border-bottom: 4px solid #000; } update based on comments to keep dash same width regardless of title width styled :after pseudo element border , display block: http://jsfiddle.net/uzvhz/2

javascript - Advice handling a lot of Strings -

i'm working on browser-based textgame javascript , html(so far!). right i'm not storing kind of information, in future. i'm telling big story game progresses , lot of text. i'm wondering if has advice on how handle this. im outputting parts of story @ once. i don't want put thousands , thousands of words inside paragraph-tags in index.html file. should put text in server , them need them? or can put text inside seperate file , call them there? if so, method effective? any advice appreciated. i'd recommend storing text on server in separate files. not make main front-end code cleaner, make easier create tools updating various parts of story, since relevant text won't contained in 1 large file.

gem install rails ERROR: While executing gem ... (Errno::EACCES) -

i somehow messed $path up. (changed it) , ruby , rails gems weren't working. did in efforts fix reinstall rvm. ruby works fine in terminal. on running gem install rails i greeted this: permission denied - /users/emkaro/.rvm/gems/ruby-2.0.0-p247/gems/atomic-1.1.13/test/test_atomic.rb when try install rails through sudo gem install rails , error: error: while executing gem ... (errno::eacces) i have xcode installed command-line tools installed well. went ahead install gcc same error when try install rails. this full error message error: while executing gem ... (errno::eacces) permission denied - /users/emkaro/.rvm/gems/ruby-2.0.0-p247/gems/atomic-1.1.13/test/test_atomic.rb emmanuels-imac:~ siaw$ sudo gem install rails password: building native extensions. take while... error: error installing rails: error: failed build gem native extension. /users/emkaro/.rvm/rubies/ruby-2.0.0-p247/bin/ruby extconf.rb *** extconf.rb failed *** not create makefile...

Git Bash on windows 7 behind proxy no longer working -

i'm on windows 7, 32 bit box, , working behind proxy. upgraded git client (git bash) git-1.8.3-preview20130601 , , of sudden, i'm getting following error whenever try push/pull: fatal: unable access 'https://github.com/user/simple_timesheets.git/: received http code 407 proxy after connect i able fine before upgrading, , when tried revert last version think had, still error. when run git config -l , lists out following variables (among others): user.name=myname user.email=my@email.com http.proxy=http://user:password@server:port core.autocrlf=true https.proxy=http://user:password@server:port http.sslcainfo=/bin/curl-ca-bundle.crt what's odd seem able use git bash client curl fine curl finance.yahoo.com --proxy http://user:password@server:port and can curl dummy https site set on computer: curl https://localhost:3000 --insecure any ideas i'm missing? thanks edit: i wrong, think there might issue curl in version 1.8.3. uninstalled git relate...

wcf - How to authenticate an application, instead of a user? -

in context of wcf/web services/ws-trust federated security, accepted ways authenticate application, rather user? gather, seems certificate authentication way go, ie generate certificate application. on right track here? there other alternatives consider? what trying solve general digital rights management problem, unsolved problem @ moment. there whole host of options remote attestation involve trying hide secrets of sort (traditional secret keys, or semi-secret behavioural characteristics). some simple examples might deter casual users of api working around it: include &officialclient=yes in request include &appkey=<some big random key> in request store secret app , use simple challenge/response: send random nonce app , app returns hmac(secret,nonce) ) in general 'defenders advantage' quite small - effort put in try , authenticate bit of software talking in fact software, isn't going take attacker/user more effort emulate it. (...

javascript - event.preventDefault() not working in Hammer.js - window still moves -

the window in mobile safari moves down making bounce effect can behaviour stopped hammer? <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1,user-scalable=no"> var statustoggle = hammer($$(this.pn1)).on("swipedown swipeup", function(e){ e.preventdefault(); e.gesture.preventdefault() searchride.togglestatusbar(); }); adding work, why not working in hammer?? pn1.addeventlistener('touchmove', function(event) { event.preventdefault(); }, false); thanks

the principle s of 3d printing with color -

i saw models made 3d printing can have colours assigned different components. wondering how achieved. 1: principle of 3d printing process print colors objects? color painted on object surface or inside object? 2: since of input 3d printing machine stl file composed of triangles, how attach color information 3d printing machine? , how 3d printing machine can retrieve , understand color information? thanks lot, modeling: draw three-dimensional view. printing: printer resolution describes layer thickness finishing: additive manufacturing techniques able combine multiple colors , multiple materials during course of constructing process.

css3 - Custom CSS border styles (this one is tricky!) -

Image
i have tricky css border want style. want achieve border effect div, div height 10px 1px solid green border, right border has overlay of 4px solid red, vertically-centers , 5px high. see below: any bright ideas? i've played around pseudo elements no luck. want in single div. thanks you can css3. div { width:10px; height:10px; border:1px solid green; position:relative; } div:after { content: ''; background: red; width: 3px; height: 6px; position: absolute; right: -2px; top: 2px; } you have play around pixel value's make want have (your example image doesn't 10px x 10px). hope helps.

uml - composition relationship with abstract class -

is possible there composition relationship ِabstract class using uml? think can't, because need object make relation, , when create abstract class, can't create object it. yes possible, , useful. @ example : uml composition abstract http://app.genmymodel.com/engine/xaelis/compositionabstract.jpg building , room abstract , have composition relationship. right, need use 1 concrete class (house or flat) implement relationship.

opengl - What does Chrome use for accelerated 2D vector graphics in its HTML5 canvas draw functions? -

so things possible hw accelerated html5 canvas animated 2d vector graphics drawing, on top of opengl (4.x) rendered 3d scene (for complex hud , gui displays). need able work on win7+, macos, , linux, mobile platform support not needed. btw working c++. i wondering if knew example chrome uses accelerated 2d vector graphics in html5 canvas draw functions? under impression accelerated using angle (which wraps opengl or dx9). or wrong , svg rendering accelerated, not javascript canvas draw functions. doing html5 canvas style animated 2d vector graphics opengl highly non-trivial, google using available library or in-house code? i have been looking openvg , have had hard time finding right implementation use that, far thing can examples compiled shivavg (but there seems shimmering artifacts tiger demo , other issues latest release 7 years ago). think shivavg using fixed function , team decide lock down our opengl usage 4.x core profile, won't work. love use nv_path_rendering ...

bookblock - Debugging jQuery Animation -

Image
i using page flipping plugin called "bookblock" (demo can found here ). i have put images on each page, adding dynamically. problem when flip page, previous , next divs squished on each side of book. following screenshot taken mid-animation of page flip. as can see each page in book "item1", "item2", etc. of display properties set "none", reason can seen. a live version of site can found here . have tried adding $(".bb-item").hide(); right before animation sequence, appears begin on line 259 of js/jquery.bookblock.js, no luck. how else go debugging problem? update: sorry, should have mentioned can access flipbook clicking on "expand" icon, in bottom right of each div in live version. i not sure why works, face's useful comment helped me find resizing window fixes problem. right after update items inside book, trigger resize method: $(window).resize(); and seems rid of problem, thanks! it ...

ruby - Routing/Config errors when upgrading to rails 4 -

i installed ruby 2 , rails 4, , created new project. made devise user, , went run server. got error /users/michaeldunnegan/.rvm/gems/ruby-2.0.0-p247@rails-4.0.0/gems/railties-4.0.0/lib/rails/application/routes_reloader.rb:10:in `rescue in execute_if_updated': rails::application::routesreloader#execute_if_updated delegated updater.execute_if_updated, updater nil: #<rails::application::routesreloader:0x007f85ac132458 @paths=["/users/michaeldunnegan/projects/soundshare/config/routes.rb"], @route_sets=[#<actiondispatch::routing::routeset:0x007f85ac188e48>]> (runtimeerror) i have absolutely no idea do. configuration pretty weird me. think error might in path, whatever is, can't sure. my rvm current looks like: ruby-2.0.0-p247@rails-4.0.0 , if that's relevant this known bug rails 4 , devise. please see rails issue on github

java - Parsing JSON by using gson -

{ "took": 6200, "timed_out": false, "_shards": { "total": 68, "successful": 68, "failed": 0 }, "hits": { "total": 110745094, "max_score": 1, "hits": [] }, "facets": { "pie": { "_type": "terms", "missing": 135, "total": 29349, "other": 26420, "terms": [ { "term": "165.130.136.210", "count": 390 }, { "term": "165.130.136.206", "count": 381 }, { "term": "205.138.114.8", "count": 359...

javascript - Pulling value from form, then converting text to integer -

i've been trying use jquery pull variable form (as string) , convert number have added other variables. instead, nan displayed. <input type="text" name="donation" id="donation" value="0"> var donation = parseint(form.find('input[text=donation]'), 10); used jquery in past, still new aspects. appreciated. perhaps because #donaton should #donation ?

eclipse - "java.lang.ClassNotFoundException: org.apache.commons.io.FileUtils" being thrown even though jar is in /lib -

i using eclipse indigo , have 2 dynamic web projects: project , project b. project has project b required project on build path , has ticked on properties -> java build path -> order , export . i have method in project a, calls method in project b has line: fileutils.writestringtofile(file, data); this line throws following exception: java.lang.classnotfoundexception: org.apache.commons.io.fileutils @ java.net.urlclassloader$1.run(unknown source) @ java.net.urlclassloader$1.run(unknown source) @ java.security.accesscontroller.doprivileged(native method) @ java.net.urlclassloader.findclass(unknown source) @ java.lang.classloader.loadclass(unknown source) @ sun.misc.launcher$appclassloader.loadclass(unknown source) @ java.lang.classloader.loadclass(unknown source) @ my.package.projectb.class.createandwritetofile(fileutil.java:62) @ my.package.projecta.class.savecurrentdialog(uiresponsestrategy.java:99) ... project b has commo...

java - screenshot saving as autogenerated file name -

i made button take screenshot , save pictures folder. set being saved under name capture.jpeg wanted saved such cafe001.jpeg, cafe002.jpeg this. please let me know how can save time format.jpeg ? thank in advance container = (linearlayout) findviewbyid(r.id.linearlayout1); button capturebutton = (button) findviewbyid(r.id.capturebutton); capturebutton.setonclicklistener(new onclicklistener() { public void onclick(view v) { container.builddrawingcache(); bitmap captureview = container.getdrawingcache(); fileoutputstream fos; try { fos = new fileoutputstream(environment.getexternalstoragepublicdirectory(environment.directory_pictures).tostring() + "capture.jpeg"); captureview.compress(bitmap.compressformat.jpeg, 100, fos); } catch (filenotfoundexception e) { e.printstacktrace(); } toast.maketext(getapplicationcontext()...

Proper way to update Edges in Bulbs (neo4j or titan) -

i'm experimenting bulbs interface graph database. ( production use titan, locally neo4j seems best experimenting ). i can't wrap head around concept... bulbs shows how create new vertices... >>> james = g.vertices.create(name="james") >>> julie = g.vertices.create(name="julie") >>> g.edges.create(james, "knows", julie) digging docs, can replace "get or create" : >>> james = g.vertices.get_or_create('name',"james",{'name':'james') what can't figure out, how existing edge. attempts far have ended recreating dozens of "james knows julie" relationships, instead of accessing existing 1 update. can point me in right direction? you can add/update edge's properties, graph databases, cannot update attributes make edge, i.e. cannot update incoming , outgoing vertex ids or label. instead, delete edge , add new one. here different w...

java - Google Guice - Use generic as parameter of injected field -

i want use generic parameter of class field injected, guice complains unbound key. possible inject field in test2? example: public static class test1<t1> { } public static class test2<t2> { @inject public test1<t2> test; } public static void main(string[] args) throws exception { injector injector = jsr250.createinjector(stage.production, new testmodule()); test2<string> test = injector.getinstance(key.get(new typeliteral<test2<string>>(){})); } private static class testmodule extends abstractmodule { @override protected void configure() { bind(new typeliteral<test1<string>>(){}).toinstance(new test1<string>()); bind(new typeliteral<test2<string>>(){}).toinstance(new test2<string>()); } } well, overkill java generics. code not work without injection, cuz test1<t2> cannot match test1...

Android copy existing project with new name in Android Studio -

i copy android project , create new project form same files different name. purpose of can have second version of app ad supported in app store. i found answer here: android - copy existing project new name but eclipse, how can in android studio? the steps in link specified should work android studio. make copy (using file manager) of entire module folder , give new name. open , use refactor -> rename (right click on item want rename) rename module , package. see this details refactoring in intellij/android studio.

forms - Make combobox act like drop-down list (C#) -

i'm using visual studio 2010 supports .net 4 , doesn't have support drop down list. trying same effect through combobox disabling ability user enter free-form text, not sure how. how can accomplish goal? additional info visual studio 2010 support goes .net 4 drop down box support in forms added in .net 4.5 ( http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.dropdownlist.aspx ) that's why can't use drop-down item nativity. that's why i'm asking help. visual studio 2010 have support drop down lists when using .net 4. part of same control you're using (the combo box), have set property it. change dropdownstyle property dropdownlist . or programmatically with: combobox1.dropdownstyle = comboboxstyle.dropdownlist; check out msdn on comboboxes: combobox.dropdownstyle property

c# - Finding Average using nested queries on another table -

i have common problem unable solve looking several forums on internet. i have restaurant rating application uses asp.net webapi. app has 2 tables restaurant , comments table. each restaurant may have several comments , each comment has rating value. trying put method in webapi pull details restaurant table average rating value each restaurant looking comments table. attempt far in code below, doesn't work. have tried using aggregate function, average function, nested queries, joins, etc still unable pull average value. grateful if help? public iqueryable<restaurantview> getrestaurants(string all) { var query = x in db.restaurants select new restaurantview { restaurantid = x.restaurantid, restaurantname = x.restaurantname, restaurantdecription = x.restaurantdecription restaurantratingaverage = (from in db.restaurants ...

images not displayed when iOS app run on device -

when run application on device, images not displayed. when in simulator mode images displayed. i receive no copy error messages or other kind of alerts when run app on device. any ideas? also images in question in paged ui scroll view, coded using following tutorial: http://www.raywenderlich.com/10518/how-to-use-uiscrollview-to-scroll-and-zoom-content the paging uiscrollview section of tutorial. thanks i start verifying have imported images correct resolutions. may example, have added retina images work in retina simulator, not on low res test device. additionally, may want consider deleting images project , re-adding them making sure select both "add target" , "copy files" check boxes on import prompt. edit: another possibility you've made capitalization error when referencing images in code. important keep in mind simulator not case sensitive these things, real device is. example, if you're image titled "image.png...

php - Submit form after countdown finishes -

i'm trying submit document ( return_url ) after countdown finishes. in current code below document submitted after countdown starts. how can make countdown finish before submitting document_url ? code: <body> <center> <form name="redirect"><font face="helvetica"><b> thank you! redirected in<input type="text" size="1" style="font-size:25px" name="redirect2">seconds.</b></font> </form></form> </center> <form name="return_url" method="post" action="confirm.php"> <input type="hidden" name="order" value="1" /> <input type="hidden" name="price" value="100" /> </form> </body> </html> <script language="javascript" type="text/javascript"> var ta...

listview - who to bind listviewcolumn header into a column cell in WPF -

i have following problem. want set trigger binding path=columnheader <datatrigger binding="{dynamicresource resourcekey=actualcolumnheader}" value="1"/> (i dont know how call this...) my code this: <listview name="lv_reporte" > <listview.view> <gridview x:name="gv_reporte"> <gridviewcolumn header="order1"> <gridviewcolumn.celltemplate> <datatemplate> <textblock> <textblock.style> <style> <style.triggers> <datatrigger binding="{dynamicresource resourcekey=actualcolumnheader}" value="1"> </datatrigger> ...

php - List of objects -

what best method find parent items of comma separated string? e.g. array(1,2,3),array("test","123, abc"),1,"abc, 123" to get array(1,2,3) array("test","123, abc") 1 "abc, 123" is possible regular expression, or there nifty php function this? use explode . $myarray = explode(",",$original); this assuming original string, , desired output can iterate through: $original = 'array(1,2,3),array("test","123, abc"),1,"abc, 123"'; $myarray = explode(",",$original); foreach ($myarray $item) { echo $item."\n"; }

c# - Could not load file or assembly Hunspellx64.dll while using NHUnspell NuGet package? -

i have asp.net/mvc web role using nhunspell nuget package. when try run following error message: could not load file or assembly 'hunspellx64.dll' or 1 of dependencies. module expected contain assembly manifest. this strange because far know, web role project should not trying load unmanaged hunspellx64.dll @ all. should handled managed nhunspell dll. dll copied on /bin directory of web role build step. update: thomas's comment webactivator being outdated able fix issue. duplicating reply comment accepted answer make sure others have problem see fix: i had nhunspell working before error started occurring. broke things installing attributerouting nuget. attributerouting drags in old version of webactivator (1.0.0.0). unfortunately nuget not suggest update when execute update operation. have manually update via package manager console per web page's instructions: http://www.nuget.org/packages/webactivator here rest of original p...

clojure - Update-in nested map -

i'm new clojure , i've been staring @ time, i'm sure there's basic don't see. want conj 2 sets, they're nested, example: (def foo {:b #{:test}}) (def bar {:a {:b #{:ab}} :c :d}) i tried: =>(update-in bar [:a :b] conj (:b foo) ) {:a {:b #{#{:test} :ab}}, :c :d} i guess makes sense, wanted {:a {:b #{:test :ab}}, :c :d} i can't seem how either #{:test} out of set conj it, or access :b set given update-in syntax. any enormously appreciated. you need use into instead of conj : (update-in bar [:a :b] (:b foo)) ;= {:a {:b #{:test :ab}}, :c :d}

django - Using HttpResponseRedirect, but browser is not showing correct URL -

i have view accepts input user , on successful post, redirects page. it's pretty same code in tutorial: def quex(request, id, question_number): next_question = int(question_number) + 1 if request.method == 'post': # if form has been submitted... form = contactform(request.post) # form bound post data if form.is_valid(): # validation rules pass # process data in form.cleaned_data # ... return httpresponseredirect('/quex/' + id + '/' + str(next_question)) else: form = questionform() # unbound form return render_to_response('questionnaire.html', { 'form': form, 'id' : id, 'question_number' : question_number}, requestcontext(request) urls.py urlpatterns = patterns('', url(r'^$', 'django.contrib.auth.views.login'), url(r'^logout$', 'screening.views.logout_view')...

vb.net - How to calculate holidays for the USA -

i need know how calculate usa holidays. need solution works year. didn't want store dates in database need maintained. for holidays on weekend needs follow policy of government adjust weekday. if falls on saturday adjusted friday. if falls on sunday needs adjusted monday. understand many (most?) banks in same way. how calculate list of usa holidays? public function getholidaylist(byval vyear integer) list(of date) dim holidaylist new list(of date) '...fill list holidays ' new year's day jan 1 ' martin luther king, jr. third mon in jan ' washington's birthday third mon in feb ' memorial day last mon in may ' independence day july 4 ' labor day first mon in sept ' columbus day second mon in oct ' veterans day nov 11 ' thanksgiving day fourth thur in nov ' christmas day dec 25 'adjust weekends end...

php - SFTP remove files with wildcard characters -

i tried use phpseclib delete logs in sftp server. codes simple: $sftp = new net_sftp($host_name); $sftp->login($username, $password); // login successful $sftp->chdir('/somefolder'); if(!$sftp->delete('*.log')) { $logger->error('cannot remove logs'); } the log shows "cannot remove logs". however, use sftp command in shell, works : $ sftp myusername@example.com password: (type in password) sftp> cd /somefolder sftp> rm *.log removing xxx.log removing yyy.log sftp> ls ( no more *.log ) sftp> exit does phpseclib delete function supports wildcard character ? if not, alternatives ? does phpseclib delete function supports wildcard character ? if not, alternatives ? not @ present no. guess $sftp->nlist() , preg_match on each row returned nlist. if matches delete it, otherwise keep it.

php - Searching in ajax does not return result with spaces -

after clicking search button in page typically outputs result of query. have problem regards conditions value of field has white space. doing trim string , in database using statement. $(document).ready(function(){ $('#btnsearch').click(function(e) { $("#content0 #sub_cont0").load("view/search.php?document=<?php echo $_get['document']; ?>&stat=<?php echo $_get['stat']?>&ac=<?php echo $_get['ac']; ?>&fac=<?php echo $_get['fac']; ?>&val=" + $("#txtsearch").val() + "&model=<?php echo trim($_get['model']);?>"); $(".tblmodellist").fadeout("slow"); }); }); example search word "casing". under category model = "test model". when queried in database, not output using query. note: in above script, trimmed model output "test" only. still not return expected result set. $sql =...

Python class variable name vs __name__ -

i'm trying understand relationship between variable python class object assigned , __name__ attribute class object. example: in [1]: class foo(object): ...: pass ...: in [2]: foo.__name__ = 'bar' in [3]: foo.__name__ out[3]: 'bar' in [4]: foo out[4]: __main__.bar in [5]: bar --------------------------------------------------------------------------- nameerror traceback (most recent call last) <ipython-input-5-962d3beb4fd6> in <module>() ----> 1 bar nameerror: name 'bar' not defined so seems have changed __name__ attribute of class can't refer name. know bit general explain relationship between foo , foo.__name__ ? it's simple. there no relationship @ all. when create class local variable created name used, pointing @ class can use it. the class gets attribute __name__ contains name of variable, because that's handy in cases, pickling. you can set local varia...

javascript - trouble understanding Popcorn.js timeupdate function as it is not working in certain cases -

why 1st block of code working while 2nd 1 not ?? -- the following code works:- // code works -- <script src=".../popcorn-complete.min.js"></script> var time_prompts = new array(); time_prompts[0] = 2 //any integer < video duration $popcorn.on( "timeupdate", function() { console.log( this.currenttime() ); if (this.currenttime() > time_prompts[0] && this.currenttime() < time_prompts[0]+0.1) { this.pause(); console.log(this.paused) } }); while following code doesn't work:- // code not work <script src=".../popcorn-complete.min.js"></script> var time_prompts = new array(); time_prompts[0] = 2 //any integer < video duration $popcorn.on( "timeupdate", function() { console.log( this.currenttime() ); if (this.currenttime() == time_prompts[0]) { ...