Posts

Showing posts from June, 2011

serialization - Why does ActionSupport implement Serializable -

what need action classes serializable? when , how happen, if @ all. as far can tell, doesn't need serializable, , mistake make actionsupport implement interface. here best reasoning have found on subject (taken here ): it's common in web frameworks use serializable objects couple or reasons, such being able preserve state across server restart , shipping objects around in cluster. with said, (imho) believe design mistake have actionsupport implement serializable. don't believe either of above apply action objects since short-lived. choice of making actions serializable should have been left developer , not "forced" framework.

grails url mapping -

i new grails & want know:- how default grails url mapping in grails? stored? how can default url mappings replaced our custom url mappings grails controller? urlmapping done in urlmappings.groovy file. read more on how map on http://grails.org/doc/latest/guide/6.%20the%20web%20layer.html#6.4%20url%20mappings

asp.net - how to make a new button in ListView? -

i need make image button in layout template of listview, when click on button should open insert template can insert new record here listview: <asp:listview id="lvcategories" runat="server" datakeynames="catid" datasourceid="categoriesds" enablemodelvalidation="true"> <alternatingitemtemplate> <tr style=""> <td> <asp:label id="catidlabel" runat="server" text='<%# eval("catid") %>' /> </td> <td> <asp:label id="cattitlelabel" runat="server" text='<%# eval("cattitle") %>' /> </td> <td> <asp:label id="catdescriptionlabel" runat="server" text='<%# eval("catdescription") %>' /> </td> <td> <asp:label id="ca...

user controls - Creating a custom blog design in Sitefinity 3.7? -

i'm working on site requires layout of blog changed. read somewhere need map custom control. know involves? don't need fledged answer, direction. thanks! peter here blog post explains how this: http://www.sitefinity.com/blogs/ivan/posts/09-02-23/mapping_a_control_to_use_external_template.aspx hope helps, ivan

ruby on rails - a question on ActiveRecord query -

in model, use statement query db table: where(:date=>start_date..end_date) it obvious records between start_date , end_date in date column. start_date , end_date date type values. based on query, results table but not everything . the data match date value of " end_date " not return. that's query exclude data on end_date, results start_date end_date-1.day , how rid of this? want use query return data end_date >= date >= start_date try: where('date between ? , ?', start_date, end_date)

javascript - How do I create an element after the closing body tag -

i checking if jquery included in document. if not want create element after closing body tag. <script type="text/javascript"> if( !(typeof jquery === 'function') ){ var script = document.createelement('script'); script.src = 'https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js'; script.type = 'text/javascript'; var head = document.getelementsbytagname("head")[0]; head.appendchild(script); } </script> if body tag appends top. wanna either append end of body tag or right after closing it. please help. use document.body.appendchild() . append element @ end of body tag. by way, jandy right, there little need add javascript file dynamically @ end of body.

oracle - blazeds converts BigDecimal to string -

i have flex application uses blazeds connect java backend. using remoting, give call api run select statement on table (using conventional jdbc classes) in oracle database. the table has 2 columns: product_code of type nvarchar2(32) , demand of type number(10, 0) my java api follows: public list<?> getqueryresult(string query) { connection conn = drivermanager.getconnection(connstr, username, password); statement stmt = conn.createstatement(); resultset rs = stmt.executequery(query); arraylist<?> result = new arraylist<?>(); while(rs.next()) { object[] itemarray = new object[2]; itemarray[0] = rs.getobject(1); itemarray[1] = rs.getobject(2); result.add(itemarray); } return result; } in flex side, have handler result event of remote operation: private function onresult(e:resultevent) : void { var result:arraycollection = (e.result arraycollection); } strangely, values corresponding demand column automatically converte...

jquery - Background image covering browser window minus header and footer below the fold -

Image
title might bit confusing, i'll try best explain need achieve. have following elements particular webpage: header - visible above content content - background image covers entire content area - this key part sub-footer - information content visible below it footer - standard company footer, visible if window height size, otherwise need scroll down see it as mention above, content portion of page maybe trickiest part. need big image in background covers entire area. css-tricks has excellent guide in ways full page background images . i'm hoping can achieved easily. issue how make sub-footer stay @ bottom if window <720px footer underneath below fold (needing scroll it). window >720px should show both sub-footer , footer no scrollbars. i won't worry @ point minimum height content needs (possibly necessitating scrollbars on content <div> or making both sub-footer and footer go below fold). here image mockups of i'm trying achieve: fir...

android - Is there a way of forcing a Network Fix location? -

i'm making first app here, use both gps , network (for when gps not available) update location. i'm testing how network location works alone, find takes bit of time retrieve real location, < 1500m accuracy. (i take google maps example) notice i'm off accuracy circle , takes while update, , when "a while" more 30 secs or minute. so question is, there way of forcing location update using network provider? if using mylocationoverlay think have no control on location update intervals. you can try implement own overlay item own undelying location update code can specify own values location update frequency. see overlay , locationmanager docs details.

javascript - close button in lytebox -

close button not working in lyte box,while link working want button instead of link there can apply css button. thank u your question hard understand, sounds of want style close 'button' css. link still works, mean there link text 'close'? if there problem image linking. either way can still style link has id 'lbclose'. a#lbclose { }

Choose folder on Android device -

i let user pick directory , save downloaded file (my app downloads file). know tools (for example, es file explorer) provide such intent-filters. see http://www.estrongs.com/en/support/developers.html . start activity result , selected folder result. also, know there no "select folder" intent standards (i can't use same intent other tools). know other tools support such functionality ? let user use tool, not es file manager. also, astro provide such intent filters? can't find info on page. (i think astro used file manager android) i've come across might potentially here: http://www.openintents.org/en/node/159 it has demo application showing how can interact third party applications file/directory picker. that said, have not tried yet. stumbled across question still looking other options. edit: actually, looks similar es file manager link. perhaps merely clone.

java - how to display many legends for chart on the image -

i have show legends created chart on image when converting chart image.but number of legends due the legends cut bottom , few legends appear on image. so please can body tell me how solve problem you can convert chart image this: outputstream out = ... org.jfree.chart.chartutilities.writechartaspng(out, chart, width, height, null, true, 0); is method you're using?

javascript - Gathering location of an IFRAME -

i building script/application (on client side , on proxy site too) gathers information elements various web-sites. one last thing makes me troubles gathering location of iframe. let me explain in more details: invariant: location of iframe not changed via user interaction some web-pages uses src attribute define location of new iframe - either defined via scripting or manually typed in source - this ok (no problem) other web-pages uses various techniques how populate iframe dynamically , not use src attribute of iframe - this ok if location of such iframe inside same domain, otherwise unsafe access other domain i include 1 example of html code: <html> <body> <a href="http://www.google.com" target="test_iframe">click here open iframe.</a> <br> <iframe id="test_iframe" name="test_iframe"></iframe> </body> </html> so if try javascript below empty string. document.getelementby...

Strange depth/blending in OpenGL drawing models -

Image
i'm having strange problem cannot figure out life of me. i'm loading obj model file maya , rendering opengl environment. appears go , in independent model viewer, display correctly. however, when loaded game environment (with strange projection matrix have no control over), model not display correctly. the vertices seem in correct place in rotating model gives correct sense of 3d. however, depending on depth function, different parts of model appear (incorrectly). for example, in model of person, when person walking left right (e.g. right side of model visible camera); if depth function set gl_lequal , unable see right arm of person when in front of torso. however, when mode set gl_less , able see left arm through torso. 1 of things easier see pictures here go: gl_less or gl_notequal : gl_lequal or gl_always : it should noted nothing displayed other depth function. in first picture of gl_lequal series, can see left arm partially obscured torso when shoul...

Windows 7 PATH environment variable expansion -

in windows 7 set path environment variable thus: %systemroot%\system32;%systemroot%;%systemroot%\system32\wbem;%systemroot%\system32\windowspowershell\v1.0\;%java_home%\bin;%m2_home%\bin;%ant_home%\bin;r:\bin;p:\bin;c:\program files (x86)\common files\intuit\qbpossdkruntime;c:\program files\sliksvn\bin\;c:\program files\tortoisesvn\bin when log out , log in, , bring command prompt, environment variables expanded---except m2_home. if bring edit window path environment variable , hit ok no edits, when open command prompt m2_home variable replaced, , remains until log out. i don't understand this. if definition order problem, m2_home appears before path alphabetically. what's going on? while not solution, hope track down issue. have faced various issues windows 7 , path expansion. try removing entries have spaces, if not help, remove except stock entries , m2_home. recommending remove see if helps track down issue. if determine entry space causing this, can ...

c++ - Question about deleting a pointer. Which class should it be deleted from? -

i have 2 4 classes: mainclass (class things start) xmlreader (class used parse xml file) serialportsettings (holds info serial port read xml-file, e.g. baud rate, comport etc) serialportlistener (takes reference serialportsettings object in constructor) mainclass has method read things xml-file. in method, first creates instance of xmlreader , gives xml-file constructor parameter. xmlreader need exist within method: xmlreader xmlreader (xmlfile); the xmlreader parsers xmlfile. mainclass gets access xml-stuff calling get-methods in xmlreader . far good. however, 1 of methods xmlreader offers, method creates object of type serialportsettings based on information read xml-file: serialportsettings* xmlreader::getserialportsettings() { .... // reading stuff xml file return new serialportsettings(baudrate, databits, comport); } this method called mainclass , return value stored in pointer: serialportsettings* settings = xmlreader.getserialportsettings()...

Cancan authentication with Rails -

i have complex scenario authentication it, came model structure. see model structure can 1 guide how use cancan embed authentication structure. def initialize (user) user ||= user.new # guest user user.roles.each |role| role.permissions.each |p| can :read, p.resource.class_name.to_s.classify.constantize |subject| p.resource.class_name == subject.id , p.can_read end can :create, p.resource.class_name.to_s.classify.constantize |subject| p.resource.class_name == subject.id , p.can_create end can :update, p.resource.class_name.to_s.classify.constantize |subject| p.resource.class_name == subject.id , p.can_update end can :destroy, p.resource.class_name.to_s.classify.constantize |subject| p.resource.class_name == subject.id , p.can_delete end end end end

Unable to access HBase table -

i have cluster of 5 nodes on created few tables on hbase , populated data. 1 of nodes failed , able list of tables on hbase scan or disable of 2 of tables gives nativeexception: org.apache.hadoop.hbase.client.noserverforregionexception: no server address listed in .meta. region tablename,,1295871604968 i want drop table cannot past problem. i'm using hbase shell this. is possible restart node? hbase should have redistributed regions other nodes. there few reasons wouldn't have happened, 1 can think of off top of head have corrupted hdfs. happen if don't have replication in data nodes (or replication turned below number of number of node failures). check file system (hadoop fsck /) also, helpful list version of hbase , hadoop using. if possible, move hbase version 0.90 hadoop 0.20-append branch (included in cdh3)

jms - JBoss MDB - JMSBytesMessage class cast exception -

i'm working on ejb3 mdb listen mq queue in distant server. working fine (mdb triggered when message put listenned queue) except treatment done mdb. information, use wmq resource adapter map queue. into method 'onmessage' of mdb, try cast given message class 'com.ibm.jms.jmsbytesmessage', strange error message. the code following 1 (simple example): public void onmessage(message themessage) { ((jmsbytesmessage) themessage).readbytes(mybytes); } and exception message: exception while reading input request: com.ibm.jms.jmsbytesmessage incompatible com.ibm.jms.jmsbytesmessage ok, the message received should (and is) type 'com.ibm.jms.jmsbytesmessage', why application doesn't work ? should possible jboss server use version of library 'com.ibm.mqjms.jar' (including jmsbytesmessage class) , cause kind of error ? ps: i've deployed application on jboss server version 4.2.3 under linux system. i've make application work on ...

jquery - Question regarding Inheritance in JavaScript -

can please explain difference between 2 codes mentioned below ? function person(){} person.prototype.dance = function(){}; function ninja(){} ninja.prototype = person.prototype; and function person(){} person.prototype.dance = function(){}; function ninja(){} ninja.prototype = new person(); i little confused @ these lines: ninja.prototype = person.prototype; and ninja.prototype = new person(); i came know second 1 supports inheritance , first 1 not, can explain me magic in second one? setting ninja.prototype = person.prototype; saying all ninjas persons, , persons ninjas , since makes 2 prototypes point same thing. changing ninja.prototype change person.prototype , vice versa. setting ninja.prototype = new person(); saying all ninjas start off being regular person , ninja.prototype can modified without changing definition of person . key here new keyword, creates unique instance of person , , therefore free modified without affecting e...

Add Effect to Highlighted Area Using jQuery Map Highlight Plugin -

i have interactive venn diagram using jquery map highlight plugin: http://jsfiddle.net/keith/reypv/2/ i'd make initial highlighted item pulse or glow, because users have commented didn't know diagram interactive. i've tried adding fade or animate in jquery couldn't work. , think i'd want first highlighted item glow, , not others once user starts interacting it. also i'm not sure if i'm highlighting initial item correctly because i'm repeating code below it, if there suggestions on doing better i'd appreciate it. i have ended having hack plugin specific needs. this takes time blink wrapper div instead ... edit: had second @ code , pulsating effect made without hacking plugin triggering mouseover , mouseout. http://jsfiddle.net/reypv/3/

maven 2 - When are properties resolved? -

i defined profile @ base-pom uses property defined sub-pom (deploy-location of appserver-module). profile shall used after initial full-build , inherited sub-poms. the question is: how/when such properties resolved: when doing initial full build or when doing local build of specific submodule ? <profile> <id>quickdeploy</id> <build> <plugins> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-jar-plugin</artifactid> <configuration> <outputdirectory>${ear.path}</outputdirectory> </configuration> </plugin> </plugins> </build> </profile> ${ear.path} defined in submodule ... i tried out question created 2 artifacts m2eclipse. first q4794952.base simple maven project , has type set pom . created second artifact (right click on base project, new => maven => maven module...

asp.net - DotNetNuke: GridView incompatible with Data Access Layer? -

i'm working on dotnetnuke module in c#, , in order cut down on amount of complexity have elected try , keep configuration of module in 1 page (other standard settings module). wonder how wise of idea is. my module simple image gallery, 1 or many images. each image has title, image source (url) , destination (another url). therefore, figured admin interface, have simple 'grid' of data can edit of existing entries or add new one, on same page, sort of this: title image url anchor href [a picture! ] [http://www.example.com/image.jpg ] [http://www.example.com] [another picture!] [http://www.example.com/image2.jpg] [http://www.example.net] [ ] [ ] [ ] looking through webcontrols, found gridview, @ first blush seemed sort of thing looking for. however, taking closer gander @ it, found needed bound directly data source, while seems dotnetnuke standard of d...

jquery - map() get() confusion -

i'm going through jquery api , i'm bit confused on map() & get() method. know i'm wrong map() method looks lot .each() statement? except documentation says returns new jquery object. i've been playing on jsfiddle trying head around it, i'm not quite there. here jsfiddle link: also here snippet of code: $.fn.equalizeheights = function() { var 2 = $(this).map(function(i, e) { return $(e).height(); }); console.log(two); console.log(two.constructor); console.log(two.get()); console.log(two.get().constructor); return this.height(math.max.apply(this,two.get())); } $('input').click(function() { $('div').equalizeheights(); }); i see extending jquery using prototype create function called equalizeheights() . , $(this) represents selector 'div' elements on page. map() call iterates through each of items in array of divs , returns height?...

In Ruby on Rails, how do I create a table/model that has a field in it that references the same table? -

i trying in rails 3. create table (syntax on code examples may not right, trying recreate memory): create_table "persons", :force => true |t| t.string "name" t.integer "guest_of_id" end and want guest_id reference row in persons table. each person guest of 1 person. in model set association: class person < activerecord::base belongs_to :guestof, :class => "person", :foreign_key => "guest_of_id" end however, when try reference guestof field a_person.guestof.name i error undefined method 'eq' nil:nilclass is possible in rails? doing wrong? missing has_many relationship? suspect google-fu failing me. possible solution have found http://railscasts.com/episodes/163-self-referential-association establishing many many relationship , think more complicated trying do. thanks. you should able do: class person < activerecord::base belongs_to :host, :class => "p...

java 2dimensional array to string array -

i have 2 dimensional array values created follows: for(int i=0;i<2;i++) { for(int j=0;j<4;j++) { array[i][j]=e.getvalues (r,c); } } which return : array[0][0] => 16 array[0][1] => 11 array[0][2] => 7 array[0][3] => 6 array[1][0] => 10 array[1][1] => 7 array[1][2] => 6 array[1][3] => 6 how can store these values single string in 2d string array: arrayvalues[0][0] = > {"16,11,7,6"}; arrayvalues[1][0] = > {"10,7,6,6"}; any appreciated. thanks. for(int i=0;i<2;i++) { for(int j=0;j<4;j++) { array[i][j]=e.getvalues (r,c); arrayvalues[i][0] += array[i][j]; if(j < 3) { arrayvalues[i][0] += ','; } } }

c++ - Linking with boost .lib -

i'm getting link time error fatal error lnk1104: cannot open file 'libboost_serialization-vc80-mt-gd-1_44.lib' downloaded boost came boost_serialization-vc80-mt-gd-1_44.lib compiler seems looking 1 starting libboost renamed it. fails find .dll @ runtime. tried rename dll doesn't seem helps. while loading dll: an unhandled non-continuable status_dll_not_found exception thrown during process load there many different versions of each boost library: multi-threaded, single-threaded, static, dynamic, etc. ones starting "lib" static libraries, ones without "lib" lib files used link dll versions. can see looking @ lib file size. if auto-linking boost, means linker looking static version of serialization. if don't have such file, means didn't build it. alternative use installer available @ http://www.boostpro.com . allows select boost libraries (static, dynamic, st, mt, vs version, etc) download , install. the other option disa...

list - Some misunderstanding between me and Scheme -

i'm started learning scheme , can't quite understand why function not work: ;(define (sort l) (define (sorted? l) (if (= (length l) 2) ; if simple list: (if (< (head l) (tail l)) #t #f) ; if complex list: (if (and (< (head l) (head (tail l))) (sorted? (tail l))) #t #f))) output: (sorted? (1 0)) . . procedure application: expected procedure, given: 1; arguments were: 0 (sorted? '(1 0)) . . <: expects type 2nd argument, given: (0); other arguments were: 1 racket, r5rs this because compare integer , list, cadr or if (< (head l) (head (tail l))) instead of if (< (head l) (tail l)) after line ; if simple list have more chances work you. the following definition works me: (define (sorted? xs) (cond ((<= (length xs) 1) #t) ((< (car xs) (cadr xs)) (sorted? (cdr xs))) ...

c# - Hashset not adding a duplicate, but returning true for Add() -

(edit) more info. first notice "new virtual". class inherits base class supposed generic parent-aware class can created icollection type. here's descriptor, basically: public abstract class parentawarecollection<tobject, tparent, tinnerlist> : icollection<tobject>, icollection, iparentprovider<tparent> tobject : iparentprovider<tparent> tinnerlist : icollection<tobject>, new() { protected tinnerlist innerlist = new tinnerlist(); ... } this class: public class parentawarehashset<tobject, tparent> : parentawarecollection<tobject, tparent, hashset<tobject>>, iset<tobject>, icollection tobject : iparentprovider<tparent> { public parentawarehashset(tparent parent) : base(parent) iparentprovider requires "parentcollection" object present. in debugging, overridden (void) add method in parentawarecollection never called. don't think "new...

c# - Can generics be used to collapse these methods? -

i have 2 methods similar things different return type (string vs int) here are: private static string loadattributestring(this xelement xmlelement, string attributename, string defaultvalue) { try {return xmlelement.attribute(attributename).value;} catch (exception) {return defaultvalue;} } private static int loadattributeint(this xelement xmlelement, string attributename, int defaultvalue) { try {return int.parse(xmlelement.attribute(attributename).value);} catch (exception) {return defaultvalue;} } is possible use generics combine these 1 method? (i tried , failed.) note: fine having 2 different methods. expand knowledge of generics. thought ask if possible. yes. use convert.changetype instead of specific parsing function. private static t loadattribute<t>(this xelement xmlelement, string a...

iphone - How to resize view when using UINavigationController setToolbarHidden:animated: -

Image
i'm using uinavigationcontroller toolbar. before display it, resize views don't blocked toolbar (i set frame of current view controller's view rect spanning bottom of navigationbar top of toolbar . but not of view controllers have toolbaritems . so, when switching view controller has items (controller a) 1 doesn't (controller b), want hide toolbar. however, when call settoolbarhidden:animated: in b's viewwillappear:animated: method, toolbar animates down during push transition , shows uiwindow background behind it. this happens in reverse direction: when transitioning b (via button), want toolbar animate in show a's toolbaritems again, since a's view doesn't extend bottom of screen, uiwindow visible during pop transition. that might not have been best description, here's screenshot: i have tried updating a's frame in viewwilldisappear:animated: method, strange things, since seems called within uinavigationcontroller push an...

c# - Try-Catch in Program.cs only works when started from visual studio -

i tried write little crash reporter uncatched expetions. works when starting app in vs. try start .exe shows me standard "there uncaught expetion"-thingy windows. , no it's not crashreporter crashes. this code in program.cs try { application.run(new testserver()); } catch (exception e) { application.run(new crashreporter(e.stacktrace.tostring())); } } this because use debugger. winforms detects , disables event handler application.threadexception. that's important, lets debug exceptions. catch clause work without debugger, you'll have add statement main() method, before run() call: application.setunhandledexceptionmode(unhandledexceptionmode.throwexception); it make more sense write event handler appdomain.current.unhandledexception instead, you'll notified unhandled exceptions in worker threads.

Strange behaviour in OpenMP nested loop -

in following program different results (serial vs openmp), reason? @ moment can think perhaps loop "large" threads , perhaps should write in other way not sure, hints? compilation: g++-4.2 -fopenmp main.c functions.c -o main_elec_gcc.exe #include <stdio.h> #include <string.h> #include <stdlib.h> #include <omp.h> #include <math.h> #define nrack 64 #define nstars 1024 double mysumallatomic_serial(float rocks[nrack][3],float moon[nstars][3],float qr[nrack],float ql[nstars]) { int j,i; float temp_div=0.,temp_sqrt=0.; float difx,dify,difz; float mod2x, mod2y, mod2z; double s2 = 0.; for(j=0; j<nrack; j++){ for(i=0; i<nstars;i++){ difx=rocks[j][0]-moon[i][0]; dify=rocks[j][1]-moon[i][1]; difz=rocks[j][2]-moon[i][2]; mod2x=difx*difx; mod2y=dify*dify; mod2z=difz*difz; t...

c# - Validating a WCF Service on startup -

have wcf service, hosted in iis, , want verify configuration settings valid, e.g. logging directory exists or can created. if configuration fails, want consider service invalid, , notify via event log, etc. ideally service unavailable if invalid. if hosted windows service, easily. hosted in iis? don't know of way make service unavailable code. any ideas? if helps, wcf service runs in own app pool. tia! james if throw exception service not available. in service's constructor checks , if perfect , if not throw exception , service not there. if remote errors off browsing service show error , stack trace.

tdd - How can I unit test or integration test for 404 - Not Found? -

my team writing content-managed web-hosting application in asp.net mvc 2 s#arp architecture framework. i'm using specflow , watin integration testing, , nunit unit testing. i have custom controller factory locates page in database based on url , site, , loads proper controller , action. loads error controller when page (or site) not found in database. i want write either unit test or integration test validates 404 page displayed when url invalid. watin cannot check response header, cannot accurately ensure actual 404 page loaded. may eliminate integration test solution. i'm new tdd , bdd, may missing obvious. also, retro-fitting tests project, makes more difficult. thanks in advance. normally when write bdd scenarios, write them user's perspective. if user ordinary person, don't care whether header genuine 404. they'd prefer page giving them clear , useful message. write scenario check clear , useful message. given no section on unicorn...

algorithm - Algorithmic solution to find closest city based on lat/lon -

note there other similar questions 1) don't want rely on online service, 2) i'm looking clean algorithmic solution. i have database of cities , latitudes/longitudes. i'm looking way that, given arbitrary lat/lon, finds closest city. solutions can think of far: the obvious brute force solution is, of course, calculate possible distances using great-circle distance formula. takes long time , o(n). a modification of kd-tree algorithm may work, i'm @ loss how modify algorithm work in non-cartesian coordinates, case lat/lon. can assume mercator projection if helps. use geo-database such postgresql. doesn't work me, period. any insights? you think of 3d problem. convert (lat, lon) coordinates (x, y, z) coordinates. needs done once database. for each test point, convert (x, y, z) , compute squares of chord distances (for speed , simplicity) each city. choose closest one. believe closest city in 3-space closest city in terms of great circl...

xml with cdata html sections using jaxb to convert to java objects ...is it possible to render the html? -

i have xml document used jaxb have struts2 display in webpage. this document @ high level contains cdata sections paragraphs contain html. java object returned list of paragraph objects text gets turned strings. when display them in jsp paragraphs outputted screen , contain html not rendered. i have found answers on here removing html java strings nothing this. don't have control on xml document consume it. eclipselink jaxb (moxy) has @xmlcdata annotation handling cdata (i'm tech lead). may if can use moxy jaxb implementation. for more information see: http://bdoughan.blogspot.com/2010/07/cdata-cdata-run-run-data-run.html

osx - How can I make another button highlighten on popup window on Mac by using Keyboard -

Image
on above shown asking popup window on mac, how can select button (left button) using keyboard. without clicking mouse button, want make left button highlighten. there shortcuts? go preferences -> keyboard. @ bottom, turn on "all controls" under "full keyboard access". the alternate option highlighted blue ring. hitting space activate this. if there multiple options, hitting tab alternate between them.

Buildup of Jquery animations on live event handler -

i using "live" technique in jquery add icons on hover using code below , on site: http://vitaminjdesign.com/adrian/ : $('a').live('mouseover mouseout', function(event) { if (event.type == 'mouseover') { $('<a href="#"><img src="images/facebook.gif" class="facebook" alt="facebook"></a>').appendto(this).fadein(500); $('<a href="#"><img src="images/twitter.gif" class="twitter" alt="twitter"></a>').appendto(this).fadein(500); } else { $('a').find('.facebook,.twitter').fadeout(500); } }); this works perfectly, there buildup of icons loading. typically use .stop() command, isn't working, perhaps because using live event handler? suggestions? also, icons don't seem fading in, fading out. try .stop(true, true) so: $('a').live...

authentication - Codeigniter with Wordpress integration -

is there way use custom wordpress installed authentication codeigniter framework? it take custom work find wordpress auth library, insert ci, , look-and-feel right app. a better way use auth library that's been specially developed ci, wonderful tankauth ...

apache2 - Apache; Phusion Passenger 3 RackBaseURI works only in Production environment for Rails 3 -

i have few rails 3 applications run under own rails/rack baseuri. under passenger 2 using railsbaseuri "mount" individual rails apps under single domain; worked normally. upgraded passenger 3.0.2 , when i'm running in development mode rails 3 apps want prepend , append baseuri, in development environment. under production, well. for example: app lives in /fsroot/otherdir/myapp target file lives in /fsroot/otherdir/myapp/public/path/to/asset.css in vhost config: rackbaseuri /myapp note:symlink in virtualhost documentroot named myapp , pointed /fsroot/otherdir/myapp/public in view: stylesheet_link_tag '/path/to/asset.css' will produce no such file or directory - asset file not found @ '/fsroot/otherdir/myapp/public/myapp/path/to/asset.css' note rackbaseuri shows here before , after public folder. i tried copying development.rb environment file on production.rb , rebooting apache same thing. there apparently other directive being a...

python - Executing a Django Shell Command from the Command Line -

i execute command via django's manage.py shell function solely command line e.g. manage.py shell -c "from myapp import models; print models.mymodel.some_calculation()" the came way might use -c option normal python interpreter e.g. python -c "print 'hello world'" however, don't see equivalent -c option manage.py shell . there way this? not that. easy enough write standalone script django .

php - problem with cookies -

i have page create cookie value using set_cookie this: setcookie("is_voted","1",time()+60*60*24*10,"/~poll/","spacepower.tv"); but can't cookie value using $_cookie array how fix problem ? i've encountered same problem. according php manual: cookies not become visible until next loading of page cookie should visible for. test if cookie set, check cookie on next loading page before cookie expires. expire time set via expire parameter. nice way debug existence of cookies calling print_r($_cookie);. basically, $_cookie superglobal updated when script first runs. if set new cookie, won't available in $_cookies. have start script see updated $_cookie values. if don't see them then , have problem.

javascript - jQuery Horror "effects", similar creepy effects? -

well longshot, can imagine attempting google "horror jquery" or "scary jquery" not relevant need: creepy jquery effects or plugins. would, example, add animated static on image or every 10 seconds produce moan. yes jquery already, i'm wondering if of have maybe seen halloween plugin or creepy jquery do.

mysql - SQL LIMIT returns no results where no LIMIT returns results -

select * mm_tfs product_slug '%football%' , schoolid = '8' , category_id ='21' limit 4 returns 4 values i'm asking, following statement returns 0 - there rule using or statement i'm not familiar with? assumption should return of values in 1 (or more if weren't limit). select * mm_tfs (product_slug '%football%' , schoolid = '8' , category_id ='21') or (product_description '%football%' , schoolid = '8' , category_id ='21') limit 4 note cyberkiwi first or portion of q2 same clause on q1 product_description '%football%' , schoolid = '8' , category_id ='21 without or statement produce desired result long not have limit. when or statement used limit well, there 0 values returned. select * mm_tfs product_description '%football%' , schoolid = '8' , category_id ='21' limit 4 ^-- produces 0 results select * mm_tfs product_d...

What Application Website should I use with a test application for Twitter? -

i'm trying write small test application twitter personal project. begin working on project, need consumer key identify , process requests. since i'm writing test application, should enter under "application website" on registration form ? use code hosting service http://sourceforge.net/ create project , host code. of course, link you'd want provide if building client. since test application, not matter enter in "application website". this, mean twitter not check whether code exists on site or not. convenience.

c# - Console 3D Cube Rotating -

what algorithm creating "3d" cube in console , rotating (dice roll style)? creative answers appreciated. i don't know if qualifies "algorithm" you'd looking for, full 3d calculations. example code drawing cube wireframe (i'm using vector/matrix classes opentk, them xna or other library well) using system; using system.linq; using opentk; class cubes { static void main() { var resolution = 25; var points = in enumerable.range(1, 8) select new vector3(i / 4 % 2 * 2 - 1, / 2 % 2 * 2 - 1, % 2 * 2 - 1); var lines = in points b in points (a - b).length == 2 // adjacent points && a.x + a.y + a.z > b.x + b.y + b.z // select each pair once select new { a, b }; var t = 0f; while (true) { t += .1f; var projection = matrix4.createperspectivefieldofview(.8f, 1, .01f, 100f); v...

user interface - How do I create a panel of buttons with a simple divider line, or no dividers, in Android? -

Image
this seems basic task, after lot of searching , research, still haven't found clear answer. found gridview, not sure how you're supposed it. i've found several apps have ui elements similar need, example top buttons of android market. that can accomplished horizontal linearlayout contains set of buttons or imagebuttons. rest styling. see hello linear layout started.

javascript - Setting hidden form field's value to 'false' yet getting 'true' on server side -

i have hidden form field: <input type=hidden id=blah1 value=true /> i have abutton, when clicked do: $("#b1").bind("click", function(){ $("#blah1").attr("value", "false"); }); but when form value on server side, 'true'. am doing wrong? i did this: e.preventdefault(); $("#blah1").attr("value", "false"); alert( $("#blah1").attr("value") ); it alerted value 'false'. you did include ' name ' attribute in real code, no? <input type=hidden id=blah1 value=true name=blah1 /> this still doesn't explain why see "true" on server side. if did include "name" attribute on hidden field, please post server-side code. running code have posted here, once "name" attribute added, achieved expected "false" result.

Cancel an HTTP GET request from Firefox Extension -

i have firefox extension listens "http-on-modify-request" , inspects requests coming firefox. i'd able cancel request (say return fail code page) or modify uri of request can't seem it. nsihttpchannel object doesn't allow - instance delete httpchannel; or reseting empty request httpchannel = components.classes["@mozilla.org/xmlextras/xmlhttprequest;1"].createinstance(components.interfaces.nsixmlhttprequest); don't work (and can't modify uri). so how both intercept , modify http requests in firefox extension. delete httpchannel; deletes variable, sort of saying httpchannel = undefined; . request unchanged. similarly, second idea sets variable point @ new nsihttpchannel instance, old request still unchanged. to modify request, use properties , methods. see nsihttpchannel or nsichannel or nsirequest . say, can't modify uri might want cancel (see below) , replace new one. i'm not sure how imagine 1 of 3 pages...

c# - POCO and non-POCO in the same class library project -

in 1 of projects have models don't want use poco i.e. use ef generated classes , others want use pocos. when mix those, poco mapping doesn't work , exception system.invalidoperationexception unhandled user code message=mapping , metadata information not found entitytype 'xxxxx.xxxxx.xxxxx.xxxxx'. source=system.data.entity this message incorrect in connection string. however, after through inspection confirm there nothing wrong or generated poco classes. found that mapping poco entities not supported if mapping attributes applied custom data classes, including edmschemaattribute @ assembly level. in msdn article working poco entities . while simplest solution split project 2 parts , keep poco , non-poco separately, wanted see if there way around. looks there isn't way this.

I want a trigger to DELETE from 2 tables in MySQL -

i have 3 mysql tables ( food , apple , , orange ). i want delete rows from: apple(idapple, iduser, name) orange(idornge, iduser, name) when deleting row in food(iduser, name) using 1 trigger? here trigger far: create trigger `food_before_delete` after delete on `food` each row delete apple, orange apple.iduser=old.iduser , orange.iduser=old.iduser but won't compile. how can make trigger deletes 2 tables @ once? delete 2 tables @ once trigger: triggers used enforce data integrity in tables. can use triggers delete number of tables @ once. before initializing triggers change mysql delimiter operator temporarily because triggers use semicolon ; operator specify multiple sql commands within trigger. step 1 change delimiter: delimiter $$ step 2 create trigger: create trigger `blog_before_delete` after delete on `blog` each row begin delete blog_tags blogid = old.id; delete blog_comm...

calling qsort with a pointer to a c++ function -

i have found book states if want use function c standard library takes function pointer argument (for example qsort), function of want pass function pointer needs c function , therefore declared extern "c". e.g. extern "c" { int foo(void const* a, void const* b) {...} } ... qsort(some_array, some_num, some_size, &foo); i not surprised if wrong information, - i'm not sure, so: correct? a lot depends on whether you're interested in practical answer compiler you're using right now, or whether care theoretical answer covers possible conforming implementations of c++. in theory it's necessary. in reality, can without it. the real question whether compiler uses different calling convention calling global c++ function when calling c function. most compilers use same calling convention either way, call work without extern "c" declaration. the standard doesn't guarantee though, in theory there compiler used diffe...

android - Rotating the Canvas impacts TouchEvents -

i have map application using in-house map engine on android. i'm working on rotating map view rotates map based on phone's orientation using sensor service. works fine exception of dragging map when phone pointing other north. example, if phone facing west, dragging map still moves map south versus east expected. i'm assuming translating canvas 1 possible solution i'm not sure correct way this. here code i'm using rotate canvas: public void dispatchdraw(canvas canvas) { canvas.save(canvas.matrix_save_flag); // mheading orientation sensor canvas.rotate(-mheading, origin[x],origin[y]); mcanvas.delegate = canvas; super.dispatchdraw(mcanvas); canvas.restore(); } what best approach make dragging map consistent regardless of phones orientation? sensormanager has "remapcoordinates()" method it's not clear resolve problem. you can trivially delta x , delta y between 2 consecutive move events. correct these values ...

BlazeDS, Flex, and Java - Can I treat a RemoteObject like an instance of the Java class? -

i'm sorry if question bit obvious, i'm new blazeds , can't seem find answer. i'm running java on blazeds server flex front-end. i'd able instantiate java class once, have flex use setters , getters play data in java class (in sense, treating remoteobject if instance of class). far i've read seems way blazeds works, every time call java method flex, calls java constructors again, resetting input setter methods. there way have server hold instance of java class between method calls? thanks! you seem have misunderstanding of how works. objects in flex client , objects on server independent. in normal circumstances, flash player/a flex app talks remote service using either webserice, httpservice, or remoteobject. remoteobject supports amf , flash remoting blazeds, livecycle data services, coldfusion, , ton of other server side software. when make remote calls server, request no different standard web page call. exists in "isolation" ,...