Posts

Showing posts from August, 2014

ios5 - iOs / Phonegap: Load external mobile site? -

so i've been looking @ ( iphone phonegap based app load external website made of componentone ) thread , wondering if same still holds true today? i'm planning on making ios app little more load external site created jquery mobile. idea of course use same site many plattforms possible. 1.) if apple still reject apps redirects, option create native ios app? and, 2) if not, what's simplest solution solve this? i've been testing pageinit fires changepage, isn't working. i'm pretty sure apple reject application if native shell redirects website. can same functionality creating book mark on home screen launches website. expect following rejection letter apple: "we've completed review of app cannot post version app store because experience provides not sufficiently different web browsing experience, incorporating native ios functionality. while app content may differ web site, experience provides not differ general experience...

android - How to get rid of click effect on custom row listview? -

i trying disable click effect on row. have used custom row have bind arrayadapter. have tried android:clickable="false", android:focusable="false" on listview, on textview, buttons, , imageview have used displaying in row. here "web_message_list.xml" <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/exclamation_feather_top" > <relativelayout android:id="@+id/titlearea" android:layout_width="match_parent" android:layout_height="40dp" android:background="@drawable/top_head"> <imageview android:id="@+id/btn_cancel" android:layout_width="wrap_content" android:layout_height=...

java - Calling Methods of Anonymous Inner Class in the parent class -

i got below doubt when surfing anonymous inner class here original code downloaded , working around (please refer below code questions). as per link above cannot overload & add additional methods in anonymous inner class. but when compile below working fine though not able call public methods outside inner class. initially surprised why not access public methods outside inner class realized object being held "father" class reference not know such function call. what changes can make in below code making calls overloaded method , new method outside inner class? class testanonymous { public static void main(string[] args) { final int d = 10; father f = new father(d); father fanon = new father(d){ // override method in superclass father void method(int x){ system.out.println("anonymous: " + x); method("anonymous: " + x); //this compil...

iphone - My application crashes if i get no records from SQLite -

i'm working sqlite first time.... discount in db, , every things works fine, until select "nothing". happens if amount (adnumbers) higher or lower specified in db. then when trying retrieve discount value db column error , application crashes. have tried make null check, doesn't seems help/work. i have tried use while( sqlite3_step(compiledstatement) == sqlite_row){ but don't returned @ all... please point me in right direction - how check if db returns records (adnumbers between values en db ) this method.. -(nsstring *) addisq:(nsstring *)strdisq:(nsinteger)adnumbers{ nsstring *strdiscount; strdiscount = @"00"; if(adstmt == nil) { const char *sql = "select id, discount_type, description, ad_from, ad_to, ad_disq discount " "where (((discount_type)=?) , ((?) between ad_from , ad_to))"; if(sqlite3_prepare_v2(database, sql, -1, &adstmt, null) != sqlite_ok) nsassert1(0, @...

facebook - App bookmark not visible on the left-side "Apps" section -

Image
my open graph enabled app not generate app bookmark on left side of facebook homepage (near "apps" section). the application in question located here: http://apps.facebook.com/lrytaslt/ it's in lithuanian, clicking on news link ask basic permissions , once approved redirect inner news page. time should added left side bookmark. not happen. can't see app under "more" link, app visible under "apps , games" link icon (with no way "favorite" regular bookmark link). is intended behavior? new facebook feature or bug? has run similar bookmark-related issues? edit: attached small screenshot issue: that app automatically redirects elsewhere when open it, that's why there's no bookmark - bookmarks available canvas apps according documentation - shouldn't redirect if want bookmark the bookmark added automatically after user continually uses canvas app few minutes

asp.net mvc 3 - Adding value to submitbutton with image -

Image
i have problem : have submit button defined follows : <input type="submit" name="actionname" value="search" /> <input type="submit" name="actionname" value="new" /> both submit buttons included in ajax beginform: @using (ajax.beginform("pfsearch", "payer", ajaxoptions)) in controller ... based on actionname string provided .. different actions based on value of button pressed within ajax befin form : if (actionname="search") { //do } and works charm .. until want add want add image class of submit button : <input class="search" type="submit" name="actionname" value="search" /> <input class="search" type="submit" name="actionname" value="new" /> my search tab looks : can see main impediment adding value ... text appears on image. how can make button act differentl...

objective c - Does either klazuka/Kal or EventKit handle multiple calendars? -

i have ipad app needs have multiple calendars, 1 each employee, , 1 giving consolidated view of of employee's calendars. does either kai or eventkit support requirement? if not, there calendar api will? event kit this... provided have ekeventstore called myeventstore, define calendar array so: nsarray *calendararray = myeventstore.calendars; and fetch events this nspredicate *fetchallevents = [self.myeventstore predicateforeventswithstartdate:[nsdate distantpast] enddate:[nsdate distantfuture] calendars:calendararray]; //you can modify predicate, keep calendar:calendararray nsarray *allevents = [self.myeventstore eventsmatchingpredicate:fetchallevents];

MongoDB stored procedures NOT in javascript -

i have collection , want perform action on every insert collection. problem code, actions in java. in oracle possible wrap java or c code pl/sql procedure, , use procedure in trigger. in couchdb write view. what closest analog mongodb? best possibility can think of wrap code rest server, , interact using stored javascript. i've seen this question, due dependency on java libs, can't use javascript in workflow, neither don't want run new heavy service along mongodb if there other way this. there number of things request: i have collection , want perform action on every insert collection. 1) you're asking here not "stored procedure", "database trigger". mongodb not provide sort of "database trigger" functionality. this consistent general design goals of mongodb, provide fast, scalable data store without heavy weight of traditional dbms systems. see presentation more details design goals of mongodb: http://www.10gen.c...

vba - Move data from MS Word to Excel -

i have microsoft word document 400 multiple choice test questions. need put text microsoft excel chart , thought alot easier if able have macro allowed me select text began a. , ends section @ first paragraph object after a. . i tried getting , told use below macro macro not anything. want macro select text only. if in microsoft word manually, hold down ctrl , highlight text begins a. , ends @ first paragraph object. sub aselection() ' ' aselection macro ' dim pgh paragraph each pgh in thisdocument.paragraphs pgh if left(.range.text, 2) = "a." , left(right(.range.text, 3), 2) = "a." debug.print .range.text end if end next end sub thisdocument typically refers template document containing executing code. use activedocument instead. also @assylias said in comment, debug.print code debugging purposes. replace entire line .range.select . this should work: sub aselection() dim o object dim pgh paragraph set o = cr...

sparql - use more than 1 input inference in Virtuoso -

i have 1 input inference in virtuoso open source, defined goodrelations site -- rdfs_rule_set('http://purl.org/goodrelations/v1', 'http://purl.org/goodrelations/v1'); -- used in query using -- define input:inference <http://purl.org/goodrelations/v1> . now want consolidate brand have same name, give owl:sameas inference it, , insert in rule set -- rdfs_rule_set('samebrands', 'samebrands'); however, when add more inference, virtuoso told me can't add more 1 inference query. how should it? thank :). you have use pragma: define input:same-as "yes" see documentation . another approach define inference rule contains 2 graphs (gr , samebrands).

c# - Remove property from Property pane in Visual Studio -

is possible remove form property or set of properties properties pane in visual studio? backstory: i've made usercontrols inherit common form properties, want remove "anchor" , "dock" properties properties pane in visual studio, since usercontrol using different resizing logic, logic anchoring , docking don't seem support. i'm thinking it's annotation of kind, i'm not entirely sure, , wasn't able find on google. thanks in advance! the attribute want browsable http://msdn.microsoft.com/en-us/library/system.componentmodel.browsableattribute.browsable.aspx override dock , anchor on user controls, add attribute (with "false" value) them , see if works (make sure recompile in order designer load changes)

subscript - in R Plot importance variables of Random Forest model -

what doing wrong here? "subscript out of bound" mean? i got below code (first block) excerpt form revolution r online seminar regarding datamining in r. i'm trying incorporate in rf model ran can't pass think ordering of variables. want plot importance of variables. i included little more needed below give context. erroring out third line of code. second code block errors getting applied data working with. can me figure out? ------------------------------------------------------------------------- # list importance of variables. rn <- round(importance(model.rf), 2) rn[order(rn[,3], decreasing=true),] ##@# of # plot variable importance varimpplot(model.rf, main="",col="dark blue") title(main="variable importance random forest weather.csv", sub=paste(format(sys.time(), "%y-%b-%d %h:%m:%s"), sys.info()["user"])) #-------------------------------------------------------------------------- my...

Oracle Hibernate configuration to resolve connection refused error -

tried use hibernate oracle , ended connection refused error. ora -12516 following options tried: set connection pool used c3p0 third party setting connection pool. changed ora settings increase job queue process. is there better analysis or solution available ? the issue got resolved after changing job queue process 500. each time app run went 45 , has caused issue.

ruby on rails - writing spec for method that hits a web service -

i'm writing spec verify video model create proper thumbnail vimeo video when created. looks this: "creates thumbnail url" vimeo_url = "http://player.vimeo.com/video/12345" vid = factory.build(:video, video_url:vimeo_url) # thumbnail created when saved vid.save! expect uri.parse(vid.thumbnail_url) end.to_not raise_error end the problem test super slow because has hit vimeo.com. i'm trying stub method calls server. 2 questions: 1) correct way/time stub something 2) if yes, how stub it? in video model have method called get_vimeo_thumbnail() hits vimeo.com. want stub method. if in spec vid.stub(:get_vimeo_thumbnail).and_return("http://someurl.com") doesn't work. when run test still hits vimeo.com. the vcr gem worth considering. hits real web service first time run , records response can replayed next time run test (making subsequent tests fast). i can't see wrong ...

asp.net mvc - Composing bounded context on single page -

i'm starting large project , want use ddd. main problem how display data multiple bounded context without duplicating data , mappings of nh. watched udi's podcast composite application. mention using razor sections display data multiple bounded contexts doesn't provide details. know how use or know other way? good thing razor allows have independent controllers responsible rendering parts of single page (portal style). example in main razor view: <some_markup> new products </some_markup> @{ html.renderaction("get", "newproducts"); } <some_markup> product ratings </some_markup> @{ html.renderaction("get", "productratings"); } where newproductscontroller , productratingscontroller belong different bounded contexts , this: public class newproductscontroller { private readonly iproducts repository; public newproductscontroller(iproducts repository) { ... } [childac...

c++ - How to get codepoint of particular WCHAR character? -

for example need codepoint of 5th character here, ð const wchar* mystring = l"Þátíð"; i know has code point : u+00f0 - how integer using c++ ? const wchar mystring[] = l"Þátíð"; size_t mystringlength = 0; if(succeeded(stringcchlengthw(mystring, strsafe_max_cch, &mystringlength)) { lpcwstr mystringiterator = mystring; for(size_t sz = 0; sz < mystringlength; ++sz) { unsigned int mysupersecretunicodecharacter = *mystringiterator; lpcwstr mynextiterator = charnext(mystringiterator); std::vector<unsigned int> diacriticsofmysupersecretunicodecharacter(mystringiterator+1, mynextiterator); mystringiterator = mynextiterator; } } edit 1: made work edit 2: made codepoints

How do I hide the cancel button in a custom DialogPreference in Android? -

how hide cancel button in custom dialogpreference in android? override onpreparedialogbuilder , set null there. /** hide cancel button */ @override protected void onpreparedialogbuilder(builder builder) { super.onpreparedialogbuilder(builder); builder.setnegativebutton(null, null); }

ios - Declaring a number (runningScore) that can be subtracted from and new number retained in objective c -

i looking set calculator of sorts whereby there targetscore , when click on button subtracts given number targetscore , result becomes new targetscore , process continues until targetscore 0. i have read steven kochans book, , several objective c dummies (quite appropriate me), have looked @ tutorials on lynda.com , read million threads on here have yet find suitable answer (or @ least 1 have recognised suitable). new objective c , more prepared hard yards , research if can point me in right direction. i not asking write code me point me in right direction, i.e. declare targetscore nsobject/nsnumber/nsdecimalnumber/nsmutablearray etc , how new targetscore retained , replace old targetscore. i thank in advance proffered, baby steps. smallest possible data format satisfy needs. in case - you'd short char (for score -128 127) or unsigned short unsigned char (for score 0 255). if not, int or nsinteger cover bases (unless score higher 2^31). it's simple inte...

reduce in performance when used multithreading in java -

i new multi-threading , have write program using multiple threads increase efficiency. @ first attempt wrote produced opposite results. here have written: class threadimpl implements callable<arraylist<integer>> { //bloom filter instance 1 of table bloomfilter<integer> bloomfilterinstance = null; // data member complete data access. arraylist< arraylist<userbean> > data = null; // store result of testing arraylist<integer> result = null; int tableno; public threadimpl(bloomfilter<integer> bloomfilterinstance, arraylist< arraylist<userbean> > data, int tableno) { this.bloomfilterinstance = bloomfilterinstance; this.data = data; result = new arraylist<integer>(this.data.size()); this.tableno = tableno; } public arraylist<integer> call() { int[] tempresult = new int[this.data.size()]; for(int i=0; i...

Issue in setting bgcolor for gridview items in android -

this may simple couldn't find solution this. problem setting background color gridview items inside onitemlongclicklistener method. i have 2 linear layouts, 1 contains textview , gridview , contains buttons(i set layout menubar on top of screen). hide second 1 screen using setvisibility(view.gone) , when ever itemlongclick on gridview item second 1 appear using setvisibility(view.visible) @ same time want change bgcolor of clicked/selected item. everything working fine whenever second layout visible , whenever scrolling gridview, clicked/selected bgcolor disappear. i tried many ways couldn't solve problem. please have on coding , tell me did wrong. gv.setonitemlongclicklistener(new onitemlongclicklistener() { public boolean onitemlongclick(adapterview<?> parent, view strings, int position, long id) { final option o = dir.get(position); //gv.performitemclick(gv, position,gv.getitemidatposition(posit...

android - multiple table sqlite database -

i new sqlite database , want make 2 tables: 1) my_folders( folder_id integer primary key autoincrement, folder_tite text not null currency text folder_descrip text folder_pic text ); 2) table my_expenses( log_id integer primary key autoincrement, e_folder_id integer name text not null, amount integer date numeric not null time numeric not null notes text foreign key(e_folder_id) references my_folders(folder_id) ); my question how implement 2nd table? can directly add codes create 2nd table "my_expenses" in same dbadapter file? or should seperate tables in different files in https://stackoverflow.com/a/5899110/1398267 ? if that's case, codes required insert new record in table my_folders , my_expenses? i created 1 table , can add new record table through piece of codes: button b1 = (button) findviewbyid(r.id.bnext); b1.setonclicklistener(new onc...

PHP session time out on browser open -

i know there many threads regarding php sessions while ajax queries etc... problem is, i have ajax grid (build after page load), allow edit when use logged on. don't mind session not checked until user change page (then valid_session.php called), have issue, when next day user opens browser on same page - grid still editable! if refresh page, user logged out. i have no-cache set on pages, browsers (in particular chrome) don't reload on open. i can't head around how force refresh on reopen. please guide me right direction... edit btw - found way handle this. call session_destroy(); in session_destroy.php on unload() via $.get() : $(window).unload(function() { $.get('session_destroy.php', function(data) { alert(data); // alerts me of var set 0 - meaning session destroyed. }); }); one solution set "last refreshed" cookie, , have javascript setinterval() checks if cookie older than, 20 minutes. if is, javascript tr...

regex - Does Vim have an equivalent to \X to match Unicode "grapheme clusters"? -

unicode specifies \x should match "extened grapheme cluster" - instance base character followed 0 or more combining characters. (i believe simplification may suffice needs.) i'm pretty sure @ least perl supports \x in regular expresions. but vim defines \x match non-hexadecimal digit. does vim have equivalent \x or way match unicode extended grapheme cluster? vim have concept of combining or "composing" characters, its documentation not cover whether or how supported in regular expressions. it seems vim not yet support directly, still interested in workaround search highlight characters include combining character in @ least basic range of u+0300 u+0364 . you can search characters , ignore composing characters \z . or can search range of unicode characters. read :help /[] more information on both. the last post here may offer more help: http://vim.1045645.n5.nabble.com/using-regexp-to-search-for-unicode-code-points-and-properti...

visual studio 2010 - Open .ISM with InstallShield Limited Edition -

environment: tfs 2010 + visualstudio 2010 + installshield limited edition. i sorry novice installshield. i have installshield project .ism extension. possible load in installshield limited edition. tried not recognizing .ism extension. i tried create new installshield project using installshield limited edition. generates .isl , .isproj extensions instead of .ism. what .ism (if installshield creating .isl , .isproj project files)? how can work on .ism installshield setup (project) , using installshield limited edition (if possible)? my minimum requirement existing setup , if not enabled build , generate msi. thanks , regards sumeet nandan garg. installshield limited edition cannot import, open, or build projects created in paid edition of installshield. in order better idea in project, might try evaluating professional or premier edition of installshield. if find need beyond capability set of limited edition, need purchase professional or premier edition. ...

express - Access bundled node.js module -

i wrote small express.js based web app. serve manifest.webapp express.js doesn't send correct mime type. because express.js bundles mime module require("mime").define(...) has no effect. defines mime type wrong module! is there way access mime module bundled express.js? or there way tell npm (and nodejitsu) not use bundled modules of express.js? i think there 2 ways fix this. use simple middleware app.get('*.webapp', function (req, res, next) { res.header('content-type', 'application/x-web-app-manifest+json'); next(); }); monkey patching modify response object , overwrite setheader method, can modify response actual value (it work middleware). var mime = require('mime'); mime.define({ 'application/x-web-app-manifest+json': [ 'webapp' ] }); app.use(function (req, res, next) { var setheader = res.setheader; res.setheader = function (field, val) { // can more strict here if (field ==...

ios - Releasing Returned object Error in Objective-c -

i have code wherein allocate nsmutableindexset , return object inside set used other methods. here code: nsmutableindexset *indexes = [nsmutableindexset new]; for (nsnumber * number in bookmarksarray) { [indexes addindex:[number intvalue]]; } return indexes; upon researching on how release returned objects, edited code above this: return [indexes autorelease]; however, gave me error saying message sent deallocated instance. should this? suggestions? the problem maybe instance got method not retained if set ivar or so. return [indexes autorelease]; //this ok. but within other methods, call method indexes, if want returned instance indexes remain out of method, should retain it. because instance got autoreleased, dealloced out of method generally.(next run loop here) nsmutableindexset *ivarindexes; - (void)othermethod { ivarindexes = [[self getbookmarkindexes] retain]; //for later use }

c++ - Delete array from an offset -

lets allocate array of ints int test[] = new int[100]; i take pointer somewhere in middle int *temp = &test[50]; then call delete[] on temp delete[] temp how compiler know size of elements delete in case? it won't (or will, don't know). you're invoking undefined behavior . you're allowed call delete[] on pointer allocated new[] . for example, crash in msvs.

regex - Convert PHP preg_match to javascript -

can me converting this preg_match('/^(.*?)[#,\.0]+(.*?)$/',$patterns[0],$matches) into javascript equivalent? tried doing matches = patterns[0].match('/^(.*?)[#,\.0]+(.*?)$/') but results in null... remove quotes regex matches = patterns[0].match(/^(.*?)[#,\.0]+(.*?)$/);

changing argument value in a C++/Python code -

my problem follow: have c++ code can't modify want (not written me , under intellectual property constraints). have link python code through python main. use boost::python reflection. @ point in code, c++ function use python overloaded function of c++ function modify parameter. function works great when used inside python. when called c++ function, modification of parameter not taken account while in c++. model problem, wrote simplified version aimed @ isolating problem. here c++ classes: #include <iostream> using namespace std; #include <boost/ref.hpp> //class aimed @ modeling c++ user's type should used in python class c { public: double myc; c(){} ~c(){} void setvalue(double val) { myc = val; } double getvalue() { return myc; } }; /* class derived in python want sure that: - void (g) , non void (f) functions reflected , extended in python - function (h) local type (c) use python overloaded ...

ruby - Rails Routes Starting Slash -

could please tell me significance of starting slashes on routes? get "search" => "hello#world" vs "/search" => "hello#world" both works what's difference? they same. ruby on rails being forgiving allowing both formats. may use them interchangeably.

swing - Re-using JTextField in Java pop-ups -

i'm building large java application uses multiple pop-up windows. of these windows must able displayed @ same time (for instance, separate pop-ups google earth , webcam feed), of them can displayed 1 @ time (for instance, error messages). first kind of pop-ups, webcam kind, working fine. error message pop-ups act webcam type of pop-ups (that is, create new .class files , there can multiple error pop-ups). how fix this? should create new error class? also, in 1 of webcam-type pop-ups, have jtextfields read username , password. log-in popup works fine, if use once, close it, , use again, doing gettext() on jtextfields returns empty string. think problem might related 1 above, not sure. passwordaction.addactionlistener(new actionlistener() { jframe pwpop=new jframe("log in"); jtextfield unamefield; jtextfield pwfield; public void actionperformed(actionevent arg0) { pwpop.setbounds(250,200,300,150); ...

r - How to align ggplot title with window rather than plot grid? -

Image
in ggplot2 version 0.9 behaviour of alignment of plot title changed. whereas in v0.8.9 alignment relative plot window, in v0.9 alignment relative plotting grid. now, whereas agree desirable behaviour, quite have long plot titles. question: there way of aligning plot title plot window rather plot grid? i'm looking solution automatic alignment of plot. in other words, manual alignment using hjust not work me (i run on hundreds of plots each project). any solution used grid directly acceptable. some sample code , plot: (notice how title gets truncated @ right of window). dat <- data.frame( text = c( "it made me feel positive brand x", "it clear , easy understand", "i didn't al all"), value=runif(3) ) library(ggplot2) ggplot(dat, aes(text, value)) + geom_bar(stat="identity") + coord_flip() + opts(title="thinking ad you've seen, agree following statements? agree that...") + theme_...

mysql - How can I join a database and table where the database name is derived from a field in the current table? -

i have database server stores main database and, table within database has structure similar below companies.companyinfo id | name | databasename | otherinfo ---+----------+--------------+---------- 0 | companya | databasea | extra1 1 | companyb | databaseb | extra2 and company databases follows databasea.users userid | name | password | -------+---------+-----------+--------- 0 | user1 | pass1 | other1 1 | user2 | pass2 | other2 and databaseb similar. what want user information 1 of usertable, linked main database so want kind of subselect user details, feed database name subselect companies.companyinfo table query. i'm stuck.. please help! it's not entirely clear you're after, in principle 1 cannot use expressions (including value of field table lookup) identifiers (e.g. name of table or column). one workaround 'prepare' statement string containing desired query; such string can constructed c...

php - Operation not permitted - unlink on local machine -

im trying unlink folder on local version of site. i error: operation not permitted any ideas how can unlink work on local machine? im using mamp. see documentation : unlink — deletes file and see also: rmdir () - removes directory you have directory. need use rmdir , not unlink .

google app engine - Use URL part to create multi tenant AppEngine application -

i'm trying different ways of implement multi tenant appengine web restful interface. 1 of them use part of url tenant name. problem i'm using jersey jax-rs implementation restful interface , url such /tenant1/res1 first parsed something take /tenant1 part, set namespace tenant1 , pass rest of url jerseys' servlet regular handling. the something maybe either servletfilter or servlet or can't think of. how can implement such thing? possible problems of such implementation? thank you, ido. i using restlet. namespace uniquely identifies customer user belongs to. the first url fragment contains namespace. verify namespace in restlet authenticator (basically filter) , when authenticated user not belong given namespace/customer refuse proceed. i use primary key of customer namespace. has added advantage valid namespace/customer can (mem-)cached, , refuse calls containing invalid namespaces. very happy setup , no problems encountered.

cocoa touch - Is there any built in method for sorting in Objective-c? -

i have 2 sorted nsmutablearrays (or can use other collection, not critical), need insert objects first array second , preserve sort order in second array. optimal (fastest) method that? can implement known algorithms, question is, if there built-in method? if not, best algorithm in case? the real answer be: it depends , since asking: fastest way of inserting objects 1 array while preserving sort order. there no built in way of inserting in right place of sorted array. can achieve same effect adding 2 arrays won't "the fastest way". what faster depends on many things like: how data arrays contain, ratio of data in array 1 vs array 2 (does 1 array contain more data other)?, etc. note: should begin simple solution , optimize once experience performance problems. measurements large data set though, see solution works whatever data users may have. inserting items 1 sorted array sorted array if want merge 2 arrays inserting objects in right place no...

validation - WPF ValidationRules disables PropertyChanged -

i have following textbox have propertychanged in viewmodel. when insert binding.validationrules , insert wrong value, doesn't trigger propertychanged event , don't understand why. help? <textbox name="riskcode" horizontalalignment="left" margin="101.923,8,0,81" textwrapping="wrap" width="56.077" maxlength="6" validation.errortemplate="{staticresource validationtemplate}" style="{staticresource textboxinerror}"> <textbox.text> <binding path="riskcode" updatesourcetrigger="propertychanged"> <binding.validationrules> <vm:riskcodevalidation/> </binding.validationrules> </binding> </textbox.text> </textbox> use validationstep . http://msdn.microsoft.com/en-us/library/system.windows.controls.validationrule.validationstep.aspx rawproposedvalu...

xcode - Resize NavigationController in InterfaceBuilder -

this daft question, there way resize navigation controller in storyboard? takes screen space. most of views pop-overs @ right size have huge ipad size navigation controller next them. this purely visual work in interface builder have 20 different screens , it's getting bit crowded.

ios - try-catch in JavaScript : how to get stack trace or line number of the original error -

when using try-catch in javascript, how line number of line caused error? on many browsers, below code work great , stack trace points actual line throw exception. however, browsers not have "e.stack". iphone's safari 1 example. is there someway line number work browsers? try { // lots of code here var = v.willgenerateerror; // how line number in catch?? // lots of code here } catch (e) { alert (e.stack) // work on chrome, ff. no not work on safari alert (e.line) // work on safari not on iphone } many thanks! update: found e.line works on safari still not available on iphone, latest ios version try use e.linenumber . example: try { var = v.willgenerateerror; } catch (e) { alert(e.linenumber); }

Qt Creator in Emacs keybind -

any way realize emacs keybind on qt creator (qtc)? some possibilities: emacskeys failed build (maybe because version supported emacskeys qtc 2.2.1 of today). utilizing fakevim feature (i haven't tried b/c modifying vim keybind , adjusting of emacs seems complicate) associating emacsclient (not tried) build error emacskeys : user@host:/usr/share/qtcreator/qt-creator-2.5.0-src$ sudo /usr/local/trolltech/qt-4.8.2/bin/qmake && make cd src/ && /usr/local/trolltech/qt-4.8.2/bin/qmake /usr/share/qtcreator/qt-creator-2.5.0-src/src/src.pro -o makefile failure open file: /usr/share/qtcreator/qt-creator-2.5.0-src/src/makefile unable generate makefile for: /usr/share/qtcreator/qt-creator-2.5.0-src/src/src.pro make: *** [src/makefile] error 5 environment) ubuntu 10.04, qt 4.8.2, qt 2.5 inspired this comment , i've managed configure emacs keybind, using qtc 's feature. "environment" -> "keyboard" tab down...

Drag file from device and copy to local hard disk drive using .NET -

i'm using code capture dragged files form , copy them specific folder (i have left copy process out, i'm using - filesystem.copydirectory(copyfiledetails.dir.fullname, copyfiledetails.target, uioption.alldialogs); , filesystem.copyfile(file, newfilename, uioption.alldialogs); this.dragenter += new drageventhandler(form1_dragenter); this.dragdrop += new drageventhandler(form1_dragdrop); private void form1_dragenter(object sender, drageventargs e) { //string action = e.data.tostring(); if (e.data.getdatapresent(dataformats.filedrop)) e.effect = dragdropeffects.copy; else if (e.data.getdatapresent("filegroupdescriptorw")) { system.io.memorystream info = e.data.getdata("filegroupdescriptor") system.io.memorystream; system.io.memorystream content = e.data.getdata("filegroupdescriptorw") system.io.memorystream; e.effect = dragdropeffects.copy; } } private void form1_dragdrop(object sender, drag...

c# - How to dispose the local variable that contains event -

possible duplicate: do event handlers stop garbage collection occuring? i had 1 wp7 application this: private void button1_click(object sender, routedeventargs e) { geocoordinatewatcher watcher = new geocoordinatewatcher(); watcher.positionchanged += new eventhandler<geopositionchangedeventargs<geocoordinate>>(watcher_positionchanged); watcher.start(); } void watcher_positionchanged(object sender, geopositionchangedeventargs<geocoordinate> e) { debug.writeline(e.position.timestamp.tostring()); } after click button twice,the console output timestamp twice. watcher local variable! what's wrong it? , how can distory it? watcher local variable, doesn't affect object necessarily. you've asked geocoordinatewatcher start - i'd expect maintain reference itself, effectively, or stash 1 somewhere appropriate. it sounds either ought disable button once it's clicked, or need keep watcher in instance variabl...

arrange act assert - Rhino Mock AAA expectation inside of expectation -

is possible mock following situation, using rhino mock aaa syntax: // interface interface ifoo { void executefoo( expression<action> action ); void increment(out int value); // value++ } // situation mock: var foo = new foo(); int value = 7; foo.executefoo( () => foo.increment( out value ) ); // , here mock needs remade: foomock.expect( f => f.executefoo( arg<expression<action>>.is.notnull )); foomock.executefoo( () => foo.increment( out value ) ); but instead of .is.notnull constraint somehow need pass expectation: foomock.expect(f => f.increment(out arg<int>.out(8).dummy)); i know may seem little bit odd, let's executefoo crucial , has done this. you can't set expectations on lambdas because of way handled compiler. see: http://weblogs.asp.net/psteele/archive/2010/06/18/rhino-mocks-lambdas-and-expectations.aspx

xcode - iOS - Generating pdf from multiple files -

i attempting convert text files pdf. easiest thing in world right combine of text files single string , use ios documentation here render single pdf. trouble is, these large text files; can equal on 90 pages. therefore need add in hyperlinks can create table of contents @ top , user can move beginning of each text file rather have scroll through 60 pages want go. problem is, if combine txt files single string, have no way of knowing when each file end while paginating, therefore wanted add files separately pdf before publishing it. problem is, @ best last txt file show rendered, because overwriting previous ones. below code, ideas? - (void)savepdffile:(nsstring *)file_name { // nsarray *filepath = [nssearchpathfordirectoriesindomains(nsdocumentdirectory, nsuserdomainmask, yes) objectatindex:0]; nsstring *homedir = nshomedirectory(); nsstring *savedirectory = [nsstring stringwithformat: @"%@/%@", homedir, @"documents/"]; nsarray *filear = [[nsfilema...

c++ - QuadTrees and recursive constructor stack overflow -

i'm creating chunked quadtree terrain , i'm trying ensure there never more 1 level of detail difference between 2 nodes. current code constructor this: quadnode::quadnode(rect area, quadnode * p, quadroot * r) { root = r; parent = p; level = p->level + 1; initializegeometry(area); for(int iii = 0; iii < 4; iii++) children[iii] = 0; for(int iii = 0; iii < 4; iii++) { if(quadrantneedschild(iii)) children[iii] = new quadnode(getrect(iii), this, root); } } and works fine. in order force no more 1 level of difference between 2 neighbour nodes i'm trying add end of constructor: quadnode * neighbour; for(int direction = 0; direction < 4; direction++) { neighbour = findneighbour(direction); if(neighbour) { while(level - neighbour->level > 1) { neighbour->subdivide(); neighbour = findneighbour(direction); ...

phpmyadmin - MySQL "You have an error in your SQL syntax" error -

my error: 1064 - have error in sql syntax; check manual corresponds mysql server version right syntax use near ')' @ line 10 what error , solution? create table login( user_name varchar(10) not null default", password varchar(10) not 'null default", email varchar(30) not null default", account_type varchar(10) not null default", ic int(10) not null default", telephone_no int(20) not null default", pin int(20) not null default", gender varchar(10) not null default", shipping_address varchar(100) not null default", city varchar(10) not null default", state varchar(10) not null default", country varchar(10) not null default", zip_code int(10) not null default", credit_type varchar(10) not null default", credit_number int(20) not null default", cvv2 int(3) not null default", ); mssql developer here (so not sure how can toy rdbms) reading error message have , before ); . f...

fortran - Why this MPI_SENDRECV is deadlock? -

this first post. thank in advance kind help. short code testing mpi_sendrecv,which did not understand. deadlock can tell me why? program sendrecv include "mpif.h" integer ibuf(20) call mpi_init(ierr) call mpi_comm_size(mpi_comm_world, nprocs, ierr) call mpi_comm_rank(mpi_comm_world, myrank, ierr) a=1 b=2 if (myid == 0) call mpi_sendrecv(a,1,mpi_real,1,0, . b,1,mpi_real,1,0, . mpi_comm_world, status,ierr) elseif (myid == 1) call mpi_sendrecv(b,1,mpi_real,0,0, . a,1,mpi_real,0,0, . mpi_comm_world,status,ierr) end if if (myid.eq.0) write(*,*) endif if (myid.eq.1) write(*,*) b endif call mpi_finalize(ierr) end as pointed out @steveblackwell, you're using myid instead of myrank . if use: call mpi_comm_rank(mpi_comm_world, myid, ierr) instead you'll halfway there. deadlock arises here because both processors (probabl...