Posts

Showing posts from May, 2010

ASP.NET: Using Request["param"] versus using Request.QueryString["param"] or Request.Form["param"] -

when accessing form or query string value code-behind in asp.net, pros , cons of using, say: // short way string p = request["param"]; instead of: // long way string p = request.querystring["param"]; // if it's in query string or string p = request.form["param"]; // posted form values i've thought many times, , come with: short way: shorter (more readable, easier newbies remember, etc) long way: no problems if there form value , query string value same name (though that's not issue) someone reading code later knows whether in urls or form elements find source of data (probably important point) . so other advantages/disadvantages there each approach? the long way better because: it makes easier (when reading code later) find where value coming from (improving readability) it's marginally faster (though isn't significant, , applies first access) in asp.net (as equivalent concept in p

java - How to renew or invalidate cache using SimpleCachingPageFilter in Ehcache? -

we using web-ehcache's net.sf.ehcache.constructs.web.filter.simplepagecachingfilter, configured xml, cache page json message, message can changed administrator. how invalidate cache when administrator changes changes json message? i figured out how make it: cachemanager.getinstance().getehcache("cachename").removeall(); it gets singletone cachemanager, gets ehcache depending on name of cache, removes elements. in next request cached page, filter looks ehcache, finds, without elementx , updates elements!

Changing gradient background colors on Android at runtime -

i'm experimenting drawable backgrounds , have had no problems far. i'm trying change gradient background color @ runtime. unfortunately, there's no api change @ runtime, seems. not trying mutate() drawable, explained here: drawable mutations the sample xml looks this. works, expected. <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <gradient android:startcolor="#330000ff" android:endcolor="#110000ff" android:angle="90"/> </shape> sadly, want list various colors, , they'd have programatically altered @ runtime. is there way create gradient background @ runtime? perhaps not using xml altogether? yes! found way! had forget xml, here's how did it: on getview() overloaded function (listadapter) had to: int h = v.getheight(); shapedrawable mdrawable = new shapedrawable(new rectshape());

How to find a particular value from whole database in SQL -

i have large data base. , want find value not sure column name. there way find value whole database irrespective of column names. waiting response tanu http://social.msdn.microsoft.com/forums/en/transactsql/thread/112b8dd8-fb1f-4c73-b61c-68919bbd5bc5 http://vyaskn.tripod.com/search_all_columns_in_all_tables.htm

Android Design Layout -

i android market apps design, bright , catchy layout. how has been done? tried put such green semi-circle bar on top transparency on circle, listview not going behind, in market apps listview scrolls behind green bar. many in advance. rgds balaji i don't know want or not may you. xml layout <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".mainactivity"> <listview android:id="@+id/list" android:layout_width="match_parent" android:layout_height="match_parent"/> <android.support.v7.widget.toolbar android:id="@+id/my_awesome_toolbar" android:layout_width="match_parent" android:layout_height

c# - TimeSpan for different years substracted from a bigger TimeSpan -

the language using c#. i have folowing dillema. datetime a, datetime b. if < b have calculate number of days per year in timespan , multiply coeficient corresponds year. problem fact can span multiple years. for example: nr of days in timespan 2009 * coef 2009 + nr of days in timespan 2010 * coef 2010 + etc here little snippet of code might help var start = new datetime(2009, 10, 12); var end = new datetime(2014, 12, 25); var s = j in enumerable.range(start.year, end.year + 1 - start.year) let _start = start.year == j ? start : new datetime(j, 1, 1) let _end = end.year == j ? end : new datetime(j, 12, 31) select new { year = j, days = convert.toint32((_end - _start).totaldays) + 1 };

c# - Nhibernate null referrence exception during database connection -

i getting exception when program starting connection ms sql 2005 express db on windows xp. got error , not... nhibernate v3 dbmonitor class runs on separate thread, on one, future can run on multiple. i have similar sessionprovidermssql2005 class sqlite connection , has same issue , session provider sqlite runs on multiple threads... system.nullreferenceexception: object reference not set instance of object. @ system.collections.generic.dictionary`2.insert(tkey key, tvalue value, boolean add) @ system.collections.generic.dictionary`2.set_item(tkey key, tvalue value) @ nhibernate.impl.sessionfactoryobjectfactory.addinstance(string uid, string name, isessionfactory instance, idictionary`2 properties) @ nhibernate.impl.sessionfactoryimpl..ctor(configuration cfg, imapping mapping, settings settings, eventlisteners listeners) @ nhibernate.cfg.configuration.buildsessionfactory() @ mysolution.databaselayer.repositories.sessionprovidermssql2005.get_sessionfa

ms access - Set datasheet column header text (without using labels in the underlying form) -

we have form in ms-access can viewed either in form or datasheet mode. the form arranged in such way labels aren't required of textboxes. in datasheet mode however, kind of column heading required , default behaviour takes control name (as in txtretailprice ) ugly. is there way set datasheet column header text without putting labels on underlying form . i've said, form nicely laid out , adding labels in there confusing. i'm hoping there solution preferably doesn't involve adding redundant labels form. i know old post , question answered, answer might helpful you. you didn't mention version of access, in access 2010 there's textbox property called datasheet caption. when insert space value property, column header in datasheet show blank. hope helps.

c# - Does a single web request to IIS stay on a single thread? -

i want write logging http module stores list of log events single request in thread local storage while request executes. on end_request want write events persistent storage. question is, 1 request match 1 thread? i.e. can assume anywhere in code can add items ienumerable , @ end of request. no. asp.net can potentially switch threads while processing request. known thread-agility. there points can/will this. can't remember off top of head - searching reference now... but short answer no : can't rely on same thread-local storage being accessible entire duration of request.

Need variable value as element name using XSLT -

i converting 1 format of xml , need insert element , name value of variable. example, trying statements below using xslt, getting error processor saying element name invalid. <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform" xmlns:w="http://schemas.microsoft.com/office/word/2003/wordml"> <xsl:output method="xml" version="1.0" encoding="utf-8" indent="no" omit-xml-declaration="no"/> <xsl:variable name="i" select="i"/> <xsl:variable name="b" select="b"/> <xsl:variable name="u" select="u"/> <xsl:variable name="s" select="s"/> <xsl:variable name="r" select="r"/> <xsl:variable name="m" select="m"/> <xsl:variable name="n" select="n"/> <x

java - Convert camel-lowercase to camel-upperCase automatically -

i'm looking easy way convert variables , function names lower_case uppercase in java code. there's lot of code, refactoring names 1 one isn't idea. it means function public void create_table(string table_name) { int useless_var = 0; useless_function("string_param"); // comment should not altered, even_if_i_use_some_underscores } should become public void createtable(string tablename) { int uselessvar = 0; uselessfunction("string_param"); // "string_param" must not become "stringparam" // comments should left untouched, even_if_i_use_some_underscores } and on. i know can python script, take time , can make mistake converting not identifier. that's why want know if there's tool or this. most java ides can cascade changes make 1 variable ever used. believe tools pmd can find these cases might not in fixing them. if working application, might want make corrections perform maint

Repository pattern using PowerShell -

here concern, my problem not powershell, way have use implement persistence. cases there more 4 commands logic or apply persistence. for example: when configuring dns zone, normal new/get/set/remove-dnszone and suspend/unsuspend-dnszone. how teammates handling make method on repository handle commands. it seems me behavior should instead on object , suspend/unsuspend-dnszone should called when create or update executed on repo. what think? edit requested, i'll put code demonstrate talking about. this fake example similar implementation of our powershell wrapper. method on repository teammates do: public void suspend(dnszone zone) { _powershell.execute("suspend-zone", new dictionary<string, object>{{"name", zone.name}}); } so somewhere in logic, suspend zone have call var myzone = new dnszone{ name= "xyz"}; _zones.suspend(myzone); instead, prone dnszone should have property or method. logic not in repo in object i

model view controller - MVC Routing w/Virtual Directory -

i'm having lot of issues mvc routing on iis6. lets virtual directory "xyz". if go http://example.com/xyz , defaults correctly home controller. routing default. navigating http://example.com/xyz/home/index gives 404, other pages give 404. also, should mention server has siteminder on it. incase has worked mvc & siteminder. solved. siteminder dll set "verify if file exists". once unchecked, worked properly, including siteminder.

Java HTTP Response Code, URL, IOException -

i'm getting 503 response server i'm trying communicate with. now, shows me in log, but, want catch ioexception fires , deal if , if response code 503, , nothing else. how this? edit: here's part of code: inurl = new bufferedreader(new inputstreamreader(myurl.openstream())); string str; while ((str = inurl.readline()) != null) { writeto.write(str + "\n"); } inurl.close(); if using java.net.httpurlconnection , use method getresponsecode() if using org.apache.commons.httpclient.httpclient , executemethod(...) returns response code

jQuery UI slider change display text -

i change 2 things, in how jquery ui slider text look, wonder if possible. i like: http://i56.tinypic.com/dm8ahi.jpg i change color of field, slider numbers have color(so text have other color). and put separator bigger numbers, show 1,000,000 instead of 1000000. is possible? the ui slider has 'slide' event provides values need (ui). use ui variable insert value page, use css style text want. read more @ http://jqueryui.com/demos/slider/

wpf - How to animate the background of a textblock when changing the value of the bound property? -

i have pretty simple wpftoolkit:datagrid show stock market bid , ask. my grid bound observablecollection<priceviewmodel> . priceviewmodel implements inotifypropertychanged . the grid correctly updates , have managed background color animate intermittent in apply animation. below xaml , snippet of view model class. the idea color red when price update lower previous , green when it's higher...nothing fancy. <wpftoolkit:datagrid name="pricedatagrid" rowheaderwidth="5" autogeneratecolumns="false" verticalcontentalignment="center" margin="0,33,0,0" horizontalalignment="left" width="868"> <wpftoolkit:datagrid.columns> <wpftoolkit:datagridtemplatecolumn header="bid" minwidth="40"> <wpftoolkit:datagridtemplatecolumn.celltemplate> <datatemplate> <textblock text=

Cocoa NSView: Making circles but they are getting cropped -

the outer edges of circle @ each point of compass getting cropped (presumably rect frame). how circle display within frame? (this getting created button click): in appcontroller.m #import "appcontroller.h" #import "makecircle.h" @implementation appcontroller - (ibaction)makecircle:(id)sender { makecircle* newcircle = [[makecircle alloc] initwithframe:nsmakerect(100.0, 100.0, 30.0, 30.0)]; [[[[nsapplication sharedapplication] mainwindow] contentview] addsubview:newcircle]; [newcircle release]; } @end in makecircle.m - (void)drawrect:(nsrect)rect { [self setneedsdisplay:yes]; [[nscolor blackcolor] setstroke]; // create our circle path nsbezierpath* circlepath = [nsbezierpath bezierpath]; [circlepath appendbezierpathwithovalinrect: rect]; //give line thickness [circlepath setlinewidth:4]; // outline , fill path [circlepath stroke]; } thanks. i think see half of edge, right?

IN Magento, how can I replicate the creation of a URL rewrite across multiple stores? -

this thinking far: create custom module fired event listener when admin magento website triggers event: controller_action_predispatch_adminhtml_urlrewrite_save so far good... question 1 how methods observer class relate data need able replicate request across every active store? question 2 realise need helper class fetch websites need secondary question there magento class/function fetches list of websites in install? question 3 apart adding logic check if chosen product/category has associated product/catalog in each of store getting new rewrite, there other checks should make? answer 1: var_dump($observer) start allow me retrieve data in preparation replication: $request = mage::app()->getfrontcontroller()->getrequest()->getpost();

windows - how to redistribute Gdiplus (GDI+)? -

i need redistribute gdiplus.dll v.1.1 app , sure particular version used. e.g. windows xp has system version of gdiplus.dll can not upgraded (v.1.0). if put gdiplus.dll application folder, system 1 still used. why? how resolve this? msdn says : if redistributing gdi+ downlevel platform or platform not ship version of gdi+ natively, install gdiplus.dll in application directory. puts in address space, should use linker's /base option rebase gdiplus.dll prevent address space conflict. but have no clue how rebase gdiplus.dll , what, can explain this? [edit] seems microsoft decided not ship gdi+ 1.1 windows xp, vista , on. nice move. thank all you don't need rebase it. if don't dll rebased automatically whenever loaded. have mild impact on start-up speed guess won't detectable. however, seems cannot redistibute gdi+ 1.1 xp: how install gdi+ version 1.1 on windows xp?

objective c - Displaying all running apps in Mac OS X -

hey, wondering how make app getting info apps currenly running on mac. basiclly want same information force quit (apple logo > force quit) thank in advance! you can use -[nsworkspace launchedapplications] .

iphone - view controller not working? -

i'm newbie in iphone development, i'm studying, searching , learning things x-code , objective-c. started project have questions do. i've started project tabbarcontroller app . it's link catalogue, bottom tabbar acting menu, 4 tabs. first tab must have view scroll of images side side , zoom. i searched around , found jmdiap sample. i've started sample alone , works nicely. it's need. have put inside project. so copied classes. after, took subview first tab (named catalogo.xib ) , selected file's owner class ( catalogocontroller ). xib, m , h files created xcode creation wizard, connections ok. selected catalogo nib use in first tab. my trouble nothing happened. when try put code in loadview or viewdidload like: self.view.backgroundcolor = [uicolor greencolor]; to see class working, nothing happens too. can me please? it sounds view didn't connected. check see if connected view object in xib window actual view (in interface

circumventing spring security -

in our app spring security uses ldap provider. i working on change let flip flag in dev allow log in if user/pass matches value database. ldap server might down , can still log in. what ive realized though urls secured with @secured( {"role_user","role_merchant"}) so need still have dealings spring security in order logins work. how go doing this? you can configure 2 providers: 1 ldap provider , dao provider. <sec:authentication-manager alias="authenticationmanager"> <sec:authentication-provider ref="yourldapauthenticationprovider" /> <sec:authentication-provider ref="yourdaoauthenticationprovider" /> </sec:authentication-manager> if ldap fails, fall dao authentication provider. you need configure own authentication filter inject flag yourdaoauthenticationprovider when authentication falls yourdaoauthenticationprovider , can check whether proceed further authentication (say, in

jQuery.cycle change div background image -

jquery newbie! i having real trouble getting cycle plugin change background image of div rather cycle through slides. div has other content don't want change. is there plugin out there should using achieve this? appreciated on this. this page should you: http://www.magneticwebworks.com/jquery-rotating-page-background/

iPhone enterprise deployment -

i building app using apple "in-house" deployment of enterprise program. want distribute app free of cost few non member of enterprise. cannot make person employee of organization because of company policy. possible , there legal issues associated on apple side kind of distribution? in advance. you'll need digging apple's policy, i'm pretty sure read enterprise deployment method strictly in-house employees. in order distribute outside individuals, may have go on app store. unless have company individuals work sign enterprise deployment program , distribute internally there? to safe, check apple

How to deploy custom style changes to a bunch of master pages in SharePoint -

i'm working in sharepoint 2010 , wondering there way deploy single css change masterpage every child site in site collection? i'm using team site , i'm using v4.master. i'm assuming subsites referencing single masterpage @ root of site collection. i'm assuming since you're using ootb masterpage (v4.master), remains "untouched" , doesn't have custom css in it. if correct far, you've got 3 options: relative css . can create custom css file , add reference in head of masterpage. change has made once , reflected on pages in sites, mean you'll need edit html in masterpage, wouldn't recommend if using 1 of ootb files such v4.master. <sharepoint:cssregistration runat="server" name="custom.css" after="corev4.css" enablecsstheming="false"> theme. create new site theme contains custom css file, assign site via site settings ui. doesn't require changes masterpag

linux - How can you have a TCP connection back to the same port? -

machine rhel 5.3 (kernel 2.6.18). some times notice in netstat application has connection, established tcp connection when local address , foreign address same. here same problem reported else too. the symptoms same described in link - client connects port x port of server running locally. after time netstat shows client has connection 127.0.0.1:x 127.0.0.1:x how it's possible? edit 01 simultaneous open causing problem (thanks lot hasturkun). can see on classical tcp state diagram in transition syn_sent state sync_received this may caused tcp simultaneous connect (mentioned on post lkml , see here ). it's possible program looping on trying connect port within dynamic local port range (which can seen in /proc/sys/net/ipv4/ip_local_port_range ),to succeed while server not listening on port. on large enough number of attempts, socket being used connect may bound same port being connected to, succeeds due mentioned simultaneous connect. magically h

Start rails server on a domain I mapped in my host file -

i want map: www.example.com in host file, how can start 'rails server' uses domain? edit hosts file (instructions osx snow leopard) sudo nano /etc/hosts add line 127.0.0.1 www.example.com refresh dns settings sudo dscacheutil -flushcache start rails on correct port rails server work on http://www.example.com:3000/ . rid of :3000, start rails with: sudo rails server --port=80 (or rvmsudo if using rvm) for production use, might want see kevins answer.

java - A design pattern for constructors -

i have been challenged design issue try describe below. suppose class, call a, has constructor bunch of parameters. since tiring , dirty write parameters in each instantiation, have written class, call stylesheeta, encapsulates parameters , parameter constructor of a. in way, can prepare default stylesheeta templates used later, , if needed, can modify them. and @ point, need extend a. suppose b extends a. b have own stylesheet, namely stylesheetb. think appropriate stylesheetb extends stylesheeta, 1 stylesheet parameter, constructor of b can construct super class a. afraid of possibility design may have flaws. example if decide add getter/setter stylesheet? there novel way handle these situations? in wrong way? confused, attach code here: class { stylesheeta ss; a(stylesheeta ss) { this.ss = ss; // stuff ingredients of stylesheet } } class stylesheeta { int n1; int n2; // :

How would you look at developing an algorithm for this hotel problem? -

there problem working on programming course , having trouble developing algorithm suit problem. here is: you going on long trip. start on road @ mile post 0. along way there n hotels, @ mile posts a1 < a2 < ... < an, each ai measured starting point. places allowed stop @ these hotels, can choose of hotels stop at. must stop @ final hotel (at distance an), destination. you'd ideally travel 200 miles day, may not possible (depending on spacing of hotels). if travel x miles during day, penalty day (200 - x)^2. want plan trip minimize total penalty is, sum, on travel days, of daily penalties. give efficient algorithm determines optimal sequence of hotels @ stop. so, intuition tells me start back, checking penalty values, somehow match them going forward direction (resulting in o(n^2) runtime, optimal enough situation). anyone see possible way make idea work out or have ideas on possible implmentations? if x marker number, ax mileage ma

html - 100% height div -

i have #main div i'd fill page between header , footer when there no content. when there content, should push sticky footer down, does. css: #main { background: transparent url("images/main-content.png") top right repeat-y; clear: both; overflow: hidden; margin-top: -10px; height: 100%; min-height: 100%; } i'm not sure why isn't working. #main inherits #wrapper , body , i'd think setting 100% height , min-height of 100% work. site: http://www.dentistrywithsmiles.com thanks in advance this. it's height: auto !important; somewhere near line 146 of css file. it's overriding 100% height of wrapper, isn't letting main div grow. since footer has constant height, try adding padding wrapper make main content div not eat footer, happens when turn of height: auto !important; .

Telerik CDN Support -

according telerik: to distribute web asset group via content delivery network should use contentdeliverynetworkurl() method: <%= html.telerik().scriptregistrar().scripts(scripts => scripts.addgroup("commonscript", group => group.add("~/scripts/core.js") .add("~/scripts/stuff.js") .combined(true) .cachedurationindays(365) .compress(true) .contentdeliverynetworkurl("http://mycdn.com/commonscript.js") ) i'm confused this, specifically: contentdeliverynetworkurl("http://mycdn.com/commonscript.js") how file created on cdn? assume core.js , stuff.js combined, cached, , compressed uploaded cdn automatically? or commonscript.js js file get's added combined script? if so, combined script gets served locally still, , not cdn? telerik very little how work. any appreciat

javascript - plugin save var inside each returned click -

you guys mind checking out jsfiddle made understand issue. http://jsfiddle.net/kr1zmo/dqbex/8/ : <a href="#" class="cref">item</a> <a href="#" class="cref">item 2</a> <a href="#" class="cref">item 3</a> <a href="#" class="cref">item 4</a> <p id="result"></p> <script language="javascript" type="text/javascript"> (function($) { $.fn.livebindtest = function() { return this['live']('click', function() { var savedvar; if (!savedvar || savedvar == 0) { // false, false things. savedvar = 1; jquery('#result').append(savedvar); } else { // true, true things. jquery('#result').append(savedvar); savedvar = 0; } retur

asp.net mvc client side validation -

i've been tinkering client side validation features in asp.net mvc after reading scottgu's blog post on subject. it's pretty easy use system.componentmodel.dataannotations attributes this: [required(errormessage = "you must specify reason")] public string reasontext { get; set; } ... happens if need little more complex. if have address class postalcode , countrycode field. want validate postal code against different regex each country. [0-9]{5} works usa, need different 1 canada. i got around rolling own validationservice class takes modelstate property of controller , validates accordingly. works great on server side doesn't work fancy new client side validation. in webforms use javascript-emitting controls requiredfieldvalidator or comparevalidator easy stuff , use customvalidator complex rules. way have validation logic in 1 place, , benefit of rapid javascript validation simple stuff (90% of time) while still security of server side va

swing - I want to have a JPanel with both a Java 2d Graphics Section and a JComponent Section at the bottom -

this tower defense game , want top section map , objects drawn in 300x200 panel , bottom 300x100 panel multiple jbuttons , jlabels. how this. have used swing long time don't know how separate graphics part other components. i suggest putting 2 jpanels inside main jpanel. top 1 map , objects, , bottom 1 contain jbuttons , jlabels. remember set appropriate layoutmanager main jpanel.

c# - Declarative language support in .NET -

i developing simulation engine visual studio offer support building business process simulations. 1 of key features declarative language allow business users setup simulation model. give brief example of mean: initialise simulation. create 100 resources. create 50 jobs. create 2 teams of resources. start simulation 10 runs. so similar above in visual studio define simulation models. know how other environments java , groovy need develop in vs company uses. ideas can find in vs? cheers. since mention groovy, think either ironpython or ironruby fit bill. ruby supposed suited dsl (domain specific language) programming.

Error XalanXPathException when using hours-from-duration xpath function in ibm db2 xslt transformation -

input xml: <test><totalduration>pt1h32m7s</totalduration></test> input xslt: <?xml version="1.0"?> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform" xmlns:fn="http://www.w3.org/2005/xpath-functions"> <xsl:template match="/test"> hours=<xsl:value-of select="fn:hours-from-duration(totalduration)"/> hr </xsl:template> </xsl:stylesheet> expected output: hours=1 hr instead getting: [ibm][db2/nt64] sql16280n xslt processor returned following error: "xalanxpathexception: function number 'http://www.w3.org/2005/xpath". sqlstate=225x0 expected output: hours=1 hr instead getting: [ibm][db2/nt64] sql16280n xslt processor returned following error: "xalanxpathexception: function number 'http://www.w3.org/2005/xpath". sqlstate=225x0 this clear : xslt processor using (xalan) doesn

c# - Are these enumerations code functionally the same? -

foreach ( effect effect in this.effects.where ( e => e.istransparenteffect && e.hasgpusupport ) ) yield return new realtimeeffect<transparenteffect> ( effect ); vs this.effects.where ( e => e.istransparenteffect && e.hasgpusupport ) .select ( e => new realtimeeffect<transparenteffect> ( e ) ); i somehow think select try gather results differently yielding in #1? also there performance difference? both codes return same results. both have deferred execution (i.e. nothing executed until start enumerating result) , stream results (i.e. not buffered). there shouldn't significant performance difference between 2 versions

Android App no longer visible by Android 1.5 on devices -

my last update on android market caused application no longer available android 1.5 devices. i have changed following: <supports-screens android:anydensity="true" /> <uses-sdk android:minsdkversion="3" /> to this: <uses-sdk android:minsdkversion="3" android:targetsdkversion="9"/> <!-- support screen types , allow resizing of layout --> <supports-screens android:anydensity="true" android:smallscreens="true" android:normalscreens="true" android:largescreens="false" android:xlargescreens="false"/> i'm not sure went wrong... tips apreciated! thanks help! -jona i assume due attribute "android:targetsdkversion" first introduced in api level 4 , therefore unavailable api level 3 devices

aspectj - Spring Roo and web scaffolding issue -

i using spring roo. removed spring roo web scaffolding annotation controller , deleted related jspx files. following error: method 'org.springframework.roo.classpath.details.methodmetadatabuilder@d9c877' failed provide body, despite being identified itd inclusion can me troubleshoot it? thanks! we're running same problem, , have found this: http://forum.springsource.org/showthread.php?p=346913 but haven't found source of issue. update: as edit mentions, re-run controller --package ~.web and roo seems fix itself. last update: so reason fixed in applicationconversionservicefactorybean, roo expecting find @ least 1 @roowebscaffold annotation in controllers, , if gone, isn't happy. fix our problem, moved of methods aspectj file java file , eliminated roo management of bean too. things seem happy again, @ least now.

objective c - How can this Xcode Clang static analyzer warning be suppressed? -

"potential leak of object allocated on line n , stored ' variable '." normally helpful analyzer warning, there few situations annoying false positives suppress keep analyzer results clean. in analyzer's defense, it's noticing memory leak not release in path of execution (to blind). i'll elaborate on situation. happens in various flavors, general pattern follows: an object allocated , delegate set. something done object. (a task started, view displayed, etc). execution of current method ends. (enter clang warning). object decides task complete, sends delegate message. delegate releases object. this not @ esoteric design pattern, i'm hoping suppression possible. know can avoided storing offending object in ivar later released, prefer not add ivar pollution. clang has few new source annotations . in specific, may interested in ns_consumed attribute.

debugging - Test iOS app on device without apple developer program or jailbreak -

how can test ios application on ipod touch without registering apple developer program or jailbreaking ipod? neither viable option @ moment. i'd test on device instead of onscreen emulator, see how performs on actual ipod. seven years after inception of app store (july 10, 2008), apple has introduced new feature in xcode 7 allows deploy , run number of apps on of devices, logging in apple id. you no longer need paid program membership deploy apps on own device (and no longer have jailbreak device if you're not comfortable doing so). well, not majority of use cases anyway. obvious reasons, capabilities , entitlements require program membership such game center , in-app purchases not available apps deployed using method. apple's developer documentation : launch app on devices using free provisioning (ios, watchos) if don’t join apple developer program, can still build , run app on devices using free provisioning . however, capabilities available

haskell - What's the best technique to generate a random-access data structure lazily? -

in haskell, i'd generate list of random integers of undetermined length. (however, less 1 million.) i'm not need elements of list immediately, i'd generate lazily. however, once generated, i'll need access elements in list random access. so, assume best technique copy infinite list array. however, don't know if arrays can "interchanged" lists -- instance, once want generate more items of list, want start left off expand array. anyways, perhaps should settle log(n) tree structure instead of array? think? does haskell have tree structure sequential elements can accessed using list-like api? if have prng, values generated seeds close should independent, can choose initial seed, each cell i in array prng(seed+i) . this using hash function :p if way, don't need array, can have function getrandomvalue seed = prng (seed+i) . whether or not better array of lazy values depend on complexity of prng, either way you'll o(1) access.

javascript - Gesture Events (2 fingers) with Blackberry -

i have built iphone application uses ongesturestart , ongestureend , etc. zoom in , out. everything fine under iphone, pinch motion not work under blackberry touchscreen device. i have read somewhere gesture events available ios. true? if so, there way bind 2 finger motions javascript events under blackberry devices?

Android: Best way to play video in Opengl application -

i'm trying figure out best way play tutorial video in opengl android application. i tried this , works fine. now problem how merge opengl application. if launch activity destroy opengl context , have recreate it. best idea @ moment add existing xml layout videoview component , use relative layout overlap on top of opengl view. i know if option or there better solution. as far remember context isn't destroyed when glsurfaceview isn't being used, swap videoview till video's done playing switch back. problem relativelayout idea if glsurfaceview have lot on @ time, might bit lower end devices have them both active.

c# - WPF TreeView-How to refresh tree after adding/removing node? -

i refer article: wpf treeview hierarchicaldatatemplate - binding object multiple child collections and modify tree structure like: root |__group |_entry |_source in entry.cs: public class entry { public int key { get; set; } public string name { get; set; } public observablecollection<source> sources { get; set; } public entry() { sources = new observablecollection<source>(); } public observablecollection<object> items { { observablecollection<object> childnodes = new observablecollection<object>(); foreach (var source in this.sources) childnodes.add(source); return childnodes; } } } in source.cs: public class source { public int key { get; set; } public string name { get; set; } } in xaml file: <usercontrol.commandbindings> <commandbinding command="new" execute

How do I delete an Apex class in Salesforce Enterprise Edition using Eclipse? -

how delete apex class , trigger in salesforce enterprise edition using eclipse? in order delete trigger production org using eclipse need use following steps(assuming have sandbox org): through web interface in sandbox org, inactivate trigger refresh sandbox project in eclipse , deploy inactive trigger production refresh production project in eclipse, right click on trigger , select delete accept option delete server i believe above steps work, have ever removed components production org using destructive changes & ant migration toolkit. to use ant migration toolkit destructive change need setup destructivechange.xml file similar this: <?xml version="1.0" encoding="utf-8"?> <package xmlns="http://soap.sforce.com/2006/04/metadata"> <types> <members>mytrigger</members> <name>apextrigger</name> </types> <version>21.0</version> </package>

iphone - What is the relationship between AppDelegate, RootViewController, and UIApplication? -

i trying figure out relationship between appdelegate, rootviewcontrooler, , uiapplication. here kinda have figured out far: when starting application up, main.m gets loaded. from here, mainwindow.xib gets loaded. in mainwindow.xib, file's owner of type uiapplication. you set uiapplication's delegate appdelegate. in appdelegate's source code, can set rootviewcontroller first view shown. is right? prompts appdelegate run it's - (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions { } method? when objective-c application starts, starts running function named main(). doesn't have in file "main.m" that's how xcode wizard sets things up. inside wizard-produced main() function, there line: int retval = uiapplicationmain(argc, argv, nil, nil); that starts "uikit" framework makes entire application. inside uiapplicationmain, object of type u

parsing - Chained State city dropdown list from JSON -

i trying populate chained state city select dropdowns. using external json file so, consists of state , corresponding city name, id , pincode. can gimme idea on how achieve this. need populate city , pincode value based on state selection. in advance... json { "alaska" : [ {"id": "1", "name": "adak", "pincode": "xxx1"}, {"id": "2", "name": "akhiok", "pincode": "xxx2" }, {"id": "3", "name": "akiak", "pincode": "xxx3" }, ], "arizona" : [ {"id": "4", "name": "apache junction", "pincode": "xxx4"}, {"id": "5", "name": "avondale", "pincode": "xxx5"}, {"id": "6"

javascript - send a POST request from a firefox extension -

i send post request web server firefox extension. i have found example send post requests; https://developer.mozilla.org/en/creating_sandboxed_http_connections#http_notifications but can't work. i have code this; var ioservice = components.classes["@mozilla.org/network/io-service;1"] .getservice(components.interfaces.nsiioservice); var uri = ioservice.newuri("http://www.google.com", null, null); gchannel = ioservice.newchannelfromuri(uri); postdata = "a=1&b=2&c=3"; var inputstream = components.classes["@mozilla.org/io/string-input-stream;1"] .createinstance(components.interfaces.nsistringinputstream); inputstream.setdata(postdata, postdata.length); var uploadchannel = gchannel.queryinterface(components.interfaces.nsiuploadchannel); uploadchannel.setuploadstream(inputstream, "application/x-www-form-urlencoded", -1); uploadchannel.requestmethod = "post"; uploadch

Create Board Game-like Grid in Python -

i thinking of creating board game in python, 1 have grid of spaces, each different properties, , may or may not have pieces resting on them. these pieces should able move between spaces, though subject various rules. (chess or checkers examples of i'm thinking of, though game have different/more complicated rules, , grid may not square, if spaces are). i wrote java implementation of similar data structures class, using modified version of linked lists. python, imagine there's better way (maybe library out there?) drawing chessboard pretty trivial tkinter. here's simple example: import tkinter tk class gameboard(tk.frame): def __init__(self, parent, rows=8, columns=8, size=32, color1="white", color2="blue"): '''size size of square, in pixels''' self.rows = rows self.columns = columns self.size = size self.color1 = color1 self.color2 = color2 self.pieces =

php - Online Test Script -

i wondering if there open source or freeware scripts online test type software. example of script after want able ask question , user answer it. , timer if possible :) there several here: http://sourceforge.net/search/?q=php+question+answers and few more here (but commercial - pay-for): http://www.hotscripts.com/search/php/question+answer+time

mysql - virtualenv pip mysqldb mac os X python -

i tried http://jazstudios.blogspot.com/2010/07/installing-mysql-python-mysqldb-in.html tip install mysql-python (mysqldb) inside virtualenv (named dogme ). (this post point out 2 important things : export archflags="-arch x86_64" echo "mysql_config = /opt/local/bin/mysql_config5" >> ./dogme/build/mysql-python/site.cfg to compile mysqldb) but, when after, run python, import mysqldb, : traceback (most recent call last): file "<stdin>", line 1, in <module> file "/home/.virtualenvs/dogme/lib/python2.5/site-packages/mysqldb/__init__.py", line 19, in <module> import _mysql importerror: dlopen(/home/.virtualenvs/dogme/lib/python2.5/site-packages/_mysql.so, 2): symbol not found: _mysql_affected_rows referenced from: /home/.virtualenvs/dogme/lib/python2.5/site-packages/_mysql.so expected in: flat namespace in /home/.virtualenvs/dogme/lib/python2.5/site-packages/_mysql.so anyone understand what's wron

java - Writing Big XML in sybase and reading it? -

i inserting vey big xml in sybase column has type 'text'. i writing using setstring in preparedstatement , reading using getstring. but when select using getstring don't complete xml. what can read/write complete xml? doesn't sybase provide support clob data type (that more suitable storing large xmls) ? in preparedstatement, need use setclob() instead of setstring() .

php - Extending Joomla Authentication Plugin -

i want create joomla authentication plugin execute business logic before letting user authenticate, want let default authentication plugin me. what want is: function onauthenticate($credentials, $options, &$response) { // business logic // execute onauthenticate event of default joomla authentication plugin // can joomla, openid etc. } so in onauthenticate function, want call default authentication plugin's onauthenticate function. any ideas? sorry guys, i'm new joomla extension development. help. i solved problem keeping plugin , joomla authentication plugin activated , set 0 in order column plugin notified of onauthenticate before joomla's auth plugin.

sql - Zend how do I create a left join -

how turn left join query: select advertisercontest.*, advertiseraccount.advertiserid, advertiseraccount.companyname advertisercontest left join advertiseraccount on advertiseraccount.loginid = advertisercontest.loginid advertisercontest.golive not null; into left join in zend? you follows: $db = zend_db_table::getdefaultadapter(); $select = $db->select(); $select->from('advertisercontest', '*') ->joinleft( 'advertiseraccount', 'advertiseraccount.loginid = advertisercontest.loginid', array('advertiseraccount.advertiserid', 'advertiseraccount.companyname') ) ->where('advertisercontest.golive not null');; $result = $db->fetchall($select); var_dump($result); hope ok.