Posts

Importing an XML document into a Rails database? -

i've been reading through tutorial after tutorial, nothing seems working out me. goal take xml document elements , attributes , insert data in database. each element/attribute column in database, , each entry row. here made-up xml doc i've been working with: <?xml version="1.0"?> <library> <name><![cdata[favorite books]]></name> <book isbn="11342343"> <title>to kill mockingbird</title> <description><![cdata[description#1]]></description> <author>harper lee</author> </book> <book isbn="989894781234"> <title>catcher in rye</title> <description><![cdata[this extremely intense description.]]></description> <author>j. d. salinger</author> </book> <book isbn="123456789"> <title>murphy's gambit</title> <description><![cdata[daughter finds dad!]]></description> <auth...

sql - Trying to remove special characters in PHP -

i have form has text inputs. when add them db '\' character before each special character {', ", etc}. want remove '\' before entering text db far have been unable to. tried doing in php before execute query: $title_str = str_replace('\'','',$_post['main_title']); but did not work. thanks, sounds magic quotes still turned on. should disable them. safe thing do. http://www.php.net/manual/en/security.magicquotes.disabling.php also, sure use prepared queries (with pdo or similar) when inserting data in database avoid sql injection problems.

javascript - WebSockets, Comet, AJAX & Long Polling -

my understanding of comet server-side ajax request. understanding of long polling ("push") is server-side ajax request. understanding of websockets two-way ajax request. if of these wrong, please begin correcting me! assuming i'm more or less correct, true these ajax (javascript using xmlhttprequest object under hood)? if not ajax calls, how implement them in client (via javascript) , on server (using java)? in advance! your understanding of websockets incorrect. websockets new protocol , provides new api has nothing xmlhttprequest . this how create websocket var examplesocket = new websocket( "ws://www.example.com/socketserver", "protocolone" ); see https://developer.mozilla.org/en/websockets/

Slide-down animation in StackPanel - WPF (C#) -

Image
i trying create animation in stackpanel control when new children-windows added stackpanel, sliding down animation occurs. in vertical list-styled stackpanel. i use following code create new children-windows , insert them top of list: usercontrol1 item1= new usercontrol1(); item1.height = 0; item1.label1.content = "child window"; stackpanel1.children.insert(0, item1); slide-down animation in stackpanel - wpf (c#) - stack overflow stack overflow questions developer jobs documentation beta tags users current community help chat stack overflow meta stack overflow communities sign up or log in customize list. more stack exchange communities company blog tour start here quick overview of site center detailed answers questions might have meta discuss workings , policies of site learn more stack overflow company business learn more hiring developers or posting ads ...

javascript - Scrolling through "touchmove" is choppy -

i wanted "position:fixed" on mobile devices (i have android one) - , doesn't exist. faked creating 2 divs heights of summed height of screen (using js) , added touch listeners bottom div. events adjust scrolltop value. copy of old "touchscroll.js". the scrolling works successfully, added sling feel. however, entire scroll choppy compared when os scrolls view of window. i've read on random places, , somewhere here add -webkit-backface-visibility:hidden; , -webkit-transform:translate3d(0,0,0); css bits solve chop. tried on div itself, on body, backface part, transform etc... permutations... nothing helped. chop still existed, , tricks stopped keyboard appearing in input s i tried create internal div within scrolling one, , instead of adjusting scrolltop value move internal div making position:absolute , adjusting it's top . made no difference. is there solution beat chop? example here: http://mobile.phantasyrpg.com/so-example unfortunately ...

javascript - Tools and techniques for UX-centric Regression testing of a web application? -

the application i'm working on simple 3-tier web application (whatever simple means :) however, application ux/ui intensive i.e. user-interface forms crux of application. every structural change page or refactoring javascript/jquery/backbone code, need ensure ui behaving expected. for example, if div 's disappearing on deleting object, or if items being successful 'posted' , displayed in different div etc. i'm relatively new domain of ux/ui-based testing , not sure how attack problem. of it's quite manual overhead ensure looks , works right. have 'one layer below' tests send http messages , seems work fine return codes etc. ui focused testing lack. i've heard selenium, jasmine , few javascript frameworks not sure if serve needs. of solution see custom code javascript tests 'autorun' these tests browser , check if things happening way should (probably human 'staring' @ screen :) quite task , thought of asking community on suggesti...

Grails: how to display images in tag? -

possible duplicate: grails: displaying created image in gsp i'm trying display images database in <g:each> tag. my domain-class: class artists { byte[] image string artistname string bio static constraints = { image(nullable:true , maxsize:200000) artistname(nullable:true) bio(nullable:true, maxsize:2000) } } and artists.gsp : <g:each in="${dog.artists.list()}"> <g:img src="${it.image }" width="120" height="160"/> //doesn't work, should here??? <p>name: ${it.artistname}</p> //works <p>biography: ${it.bio}</p> //works </g:each> help please !!! you can render image inline way you're attempting using rendering plugin, , following gsp tag (this png check inline images in docs other content types): <rendering:inlinepng bytes="${it.image}"/>