Posts

Showing posts from June, 2011

asp.net - Put get set properties in another file -

here develop function.but after saw notimplemented exception occured there.and set properties.here code, private void modifymessage() { char [] characters_to_removed_from_end = { ' ' }; string trimmedstring = this.message_in.trimend(characters_to_removed_from_end); trimmedstring = regex.replace(trimmedstring, @"s\+", ""); trimmedstring = rearrangemessage(trimmedstring); } after automatically generate below code, private string rearrangemessage(string trimmedstring) { throw new notimplementedexception(); } public string message_in { get; set; } public string rearrangemessage { get; set; } } can put second code in file ? or happen here ? post edited full code.... using system; using system.collections.generic; using system.linq; using system.web; using system.web.ui; using system.web.ui.webcontrols; using system.configuration; using system.data.sqlclient; using system....

c# - Unable to See the my custom-made Windows Service in Services -

i developing custom made windows service using .net 2.0 framework. have used installerutil.exe , installs perfectly(according log command prompt). but, thing is, unable find under windows services. ran previous custom made services using 4.0 framework on pc , ran fine. note ddnt put code in service yet. need make start once installed. i've heard of problems installutil. try using command line sc program: sc create "service name" binpath= "full path service exe" start= auto just take care spaces in command line.

iphone - didUpdateToLocation is not called -

i want receive location updates. have added location delegate header: @interface appdelegate : uiresponder <uiapplicationdelegate, cllocationmanagerdelegate> and following functions: - (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions { //initialize location manager cllocationmanager* locationmanager = [[cllocationmanager alloc] init]; locationmanager.delegate = self; // [locationmanager startmonitoringsignificantlocationchanges]; [locationmanager startupdatinglocation]; self.window = [[uiwindow alloc] initwithframe:[[uiscreen mainscreen] bounds]]; self.viewcontroller = [[viewcontroller alloc] initwithnibname:@"someviewcontroller" bundle:nil]; self.window.rootviewcontroller = self.viewcontroller; [self.window makekeyandvisible]; return yes; } - (void)locationmanager:(cllocationmanager *)manager didfailwitherror:(nserror *)error{ //some problem } - (void)lo...

onclicklistener - how can I fire Onclick event programmatically in android? -

i have custom view withe 2 lineat layouts : first view's header , second the details view. in custom view, onclicklistener of header linearlayout defined: when fires, collapses/expandes second linearlayout. what want add more functionalities header's onclicklistener event (ie : collapse/expand second layout , show toast). i can't modify source code of custom view. tried set new onclicklistener hides initial event (collapse/expand). how should implement this? the source code of custom view: public class expandolayout extends viewgroup { /* declarations */ private linearlayout header; private linearlayout footer; /* code */ @override protected void onfinishinflate() { header= new linearlayout(context); header.setonclicklistener(new onclicklistener() { @override public void onclick(view v) { toggleexpand(); } }); } } what want add code defined onclicklistener even...

ios - UIBezierPath not drawing a smooth curve -

Image
i using uibezierpath drawing, , have written code on touch events , working fine, curves not smooth, when move finger around , draw curve, not smooth. - (void)drawrect:(cgrect)rect { [[uicolor redcolor] setstroke]; (uibezierpath *_path in patharray) [_path strokewithblendmode:kcgblendmodenormal alpha:1.0]; } #pragma mark - touch methods -(void)touchesbegan:(nsset *)touches withevent:(uievent *)event { mypath=[[uibezierpath alloc]init]; mypath.linewidth=5; mypath.linecapstyle = kcglinecapround; mypath.flatness = 0.0; uitouch *mytouch=[[touches allobjects] objectatindex:0]; [mypath movetopoint:[mytouch locationinview:self]]; [patharray addobject:mypath]; } -(void)touchesmoved:(nsset *)touches withevent:(uievent *)event { uitouch *mytouch=[[touches allobjects] objectatindex:0]; [mypath addlinetopoint:[mytouch locationinview:self]]; [self setneedsdisplay]; } here image in above image if see letters , d see c...

emacs - How to use this argument "KEEP-BACKUP-VERSION" on Lisp -

there. i use emacs editor. , write lisp(emacs-lisp) code. but, not know how use argument of file-name-sans-versions. on manual, ===== (file-name-sans-versions name &optional keep-backup-version) return file name sans backup versions or strings. separate procedure site-init or startup file can redefine it. if optional argument keep-backup-version non-nil, not remove backup version numbers, true file version numbers. ===== i not understand sentences => not remove backup version numbers, true file version numbers. so, please teach me "how to" sample code. thanks. there example in elisp manual , in (elisp) file name components node: if keep-backup-version non-`nil', true file version numbers understood such file system discarded return value, backup version numbers kept. (file-name-sans-versions "~rms/foo.~1~") => "~rms/foo" (file-name-sans-versions "~rms/foo~") ...

xslt - Accessing Properties of an xml file in Word 2007 -

i writing style sheet ms word 2007 , want add template using < xsl : template > element accesses properties of word 2007 document. (template, totaltime, etc.) can provide me code start this? at stylesheet level, declare namespaces prefixes wish use namespaces in word 2007 flat opc xml: <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/xsl/transform" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:ep="http://schemas.openxmlformats.org/officedocument/2006/extended-properties" xmlns:pkg="http://schemas.microsoft.com/office/2006/xmlpackage" xmlns:vt="http://schemas.openxmlformats.org/officedocument/2006/docpropsvtypes"> to remove <template> extended property (from app.xml in zipped docx): <xsl:template match="ep:template" />

ruby - Why is the splat/unary operator changing the assigned value a when p is called before *a = ""? -

to give little context around how understand problem. using splat collect on string sends :to_a or :to_ary string class string def method_missing method, *args, &block p method #=> :to_ary p args #=> [] p block #=> nil end end *b = "b" so thinking redefining :to_ary method i'm after. class string def to_ary ["to_a"] end end p *a = "a" #=> "a" p #=> "a" *b = "b" p b #=> ["to_a"] now confuses me no end. printing result *a = "a" changes value assigned a? to demonstrate further class string def to_ary [self.upcase!] end end p *a = "a" #=> "a" p #=> "a" *b = "b" p b #=> ["b"] very interesting question! ruby takes expression: p *a = "a" and translates this: temp = (a = "a") p *temp so first thing happens...

concurrency - @Version in hibernate, when running in cluster env does not work...(Optimistic Lock) -

i have entity uses @version on 1 of fields, want achieve if 2 transactions modify entity in same time, 1 fail(and optimistic lock exception) , other succeed. when run test on single jvm works fine, when run in cluster env, 2 transactions succeed , no optimistic lock thrown. public class deploymentlock { @column(name = "deployment_counter") private long deploymentcounter; @version @column(name = "entity_version") private long version; ... } am missing something? need use "@generated(generationtime.always)" under @version? im using spring , hibrnate in app way... idea? if have 2 instances of deploymentlock inside of 2 different hibernate sessions (usually in 2 different jvms or on 2 different hosts) each same version value, 2nd of updates call should throw hibernateoptimisticlockingfailureexception . basically hibernate doing like: update deploymentlock set deploymentcounter = ..., version = 2 version =...

apache - can't get virtualhost run on different port -

i'm trying setup on ubuntu, virtualhosts on different ports, can work. configuration in sites-available looks like namevirtualhost 127.0.0.1:5050 listen 5050 <virtualhost 127.0.0.1:5050> servername localhost documentroot "/var/www/example" <directory /> options followsymlinks allowoverride none </directory> <directory /var/www/example/> options indexes followsymlinks multiviews allowoverride none order allow,deny allow </directory> </virtualhost> and added host file 127.0.0.1:5050 localhost the hosts file maps names ip addresses. cannot used ports. may specify ports part of url (such http://localhost:5050/ ). you can run virtual hosts on ports other 80, have explicitly reference port i've indicated.

android - How to sync between ProgressDialog and text appearance? -

i got progress dialog code: new thread() { @override public void run() { try { sleep(1000); } catch (exception e) { log.e("tag", e.getmessage()); } // dismiss progress dialog progressdialog.dismiss(); } }.start(); and got text apear after httprequest actions: edittext2.settext(stringer); how sync between them? want text hidden untill progress finish tnx! you have use handlers update ui. little modification here, new thread() { @override public void run() { try { //instead of sleep, call http request method here. handler.sendemptymessage(0); } catch (exception e) { log.e("tag", e.getmess...

c# - why is it not possible to compare IntPtr.Zero and default(IntPtr)? -

i learned hard way intptr.zero cannot compared default(intptr). can tell me why? intptr.zero == new intptr(0) -> "could not evaluate expression" intptr.zero == default(intptr) --> "could not evaluate expression" intptr.zero == (intptr)0 -> "could not evaluate expression" intptr.zero.equals(intptr.zero) --> "enum value out of legal range" exception intptr.zero.equals(default(intptr)) --> "enum value out of legal range" exception intptr.zero == intptr.zero --> true new intptr(0) == new intptr(0) --> true works me in compiled code in vs 2010, vs 2008, vs 2005 sp1, mono 1.2.6. managed reproduce both problems in watch window of visual studio 2005 (i tried vs 2005 sp1), compiled code works expected. (by both problems mean problem 1: "could not evaluate expression", problem 2: "enum value out of legal range".) thus, pointed out of comment authors, vs 2005 watch window bug stumbled upon...

ios - UIAlertViewStyleLoginAndPasswordInput with more TextFields? -

its possible add more textfields uialertviewstyleloginandpasswordinput? how do? or there other possibility? yes possible can this uialertview *myalertview = [[uialertview alloc] initwithtitle:@"your title here!" message:@"this gets covered" delegate:self cancelbuttontitle:@"cancel" otherbuttontitles:@"ok", nil]; uitextfield *mytextfield = [[uitextfield alloc] initwithframe:cgrectmake(12.0, 45.0, 260.0, 25.0)]; [mytextfield setbackgroundcolor:[uicolor whitecolor]]; [myalertview addsubview:mytextfield]; [myalertview show]; [myalertview release]; hope helps.

r - Memory Allocation "Error: cannot allocate vector of size 75.1 Mb" -

in course of vectorizing simulation code, i've run memory issue. i'm using 32 bit r version 2.15.0 (via rstudio version 0.96.122) under windows xp. machine has 3.46 gb of ram. > sessioninfo() r version 2.15.0 (2012-03-30) platform: i386-pc-mingw32/i386 (32-bit) locale: [1] lc_collate=english_united kingdom.1252 lc_ctype=english_united kingdom.1252 [3] lc_monetary=english_united kingdom.1252 lc_numeric=c [5] lc_time=english_united kingdom.1252 attached base packages: [1] stats graphics grdevices utils datasets methods base other attached packages: [1] matrix_1.0-6 lattice_0.20-6 mass_7.3-18 loaded via namespace (and not attached): [1] grid_2.15.0 tools_2.15.0 here minimal example of problem: > memory.limit(3000) [1] 3000 > rm(list = ls()) > gc() used (mb) gc trigger (mb) max used (mb) ncells 1069761 28.6 1710298 45.7 1710298 45.7 vcells 901466 6.9 21692001 165.5 17338618...

jQuery drag and drop prevent -

i have simple drawing application, can color cells of table, , if hold mouse button down, can color multiple cells move mouse. see example here: http://jsfiddle.net/mfzkg/21/ it works well, problem in cases on mousehold browser thinks doing drag , drop doesn't stop on mouseup, if click mouse. does know way prevent drag , drop function or have idea how work around problem? thanks! i believe should it: $('td').mousedown(function(e) { e.preventdefault(); ismousedown = true; }); you may want add mouseup event whole body if mouse goes outside of box , button let go of, still resets. $("body").mouseup(function() { ismousedown = false; }); on side note, don't put html , body tags in jsfiddle or style tags in css pane.

unit testing - Visual Studio Cannot Scan/Find MSTest Methods -

i converted project nunit tests, had mstests instead. compiles, , when right click on project, can select "run unit tests." works, , tests execute successfully. however, cannot see tests in either "test list editor" or "test view." i've tried: selecting "refresh" button in both lists rebuilding solution re-starting visual studio activated background discovery (i have vs 2010 sp1, , resharper) none of these, alone or in combination, has worked. else can tried, force visual studio recognize these tests? the answer, found, must convert class library mstest project .

iphone - popToViewController can't switch between views -

i have function in ibaction button: i start off table button, when button pressed takes place: tabbarcontroller *v = [[tabbarcontroller alloc] initwithnibname:@"tabbarcontroller" bundle:nil]; [self.navigationcontroller pushviewcontroller: v animated:yes]; [v release]; on second view there button when pressed this: nsarray *array = [self.navigationcontroller viewcontrollers]; [self.navigationcontroller poptoviewcontroller:[array objectatindex:1] animated:yes]; this causes app crash, , @ index 0 nothing. because second page not uitable first? i want able move uitable view uiview , forth, should use addsubview instead? need first view have navbar second shouldn't. i think problem [array objectatindex:1] current viewcontroller, popping current view controller might reason of crash (did not try though) so why don't do: [self.navigationcontroller popviewcontrolleranimated:yes];

gcc - Is it guaranteed that Complex Float variables will be 8-byte aligned in memory? -

in c99 new complex types defined. trying understand whether compiler can take advantage of knowledge in optimizing memory accesses. these objects ( a - f ) of type complex float guaranteed 8-byte aligned in memory? #include "complex.h" typedef complex float cfloat; cfloat a; cfloat b[10]; void func(cfloat c, cfloat *d) { cfloat e; cfloat f[10]; } note d , question relates object pointed d , not pointer storage itself. and, if assumed aligned, how can 1 sure address passed of actual complex , not cast (non 8-aligned) type? update 1: answered myself in last comment regarding d pointer. b/c there no way know address assigned parameter of function call, there no way guarantee 8-aligned. solvable via __builtin_assumed_aligned() function. the question still open other variables. update 2: posted follow-up question here . a float complex guaranteed have same memory layout , alignment array of 2 float (§6.2.5). alignment defined compiler or pla...

ibm mq - perl mqseries read event messages -

i want read system.admin.qmgr.event event messages. can receive messages, output format not readable. this perl sub use reading: sub readeventmessage() { $self = shift; $qmgr = shift; # name of queue manager $sourceq = shift; $nmessages = shift; $count = 0; $sourcequeue = mqseries::queue->new ( queuemanager => $qmgr, queue => $sourceq, #mode => 'input', options => mqoo_input_shared | mqoo_browse, )|| die ("unable instantiate $qmgr::$sourceq object\n"); while (1) { #my $returned_message = mqseries::message->new( data =>"" ); $returned_message = mqseries::message->new(), #data => { # format => mqevent, #}, getmsgopts => { options => mqseries::mqgmo_browse_next | mqseries::mqgmo_accept_truncated_msg | mqseries::mqgmo_fail_if_quiescing } ...

Can't create ASP.NET MVC* project on Visual Studio 2012 -

i've downloaded , installed vs2012 ultimate rc. when create new asp.net mvc project refuses create following error message: "the project file '......' cannot opened. there missing project subtype. subtype : '{e53f8fea-eae0-44a6-8774-ffd645390401}' unsupported installation." thanks help. alright, works now. seems there problem in vs12 installation. repair has fixed problem , it's working great now. thank guys.

gridview - Chris Banes' Android-PullToRefresh java.lang.NoSuchFieldError: com.handmark.pulltorefresh.library.R$id.pull_to_refresh_sub_text -

i'm trying use https://github.com/chrisbanes/android-pulltorefresh/ . followed example got error java.lang.nosuchfielderror: com.handmark.pulltorefresh.library.r$id.pull_to_refresh_sub_text this grid: <com.handmark.pulltorefresh.library.pulltorefreshgridview xmlns:ptr="http://schemas.android.com/apk/res/com.abc.myproject" android:id="@+id/gv_image" android:layout_width="match_parent" android:layout_height="match_parent" android:listselector="#00000000" android:padding="4dp" android:horizontalspacing="4dp" android:verticalspacing="4dp" android:gravity="center" android:numcolumns="3" android:columnwidth="128px" android:stretchmode="columnwidth" ptr:ptrmode="pulldownfromtop" ptr:ptrdrawable="@drawable/android" /> when run have above exception. added pulltorefresh project in workspace , make project'...

hyperlink - Rules applying to linking to itunes from iOS application -

i link various itunes products application can't seem find rules/documentation covering this. allowed use itunes logo , there special need in mechanics of linking. see section 8.1 here advice on trademarks: https://developer.apple.com/appstore/resources/approval/guidelines.html as linking itunes products, imagine you're using openurl: call of uiapplication this, sufficient. hope helps.

asp.net - How to send the og:Title og:Image og:Description og:url info from C# to Facebook -

i have button in page. on clicking button, trying send following tags information in facebook... <meta property="og:title" content="title" /> <meta property="og:description" content="description" /> <meta property="og:url" content="url info" /> <meta property="og:image" content="image url" /> following button frame <iframe frameborder="0" scrolling="no" allowtransparency="true" style="border: none; overflow: hidden; width: 260px; height: 35px;" src="http://www.facebook.com/plugins/like.php? href=http://localhost:49334/webform1.aspx&amp;send=false&amp; layout=button_count&amp;width=100&amp;show_faces=false&amp; action=like&amp;colorscheme=light&amp;font=arial&amp;height=35"> </iframe> following first approach dynamically handle meta tags. var fbtitletag = new metatag...

java - Algorithm for sorting a "plain-list-tree-structure" -

sorry subject, didn't find better title :-) i have tree structure, here's "node" class: public class categoria implements serializable { private static final long serialversionuid = 1l; @id @generatedvalue(strategy = generationtype.identity) private long id; @notnull private string name; @onetomany(cascade=cascadetype.all,fetch=fetchtype.eager) @joincolumn(name = "parent_id") private list<categoria> children = new linkedlist<categoria>(); @manytoone(fetch=fetchtype.lazy) @joincolumn( name = "parent_id", insertable=false, updatable=false ) private categoria parent; @transient private integer depth; private integer ordernumber; ... getters, setters, .... } don't care hibernate/jpa annotations, there's no problem them, think of ideal pojo world. i made recursive method builds "plain" list of adjacent nodes. so, imag...

How to get virtualenv to work with fish shell -

i'm trying virtualenv work fish shell. have virtualenv installed , works fine bash , zsh. however, running following command returns fish: unknown command 'source' : $ source ~/path/to/bin/activate does know how virtualenv , fish shell work together. in advance. you don't need activate use virtualenv convenience. can use virtualenv directly: virtualenv venv ./venv/bin/pip install foo have tried fish using: . venv/bin/activate.fish it isn't used bash may have issues - looking @ commit history shows recent fix: https://github.com/pypa/virtualenv/commits/develop/virtualenv_embedded/activate.fish

asp.net - Using WebActivator in VB.NET project -

in order make elmah.mvc package work in vb.net projects well, i've create asp.net mvc3 vb.net application added webactivator nuget package (v.1.5.1), in app_start folder inserted simple code, like [assembly: webactivator.preapplicationstartmethod(typeof(elmah.mvc.web.app_start.elmahmvc_start), "start")] namespace elmah.mvc.web.app_start { public class elmahmvc_start { public static void start() { elmah.mvc.bootstrap.initialize(); } } } the project built fine, never hit elmah.mvc.bootstrap.initialize(); line. does webactivator work vb.net? wounder if not, cause lot of different projects using webactivator (ninject, structuremap etc.) supported in vb.net? webactivator should work in language, it's pure runtime component. i'm confused how can end using c# code in vb app. shouldn't write in vb? maybe c# files getting ignored is, why doesn't work?

c++ - Optimization run assistance -

i running optimisation of 2 sets of data against each other , after assistance looking settings of run based on calculated results. i'll explain.... i run 2 data lines against each other (think graph lines) - line , line b. these lines have crossing points - upward , downward based on direction of each line.e.g. line going , line b going down 'upwards cross' , line going down , line b going 'downward cross'.the program calculates financial analysis. i analyze crossing points , gain resultant 'rank' analysis based on set of rules. rank single integer. line has number of settings optimisation run e.g. window 1 value of 10 20 , window 2 @ value of 30 40. line b has settings. when run optimisation iterate through parameters available each line , calculate rank. result of optimisation run list of ranks size of number of permutations avaliable. so question this: what best way line settings calculated rank using position (index) in rank list. optimi...

osx - Traffic shaping on shared internet connection -

i'm running os x lion, , i'm trying simulate low bandwidth connection (like 3g, edge, etc.) on shared internet connection android devices. the application runs on android devices talks directly using local ip each other. i tried setting ipfw rules, limit connectivity internet , not between 2 devices. how can limit direct connection between 2 devices when both connected shared internet connection on macbook? thanks.

asp.net mvc 3 - MVC ActionResult to force JQuery Mobile to refresh the page? -

i have mvc3 project using jquery mobile , have slight issue when return action result view, jquery mobile not reloading page , therefore <script> tags within <head> not being loaded? i had same issue when redirecting page in jquery mobile , fix adding rel="external" tag. is there anyway can force page reloaded within action result? thanks, mike try in action result.. window.location = 'your full path';

Get the resut from facebook in asp.net mvc site -

i have asp.net mvc site , in have user search functionality. want should search result facebook if there user name typed in search box. in search want user photo , full name. thanks in advance you can info logged in user using graph api or fql. asp.net app, should search server-side appears in-line in other search results. take @ https://developers.facebook.com/docs/authentication/server-side/ description of server-side authentication flow. take @ https://developers.facebook.com/docs/reference/api/user/#friends examples on how list of friends logged-in user. example: https://developers.facebook.com/tools/explorer/?method=get&path=me/friends?fields=picture

c# - MVC RedirectToAction is not working properly -

in 1 of controllers, have return looks this: return redirecttoaction("administerfiles/viewdatafiles?catid=14"); but when renders result browser string becomes one: administerfiles/administerfiles/viewdatafiles%3fcatid%3d14 how can solve ? . you need action parameter (along route data): return redirecttoaction("viewdatafiles", new { catid = 14 }); if want specify controller (it defaults current controller), can this: return redirecttoaction("viewdatafiles", "administerfiles", new { catid = 14 });

jquery - Datatables AJAX request error -

i using datatables server-side processing information form. on form submit datatables sends ajax request, request handled java servlet. after problems decided start using firebug. when click on submit button firebug returns following jquery related error: // send request // may raise exception // handled in jquery.ajax (so no try/catch here) xhr.send( ( s.hascontent && s.data ) || null ); when use firebug resend request, request handled correctly, means json response send browser. i feeling there wrong order of call, servlet isn't ready or that, explain why re-send request succeeds. altough i'm not certain. datatables jquery code: $(document).ready(function() { $("#searchresults").datatable({ "bjqueryui": true }); $('.searchsubmit').click(function() { var formdata = $('form').serialize(); $("#searchresults").datatable({ "bdestroy": true, ...

javascript - How could I keep resending this ajax request? -

i've tried use setinterval allow ajax request send every 2 seconds keeps crashing page, think going wrong! here code: var fburl = "http://graph.facebook.com/http://xzenweb.co.uk?callback=?"; //getting facebook api content $.getjson(fburl, function(data){ var name = data["shares"]; var datastring = 'shares='+name; //sending share count data server $.ajax({ type: "post", url: "index.php", data: datastring, cache: false, success: function(html) { $("#content").html(html); } }); return false; }); i'm new both ajax , javascript, appreciate if me out :) provide callback function $.getjson function test(){ $.getjson(fburl, function(data) { //your method }); setinterval("test()",2000); } updated answer ...

opencv - How to find Camera matrix for Augmented Reality? -

i want augment virtual object @ x,y,z meters wrt camera. opencv has camera calibration functions don't understand how can give coordinates in meters i tried simulating camera in unity don't expected result. i set projection matrix follows , create unit cube @ z = 2.415 + 0.5 . 2.415 distance between eye , projection plane (pinhole camera model) since cube's face @ front clipping plane , it's dimension unit shouldn't cover whole viewport? matrix4x4 m = new matrix4x4(); m[0, 0] = 1; m[0, 1] = 0; m[0, 2] = 0; m[0, 3] = 0; m[1, 0] = 0; m[1, 1] = 1; m[1, 2] = 0; m[1, 3] = 0; m[2, 0] = 0; m[2, 1] = 0; m[2, 2] = -0.01f; m[2, 3] = 0; m[3, 0] = 0; m[3, 1] = 0; m[3, 2] = -2.415f; m[3, 3] = 0; the global scale of calibration (i.e. units of measure of 3d space coordinates) determined geometry of calibration object use. example, when calibrate in opencv using images of flat checkerboard, input...

java - IllegalThreadState exception while asynchronous list field implementation in Blackerry -

this question continuation previous question on stack overflow how-to-download-images-asynchronously-from-web-server . struggling make asynchronous list in blackberry. working fine me. giving me problem now. what have done far created list view taking value xml feed list loaded default thumbnail created runnablefactory , limiting thread pool size 5 , adding runnable's it. runnable objects has capability download image server. now list loads fine asynchronously. problem scenario on loading of list screen initializing runnablefactory , starting download , render images in list. but, let have 50 number of rows in list. , 10 images downloaded successfully, , runnablefactory still in action. @ point press key , click next. practically should come list screen , again initiate download process freshly. throwing illegalthredstate exception my assumptions on problem as threads running, might have cancel of threads on key pressed. if problem can please let me know how ...

Is it mandatory to get an Acces token to use C# facebook SDK -

i found c# sdk , see examples needs access token acquired through oauth process. want access publics albums , pictures necessary register app , oauth suff ? seems overkill access public data.

Selecting columns from a MYSQL routine result -

i have routine called sp_getalldata , want select 2 columns col1 , col2 resultset of routine. i've tried select col1, col2 (call sp_getalldata()) but invalid. options? you cannot use stored function data source in mysql. mysql not supports table functions. can write stored procedure select statement , call procedure output result-set.

objective c - iphone dev sending post to Linkedin from iphone app -

i want post on linkedin iphone app, can guide me sort of tutorial urls, etc. have @ linkedin api , @ restkit combine 2 , know. if take tutorial on restkit , replace example links linkedin api links have need.

.net - Setting ReadOnly Property in PropertyGrid Sets All Properties Readonly -

i using propertygrid control edit class properties , trying set properties read-only depending on other property settings. this code of class: imports system.componentmodel imports system.reflection public class propertyclass private _someproperty boolean = false <defaultvalue(false)> public property someproperty boolean return _someproperty end set(value boolean) _someproperty = value if value setreadonlyproperty("serialportnum", true) setreadonlyproperty("ipaddress", false) else setreadonlyproperty("serialportnum", false) setreadonlyproperty("ipaddress", true) end if end set end property public property ipaddress string = "0.0.0.0" public property serialportnum integer = 0 private sub setreadonlyproperty(byval propertyname string, by...

php - Internal Server Error uploading a file -

error have web app mass uploader (plupload) photos , when upload twenty photos, 6 (around 30 %) fail internal server error. have checked apache error.log domain , has nothing new (i know i'm looking @ right error.log since older errors did show here). this happens on vps on dreamhost (my hosting provider) servers while on development server runs silky smooth. oh, , things used work fine month ago , started fail. using uploadify , since used flash, impossible me debug upload failed. files , script uploaded files photos, 100 kb big, though i've uploaded (and still can) 3 mb photos. .htaccess naturally doesn't change during uploads. on server side php script uses gd2 library move , resize photo. server state have upgraded vps 300 400 mb of ram. thing used work , upgraded memory ruled out reason. memory limit php @ 200 mb, should sufice. i getting mighty frustrated dreamhost not want help , stating "we can not responsible error code causes" , "w...

View already-committed Git merge in external 3-way diff tool -

is there way view merge has been committed in 3-way diff? if huge merge between branches committed 3 weeks ago, there way can see 3-way diff of in external diff-tool beyondcompare3? i'm looking just files changed in merge commit . bonus if show me conflicts , manually changed, opposed seeing entire difference of file between 2 branches. i wouldn't mind settling 2-way diff if left side had <<<<< ===== >>>>> conflict markers , right side committed result. i tried looking @ diff-tree , diff-files , diff , difftool , show , , others , couldn't figure out. know gitk show changes in merge commit not over-under diff view , hard understand when there tons of changes. if git difftool --cc firstparent..secondparent..result updated answer: original version of script below flawed in sense $conflicting_files in fact did not contain files had conflicts, files changed in both parent branches (but not had conflicts). also, not using ...

mysql - Rails find_by with OR -

i have named scope set in rails application used locate record either id (directly index view) or uuid (from email - users can't enter in id , view record) scope :by_uuid, lambda { |id| where('id = ? or uuid = ?', id, id) } this used in show action, id comes url, like services/114 services/74c083c0-8c29-012f-1c87-005056b42f8a this works great, until uuid such 74c083c0-8c29-012f-1c87-005056b42f8a this, rails unfortunately converts int value , services/74 record correct uuid adding .first scope not because order different each record, not work. is there way prevent rails converting id , taking string literally? obviously, there not record id matches that, if goes willy-nilly integer values of string passed it, back. using dynamic finders, such service.find_by_uuid or service.find_by_id work intended, need able retrieve record using uuid or id in same method (show). is there way like service.find_by_id_or_uuid we fixed issue following ch...

java - Are static variables serialized in Serialization process -

i'm stumbled upon understanding java serialization. have read in many documents , books static , transient variables cannot serialized in java. declare serialversionuid follows. private static final long serialversionuid = 1l; if static variable not serialized then, face exception during de-serialization process. java.io.invalidclassexception in serialversionuid deserialized object extracted , compared serialversionuid of loaded class. to knowledge think if static variables cannot serialized. there no point of exception. may wrong because i'm still learning. is myth "static , transient variables in java cannot serialized". please correct me, i'm in mess concept. serialversionuid special static variable used serialization , deserialization process, verify local class compatible class used serialize object. it's not static variable others, not serialized. when object of class serialized, class name , serial version uid written stream...

reflection - In C#, how do you get the name of an indexed property if you only have it's index number? -

i have object created json mapper function (using litjson). contains indexed properties. i can iterate through properties , each property value this for(int = 0; < jdata.count;i++) { console.writeline(jdata[i]); } i each property name, string, rather property value. the closest thing i've found https://stackoverflow.com/questions/1011109/how-do-you-get-the-name-of-the-property where works string name = reflectionutility.getpropertyname((sample2 s) => s.foo); but doesn't (seemingly because it's indexed property?) string name = reflectionutility.getpropertyname((sample2 s) => s[0]); i found source code . looks jsondata implements idictionary, should able access keys property. indexers implemented functions take index argument, there's no way use reflection "name" associated given index.

JQuery button not created with icon and label -

i creating 2 buttons use in dialog box , not seem do, cannot icon display text. can elsewhere fine. this works (which copy , pasted docs: $("#signout_button").button({label:"sign out", icons: { primary: 'ui-icon-key'}}); this not work: $("#dialog_link").dialog({draggable: true, title: "are sure?", show: "slide", modal: true, width:500,height:200, buttons: [{ label:'yes, sure', icons: { primary: 'ui-icon-alert' }, click: function(){ alert('well alrighty then'); } },{ text:'no, please make stop', icons: { primary: 'ui-icon-alert' }, click: function(){ alert('well alrighty then'); } }] }); the div exists , sim...

html - Make Div A The Same Height As Fluid Div B -

i'm kinda stuck on something... i'm trying #right same height #left #right fluid. how go doing this? #container { width: 960px; margin: 0 auto; } #left { background: #ccc; float: left; padding: 10px; width: 160px; } #right { background: #ccc; float: right; padding: 10px; width: 750px; } - <div id="container"> <div id="left"> test </div> <div id="right"> test </div> </div> thanks. you can applying background image that's simulates 100% height #left : html <div id="container"> <div id="left"> test </div> <div id="right"> test<br />test </div>​ </div> css #container { width: 960px; margin: 0 auto; background: url(http://www.dummyimage.com/180x1/ccc/ccc.png) repeat-y; overflow:hidden; } ...

c# - Hiding implementational detail from parent classes -

suppose i'm designing robot can pickup various tools , use them. create robot class has pickup method pick tools wanted use. each tools create class it, say, knife class has cut method. after invoking pickup method on robot want tell robot cut. oop concept have tell robot, not knife? , cut method on knife how can invoke that? have implement kind of usetoolcurrentlyheld() on robot propagate commands knife. or directly call knife (that robot hold) directly using this: myrobot.toolcurrentlyinhand.cut() i feel it's weird parent method must have take care of classes contain. have duplicate methods, knife has cut() , robot must have usecutonknife() invoke cut() on knife because oop practice abstract knife out , make feel ordering robot without worrying internal information knife. another question, if composing music create music class contains many measure class store note information. in 1 measure there can many note class inside note class have information like, in ...

jquery - How to call a javascript function from zend controller indexAction? -

i want call javascript function zend controller indexaction. controller this.. // mycontroller.php public function indexaction(){ $role = 'admin'; $id = 23; // here want call javascript function /// myjsfun(role, id); } and viwefile controller //index.phtml here javascript function <script type='text/javascript'> function myjsfun(role, id){ // code function } //mycontroller.php $role = 'admin'; $id = 23; $this->view->role = $role; $this->view->id = $id; //index.phtml <script type='text/javascript'> function myjsfun(role, id){ // code function } //actual call: myjsfun(<?php echo zend_json::encode($this->role) ?>, <?php echo zend_json::encode($this->id) ?>); </script>

c# - Cloning an entity in NHibernate? -

i want save single object database twice. have code: using (var ss = nhibhelp.opensession()) using (var tt = ss.begintransaction()) { var entity = new entity(); ss.save(entity); ss.save(entity); tt.commit(); } but results in 1 row being added database. how insert single object database twice (with 2 different ids) ? you shouldn't - nhibernate maintains "object identity" within it's session, not differentiate between ..well.. same object. advise against this, , better solution @ way of cloning object (either via reflection, or clone method), , saving cloned object. if want ignore advice above, can work evicting entity session, setting it's id it's unsaved value (depends on mapping, 0), , saving again. it might work if called session.merge(entity) twice (you have reset id it's unsaved value after first call). alternatively use stateless session session.merge() , don't have evict entity between save's. ...

symfony - Symfony2 Twig Form Widget Array Access -

i have form widget several choices (many-to-many relationship) in twig template can iterate on checkboxes: {% choice in form.downloads %} {{ form_widget(choice) }} {{ form_label(choice) }}<br /> {% endfor %} i'd acces choices directly (they should bi formatted end positioned differently) tried several syntaxes doesn't work {{ form_widget(form.downloads.0) }} {{ form_label(form.downloads.0) }}<br /> {{ form_widget(form.downloads['0']) }} {{ form_label(form.downloads['0']) }}<br /> {{ form_widget(form.downloads[0]) }} {{ form_label(form.downloads[0]) }}<br /> do use wrong array keys or array access not possible? array access possible when you're using twig. guess error got when you're trying access first generated checkbox using {{ form_widget(form.downloads.0) }} {{ form_label(form.downloads.0) }}<br /> is method "0" object "symfony\component\form\formview" not ex...

php 5.3 - php5 --- method visibility issue -

please have @ below given code. <?php class bar { public function test() { $this->testprivate(); $this->testpublic(); } public function testpublic() { echo "bar::testpublic\n"; } private function testprivate() { echo "bar::testprivate\n"; } } class foo extends bar { public function testpublic() { echo "foo::testpublic\n"; } private function testprivate() { echo "foo::testprivate\n"; } } $myfoo = new foo(); $myfoo->test(); // bar::testprivate // foo::testpublic ?> in above example, when called $myfoo->test(); it called testprivate of bar class how come called testpublic of foo class. can 1 me in ? bar.testprivate , foo.testprivate have protected methods instead of private ones. see here more: http://php.net/manual/en/language.oop5.visibility.php

Retrieve Facebook User ID (or anything unique) without Authentication? -

is there anyway facebook id of user without forcing them authenticate? i'm trying create app page user can add answer poll once, need able identify viewers kind of unique identifier. my preference not force them log in. think it's bad ux add 2 steps can make sure facebook user on facebook page unique. don't need permissions profile/etc. btw, i've seen similar questions though nothing current or close enough me. no possibility if don't make user log in, security reasons, user has aware collecting information him, it's why there login. with php sdk, id after login: $userid = $facebook->getuser();

sql server - Condensing similar rows occuring in groups and keeping order -

i have sql table containing gps coordinates of device, updated every n minutes (the device installed in vehicle). given nature of gps, lots of entries similar, entirely different far server concerned. can approximately match things (within ~3.6' or maybe 36') easy enough cast(lat decimal(7,4)) i'd able take result set , condense approximate duplicate entries, still maintain time-based order. here's example: row lat lng vel hdg time 01 31.12345 -88.12345 00 00 12-4-21 01:45:00 02 31.12346 -88.12345 00 00 12-4-21 01:46:00 03 31.12455 -88.12410 10 01 12-4-21 01:47:00 04 31.12495 -88.12480 17 01 12-4-21 01:48:00 05 31.12532 -88.12560 22 01 12-4-21 01:49:00 06 31.12567 -88.12608 25 02 12-4-21 01:50:00 07 31.12638 -88.12672 24 02 12-4-21 01:51:00 08 31.12689 -88.12722 19 02 12-4-21 01:52:00 09 31.12345 -88.12345 00 00 12-4-21 01:53:00 10 31.12346 -88.1...

algorithm - Why is iterative k-way merge O(nk^2)? -

k-way merge algorithm takes input k sorted arrays, each of size n. outputs single sorted array of elements. it using "merge" routine central merge sort algorithm merge array 1 array 2, , array 3 merged array, , on until k arrays have merged. i had thought algorithm o(kn) because algorithm traverses each of k arrays (each of length n) once. why o(nk^2)? because doesn't traverse each of k arrays once. first array traversed k-1 times, first merge(array-1,array-2), second merge(merge(array-1, array-2), array-3) ... , on. the result k-1 merges average size of n*(k+1)/2 giving complexity of o(n*(k^2-1)/2) o(nk^2). the mistake made forgetting merges done serially rather in parallel, arrays not size n.

javascript - onClick - call phone number -

possible duplicate: url scheme phone call iphone safari making phone call i using code below on mobile site when clicks don't want them directed new page want phone number called. possible using onclick function? <div class="button left" id="map" onclick="window.location='#'"><span class="bottom">call now</span></div> you should rather use <a href="tel:[phone number]"><span class="bottom">call now</span></a>