Posts

Showing posts from January, 2011

c# - XElement is automatically adding xmlns="" to itself -

i creating new xdocument table. have validate document xsd document , keeps failing because add xmlns="" 1 of elements when shouldn't. here's parts of code pertinent. xnamespace xsi = "http://www.w3.org/2001/xmlschema-instance"; xnamespace xmlns = "https://uidataexchange.org/schemas"; xelement employertpaseparationresponse = null; xelement employertpaseparationresponsecollection = new xelement(xmlns + "employertpaseparationresponsecollection", new xattribute(xnamespace.xmlns + "xsi", xsi), new xattribute(xsi + "schemalocation", "https://uidataexchange.org/schemas separationresponse.xsd")); xdocument doc = new xdocument( new xdeclaration("1.0", null, "yes"), employertpaseparationresponsecollection); //sample xelement populate element database staterequestrecordguid = new xelement("stater

css - How do I apply a style to a <span> if a condition exists, and take it away if it doesn't in Rails 3? -

the span tag looks this: <span class='best_in_place<%= ' list-downvoted' if upload.downvoted? %><%= ' list-upvoted ' if upload.upvoted? %>' however, if span both downvoted & upvoted, applies both styles. how modify apply one, , rid of other if other exist? i.e. if item has been downvoted before, remove list-downvoted class, , vice versa. edit: added recommended code in uploadshelper module uploadshelper def best_span_class_for_upload(upload) # start base style css_class = 'best_in_place' # add on conditional styles using string#<< concatenation css_class << ' list-downvoted' if (upload.downvoted?) css_class << ' list-upvoted' if (upload.upvoted?) # return result css_class end end with span looking now: <span class='<%= best_span_class_for_upload(upload) %>' id='best_in_place_upload_name' data-url='<

iphone - Does UIImageView have a property to indicate setImage has completed and animations are ready? -

just getting started obj-c , ios programming. have code loads , imageview (hidden: yes) uiview - [bgimageview setimage:[uiimage imagenamed:@"filename.jpg"]; the code sets , commits animations on fgimageview , bgimageview. because of images can large, animation new bgimage not render new background image in , instead 'stalls , displays'. note stall not happen during setimage. happens during second animationcommit later in code. because animationcommit forces application wait until animation of imageview done. what i'm looking sort of 'setimage commit' on uiimageview, i'd rather display spinner until image loaded, proceed animation, there doesn't appear isloaded property uiimageview class. is there simple way determine uiimageview done setimage call? there method in uiimageview - (bool)isanimating , potentially use: if (![bgimageview isanimating]) { // continue next image; } would suffice or there other animation in

deployment - deployable wiki-based documentation -

i looking wiki project editable developers , can have comments , history, else, has following features: a way tag or version wiki in intuitive interface competent developer can use a way deploy tagged or versioned snapshot of wiki option of stripping of editorial history. the use case have team of developers able fluidly update documentation in lifecycle of project , have necessary internal dialogs, have way package documentation in polished way can included commercial product. the ideal solution, if software exists somewhere, have type of facility can say, pdf output send commercial printer or have way custom templates depending on parameters of deployment. does sage developer out there know of such software? i take @ github's gollum seems fit requirements quite well. support a bunch of different markup alternatives , , both markdown , textile have converters pdf (and bunch of other markup choices well).

connection - Unable to connect to a SQL Server database remotely -

i have sql server 2008 r2 developer edition set on windows server 2008 r2 edition , although able database locally via sql server management studio (using server name\mssqlserver ), unable in there remotely (using ip\mssqlserver ). i have turned off firewall windows (no other firewall installed) , turned on 4 protocols sql server (shared memory, named pipes, tcp/ip , via) , has turned on every single service in sql server management studio no luck. could please me? many in advance! enable tcp/ip, shared memory , named pipes prorams> sql 2012 > configuration tools > sql server configuration manager > expand sql server network configuration > protocols sql2012r2de

java - JRuby, large arrays, and performance issues in a real-time application -

i'm working on real-time game application. of written in java, decided experiment moving of initialization procedures jruby scripts in order maximize ease player modify how world generated. as start, decided move map generation jruby script. @ present, boils down following java code: scriptingcontainer container = new scriptingcontainer(); container.put("$data", datapackage); container.runscriptlet(pathtype.relative, scriptname); datapackage = (blockmapgenerationdatapackage)container.get("$data"); the data package contains information necessary java program produce final terrain , render it, , contains necessary data in order ruby script able craft manner of maps. in particular, contains rather large array (currently 1000 x 1000 x 15). test whether ruby script working, i've stripped out entire map generation algorithm , put in following extremely simple test: require 'java' dir["../../dist/\*.jar"].each { |jar| require jar } in

java - JAR classpath and external jars -

i actualy have 2 problems i use eclipse -> export project generate jar file simple desktop (gui) program generates jar file , ant script. first problem: generated jar works fine when double-clicked. when use generated ant script generate jar myself, doesn't work. can wrong target (assuming dependencies met) <target name="create_run_jar"> <jar destfile="g:/dev/myproj/myproj.jar"> <manifest> <attribute name="main-class" value="view.myproj"/> <attribute name="class-path" value=". myproj_lib/grouplayout.jar"/> </manifest> <fileset dir="g:/dev/myproj/bin"/> </jar> <delete dir="g:/dev/myproj/myproj_lib"/> <mkdir dir="g:/dev/myproj/myproj_lib"/> <copy file="g:/dev/.metadata/.plugins/org.dyno.visual.swing/layou

actionscript 3 - Removing object from the display list -

i have application uses main class control other movieclips, adding , removing them needed, of them separate screens or sub menus. when leave main menu , come later screen, animations , roll on buttons still play, don't want, need main menu screen reset every time seen. i read on , found out removing child doesn't remove memory. i tried setting mainmenu null before moving onto different screen threw error, stating parameter child must none null. could shed light on how kill mainmenu when not needed. public function confsubmenuonescreen():void { submenuonescreen = new submenuone(); mainmenu = null; removechild(mainmenu) addchild(submenuonescreen) currentscreen = submenuonescreen; } this example of code removes menu , adds screen, mainmenu = null code throws error. the error you're getting because you're setting object null - attempting remove object (which null). reversing 2 lines fix error. however, w

java - How to store Jboss web service requests -

i'm using jboss 6 , need store incoming/outgoing web service requests(soap). know jboss allows log web service messages, want store them in database without going through log file. idea how may that? many thanks! i don't have experience jboss. i'd think treat these requests application data. means map them database via persistence api.

dependency injection - Castle Windsor Typed Factory Facility with generics -

i'm trying register factory resolve array of event handlers defined follow: public interface ievent { } public class eventa : ievent { } public class eventb : ievent { } public class eventc : ievent { } public interface ihandler<tevent> tevent : ievent { void handle(tevent ev); } public class handlerx : ihandler<eventa>, ihandler<eventb> { public void handle(eventa ev) { throw new notimplementedexception("handle eventa"); } public void handle(eventb ev) { throw new notimplementedexception("handle eventb"); } } public class handlery : ihandler<eventb>, ihandler<eventc> { public void handle(eventb ev) { throw new notimplementedexception("handle eventb"); } public void handle(eventc ev) { throw new notimplementedexception(&

Is there a way to use C++ preprocessor stringification on variadic macro arguments? -

my guess answer question no, awesome if there way. clarify, assume have following macro: #define my_variadic_macro(x...) // stuff here in macro definition what somehow perform stringification on variables of x before passing variadic function; keyword here before. realize there's no way access individual arguments within macro definition, there way stringify arguments, maybe following? #define my_variadic_macro(x...) some_variadic_function("some string", #x) you can use various recursive macro techniques things variadic macros. example, can define num_args macro counts number of arguments variadic macro: #define _num_args(x100, x99, x98, x97, x96, x95, x94, x93, x92, x91, x90, x89, x88, x87, x86, x85, x84, x83, x82, x81, x80, x79, x78, x77, x76, x75, x74, x73, x72, x71, x70, x69, x68, x67, x66, x65, x64, x63, x62, x61, x60, x59, x58, x57, x56, x55, x54, x53, x52, x51, x50, x49, x48, x47, x46, x45, x44, x43, x42, x41, x40, x39, x38, x37, x36, x35, x3

python - Using a constantly changing variable to define a list -

i want make piece of code pulls title , link off rss feed , compiles variable can used in message body. problem body gets redefined every time pull info off rss. new programming , python, , under impression using list best thing do. for in range(3): messagetitle = feed['items'][i].title messagelink = " - ",feed['items'][i]['link'] body = "%s%s%s%s" % (messagetitle,"\n","\n", messagelink) #in unicode gmail_user = "user@gmail.com" gmail_pwd = "pw" mail("user@gmail.com", "reddit update", body) i going insert list below body, , use body define it.. like: list[i] = [body] am on right track? there variety of design patterns can consider using. demonstrate few don't need use [i] even: accumulator: messages = [] feeditem in feed['items']: message = {'title':..., ...} message['link'] =

WCF hosted in windows service errors -

i have wcf in vb hosted in windows service. managed install program service installs. but, when try start service, following error: the service on local computer started , stopped. services stop automatically if have no work do, example, performance logs , alerts service. cheking event viewer gives me following: service cannot started. system.argumentexception: servicehost supports class service types. @ system.servicemodel.description.servicedescription.getservice(type servicetype) @ system.servicemodel.servicehost.createdescription(idictionary`2& implementedcontracts)......... anybody have ideas what's going on? thanks! the servicehost constructor must concrete implementation of service contract. it sounds passing in interface rather service implementation.

c - Getting IP address from struct sockaddr doesn't work for 32bit compilation -

i have small client/server app sends/receives udp discovery packets. when udp packet received want display source ip. client/server code based on udp example beej: http://beej.us/guide/bgnet/output/html/multipage/clientserver.html when compile 64bit ip displayed expected when compile 32bit (-m32 option) doesn't right value @ all. code snippit: // sockaddr, ipv4 or ipv6: void *get_in_addr(struct sockaddr *sa) { if (sa->sa_family == af_inet) { return &(((struct sockaddr_in*)sa)->sin_addr); } return &(((struct sockaddr_in6*)sa)->sin6_addr); } ... printf("listener: waiting recvfrom...\n"); addr_len = sizeof their_addr; if ((numbytes = recvfrom(sockfd, buf, maxbuflen-1 , 0, (struct sockaddr *)their_addr, &addr_len)) == -1) { perror("recvfrom"); exit(1); } printf("listener: got packet %s\n", inet_ntop(their_addr->sa_family, get_in_addr((struct sockaddr *)their_addr), s,

c# - How to walk the .NET try/catch chain to decide to generate a minidump -

we've hit snag mixing tasks our top-level crash handler , trying find workaround. i'm hoping has ideas. our tools have top-level crash handler (from appdomain's unhandledexception event) use file bug reports minidumps. works wonderfully. unfortunately, tasks throw wrench in this. we started using 4.0 tasks , discovered internally in task action execution code, there try/catch grabs exception , stores passing down task chain. unfortunately, existence of catch (exception) unwinds stack , when create minidump call site lost. means have none of local variables @ time of crash, or have been collected, etc. exception filters seem right tool job. wrap task action code in filter via extension method, , on exception getting thrown call our crash handler code report bug minidump. however, don't want on every exception, because there may try-catch in our own code ignoring specific exceptions. want crash report if catch in task going handle it. is there way walk chain

Play local video from web browser -

how can play video on user's local hard drive when go website? want sync video controls on website. this massive security hole on part of browser, you'd need use flash or java request permissions , let user select file... know java can, i'm not sure flash can. if have control on browser, can perhaps pass in command-line flag ignore security checks... 1 person going forget re-enable security when visit other sites.

web config - Webconfig error with the site online -

i'm trying publish web site . the publication works perfectly, when try access address returns me following error: parser error message: not load file or assembly 'microsoft.web.helpers' or 1 of dependencies. assembly built runtime newer loaded runtime , cannot loaded. source error: line 293: line 294: line 295: line 296: line 297: source file: c:\windows\microsoft.net\framework\v2.0.50727\config\web.config line: 295 assembly load trace: following information can helpful determine why assembly 'microsoft.web.helpers' not loaded. wrn: assembly binding logging turned off. enable assembly bind failure logging, set registry value [hklm\software\microsoft\fusion!enablelog] (dword) 1. note: there performance penalty associated assembly bind failure logging. turn feature off, remove registry value [hklm\

ruby on rails - Devise and user registration requiring admin approval -

i implement following registration system : user signs , redirected thank signing page (is not sent email , cannot yet log in) admin logs in , sees list of newly registered (but yet unapproved) users admin edits user details , clicks 'approved' sends email password new user how can devise? this answered in page on devise wiki .

multithreading - Deadlock Delphi explanation/solution -

on server application have following: class called jobmanager singleton. class, scheduler, keeps checking if time add sort of job jobmanager. when time so, scheduler like: tjobmanager.singleton.newjobitem(parameterlist goes here...); at same time, on client application, user generates call server. internally, server sends message itself, , 1 of classes listening message jobmanager. jobmanager handles message, , knows time add new job list, calling own method: newjobitem(parameter list...); on newjobitem method, have this: cs.acquire; try dosomething; callamethodwithanothercriticalsessioninternally; cs.release; end; it happens system reaches deadlock @ point (cs.acquire). communication between client , server application, made via indy 10. think, rpc call fire server application method sends message jobmanager running on context of indy thread. the scheduler has own thread running, , makes direct call jobmanager method. situation prone deadlocks?

serialization - loading serialized data into a table -

for answer to question , wanted load serialized lua code table. string loaded of form: savedvars = { } savedstats = { } (where each of {...} might lua expression, including table constructor nested data. i'm assuming not calling (global) functions or using global variables. what want have table of form: { ["savedvar"] = { }, ["savedstats"] = { } } i not want have global variables savedvars afterwards. how elegantly? (i found solution, maybe has better one.) here solution: -- loads string table. -- executes string environment of new table, , -- returns table. -- -- code in string should not need variables not declare itself, -- these not available on runtime. runs in empty environment. function loadtable(data) local table = {} local f = assert(loadstring(data)) setfenv(f, table) f() return table end it loads data string loadstring , uses setfenv modify global environment of function new table. calling loaded f

Barcode manufacturers -

i'm hoping here has worked upc/coupon barcodes before. part of every upc/coupon barcode manufacturer code. need database every manufacturer code. have idea find database of these manufacturer codes? a quick google search "upc database" turned several different ones. sadly, not going find definitive database. stores use own upcs internally, , have abbreviated upcs (look @ can of pepsi see mean).

how to know requestlocationupdates method in location manager is working or not in android emulator by using giving min. time -

here make 1 program in set time in requestlocationsupdates method 61000 miliseconds .so emulator in ddms change location lati , longi dnt press send button. after 61 seconds why not update new inserted lat long in emulator automatically after 61 seconds. here code... package com.getlocation; import android.content.context; import android.location.location; import android.location.locationlistener; import android.location.locationmanager; import android.os.bundle; import android.util.log; import android.widget.textview; import com.google.android.maps.geopoint; import com.google.android.maps.mapactivity; public class showmap extends mapactivity { textview tv; /*private mapcontroller mapcontroller; private mapview mapview;*/ private locationmanager locationmanager; public void oncreate(bundle bundle) { super.oncreate(bundle); setcontentview(r.layout.main); // bind layout activity tv=(textview) findviewbyid(r.id.textview1);

objective c - how to assign an integer data type array values to a UITextField in iphone -

how assign integer data type array values uitextfield because have integer array , want display contents in textfield try this, nsstring *intergerstring = [nsstring stringwithformat:@"%d",intergervalue]; txtfield.text = intergerstring;

batch file - How do I add an environment variable for a windows user -

i have sheduling engine runs jobs on windows 2003 server. it runs particular domain user. i don't have access log on user have admin access. i need able script storing password in environment variable specific user the user not appear have environment on target platform because hku\sid not exist in registry user. (sid users domain sid) but has profile i cant add hku\sid\environment\var_name .... using reg.exe, returns error: parameter incorrect. any ideas? can use login script set command create environment variable?

Config file handling in Perl -

there plenty of modules in config:: namespace on cpan, limited in ond way or another. i'm using config::std , fine of time, makes things difficult: more 2 levels of nested directives handling of multiple values per key conf.d directories, i.e. multiple config files merged 1 big config hash config::std generates blessed hashref after parsing config, applications coded use hashref configuration. i'd prefer not having change this. what looking universal, lightweight config module produces hashref. my question is : config modules should consider replacing config::std? you didn't state data coming from. reading in configuration file , running limit of configuration file itself? config::std great module. however, meant read , write windows config/ini files, , windows config/ini files flat , simple formats. thus, wouldn't expect config::std more. if you're using windows config/ini files right now, may need read more complex data structures in

php - Can I set a time limit for a code block? -

is possible start block of code (maybe call function) , if doesn't execute within time skip it. //give function 10 seconds execute $value = mega_function();// take 1-1000 seconds //if 10 seconds have passed , value still not set, abort , set $value = false; no. have either call function inside external file using curl or file_get_contents() - can set timeout there keep track of time inside mega_function() , return() if necessary. what mega_function() do?

database - Writing Joomla bridge - User plugin -

i want write joomla plugin connect user tables in database (one way). so on new user registration, user duplicated , stored in second table (other script). main goal. things updating on password change/delete etc. can left until later. any ideas can find information helping me write plugin joomla 1.6? can user registration data etc? i have written plugin joomla 1.6 takes new registered user's id , puts table. deletes user info secondary table if user account deleted. should going, have @ code below: this plugin called: plg_foo_user foouser.php <?php defined('_jexec') or die(); jimport('joomla.plugin.plugin'); class plguserfoouser extends jplugin { function onuseraftersave( $user, $isnew, $success, $msg ) { //jerror::raisewarning(100, 'here1'); if ($isnew && $success) { $db = &jfactory::getdbo(); $db->setquery( 'insert #__foo_users (user_id) values ('.$user['id'].')' );

Jquery select change -

<select id="nazione" name="nazione"> <option prefix='+93' value='af' >afghanistan </option> <option prefix='+355' value='al' >albania </option> <option prefix='+213' value='dz' >algeria </option> <option prefix='+376' value='ad' >andorra .... etc </select> and js $(document).ready(function() { $('#nazione').change(function(){ alert( $(this).find("option:selected").attr('prefix') ); alert( $(this).attr('prefix') ); }); }); i have alert null... why? your code fine. here's demo : http://jsfiddle.net/hkktc/1/ the reason you're not getting value second alert call because attribute prefix doesn't exist select , exists option

configuration - Magento: Disable module for any particular store -

suppose, have 3 stores. i want disable module in store 2. want enabled in store 1 , store 3. i see can by:- going system -> configuration -> advanced selecting desired store current configuration scope dropdown list. but not work fully. and, don't want check store in module code or create system configuration field module check/uncheck store enable/disable. what expecting adding code in app/etc/modules/mynamespace_mymodule.xml . can way? this configuration disables module output in layout frontend, module controllers, event observers, admin pages, etc still working. also don't forget specify module name in layout files definition, otherwise layout file content loaded particular store: <config> <layout> <module_alias module="module_name"> <file>yourlayoutfile.xml</file> </module_alias> </layout> </config> if developing module , want disable full func

sql - PHP Change Array Structure / Format -

i have array @ present looks this: array ( [0] => array ( [language] => english ) [1] => array ( [language] => arabic ) [2] => array ( [language] => bengali ) ) what i'd change looks this: array ( [language] => array ( [0] => english [1] => arabic [2] => bengali ) ) i have array looks this: array ( [id] => 3 [name] => lethalmango [joined] => 2010-01-01 00:00:00 ) and i'd change to: array ( [user] => array ( [id] => 3 [name] => lethalmango [joined] => 2010-01-01 00:00:00 ) ) i've tried number of methods without success i'm sure there more efficient way. first : $result = array(); foreach($array $value){ $result['language'][]= $value['language'] }

asp.net mvc 2 - Allow anonymous access to Content and Script folder -

i building asp.net mvc 2 website uses forms authentication. want allow unauthenticated users access scripts , content folders, stylesheets , images load. however, not work. found on google, should work: <location allowoverride="false" path="content"> <system.web> <authorization> <allow users="?" /> </authorization> </system.web> </location> <location allowoverride="false" path="scripts"> <system.web> <authorization> <allow users="?" /> </authorization> </system.web> </location> it not work in asp.net mvc 2 on iis (win7). stylesheet , javascript requests redirected account/logon. how fix this? update: anonymous authentication enabled in iis. forms authentication. don't use authorization tags in web.config. use authorization attribute in controllers (or actions).

asp.net - the page post back to the inital state when data loads from the drop down list -

i have page named loginsecurity_test.aspx.there 3 radio buttons on when user selects 1 button 1 login form displays.for example when select individual user button form displayed.i have select customer number drop down list.when select customer number page post , instead of taking form again go inital stage 3 radio buttons being displayed.the language vb.net radio button functionality using javascript at guess, need check page.ispostback in page load event can track state of page.

html - Center tag works fine, but align attribute doesn't! What may be the issue? -

i trying align complete page, center of frame, , if use center tag, works fine. but, if use <body align=center> or <body style="align:center"> it doesn't align page, keep left-aligned default. now, newbie @ html honest, don't have idea, may causing this. also, happens in non-ie browsers. ie shows page center aligned, without tags. although, not of significance, can use center tag, nice know why align attribute doesn't work. kindly let me know, if got idea, problem. edit: turns out, because of quirks mode. david , town! :d <body align=center> don't use this. align attribute deprecated. <body style="align:center"> css preferred method but: inline style (the use of style attribute) should avoided in favour of real stylesheets. there no align property in css use text-align property if want centre inline content of element apply or set left , right margins auto centre block element

Good resources for model binding in ASP.NET MVC3 with C#? -

i know how model binding works in asp.net mvc3. since still waiting professional asp.net mvc3 book , cannot find googling it, last hope. i know how perform binding simple objects when comes viewmodels, nested list<t> , unable perform binding. thanks francesco update: for clarification, mean model binding view action methods, thanks the question not clear, i'll address think asking on. in cases view model entity has property of list<t> or other enumerable, not automatically bound resulting model instance available in action method marked httppost. you need to find place persist data, or, re-query in action method , update posted instance. the reliable way have found involves serializing data json , putting values hidden form fields, when this, view models no longer have list property, rather, serialized properties. this dilemma forces me re-evaluate need data available on form posts, , in cases because have tried reuse view model across

"git rebase origin" vs."git rebase origin/master" -

i don't difference between git rebase origin , git rebase origin/master . in case cloned git repository twice. in first clone have use git rebase origin , in other clone must use git rebase origin/master . an example: http://paste.dennis-boldt.de/2011/05/11/git-rebase here's better option: git remote set-head -a origin from documentation: with -a, remote queried determine head, $git_dir/remotes//head set same branch. e.g., if remote head pointed @ next, "git remote set-head origin -a" set $git_dir/refs/remotes/origin/head refs/remotes/origin/next. work if refs/remotes/origin/next exists; if not must fetched first. this has been around quite while (since v1.6.3); not sure how missed it!

opengl es - Android - How to draw 3D cube on a real scene (no marker, camera is open) -

i know have basic question, can't think how can draw cube while camera open. can seperately open camera or draw cube in scene background using glsurfaceview.renderer , however, don't know how combine these 2 code :s mean don't know how draw cube when camera open. i'm still struggling problem.. here how i'm trying it: in mainactivity, i'm calling camera view this: preview camerapreview; setcontentview(r.layout.main); camerapreview = new preview(this); ((framelayout) findviewbyid(r.id.preview)).addview(camerapreview); and extend activity , call 3d cube show on camera view however no success, whenever include onpause() , onresume() methods in second one, application crashes... any suggestion ? this called augmented reality .take framelayout in xml , add in in code id . add both surfaceview , glsurfaceview framelayout.

c# - try-catch block -

i have class different methods doing same thing reading file. want use try-catch block exception handling. want ask if there way methods go inside single try block every method give same exception "file not found".. my preferred way of handling call common method of them, each (individually) looks like: try { // code } catch(someexceptiontype ex) { dosomethingaboutthat(ex); } however, can delegates, i.e. void execute(action action) { try { // code } catch(someexceptiontype ex) { // } } and execute(() => {open file});

javascript - asp.net mvc url to string -

i creating mvc application , possible url string somehow? url like:http://localhost:7264/asortiman/browse?kategorije=327 , in head of view url string , take last 3 digits in case 327 , use param in function. why dont @ controller level , send viewbag dynamic object? i suppose controller asortiman , action method browse. if define method like; public actionresult browse(int kategorije){ viewbag.kategorije = kategorije; return view(); } then @ view can reach same dynamic object. further use see default mvc application project @ vs2010

Dynamics CRM Change Status Workflow error -

Image
i have workflow that runs update status of case record resolved. however, workflow gets put status 'waiting' , contains generic error message. when looking @ system job message says: this has worked on system (as doing updating status) assume has customizations in place. has else ever come across , how did resolve it? thanks in advance update: i have created new organisation test out possible solutions , narrow down might happening. i created workflow on blank organisation , test case record try out on. worked fine expected. i imported customizations on customers system. did same again , worked fine. i created new case record , tried original workflow, did not work. i added workflow same first workflow , tried on pre customizations record, worked. i tried new workflow on new record , once again did not work. it therefore appearing workflows not working on records post customization import. has come across before, , steps taken resolve? thanks aga

flex4 - A better way updating a nested XML -

i have few lines of code: lev = arrinfo[1] xml = sxml; switch(lev){ case 0: xml = sxml; break; case 1: var xl:xml = arrinfo[0]; xml.sublevels = xl; break; case 2: xl = arrinfo[0]; xml.sublevels.sublevel.sublevels = xl; break; case 3: xl = arrinfo[0]; xml.sublevels.sublevel.sublevels.sublevel.sublevels = xl; break; } in switch statement, checks level of sublevels xl xml should attached , based on level, goes attach it. so, if level three, means xl should substitute sublevels in level. in case 3: xl substitutes sublevels in sublevel node of (level-1) sublevels node , if have case 4: xl should replace sublevels of sublevel node of (4-1) sublevels. this: case 4: xl = arrinfo[0]; xml.sublevels.sublevel.sublevels.sublevel.sublevels.sublevel.sublevels = xl; however, means have manually if know number of sublevels

Moving to named anchor after jquery/javascript processing -

how move focus different section (named anchor) on same page after doing jquery processing. function abc() processing , afterwards, need move user section on same page (further down page). you can use code below scroll screen <div id="navigation"> . change selector match element want scroll to. $('html, body').animate({ scrolltop: $('#navigation').offset().top }, 'slow');

java - Catch truncation errors -

i have small application embedded database. truncation errors when trying insert varchars exceeds maximum size of corresponding database column. i wish detect before insert/updating , show correct message user. now presume there 2 possibilities achieve this. get maximum length of column of interest through databasemetadata object. reduce performance lack using singletons or similar constructions. keep maximum lengths in java code (eg: in resourcebundle or properties file) , check against these values. downside off course java code , database must in sync. error prone. what best approach? the answer won't require maintenance getting maximum length of column of interest @ database connect time. if use integer.valueof(...) can store in object, lower values (according current jvm specs) backs singleton pool anyway. unload lot of memory performance issues, columns refer few unique values have in database. also, digging around in databasemetadata, flags in

web crawler - Perl Mechanize module for scraping pdfs -

i have website many pdfs uploaded. want download pdfs present in website. first need provide username , password website. after searching sometime found www::mechanize package work. problem arises here want make recursive search in website meaning if link not contain pdf, should not discard link should navigate link , check whether new page has links contain pdfs. in way should exhaustively search entire website download pdfs uploaded. suggestion on how this? i'd go wget , runs on variety of platforms. if want in perl, check cpan web crawlers. you might want decouple collecting pdf urls downloading them. crawling lengthy processing , might advantageous able hand off downloading tasks seperate worker processes.

c# - Impossible to add a User-Defined-Data Type parameter to my query -

i'm trying use user-defined-data type c# , sql server 2008 have exception raised when command.executereader() executed. string qyery = "select * product isavailableproduct < @param"; sqlcommand command = new sqlcommand(qyery, conn); sqlparameter param = new sqlparameter("@param", sqldbtype.structured); param.udttypename = "mybolean"; param.sqldbtype = sqldbtype.structured; param.value = 1; command.parameters.add(param); sqldatareader reader = command.executereader(); the raised exception : failed convert parameter value int32 ienumerable``1. what's wrong in code ? edit : if change sqldbtype udt , have exception : specified type not registered on target server.system.int32, mscorlib, version=2.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089. if set dbtype property int (which base type of "mybolean") result exception failed convert parameter value int32 ienumerable 1.`` raised too. edit : i modif

extjs4 - How can I access class variables in an ExtJS event handler? -

this.geturl = 'test'; this.items.add( new ext.form.checkbox( { listeners: { check: function(checkbox, checked) { alert(this.geturl); }, } ) ) how access this.geturl in check handler? there multiple ways access property geturl . here few possible options: 1. use ext.getcmp : if set id formpanel (or other extjs component whatever using), can access using ext.getcmp() method. so, var yourcomponent = ext.getcmp('yourcomponentid'); alert(yourcomponent.geturl); 2. use ownerct property : if need access parent container (if parent holding checkbox) can access parent container through public property ownerct . 3. use refowner property : if use ref system in code, can make use of property hold of container , access required variable. i think easy go first option.

Load Jquery BlockUI from text link -

not sure if possible, couldn't find answer... want html link launch blockui "loading" box. <script type="text/javascript" src="jquery.min.js"></script> <script type="text/javascript" src="jquery.blockui.js"></script> <script language=javascript> $(document).ready(function() { $('#pop').click(function() { $.blockui({ message: '<h1>processing query....</h1>', timeout: 100000 }); }); });</script> echo "<tr>"; echo "<td><div id=\"pop\"><a href=report$radio.php?prov=$prov&date1=$date1&starthour=$hour1&endhour=$hour2&date2=$date2&lookup=" . $row[$radio] . ">" . $row[$radio] . "</a></div></td>"; echo "<td>" . $row['count'] . "</td>"; echo "</tr>&

assembly - clearing memory locations with pic microcontroller -

i beginner asm , embedded systems. looking @ code meant clear memory locations using "indirection" register (or - not sure). code goes like: movlw 0x20 movwf fsr loop clrf indf incf fsr, f btfsc fsr, 7 goto loop i don't incf fsr, f part. instruction incf takes 2 operands; increments value in first location, , stores result in 2nd. in case f have incremented value, why test on fsr ? f mean file register, code d (destination) select bit; d = 0: store result in w, d = 1: store result in file register f. default d = 1. the compiler should understand: ;increment fsr byte , result store fsr incf fsr, f or incf fsr, 1 ;increment fsr byte , result store w reg incf fsr, w or incf fsr, 0

visual studio 2010 - Use VS2010 internal browser for testing -

i'd vs2010 open internal browser window test web application instead of opening new "default browser" window. possible? thanks! i created aspx file, clicked on browser with... selected internal web browser , clicked on "set default".

Delphi XML traversing -

i new delphi. i wanted find authors under each subject. here xml <?xml version="1.0"?> <catalog> <subject id="computer"> <book id="bk101"> <author>gambardella, matthew</author> <title>xml developer's guide</title> <genre>computer</genre> <price>44.95</price> <publish_date>2000-10-01</publish_date> <description>an in-depth @ creating applications xml.</description> </book>

Google Chrome Help -

i want make extension highlights word (for example food) on every page person visits. curious how this, google chrome extension. you should able using content scripts . in content script js file, line should trick (assuming include jquery in js content script includes): $('body').html($('body').html().replace(word_of_choice, '<span class="highlighted">' + word_of_choice + '</span>')); and define highlighted class in css file in content script includes.

version control - How can I recover a folder deleted by SVN before it's been added to the repository -

i running os x 10.6 , using svn applications "versions", , today made large mistake. hoping might able me out. i had been trying add new folder (4 days of work) repository online. way i'd able distribute team moving forward. when attempted this, i'd ran trouble. thought i'd fix issue , versions gave me kind of error being obstructed. should point out right now, i'm new working svn , of our projects little smaller in size , don't require kind of versioning. when couldn't figure out error in versions, , being difficult find documentation on thought i'd try troubleshooting , hope worked. proceeded delete troubled folder (thinking it'd either stay in folder , no longer linked directory or @ least sent trash folder) however not case, , i've been unable find documentation on how recover this. there's no "undo" function (why beyond me) , since wouldn't add repository cannot revert either. i'm hoping here might cra

string - C# TextBox Control Not Updating With New Text -

i embedded system software developer safety critical systems, new c# proficient in c-based languages. to provide little background, have developed windows form interprets serial data packets sent embedded software through serial port meaningful debugging information. what want display each byte of each packet in textbox control. textbox control displays packet information second form opened first form. here's code event handler opens second form first: private void showrawserialdata(object sender, eventargs e) { sendserialdatatoform = true; if (serialstreamdataform == null) serialstreamdataform = new rawserialdataform(); serialstreamdataform.instance.show(); } in above code, .instance.show() directive means may open new form if form closed, not show new form if form open. then, in serial data received event handler, this: // bytes serial stream bytestoread = ifdserialport.bytestoread; msgbytearray = new byte[bytestoread]; bytesread = ifdserialpor

python - Problem with django-avatar -

i'm trying implement django-avatar in django app on production server. problem form upload images accepts every type of files! means user can upload file.php . so, thought django-avatar handle this. how can fix? want form accepts images. the current version of django-avatar contains fix allow image uploads. version using? pypi version (currently 1.0) old , not contain updates. download newest version https://github.com/ericflo/django-avatar

java - How do I assign a boolean value based on the existence of an element in JAXB? -

this related this question , this question asked yesterday. i use boolean determine whether or not element exists in xml document. files parsing allow elements such following: <familymember> <name>jeff</name> </familymember> <familymember> <name>spot</name> <ispet/> </familymember> in example, element specifies familymember pet, there no additional data associated element. able tell jaxb return boolean based on whether or not element exists in parsed file. if element exists, value should true; otherwise, should false. to within xsd schema use generate java classes, if possible. you should able xmladapter similar following: http://bdoughan.blogspot.com/2010/12/represent-string-values-as-element.html once have answer ( how specify adapter(s) jaxb uses marshaling/unmarshaling data? ) able apply adapter. the following how done. note following example works using eclipselink jaxb (moxy) , th