Search Results

Search found 429 results on 18 pages for 'cdata'.

Page 13/18 | < Previous Page | 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • Prohibit ampersand in Rails form

    - by snlsn
    NOT a Rails 3 issue In a Contact model I have a company_name attribute. For reasons that don't matter to this question, I want to prohibit an ampersand character. We have a lot of clients with ampersands in their company name, and users forget they aren't allowed to use this character. This isn't an html sanitize issue. I don't care about whitespace or CDATA or anything. The entries in this field are plain text and I don't want an ampersand to be entered in this one field in any way, shape or form. I assume a validation on the model is the way to go. I have tried validates_exclusion_of. I have tried validates_format_of. No success. I'm unsophisticated when it comes to regex, so I might be doing things very wrong. But the bottom line is - I need to prevent a user from entering that "&" character in the company_name field. Thanks a million. Steve

    Read the article

  • Flex customized Horizental List

    - by muzammal
    i have customized Horizontal List (items are image and some text) of a reel with some no of clips . i have customized highlight , un highlight and select style , which will be implemented dynamically and mouse over and out. now pproblem is to make un highlight previously playing clip. enter code here styleName="unhighlightedClip" updateComplete="currentlyPlaying();" rollOver="highlighted();" rollOut="unhighlighted();" .currentlyPlayingClip{ borderColor: #95123E; borderStyle: solid; borderThickness: 2; } .unhighlightedClip{ borderStyle: none; } .highlightedClip{ borderColor: #70BAE7; borderStyle: solid; borderThickness: 2; } </mx:Style> <mx:Script> <![CDATA[ import mx.controls.Alert; import mx.controls.HorizontalList; private var prevIndex:int = -1; protected function unhighlighted():void{ var selected:Boolean = HorizontalList(this.owner).isItemSelected(this.data); clipDesription.useHandCursor = false; clipStartTime.useHandCursor = false; this.useHandCursor = false; if(!selected) this.setStyle('styleName', 'unhighlightedClip'); } protected function highlighted():void{ clipDesription.useHandCursor = true; clipStartTime.useHandCursor = true; this.useHandCursor = true; var selected:Boolean = HorizontalList(this.owner).isItemSelected(this.data); if(!selected) this.setStyle('styleName', 'highlightedClip'); } protected function currentlyPlaying():void{ var selected:Boolean = HorizontalList(this.owner).isItemSelected(this.data); var currentIndex:int = HorizontalList(this.owner).selectedIndex; if(selected) this.setStyle('styleName', 'currentlyPlayingClip'); // else if(prevIndex != currentIndex ) // this.setStyle('styleName', 'unhighlightedClip'); // // prevIndex = currentIndex; } ]]

    Read the article

  • Ant build script executing <sql> task using java code

    - by Jay
    Any idea, why none of the debugging comments are printed once after executing the ANT build script's SQL task via java code? The java class to execute the sql in build scirpt is public class AntRunnerTest { private Project project; public void executeTask(String taskName) { try { project = new Project(); project.init(); project.setBasedir(new String(".")); ProjectHelper helper = ProjectHelper.getProjectHelper(); project.addReference("ant.projectHelper", helper); helper.parse(project, new File("build-copy.xml")); System.out.println("Before"); project.executeTarget(taskName); System.out.println("After"); } catch(Exception ex) { System.out.println(ex.getMessage()); } } public static void main(String args[]) { try { AntRunnerTest newInst = new AntRunnerTest(); newInst.executeTask("sql"); } catch(Exception e) { System.out.println(""+e); } } } I dont see the debug String "After" getting printed in the console. I noticed this issue only when i try to execute a sql task using java code. The ant script has the following simple transaction tag in it. <transaction> <![CDATA[ select now() ]]> </transaction> Any thoughts? Thanks in advance.

    Read the article

  • JavaScript doesnt work on Kohana with google maps engine line

    - by user2902495
    <div style="width: 1200px; height: 750px;"> <iframe src="http://mapsengine.google.com/map/embed?mid=zkh_WUG-PAC0.k8Xr_3BhSQ00" width="640" height="480" <script type="text/javascript"> //<![CDATA[ function load() { /* ???????? ?? ????????????? ? ???????????? ?????????*/ if (GBrowserIsCompatible()) { /* ??????? ????? - ????? */ var pntx=37.62039542198181; var pnty=55.75294375419617; var center = new GLatLng(pnty, pntx); /* ???????? ??????? ?????, googlemap - ???, ?? ???????? ????????? ?????? ?????, ??????????? ????*/ var map = new GMap2(document.getElementById("mapgoogle")); } } //]]> </script> > </iframe> ... <body onload="load()" onunload="GUnload()"> <div align="center"><div id="mapgoogle" style="width: 90%; height: 500px;"></div></div> </body> </div> a point does not take place on the center of map ?????, and not the alone from Javascript does not work! help to correct!

    Read the article

  • XSLT for-each from query results

    - by Ben Record
    I've been on a hunt for a while trying to find a solution to this but I cannot find anywhere that addresses this problem. I'm running a SQL query through XSLT which will return three rows. Here is the query: <query name="OrderedProductNames" rowElementName ="OrderedItem"> <sql> <![CDATA[ select OrderedProductName, Quantity from Orders_ShoppingCart where OrderNumber = 101689 // Hard coded order number for testing purposes. ]]> </sql> </query> Ideally, I would like to iterate through each row returned and do a choose when which is tested on a variable from the current row being inspected in the for-each loop, but I am not entirely sure thhis is possible. My secondary thought would be to use the for-each loop as a way to inject hidden HTML input elements with the values I would need, then I could write a javascript function to complete what I'm trying to do. Any suggestion on how I would go about completing either task would be greatly appreciated.

    Read the article

  • Get node value from document

    - by J Noel
    I have XML in PHP, I am trying to get the value of the status node: <?xml version="1.0" encoding="utf-8" ?> <response> <result> <form name="MREP"> <update> <criteria> <field name="Serial_Number" compOperator="Equals" value="A-000-1012"></field> <reloperator>AND</reloperator> <field name="MREP_Type" compOperator="Equals" value="0"></field> </criteria> <newvalues> <field name="Is_being_Used"> <value><![CDATA[TRUE]]></value> </field> </newvalues> <status>Success</status> </update> </form> </result> </response> I tried $xml = simplexml_load_string($mrepValide); echo $xml->status; (where $mrepValide is a string of XML shown above) But I think it didnt work since status is not the parent node. Any help would be greatly appreciated.

    Read the article

  • Best practice to hide/encrypt email adress in webpage

    - by Sebi
    I couldn't find a similar question, that's why here it is: Whats the best way to hide or encrypt an email link in a website, so that a crawler can't read it, but the user can nevertheless click it? I don't want to conufse the users by typing the email like this: john (at) mail.com or similar ways. (and i think this kind of links can nevertheless read by crawlers?) I also tried things like that: <script>// <![CDATA[eval(unescape('%76%61%72%20%73%3D%27%61%6D%6C%69%6F%74%72%3A%62%61%40%65%64%61%6E%6F%6C%2E%69%27%3B%76%61%72%20%72%3D%27%27%3B%66%6F%72%28%76%61%72%20%69%3D%30%3B%69%3C%73%2E%6C%65%6E%67%74%68%3B%69%2B%2B%2C%69%2B%2B%29%7B%72%3D%72%2B%73%2E%73%75%62%73%74%72%69%6E%67%28%69%2B%31%2C%69%2B%32%29%2B%73%2E%73%75%62%73%74%72%69%6E%67%28%69%2C%69%2B%31%29%7D%64%6F%63%75%6D%65%6E%74%2E%77%72%69%74%65%28%27%3C%61%20%68%72%65%66%3D%22%27%2B%72%2B%27%22%3E%4F%62%65%72%70%61%72%6C%65%69%74%65%72%3C%2F%61%3E%27%29%3B'))]]></script> but i heard this can also be read by crawler and it isn't really good practices are ther any common approaches?

    Read the article

  • Flex 3 (Action Script): How to access a function from a loaded swf-file ?

    - by Trantec
    Hi, i load in ActionScript a swf file. So far no Problem, but I didn't found a way to access one of it's functions, the best thing would be if I could access the main function in the mxml part of the swf. Here is the code of the main-mxml file that belongs to the swf that should load and access another swf: <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" initialize="basket();"> <mx:Script> <![CDATA[ import mx.controls.SWFLoader; private function basket(): void { var swfLoader: SWFLoader = new SWFLoader(); swfLoader.addEventListener( Event.COMPLETE, handleSWFLoaded ); try { swfLoader.load( "../../data/InternalSWF.swf" ); } catch (error: Error) { trace( "Couldn't load file !" ); } } private function handleSWFLoaded( event: Event ): void { var swfApp:* = event.target.content; // This both ways don't work... //if (swfApp.hasOwnProperty("initApp")) { // var initApp:Function = (swfApp["initApp"] as Function); // initApp(); //} // swfApp.initApp(); } ]]> </mx:Script> <mx:Text id="output" width="100%" textAlign="center" /> </mx:Application> The if-Statement "if (swfApp.hasOwnProperty("initApp")) {" is never true and the call "swfApp.initApp()" says that this function does not exist. In the original version I added event listeners for HTTPStatusEvent.HTTP_STATUS, IOErrorEvent.IO_ERROR and SecurityErrorEvent.SECURITY_ERROR. But except for HTTP_STATUS = 0 none of them are called. Is the whole idea of how i try to do this wrong ?

    Read the article

  • Not Understanding Basics Of Dynamic DataBinding (bindPropety) In Flex

    - by Joshua
    I need to dynamically bind properties of components created at runtime. In this particular case please assume I need to use bindProperty. I don't quite understand why the following simplistic test is failing (see code). When I click the button, the label text does not change. I realize that there are simpler ways to go about this particular example using traditional non-dynamic binding, but I need to understand it in terms of using bindProperty. Can someone please help me understand what I'm missing? <?xml version="1.0" encoding="utf-8"?> <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:ns1="Tools.*" minWidth="684" minHeight="484" xmlns:ns2="*" creationComplete="Init();"> <mx:Script> <![CDATA[ import mx.collections.ArrayCollection; import mx.binding.utils.*; public var Available:ArrayCollection=new ArrayCollection(); public function get Value():String { return (Available.getItemAt(0).toString()); } public function Init():void { Available.addItemAt('Before', 0); BindingUtils.bindProperty(Lab, 'text', this, 'Value'); } public function Test():void { Available.setItemAt('After', 0); } ]]> </mx:Script> <mx:Label x="142" y="51" id="Lab"/> <mx:Button x="142" y="157" label="Button" click="Test();"/> </mx:WindowedApplication> Thanks in advance.

    Read the article

  • Flex Tree Properties, Null Reference?

    - by mvrak
    I am pulling down a large XML file and I have no control over it's structure. I used a custom function to use the tag name to view the tree structure as a flex tree, but then it breaks. I am guessing it has something to do with my other function, one that calls attribute values from the selected node. See code. <mx:Tree x="254" y="21" width="498" height="579" id="xmllisttree" labelFunction="namer" dataProvider="{treeData}" showRoot="false" change="treeChanged(event)" /> //and the Cdata import mx.rpc.events.ResultEvent; [Bindable] private var fullXML:XMLList; private function contentHandler(evt:ResultEvent):void{ fullXML = evt.result.page; } [Bindable] public var selectedNode:Object; public function treeChanged(event:Event):void { selectedNode=Tree(event.target).selectedItem; } public function namer(item:Object):String { var node:XML = XML(item); var nodeName:QName = node.name(); var stringtest:String ="bunny"; return nodeName.localName; } The error is TypeError: Error #1009: Cannot access a property or method of a null object reference. Where is the null reference?

    Read the article

  • JQUERY - how Two elements - IMG - DIV when hover over IMG show/hide the DIV - added with hover hide/

    - by Jan Fosgerau
    Im very new to the wonder that is jquery. and i just figure out how to make my img buttons show/hide with a opacity difference (as such) <script type="text/javascript"> <![CDATA[ $(".ExcommKnap").mouseover(function () { $(this).stop().fadeTo('fast', 0.5, function(){}) }); $(".ExcommKnap").mouseout(function () { $(this).stop().fadeTo('fast', 1.0, function(){}) }); ]]> </script> which is good and all. but i also need to make the button when hovered over show text just above it that is specific to that button. i made these here elements that are looped in a for each. <div style="top:10px; width:755px;text-align:right; position:absolute; "> <div id="Page-{@id}" class="headlinebox"> <xsl:value-of select="@nodeName"/> </div> </div> <a href="{umbraco.library:NiceUrl(@id)}"> <img class="ExcommKnap" src="{$media/data[@alias='umbracoFile']}" /> </a> i need to make the individual text appear when hovered over its button. hence i have the id="page-{@id}" looped out along and need to get this place in the jquery code i presume. so when i hover over a img class="ExcommKnap" it makes the correct text visible. But i need the div id="page-{id}" to be invisible to begin with on pageload and then visible when its button is being hovered over. can anyone help ?

    Read the article

  • Obtain reference to View in ActionScript class within ViewNavigatorApplication

    - by chb
    I've got a very simple project in FlashBuilder 4.5. It's a mobile application of type ViewNavigatorApplication with a single view, MapView. In the MapView.mxml file, I've got a Flex component of type Map declared in xml. <?xml version="1.0" encoding="utf-8"?> <s:View xmlns:fx="http://ns.adobe.com/mxml/2009" name="CatBusMapView"> <fx:Script> <![CDATA[ import com.esri.ags.Map; .... ]]> </fx:Script> <fx:Declarations> .... </fx:Declarations> <esri:Map id="cbm"> ... </esri:Map> </s:View> In this same project, I've an actionscript class called UserGeolocation. In this class, I'm attempting to get a reference to this map component. So far, I can get a reference to the top-level application, its ViewNavigator and the NavigationStack of said ViewNavigator. However, I cannot find a way to access the MapView, much less the map I've declared within it. I'm aware of methods like firstView() and activeView(), but I want an absolute solution, one that retrieves the view regardless of whether or not it's first or active. I've tried navigator.getChildByName("MapView") with no luck.

    Read the article

  • What's wrong with this C# CodeSnippet?

    - by Buffalo
    I've made snippets before but I must be overlooking something really simple; I cannot figure out where the error is in this snippet... <CodeSnippet Format="1.0.0" xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"> <Header> <Title>Throw NotImplementedException()</Title> <Author>olaffuB</Author> <Shortcut>nie</Shortcut> <Description>Quickly add a new NotImplementedException() to code.</Description> <SnippetTypes> <SnippetType>Expansion</SnippetType> </SnippetTypes> </Header> <Snippet> <Declarations> <Literal> <ID>TODO</ID> <Default></Default> </Literal> </Declarations> <Code Language="C#"> <![CDATA[throw new NotImplementedException("$TODO$"); // TODO: $TODO$]]> </Code> </Snippet> Basically, when I got to import the snippet, it says that it is "invalid". The file name is "nie.snippet". Thanks!

    Read the article

  • Why does the roll_out event fire in this code?

    - by user339681
    I have made this simple example to demonstrate some problems I'm having. <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"> <mx:Canvas id="buttonCanvas" x="100" y="100" opaqueBackground="#000000" width="80%" height="300" creationComplete="init(event)"> <mx:Button x="5" y="5"/> <mx:Button x="5" y="50"/> </mx:Canvas> <mx:Script> <![CDATA[ private function init(event:Event):void{ buttonCanvas.addEventListener(MouseEvent.ROLL_OUT, function(event:Event):void{ buttonCanvas.opaqueBackground=(buttonCanvas.opaqueBackground==0)? 0x666666:0; }); } ]]> </mx:Script> </mx:Application> I don't understand the following: Why doesn't the percentage nor absolute dimensions affect the canvas? Why does the roll_out event fire when the mouse leaves a button (even when it is still inside the canvas). I'm going nuts trying to figure this out. Any help would be greatly appreciated!

    Read the article

  • Flex 4: Scale to a point (zoom into an image where the mouse was clicked)

    - by Jason W
    I've been trying to get this working and I can't seem to figure it out. There is an Image control that when I click on it I need to zoom in (using the center/transform point where the mouse is clicked). I have the zoom transition working great, but when I set transformX & tranformY (with autoCenterTransform false) it doesn't zoom into that point. Here is my code that only zooms in (not to a specific point) <fx:Script> <![CDATA[ protected function imgLogo_clickHandler(event:MouseEvent):void { transformer.play(); } ]]> </fx:Script> <fx:Declarations> <s:Parallel id="transformer" target="{imgLogo}"> <s:Scale scaleXBy="0.5" scaleYBy="0.5" /> </s:Parallel> </fx:Declarations> <mx:Image id="imgLogo" width="250" x="100" y="100" maintainAspectRatio="true" source="@Embed('src/logo.png')" click="imgLogo_clickHandler(event)" /> Any help is greatly appreciated. Thanks

    Read the article

  • Removing specific tags in a KML file

    - by Legion
    I have a KML file which is a list of places around the world with coordinates and some other attributes. It looks like this for one place: <Placemark> <name>Albania - Durrës</name> <open>0</open> <visibility>1</visibility> <description>(Spot ID: 275801) show <![CDATA[<a href="http://www.windguru.cz/int/index.php?go=1&vs=1&sc=275801">forecast</a>]]></description> <styleUrl>#wgStyle001</styleUrl><Point> <coordinates>19.489747,41.277806,0</coordinates> </Point> <LookAt><range>200000</range><longitude>19.489747</longitude><latitude>41.277806</latitude></LookAt> </Placemark> I would like to remove everything except the name of the place. So in this case that would mean I would like to remove everything except <name>Albania - Durrës</name> The problem is, this KML file includes more than 1000 of these places. Doing this manually obviously isn't an option, so then how can I remove all tags except for the name tags for all of the items in the list? Can I use some kind of program for that?

    Read the article

  • Java scripts conflict on my home page

    - by naveen
    <script type="text/javascript" src="jquery-1.js"></script> <script type="text/javascript" src="mootools.js"></script> <script type="text/javascript" src="slideshow.js"></script> <script type="text/javascript"> //<![CDATA[ window.addEvent('domready', function(){ var data = { '1.jpg': { caption: 'Volcano Asención in Ometepe, Nicaragua.' }, '2.jpg': { caption: 'A Ceibu tree.' }, '3.jpg': { caption: 'The view from Volcano Maderas.' }, '4.jpg': { caption: 'Beer and ice cream.' } }; var myShow = new Slideshow('show', data, {controller: true, height: 400, hu: 'images/', thumbnails: true, width: 500}); }); //]]> </script> <script type="text/javascript"> $(document).ready(function() { //slides the element with class "menu_body" when paragraph with class "menu_head" is clicked $("#firstpane p.menu_head").click(function() { $(this).css({backgroundImage:"url(down.png)"}).next("div.menu_body").slideToggle(300).siblings("div.menu_body").slideUp("slow"); $(this).siblings().css({backgroundImage:"url(left.png)"}); }); //slides the element with class "menu_body" when mouse is over the paragraph $("#secondpane p.menu_head").mouseover(function() { $(this).css({backgroundImage:"url(down.png)"}).next("div.menu_body").slideDown(500).siblings("div.menu_body").slideUp("slow"); $(this).siblings().css({backgroundImage:"url(left.png)"}); }); }); </script> <!--[if lt IE 7]> <script type="text/javascript" src="unitpngfix.js"></script> <![endif]-->

    Read the article

  • Trouble managing events in Flex/actionscript

    - by Zaka
    Hello all, I'm doing some newbie tests, so I decided to capture the keyboard events to move a rectangle. But I don't get the desired result. Unless I click on the TextArea box, I'm not able to capture the event key code. After that, all goes pretty well. I'm using Eclipse 3.3 + Flex 3.0 on Linux. Here's my code: <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" enterFrame="enterFrame(event)" keyDown="onKeyDown(event)"> <mx:TextArea id="myText" x="200" y="200" width="100" height="100" /> <mx:Canvas id="myCanvas" x="0" y="0" width="100" height="100" /> <mx:Script> <![CDATA[ public var clearColor : uint = 0xFF456798; public var myPoint : Point = new Point(0,0); public function enterFrame(event:Event):void { myCanvas.graphics.clear(); myCanvas.graphics.beginFill(0xFF344ff0); myCanvas.graphics.drawRect(myPoint.x,myPoint.y,40,40); myCanvas.graphics.endFill(); } public function onKeyDown(event:KeyboardEvent):void { myText.text = "Keycode is: " + event.keyCode + "\n"; switch(event.keyCode) { case 37: //Left myPoint.x -= 1; break; case 38: //Up myPoint.y -= 1; break; case 39: //Right myPoint.x += 1; break; case 40: //Down myPoint.y += 1; break; } } ]]> </mx:Script> </mx:Application>

    Read the article

  • How to further improve error messages in Scala parser-combinator based parsers?

    - by rse
    I've coded a parser based on Scala parser combinators: class SxmlParser extends RegexParsers with ImplicitConversions with PackratParsers { [...] lazy val document: PackratParser[AstNodeDocument] = ((procinst | element | comment | cdata | whitespace | text)*) ^^ { AstNodeDocument(_) } [...] } object SxmlParser { def parse(text: String): AstNodeDocument = { var ast = AstNodeDocument() val parser = new SxmlParser() val result = parser.parseAll(parser.document, new CharArrayReader(text.toArray)) result match { case parser.Success(x, _) => ast = x case parser.NoSuccess(err, next) => { tool.die("failed to parse SXML input " + "(line " + next.pos.line + ", column " + next.pos.column + "):\n" + err + "\n" + next.pos.longString) } } ast } } Usually the resulting parsing error messages are rather nice. But sometimes it becomes just sxml: ERROR: failed to parse SXML input (line 32, column 1): `"' expected but `' found ^ This happens if a quote characters is not closed and the parser reaches the EOT. What I would like to see here is (1) what production the parser was in when it expected the '"' (I've multiple ones) and (2) where in the input this production started parsing (which is an indicator where the opening quote is in the input). Does anybody know how I can improve the error messages and include more information about the actual internal parsing state when the error happens (perhaps something like a production rule stacktrace or whatever can be given reasonably here to better identify the error location). BTW, the above "line 32, column 1" is actually the EOT position and hence of no use here, of course.

    Read the article

  • JAXB Unable To Handle Attribute with Colon (:) in name?

    - by Intellectual Tortoise
    I am attempting to use JAXB to unmarshall an XML files whose schema is defined by a DTD (ugh!). The external provider of the DTD has specified one of the element attributes as xml:lang: <!ATTLIST langSet id ID #IMPLIED xml:lang CDATA #REQUIRED > This comes into the xjc-generated class (standard generation; no *.xjb magic) as: @XmlAttribute(name = "xml:lang", required = true) @XmlJavaTypeAdapter(NormalizedStringAdapter.class) protected String xmlLang; However, when unmarshalling valid XML files with JAXB, the xmlLang attribute is always null. When I edited the XML file, replacing xml:lang with lang and changed the @XmlAttribute to match, unmarshalling was successful (i.e. attributes were non-null). I did find this http://old.nabble.com/unmarshalling-ignores-element-attribute-%27xml%27-td22558466.html. But, the resolution there was to convert to XML Schema, etc. My strong preference is to go straight from an un-altered DTD (since it is externally provided and defined by an ISO standard). Is this a JAXB bug? Am I missing something about "namespaces" in attribute names? FWIW, java -version = "build 1.6.0_20-b02" and xjc -version = "xjc version "JAXB 2.1.10 in JDK 6""

    Read the article

  • Ruby - RegEx problem or maybe another solution altogether

    - by r3nrut
    Ok the problem I'm having is that I have a block of javascript I've successfully scraped out of a websites source and now I have to sift through the js to get the specific values I'm looking for. Below is the chunk i'm needing to deal with. I need to find "flvFileName" and get all the file names listed. In this case its: trailer1,trailer2,trailer3. At first I started using regex to match the start and end tags and them match the file names and extract them to an array but the problem is that there isn't always 3 videos in the list. Could be 0, 1, 2, 3, 4 etc. So matching doesn't work. Any thoughts on a way to approach this that won't make me continue to abuse my laptop? ["", "\r\n", "\n", "\r\n function IgnoreEnter(e) {\r\n var code;\r\n if (!e) // IE\r\n {\r\n var e = window.event;\r\n }\r\n if (e.keyCode) {\r\n code = e.keyCode;\r\n }\r\n else if (e.which) // Firefox, Opera\r\n {\r\n code = e.which;\r\n }\r\n\r\n if (code == 13) {\r\n e.cancelBubble = true;\r\n e.returnValue = false;\r\n }\r\n }\r\n\r\n function ResetDefault() {\r\n __defaultFired = false;\r\n }\r\n", "", "\r\n// <![CDATA[\r\n$(doc).ready(function () { $('#VideoObject').flash({ swf: '/scinema/video.swf', height: 300, width: 480, hasVersion: 8, menu: false, wmode: 'transparent', bgcolor: '#000',flashvars: {flvFileName: 'trailer1,trailer2,trailer3', age: 'no', isForced: 'true'} }); });

    Read the article

  • How to add root node in the output method = text

    - by Akhil
    My sample input is <?xml version="1.0" encoding="UTF-8"?> <ns0:JDBC_RECEIVERDATA_MT_response xmlns:ns0="urn:parmalat.com.au:TESTSQL_REPLICATION"> <Statement_response> <response_1> <row> <XML_F52E2B61-18A1-11d1-B105-00805F49916B><![CDATA[<TransactionLog TID="1400" SeqNo="3337446" SQLTransaction="Insert into TankerLoads Values(141221,53,299,18,1,426148,6,&apos;Nov 19 2007 12:00AM&apos;,&apos;Dec 30 1899 12:59PM&apos;,3.00,20682,0,&apos;Zevo&apos;,&apos;Nov 19 2007 12:00AM&apos;,0)"/></row> <row> <XML_F52E2B61-18A1-11d1-B105-00805F49916B>um = 141221"/&gt;&lt;TransactionLog TID="1400" SeqNo="3337452" SQLTransaction="Insert into MilkPickups Values(790195,141221,0,&amp;apos;Nov 19 2007 12:00AM&amp;apos;,2433,&amp;apos;Nov 19 2007 12:00AM&amp;apos;,&amp;apos;Dec 30 1899 11:26AM&amp;apos;,3131,2.90)"/&gt; Like this I have mutiple records and my output should be like <root> <TransactionLog TID="1400" SeqNo="3337446" SQLTransaction="Insert into TankerLoads Values(141221,53,299,18,1,426148,6,'Nov 19 2007 12:00AM','Dec 30 1899 12:59PM',3.00,20682,0,'Zevo','Nov 19 2007 12:00AM',0)" /> <TransactionLog TID="1400" SeqNo="3337447" SQLTransaction="Update TankerLoads Set TankerNum = 53,DriverNum = 299,CarterNum = 18,MilkTypeNum = 1,SampleNum = 426148,ReceivalBayNum = 6,UnloadDate = 'Nov 19 2007 12:00AM',UnloadTime = 'Dec 30 1899 12:59PM',Temperature = 3.00,Volume = 20682,NetWeight = 0,WeighbridgeDocket = 'Zevo',LoadPickupDate = 'Nov 19 2007 12:00AM',IsValidated = 0 Where TankerLoadNum = 141221" /></root> AND I AM USING OUTPUT METHOD AS TEXT BECAUSE IF I USE XML THE TAG ARE REPLACED WITH &LT &GT WHICH I DONT MOREOVER IF YOU SEE THE ABOVE TWO ROWS THE LAST LINE IS HALF THE RECORD IS IN THE FIRST ROW AND CONTINUING THE OTHER HALF IN THE SECOND ROW SO i USED WHICH LEAVES SINGLE SPACE SO EVEN I DONT WANT THAT SINGLE SPACE..I HOPE I AM CLEAR IF NOT PLEASE LET ME KNOW I WILL ADD MORE COMMENTS..TPLEASE HELP ME OUT..THNKYOU

    Read the article

  • Layering Images & Click to Choose Using Javascript

    - by rneal
    So I'm making a gallery of fabrics and backgrounds for letters for a fraternity/sorority store in my college's town. If you don't know what I'm talking about, this is a fabric letter. You can see how it has a white outline (background) and a red inside (foreground). WELL, I want to make it so you can change both the foreground and background, simply by clicking it's similar image. This is what I have so far <script type="text/javascript">// <![CDATA[ function changeImage(filename) { document.mainimage.src = filename; }// ]]></script> with these for each fabrics: <a href="javascript:changeImage('/wp-content/themes/collegiateconnectionbg/images/fabrics/foregrounds/37.jpg')"> <img src="/wp-content/themes/collegiateconnectionbg/images/fabrics/foregrounds/37.jpg" alt="" width="100px" height="50px" /></a> I really like how this works, but it's only good for one layer. Is there anyway I can add a layer below it, but still make it show at the top of the page? I know I'll have to use photoshop and transparency for both options, thats no problem, but I wanted to make sure I can do this before I start creating 600+ images. I know I can play with z-index and css, but since I'm using wordpress the one example I read about here wasn't working or I didn't completely understand it, and messed up my entire page. Also here's my tester webpage to see the current code in work. (if you click the navy&white stars image, you can see a very rough makeshift "A") Thanks in advance!

    Read the article

  • how Two elements - IMG - DIV when hover over IMG show/hide the DIV - added with hover hide/show on i

    - by Jan Fosgerau
    Im very new to the wonder that is jquery. and i just figure out how to make my img buttons show/hide with a opacity difference (as such) <script type="text/javascript"> <![CDATA[ $(".ExcommKnap").mouseover(function () { $(this).stop().fadeTo('fast', 0.5, function(){}) }); $(".ExcommKnap").mouseout(function () { $(this).stop().fadeTo('fast', 1.0, function(){}) }); ]]> </script> which is good and all. but i also need to make the button when hovered over show text just above it that is specific to that button. i made these here elements that are looped in a for each. <div style="top:10px; width:755px;text-align:right; position:absolute; "> <div id="Page-{@id}" class="headlinebox"> <xsl:value-of select="@nodeName"/> </div> </div> <a href="{umbraco.library:NiceUrl(@id)}"> <img class="ExcommKnap" src="{$media/data[@alias='umbracoFile']}" /> </a> i need to make the individual text appear when hovered over its button. hence i have the id="page-{@id}" looped out along and need to get this place in the jquery code i presume. so when i hover over a img class="ExcommKnap" it makes the correct text visible. But i need the div id="page-{id}" to be invisible to begin with on pageload and then visible when its button is being hovered over. can anyone help ?

    Read the article

  • Extending Oracle CEP with Predictive Analytics

    - by vikram.shukla(at)oracle.com
    Introduction: OCEP is often used as a business rules engine to execute a set of business logic rules via CQL statements, and take decisions based on the outcome of those rules. There are times where configuring rules manually is sufficient because an application needs to deal with only a small and well-defined set of static rules. However, in many situations customers don't want to pre-define such rules for two reasons. First, they are dealing with events with lots of columns and manually crafting such rules for each column or a set of columns and combinations thereof is almost impossible. Second, they are content with probabilistic outcomes and do not care about 100% precision. The former is the case when a user is dealing with data with high dimensionality, the latter when an application can live with "false" positives as they can be discarded after further inspection, say by a Human Task component in a Business Process Management software. The primary goal of this blog post is to show how this can be achieved by combining OCEP with Oracle Data Mining® and leveraging the latter's rich set of algorithms and functionality to do predictive analytics in real time on streaming events. The secondary goal of this post is also to show how OCEP can be extended to invoke any arbitrary external computation in an RDBMS from within CEP. The extensible facility is known as the JDBC cartridge. The rest of the post describes the steps required to achieve this: We use the dataset available at http://blogs.oracle.com/datamining/2010/01/fraud_and_anomaly_detection_made_simple.html to showcase the capabilities. We use it to show how transaction anomalies or fraud can be detected. Building the model: Follow the self-explanatory steps described at the above URL to build the model.  It is very simple - it uses built-in Oracle Data Mining PL/SQL packages to cleanse, normalize and build the model out of the dataset.  You can also use graphical Oracle Data Miner®  to build the models. To summarize, it involves: Specifying which algorithms to use. In this case we use Support Vector Machines as we're trying to find anomalies in highly dimensional dataset.Build model on the data in the table for the algorithms specified. For this example, the table was populated in the scott/tiger schema with appropriate privileges. Configuring the Data Source: This is the first step in building CEP application using such an integration.  Our datasource looks as follows in the server config file.  It is advisable that you use the Visualizer to add it to the running server dynamically, rather than manually edit the file.    <data-source>         <name>DataMining</name>         <data-source-params>             <jndi-names>                 <element>DataMining</element>             </jndi-names>             <global-transactions-protocol>OnePhaseCommit</global-transactions-protocol>         </data-source-params>         <connection-pool-params>             <credential-mapping-enabled></credential-mapping-enabled>             <test-table-name>SQL SELECT 1 from DUAL</test-table-name>             <initial-capacity>1</initial-capacity>             <max-capacity>15</max-capacity>             <capacity-increment>1</capacity-increment>         </connection-pool-params>         <driver-params>             <use-xa-data-source-interface>true</use-xa-data-source-interface>             <driver-name>oracle.jdbc.OracleDriver</driver-name>             <url>jdbc:oracle:thin:@localhost:1522:orcl</url>             <properties>                 <element>                     <value>scott</value>                     <name>user</name>                 </element>                 <element>                     <value>{Salted-3DES}AzFE5dDbO2g=</value>                     <name>password</name>                 </element>                                 <element>                     <name>com.bea.core.datasource.serviceName</name>                     <value>oracle11.2g</value>                 </element>                 <element>                     <name>com.bea.core.datasource.serviceVersion</name>                     <value>11.2.0</value>                 </element>                 <element>                     <name>com.bea.core.datasource.serviceObjectClass</name>                     <value>java.sql.Driver</value>                 </element>             </properties>         </driver-params>     </data-source>   Designing the EPN: The EPN is very simple in this example. We briefly describe each of the components. The adapter ("DataMiningAdapter") reads data from a .csv file and sends it to the CQL processor downstream. The event payload here is same as that of the table in the database (refer to the attached project or do a "desc table-name" from a SQL*PLUS prompt). While this is for convenience in this example, it need not be the case. One can still omit fields in the streaming events, and need not match all columns in the table on which the model was built. Better yet, it does not even need to have the same name as columns in the table, as long as you alias them in the USING clause of the mining function. (Caveat: they still need to draw values from a similar universe or domain, otherwise it constitutes incorrect usage of the model). There are two things in the CQL processor ("DataMiningProc") that make scoring possible on streaming events. 1.      User defined cartridge function Please refer to the OCEP CQL reference manual to find more details about how to define such functions. We include the function below in its entirety for illustration. <?xml version="1.0" encoding="UTF-8"?> <jdbcctxconfig:config     xmlns:jdbcctxconfig="http://www.bea.com/ns/wlevs/config/application"     xmlns:jc="http://www.oracle.com/ns/ocep/config/jdbc">        <jc:jdbc-ctx>         <name>Oracle11gR2</name>         <data-source>DataMining</data-source>               <function name="prediction2">                                 <param name="CQLMONTH" type="char"/>                      <param name="WEEKOFMONTH" type="int"/>                      <param name="DAYOFWEEK" type="char" />                      <param name="MAKE" type="char" />                      <param name="ACCIDENTAREA"   type="char" />                      <param name="DAYOFWEEKCLAIMED"  type="char" />                      <param name="MONTHCLAIMED" type="char" />                      <param name="WEEKOFMONTHCLAIMED" type="int" />                      <param name="SEX" type="char" />                      <param name="MARITALSTATUS"   type="char" />                      <param name="AGE" type="int" />                      <param name="FAULT" type="char" />                      <param name="POLICYTYPE"   type="char" />                      <param name="VEHICLECATEGORY"  type="char" />                      <param name="VEHICLEPRICE" type="char" />                      <param name="FRAUDFOUND" type="int" />                      <param name="POLICYNUMBER" type="int" />                      <param name="REPNUMBER" type="int" />                      <param name="DEDUCTIBLE"   type="int" />                      <param name="DRIVERRATING"  type="int" />                      <param name="DAYSPOLICYACCIDENT"   type="char" />                      <param name="DAYSPOLICYCLAIM" type="char" />                      <param name="PASTNUMOFCLAIMS" type="char" />                      <param name="AGEOFVEHICLES" type="char" />                      <param name="AGEOFPOLICYHOLDER" type="char" />                      <param name="POLICEREPORTFILED" type="char" />                      <param name="WITNESSPRESNT" type="char" />                      <param name="AGENTTYPE" type="char" />                      <param name="NUMOFSUPP" type="char" />                      <param name="ADDRCHGCLAIM"   type="char" />                      <param name="NUMOFCARS" type="char" />                      <param name="CQLYEAR" type="int" />                      <param name="BASEPOLICY" type="char" />                                     <return-component-type>char</return-component-type>                                                      <sql><![CDATA[             SELECT to_char(PREDICTION_PROBABILITY(CLAIMSMODEL, '0' USING *))               AS probability             FROM (SELECT  :CQLMONTH AS MONTH,                                            :WEEKOFMONTH AS WEEKOFMONTH,                          :DAYOFWEEK AS DAYOFWEEK,                           :MAKE AS MAKE,                           :ACCIDENTAREA AS ACCIDENTAREA,                           :DAYOFWEEKCLAIMED AS DAYOFWEEKCLAIMED,                           :MONTHCLAIMED AS MONTHCLAIMED,                           :WEEKOFMONTHCLAIMED,                             :SEX AS SEX,                           :MARITALSTATUS AS MARITALSTATUS,                            :AGE AS AGE,                           :FAULT AS FAULT,                           :POLICYTYPE AS POLICYTYPE,                            :VEHICLECATEGORY AS VEHICLECATEGORY,                           :VEHICLEPRICE AS VEHICLEPRICE,                           :FRAUDFOUND AS FRAUDFOUND,                           :POLICYNUMBER AS POLICYNUMBER,                           :REPNUMBER AS REPNUMBER,                           :DEDUCTIBLE AS DEDUCTIBLE,                            :DRIVERRATING AS DRIVERRATING,                           :DAYSPOLICYACCIDENT AS DAYSPOLICYACCIDENT,                            :DAYSPOLICYCLAIM AS DAYSPOLICYCLAIM,                           :PASTNUMOFCLAIMS AS PASTNUMOFCLAIMS,                           :AGEOFVEHICLES AS AGEOFVEHICLES,                           :AGEOFPOLICYHOLDER AS AGEOFPOLICYHOLDER,                           :POLICEREPORTFILED AS POLICEREPORTFILED,                           :WITNESSPRESNT AS WITNESSPRESENT,                           :AGENTTYPE AS AGENTTYPE,                           :NUMOFSUPP AS NUMOFSUPP,                           :ADDRCHGCLAIM AS ADDRCHGCLAIM,                            :NUMOFCARS AS NUMOFCARS,                           :CQLYEAR AS YEAR,                           :BASEPOLICY AS BASEPOLICY                 FROM dual)                 ]]>         </sql>        </function>     </jc:jdbc-ctx> </jdbcctxconfig:config> 2.      Invoking the function for each event. Once this function is defined, you can invoke it from CQL as follows: <?xml version="1.0" encoding="UTF-8"?> <wlevs:config xmlns:wlevs="http://www.bea.com/ns/wlevs/config/application">   <processor>     <name>DataMiningProc</name>     <rules>        <query id="q1"><![CDATA[                     ISTREAM(SELECT S.CQLMONTH,                                   S.WEEKOFMONTH,                                   S.DAYOFWEEK, S.MAKE,                                   :                                         S.BASEPOLICY,                                    C.F AS probability                                                 FROM                                 StreamDataChannel [NOW] AS S,                                 TABLE(prediction2@Oracle11gR2(S.CQLMONTH,                                      S.WEEKOFMONTH,                                      S.DAYOFWEEK,                                       S.MAKE, ...,                                      S.BASEPOLICY) AS F of char) AS C)                       ]]></query>                 </rules>               </processor>           </wlevs:config>   Finally, the last stage in the EPN prints out the probability of the event being an anomaly. One can also define a threshold in CQL to filter out events that are normal, i.e., below a certain mark as defined by the analyst or designer. Sample Runs: Now let's see how this behaves when events are streamed through CEP. We use only two events for brevity, one normal and other one not. This is one of the "normal" looking events and the probability of it being anomalous is less than 60%. Event is: eventType=DataMiningOutEvent object=q1  time=2904821976256 S.CQLMONTH=Dec, S.WEEKOFMONTH=5, S.DAYOFWEEK=Wednesday, S.MAKE=Honda, S.ACCIDENTAREA=Urban, S.DAYOFWEEKCLAIMED=Tuesday, S.MONTHCLAIMED=Jan, S.WEEKOFMONTHCLAIMED=1, S.SEX=Female, S.MARITALSTATUS=Single, S.AGE=21, S.FAULT=Policy Holder, S.POLICYTYPE=Sport - Liability, S.VEHICLECATEGORY=Sport, S.VEHICLEPRICE=more than 69000, S.FRAUDFOUND=0, S.POLICYNUMBER=1, S.REPNUMBER=12, S.DEDUCTIBLE=300, S.DRIVERRATING=1, S.DAYSPOLICYACCIDENT=more than 30, S.DAYSPOLICYCLAIM=more than 30, S.PASTNUMOFCLAIMS=none, S.AGEOFVEHICLES=3 years, S.AGEOFPOLICYHOLDER=26 to 30, S.POLICEREPORTFILED=No, S.WITNESSPRESENT=No, S.AGENTTYPE=External, S.NUMOFSUPP=none, S.ADDRCHGCLAIM=1 year, S.NUMOFCARS=3 to 4, S.CQLYEAR=1994, S.BASEPOLICY=Liability, probability=.58931702982118561 isTotalOrderGuarantee=true\nAnamoly probability: .58931702982118561 However, the following event is scored as an anomaly with a very high probability of  89%. So there is likely to be something wrong with it. A close look reveals that the value of "deductible" field (10000) is not "normal". What exactly constitutes normal here?. If you run the query on the database to find ALL distinct values for the "deductible" field, it returns the following set: {300, 400, 500, 700} Event is: eventType=DataMiningOutEvent object=q1  time=2598483773496 S.CQLMONTH=Dec, S.WEEKOFMONTH=5, S.DAYOFWEEK=Wednesday, S.MAKE=Honda, S.ACCIDENTAREA=Urban, S.DAYOFWEEKCLAIMED=Tuesday, S.MONTHCLAIMED=Jan, S.WEEKOFMONTHCLAIMED=1, S.SEX=Female, S.MARITALSTATUS=Single, S.AGE=21, S.FAULT=Policy Holder, S.POLICYTYPE=Sport - Liability, S.VEHICLECATEGORY=Sport, S.VEHICLEPRICE=more than 69000, S.FRAUDFOUND=0, S.POLICYNUMBER=1, S.REPNUMBER=12, S.DEDUCTIBLE=10000, S.DRIVERRATING=1, S.DAYSPOLICYACCIDENT=more than 30, S.DAYSPOLICYCLAIM=more than 30, S.PASTNUMOFCLAIMS=none, S.AGEOFVEHICLES=3 years, S.AGEOFPOLICYHOLDER=26 to 30, S.POLICEREPORTFILED=No, S.WITNESSPRESENT=No, S.AGENTTYPE=External, S.NUMOFSUPP=none, S.ADDRCHGCLAIM=1 year, S.NUMOFCARS=3 to 4, S.CQLYEAR=1994, S.BASEPOLICY=Liability, probability=.89171554529576691 isTotalOrderGuarantee=true\nAnamoly probability: .89171554529576691 Conclusion: By way of this example, we show: real-time scoring of events as they flow through CEP leveraging Oracle Data Mining.how CEP applications can invoke complex arbitrary external computations (function shipping) in an RDBMS.

    Read the article

< Previous Page | 9 10 11 12 13 14 15 16 17 18  | Next Page >