Daily Archives

Articles indexed Monday January 17 2011

Page 27/36 | < Previous Page | 23 24 25 26 27 28 29 30 31 32 33 34  | Next Page >

  • Groovy/Grails course content

    - by Don
    Hi, Some Java developers have asked if I could give them a 2-day primer on Grails development. I'm assuming they're familiar with: Java language and libraries Java web development, e.g. Servlets, JSPs Spring Hibernate Client-side development, CSS, HTML, JavaScript I'm further assuming they have no experience with Groovy or Grails. AFAIK, the app that they'll be building is a new project, so there's no need to cover topics like using GORM with a legacy database. I'm trying to decide how I should structure the course, e.g. what topics to cover and how much time to spend on each. I reckon about 1/2 - 3/4 days on Groovy and the rest of the time on Grails would be adequate. I'll probably use the Groovy console to demonstrate the Groovy language concepts and a simple Grails app for explaining the conventions and structure of a Grails project. If anyone has a list of Groovy/Grails topics that I should cover, or even an outline of a similar course that they've given/taken, I'd be very grateful. Naturally, I will credit for any resources that I use during the course.

    Read the article

  • Good abbreviations for XML ... things

    - by Peter Turner
    I've never been very good at maintaining a coherent bunch of variable names for interfacing with XML files because I never name the variables in my interfaces the same way across my source. There are Elements, Attributes, Documents, NodeLists, Nodes, DocumentFragments and other stuff. What's a good scheme for keeping track of this stuff as variables? Is there a standard in regard to Hungarian notation? Do you even put anything signifying that the data is actually XML, is this bad practice?

    Read the article

  • Laptop suspend appears broken, what must I roll back?

    - by M. Tibbits
    Question: What package contains the subprogram responsible for the KMenu option "sleep"? Background: I've been running KUbuntu 10.04.1 and I am completely updated. Recently (within the past month), the "sleep" menu item has stopped working. It just sits there waiting like I clicked nothing. I've check all of the logs in /var/log and nothing is added when I click sleep. I'm guessing that something I updated has bollux'ed things up, but I don't know which package contains the component that I need to roll back. In the meantime, I've installed uswsusp, but s2ram & s2both don't ask my password when the laptop resumes -- which really bothers me. So now that I've got a little time to track this down, I had to post -- any ideas??

    Read the article

  • Connectify like functionality on Ubuntu running on T61 - wifi 4965 AGN

    - by Vivek Sharma
    I would like to use my laptop as an Access point, so that i can connect my phones through Wifi. I have done this my office laptop T410. I am having T61 with wifi module 4965. Connectify on windows does not support it. I am following -- https://help.ubuntu.com/community/WifiDocs/WirelessAccessPoint to make achieve WAP capability on my T61 running ubuntu 10.10. The link says something about "master mode", how do i put my T61 wifi-inter4965 in master mode. Can i install madwifi or atheros drivers on it. I am using galaxy S froyo, and it does not support Ad-hoc network. Has anyone tired to achieve this.

    Read the article

  • Ubuntu/Windows XP - Joint systems

    - by Brian Buck
    I have a computer sectioned to run both Ubuntu 10.10 and Windows XP but as XP refuses to log in (If I select XP the log in starts with the Windows logo being shown on the screen for a few seconds before the screen goes blank and the page showing the option of selecting Windows or Ubuntu the re-appears), I would like to clear it completely from the system and just run Ubuntu. Can this be done, and if so, how do I proceed with doing it?

    Read the article

  • Hotkey to shut down from login screen?

    - by Skizz
    I used to run 9.04 on my server and used to be able to use Alt-T, Alt-S to shut the system down from the login screen. It was using a KDE login screen. Now I've upgraded to 10.04 and use the Gnome login screen and I can't see any keyboard shortcuts to shutdown the server. Is there a shortcut and if so, what is it? Further info - I would normally shut down the server without turning on the monitor, which was easy using the keyboard shortcuts. Doing it with a mouse is not so easy without the monitor being on.

    Read the article

  • Laptop resumes from suspend while lid is closed

    - by Gus
    I have a Dell Studio 15 and I am running Ubuntu 10.10. When I close my lid or select the suspend option, the machine suspends as indicated by the slowly pulsing power indicator. I'll put the machine in my bag and after a while it seems that the machine resumes, at least I think. When ever I go to get it, it's overheated and the system cannot resume. I am guessing that the processor resets in this overheat condition, but heat is still generated. This has happened about three times and I'm getting worried that I'll end up damaging the machine. How can I diagnose why the system is resuming from suspend? Can I force it to never resume from suspend if the lid is down?

    Read the article

  • In Joomla how to change the module mod_news_show_gk3???

    - by Emerson
    How can I change the mod_news_show_gk3 module to: Change the size of the post image. It uses the first image of the post, but it seems to not be resizing the image. Add an extra field: It is important to show in the main page what is the source of the post. I would then like to add an extra field during post editing time, namely "source", and then I would like to show the source below the title and before the text. Change the title size. Title is oversized and I couldn't find any way to decrease its size. Add a border around the section. Here is the address: http://central.antinovaordemmundial.com/ Thanks!

    Read the article

  • Problem with From field in contact form and mail() function

    - by Matthew
    I've got a contact form with 3 fields and a textarea... I use jQuery to validate it and then php to send emails. This contact form works fine but, when I receive an email, From field isn't correct. I'd like to want that From field shows text typed in the Name field of the contact form. Now I get a From field like this: <[email protected]> For example, if an user types "Matthew" in the name field, I'd like to want that this word "Matthew" appears in the From field. This is my code (XHTML, jQuery, PHP): <div id="contact"> <h3 id="formHeader">Send Us a Message!</h3> <form id="contactForm" method="post" action=""> <div id="risposta"></div> <!-- End Risposta Div --> <span>Name:</span> <input type="text" id="formName" value="" /><br /> <span>E-mail:</span> <input type="text" id="formEmail" value="" /><br /> <span>Subject:</span> <input type="text" id="formSubject" value="" /><br /> <span>Message:</span> <textarea id="formMessage" rows="9" cols="20"></textarea><br /> <input type="submit" id="formSend" value="Send" /> </form> </div> <script type="text/javascript"> $(document).ready(function(){ $("#formSend").click(function(){ var valid = ''; var nome = $("#formName").val(); var mail = $("#formEmail").val(); var oggetto = $("#formSubject").val(); var messaggio = $("#formMessage").val(); if (nome.length<1) { valid += '<span>Name field empty.</span><br />'; } if (!mail.match(/^([a-z0-9._-]+@[a-z0-9._-]+\.[a-z]{2,4}$)/i)) { valid += '<span>Email not valid or empty field.</span><br />'; } if (oggetto.length<1) { valid += '<span>Subject field empty.</span><br />'; } if (valid!='') { $("#risposta").fadeIn("slow"); $("#risposta").html("<span><b>Error:</b></span><br />"+valid); $("#risposta").css("background-color","#ffc0c0"); } else { var datastr ='nome=' + nome + '&mail=' + mail + '&oggetto=' + oggetto + '&messaggio=' + encodeURIComponent(messaggio); $("#risposta").css("display", "block"); $("#risposta").css("background-color","#FFFFA0"); $("#risposta").html("<span>Sending message...</span>"); $("#risposta").fadeIn("slow"); setTimeout("send('"+datastr+"')",2000); } return false; }); }); function send(datastr){ $.ajax({ type: "POST", url: "contactForm.php", data: datastr, cache: false, success: function(html) { $("#risposta").fadeIn("slow"); $("#risposta").html('<span>Message successfully sent.</span>'); $("#risposta").css("background-color","#e1ffc0"); setTimeout('$("#risposta").fadeOut("slow")',2000); } }); } </script> <?php $mail = $_POST['mail']; $nome = $_POST['nome']; $oggetto = $_POST['oggetto']; $text = $_POST['messaggio']; $ip = $_SERVER['REMOTE_ADDR']; $to = "[email protected]"; $message = $text."<br /><br />IP: ".$ip."<br />"; $headers = "From: $nome \n"; $headers .= "Reply-To: $mail \n"; $headers .= "MIME-Version: 1.0 \n"; $headers .= "Content-Type: text/html; charset=UTF-8 \n"; mail($to, $oggetto, $message, $headers); ?>

    Read the article

  • installing snippets

    - by Sevenearths
    How do I install snippets in django? (specifically this) I have the file /{project}/snippets/EnforceLoginMiddleware.py and I have tried any number of permutations inside MIDDLEWARE_CLASSES to load it as well as googling django snippets install to no avail :( Any help would be grateful :) PS(Why can't I find any documentation or examples on the installation of snippets. Maybe I'm just a bad googler)

    Read the article

  • R: Forecast package: Automatic algorithm for composite model involving ETS and AR

    - by phanikishan
    Hey, I would like to write a code involving automatic selection of a best composite model using ETS as well as autoregressive models. What is the criteria I should base my selection on? Also if I'm using the auto.arima function for deducing number of AR terms and corresponding coefficients from the forecast package in R, does my input series necessarily have to be stationary? or the value for d would be automatically selected thus returning a non-stationary model? Thanks, Phani

    Read the article

  • Indexing one-dimensional numpy.array as matrix

    - by Alain
    I am trying to index a numpy.array with varying dimensions during runtime. To retrieve e.g. the first row of a n*m array a, you can simply do a[0,:] However, in case a happens to be a 1xn vector, this code above returns an index error: IndexError: too many indices As the code needs to be executed as efficiently as possible I don't want to introduce an if statement. Does anybody have a convenient solution that ideally doesn't involve changing any data structure types?

    Read the article

  • Beagleboard: How do I send/receive data to/from the DSP?

    - by snakile
    I have a beagleboard with TMS320C64x+ DSP. I'm working on an image processing beagleboard application. Here's how it's going to work: The ARM reads an image from a file and put the image in a 2D array. The arm sends the matrix to the DSP. The DSP receives the matrix. The DSP performs the image processing algorithm on the received matrix (the algorithm code uses about 5MB of dynamically allocated memory). The DSP sends the processed image (matrix) to the ARM. The arm received the matrix. The arm saved the processed image to a file. I'v already written the code for steps 1,3,5. What is the easiest way to do steps 3+4 (sending the data)? Code examples are welcome.

    Read the article

  • What happens to a SIGINT (^C) when sent to a perl script containing children?

    - by CmdrGuard
    I have a Perl script that forks. Each fork runs an external program, parses the output, and converts the output to a Storable file. The Storable files are then read in by the parent and the total data from each of the children are analyzed before proceeding onto a repeat of the previous fork or else the parent stops. What exactly happens when I issue a ^C while some of the children are still running the external program? The parent perl script was called in the foreground and, I presume, remained in the foreground despite the forking. Is the SIGINT passed to all children, that is, the parent, the parent's children, and the external program called by the children??

    Read the article

  • Android: how to convert whole ImageView to Bitmap?

    - by yosh
    I have my application that is displaying images with different ratio, resized inside (centerInside) imageView. What I need is to create bitmap from the ImageView including the background (black in this case). So for example I have device screen 320x480, full screen imageView with image resized to 280x480. How could I get 320x480 bitmap from it? On top of this imageview I have some logos or buttons that I don't want to include to bitmap, they're like on top layer. All I need is bitmap with image and black border from some sides.

    Read the article

  • CSS content overflowing containing div

    - by kaese
    Hi, Currently have a problem with some DIVs overlapping their containing DIVs. See image below (the 3 products at the bottom): All the body content of the page is held within the #content DIV: div#content { width: 960px; float: left; background-image: url("../img/contentBg.png"); background-repeat: repeat; margin-top: 10px; line-height: 1.8em; border-top: 8px solid #5E88A2; padding: 10px 15px 10px 15px; } And here is the CSS for the product boxes within the #content div: .upper { text-transform: uppercase; } .center { text-align: center; } div#products { float: left; width: 100%; margin-bottom: 25px; } div.productContainer { float: left; width: 265px; font-size: 1em; margin-left: 50px; height: 200px; padding-top: 25px; text-align: right; } div.product { float: left; width: 200px; } div.product p { } div.product a { display: block; } div.product img { float: left; } div.product img:hover { opacity: 0.8; filter: alpha(opacity = 80); } div.transparent { opacity: 0.8; filter: alpha(opacity = 80); } And here is the HTML for the boxes: <div class="productContainer"> <div class="product"> <h2 class="upper center">A2 Print</h2> <a href='../edit/?productId=5&amp;align=v' class='upper'> <img src="../../wflow/tmp/133703b808c91b8ec7e7c7cdf19320b7A2-Print.png" alt="Representation of image printed at A2 Print through MyPersonalPoster." /></a> <p class="upper">16.5 inches x 23.4 inches<br /><strong>&pound;15.99</strong></p> <p class="upper smaller"><em><span><span class="yes">Yes</span> - your picture quality is high enough for this size</span> </em></p> <p><a href='../edit/?productId=5&amp;align=v' class='upper'><span>Select</span></a></p> </div> </div> <div class="productContainer"> <div class="product transparent"> <h2 class="upper center">A1 Print</h2> <a href='../edit/?productId=11&amp;align=v' class='upper'> <img src="../../wflow/tmp/133703b808c91b8ec7e7c7cdf19320b7A1-Print.png" alt="Representation of image printed at A1 Print through MyPersonalPoster." /></a> <p class="upper">23.4 inches x 33.1 inches<br /><strong>&pound;19.99</strong></p> <p class="upper smaller"><em><span><span class="no">Warning</span> - your picture quality may not be sufficient for this size</span> </em></p> <p><a href='../edit/?productId=11&amp;align=v' class='upper'><span>Select</span></a></p> </div> </div> <div class="productContainer"> <div class="product transparent"> <h2 class="upper center">Poster Print (60cm x 80cm)</h2> <a href='../edit/?productId=12&amp;align=v' class='upper'> <img src="../../wflow/tmp/133703b808c91b8ec7e7c7cdf19320b7Poster-Print-(60cm-x-80cm).png" alt="Representation of image printed at Poster Print (60cm x 80cm) through MyPersonalPoster." /></a> <p class="upper">23.6 inches x 31.5 inches<br /><strong>&pound;13.95</strong></p> <p class="upper smaller"><em><span><span class="no">Warning</span> - your picture quality may not be sufficient for this size</span> </em></p> <p><a href='../edit/?productId=12&amp;align=v' class='upper'><span>Select</span></a></p> </div> </div> Any idea what could be causing these DIVs to overlap? What I'd like is for all the boxes to fit within the #container div as expected. It's driving me crazy! Cheers

    Read the article

  • xerces-c: Xml parsing multiple files

    - by user459811
    I'm atempting to learn xerces-c and was following this tutorial online. http://www.yolinux.com/TUTORIALS/XML-Xerces-C.html I was able to get the tutorial to compile and run through a memory checker (valgrind) with no problems however when I made alterations to the program slightly, the memory checker returned some potential leak bytes. I only added a few extra lines to main to allow the program to read two files instead of one. int main() { string configFile="sample.xml"; // stat file. Get ambigious segfault otherwise. GetConfig appConfig; appConfig.readConfigFile(configFile); cout << "Application option A=" << appConfig.getOptionA() << endl; cout << "Application option B=" << appConfig.getOptionB() << endl; // Added code configFile = "sample1.xml"; appConfig.readConfigFile(configFile); cout << "Application option A=" << appConfig.getOptionA() << endl; cout << "Application option B=" << appConfig.getOptionB() << endl; return 0; } I was wondering why is it when I added the extra lines of code to read in another xml file, it would result in the following output? ==776== Using Valgrind-3.6.0 and LibVEX; rerun with -h for copyright info ==776== Command: ./a.out ==776== Application option A=10 Application option B=24 Application option A=30 Application option B=40 ==776== ==776== HEAP SUMMARY: ==776== in use at exit: 6 bytes in 2 blocks ==776== total heap usage: 4,031 allocs, 4,029 frees, 1,092,045 bytes allocated ==776== ==776== 3 bytes in 1 blocks are definitely lost in loss record 1 of 2 ==776== at 0x4C28B8C: operator new(unsigned long) (vg_replace_malloc.c:261) ==776== by 0x5225E9B: xercesc_3_1::MemoryManagerImpl::allocate(unsigned long) (MemoryManagerImpl.cpp:40) ==776== by 0x53006C8: xercesc_3_1::IconvGNULCPTranscoder::transcode(unsigned short const*, xercesc_3_1::MemoryManager*) (IconvGNUTransService.cpp:751) ==776== by 0x4038E7: GetConfig::readConfigFile(std::string&) (in /home/bonniehan/workspace/test/a.out) ==776== by 0x403B13: main (in /home/bonniehan/workspace/test/a.out) ==776== ==776== 3 bytes in 1 blocks are definitely lost in loss record 2 of 2 ==776== at 0x4C28B8C: operator new(unsigned long) (vg_replace_malloc.c:261) ==776== by 0x5225E9B: xercesc_3_1::MemoryManagerImpl::allocate(unsigned long) (MemoryManagerImpl.cpp:40) ==776== by 0x53006C8: xercesc_3_1::IconvGNULCPTranscoder::transcode(unsigned short const*, xercesc_3_1::MemoryManager*) (IconvGNUTransService.cpp:751) ==776== by 0x40393F: GetConfig::readConfigFile(std::string&) (in /home/bonniehan/workspace/test/a.out) ==776== by 0x403B13: main (in /home/bonniehan/workspace/test/a.out) ==776== ==776== LEAK SUMMARY: ==776== definitely lost: 6 bytes in 2 blocks ==776== indirectly lost: 0 bytes in 0 blocks ==776== possibly lost: 0 bytes in 0 blocks ==776== still reachable: 0 bytes in 0 blocks ==776== suppressed: 0 bytes in 0 blocks ==776== ==776== For counts of detected and suppressed errors, rerun with: -v ==776== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 2 from 2)

    Read the article

  • Spring @Transactional - Can I Override rollbackFor

    - by user475039
    Hi all, I am calling a service which has the following annotation: @Transactional(rollbackFor=ExceptionA.class) public void myMethodA(....) throws ExceptionA { . . } I am calling this method from an other method in another Spring Bean. @Transactional(rollbackFor=ExceptionB.class) public void mainEntryPointMethod(....) throws ExceptionB { . try { myMethodA() } catch (ExceptionA exp) { . } . } My problem is that if myMethodA throws an exception, my transaction (which is passed from mainEntryPointMethod - myMethodA by default propagation) will be marked for rollback. Is there a way in which the 'rollbackFor' for the inner method can be overriden? Thanks in advance Chris

    Read the article

  • How to make this JavaScript much faster?

    - by Ralph
    Still trying to answer this question, and I think I finally found a solution, but it runs too slow. var $div = $('<div>') .css({ 'border': '1px solid red', 'position': 'absolute', 'z-index': '65535' }) .appendTo('body'); $('body *').live('mousemove', function(e) { var topElement = null; $('body *').each(function() { if(this == $div[0]) return true; var $elem = $(this); var pos = $elem.offset(); var width = $elem.width(); var height = $elem.height(); if(e.pageX > pos.left && e.pageY > pos.top && e.pageX < (pos.left + width) && e.pageY < (pos.top + height)) { var zIndex = document.defaultView.getComputedStyle(this, null).getPropertyValue('z-index'); if(zIndex == 'auto') zIndex = $elem.parents().length; if(topElement == null || zIndex > topElement.zIndex) { topElement = { 'node': $elem, 'zIndex': zIndex }; } } }); if(topElement != null ) { var $elem = topElement.node; $div.offset($elem.offset()).width($elem.width()).height($elem.height()); } }); It basically loops through all the elements on the page and finds the top-most element beneath the cursor. Is there maybe some way I could use a quad-tree or something and segment the page so the loop runs faster?

    Read the article

  • Difficulty with jQuery and input keydown event

    - by Rosarch
    I am making a simple JavaScript enhanced list. I want it to be a list of inputs, each with an 'Add' and 'Remove' button. If the user clicks 'Add', a new li will be added. If the user clicks 'Remove', that li will be removed. It works fine, except for hitting "enter" in an <input>. Currently, it always causes the Remove.click event handler to fire, unless there's only one item in the list. I'm not sure why. How can I suppress this? Here is the complete jQuery. My attempt to fix the "enter" issue is commented out, and it doesn't work. I suspect that I could be designing this code better; if you see an improvement I'd love to hear it. function make_smart_list(list) { var ADD_CLASS = 'foo-widget-Add'; var REMOVE_CLASS = 'foo-widget-Remove'; var jq_list = $(list); jq_list.parents('form').submit(function() { return false; }); function refresh_handlers() { jq_list.find(sprintf('.%s, .%s', REMOVE_CLASS, ADD_CLASS)).unbind('click'); // jq_list.find('input').unbind('submit'); // // jq_list.find('input').submit(function() { // var jq_this = $(this); // var next_button = jq_this.nextAll('button'); // if (next_button.hasClass(ADD_CLASS)) { // next_button.nextAll('button').click(); // return; // } // // if (next_button.hasClass(REMOVE_CLASS)) { // return false; // } // // }); jq_list.find("." + REMOVE_CLASS).click(function() { var jq_this = $(this); jq_this.parent().remove(); refresh_handlers(); return false; }); jq_list.find("." + ADD_CLASS).click(function() { var jq_this = $(this); if (jq_this.prevAll('input').val() == '') { return; } jq_this.parent().clone().appendTo(jq_this.parent().parent()); jq_this.parent().next().find('input').val('').focus(); jq_this.removeClass(ADD_CLASS).addClass(REMOVE_CLASS); jq_this.text('Remove'); refresh_handlers(); return false; }); } refresh_handlers(); } (sprintf is another script I have.)

    Read the article

  • boolean VB expression returning false for integer 1

    - by Bill
    This is probably a really basic (no pun intended) question, but I can't seem to find an answer anywhere. Why does the result of func1 return False and func2 returns True? On every other test I have done, integer 1 is converted to boolean true and 0 to false. Works ok if I just set rtnValue to 1 or 0. Public Function func1() As Boolean Dim rtnValue As Integer = 0 Return rtnValue = 1 End Function Public Function func2() As Boolean Dim rtnValue As Integer = 0 Return rtnValue = 0 End Function

    Read the article

  • Print unique ascii characters in eclipse console

    - by Shaded
    Hey guys, Kind of a strange question but... here it goes. Recently my application threw an IOException that the text only had a clubs symbol in it (like the suit in cards) I know this is probably because there was a number in there that was cast to a char and printed to the screen, and I've found where that might have happened. The only problem is, I can't recreate it in eclipse because the eclipse console doesn't want to print those characters for me. All I get are boxes. I figure this is an encoding issue or something but I need eclipse to print out those characters just like the windows console would. Is there a setting I can change to do this?

    Read the article

  • What collection object is appropriate for fixed ordering of values?

    - by makerofthings7
    Scenario: I am tracking several performance counters and have a CounterDescription[] correlate to DataSnapshot[]... where CounterDescription[n] describes the data loaded within DataSnapshot[n]. I want to expose an easy to use API within C# that will allow for the easy and efficient expansion of the arrays. For example CounterDescription[0] = Humidity; DataSnapshot[0] = .9; CounterDescription[1] = Temp; DataSnapshot[1] = 63; My upload object is defined like this: Note how my intent is to correlate many Datasnapshots with a dattime reference, and using the offset of the data to refer to its meaning. This was determined to be the most efficient way to store the data on the back-end, and has now reflected itself into the following structure: public class myDataObject { [DataMember] public SortedDictionary<DateTime, float[]> Pages { get; set; } /// <summary> /// An array that identifies what each position in the array is supposed to be /// </summary> [DataMember] public CounterDescription[] Counters { get; set; } } I will need to expand each of these arrays (float[] and CounterDescription[] ), but whatever data already exists must stay in that relative offset. Which .NET objects support this? I think Array[] , LinkedList<t>, and List<t> Are able to keep the data fixed in the right locations. What do you think?

    Read the article

  • codeigniter mulitple LIKE db query using associative array- but all from the same column name...?

    - by Inigo
    Hi, I'm trying to query my database using codeigniter's active record class. I have a number of blog posts stored in a table. The query is for a search function, which will pull out all the posts that have certain categories assigned to them. So the 'category' column of the table will have a list of all the categories for that post in no particular order, separated by commas, like so: Politics,History,Sociology.. etc. If a user selects, say, Politics and History, The titles of all the posts that have BOTH these categories should be returned. Right? So, the list of categories queried will be the array $cats. I thought this would work- foreach ($cats as $cat){ $this->db->like('categories',$cat); } By Producing this- $this-db-like('categories','Politics'); $this-db-like('categories','History'); (Which would produce- 'WHERE categories LIKE '%Politics%' AND categories LIKE '%History%') But it doesn't work, it seems to only produce the first statement. The problem I guess is that the column name is the same for each of the chained queries. There doesn't seem to be anything in the CI user guide about this (http://codeigniter.com/user_guide/database/active_record.html) as they seem to assume that each chained statement is going to be for a different column name. Does anyone know how I could do this? Thanks! edit- Of course it is not possible to use an associative array in one statement as it would have to contain duplicate keys- in this case every key would have to be 'categories'...

    Read the article

  • Javascript to add cdata section on the fly?

    - by Chris G.
    I'm having trouble with special characters that exist in an xml node attribute. To combat this, I'm trying to render the attributes as child nodes and, where necessary, using cdata sections to get around the special characters. The problem is, I can't seem to get the cdata section appended to the node correctly. I'm iterating over the source xml node's attributes and creating new nodes. If the attribute.name = "description" I want to put the attribute.text() in a cdata section and append the new node. That's where I jump the track. // newXMLData is the new xml document that I've created in memory for (var ctr =0;ctr< this.attributes.length;ctr++){ // iterate over the attributes if( this.attributes[ctr].name =="Description"){ // if the attribute name is "Description" add a CDATA section var thisNodeName = this.attributes[ctr].name; newXMLDataNode.append("<"+thisNodeName +"></"+ thisNodeName +">" ); var cdata = newXMLData.createCDATASection('test'); // here's where it breaks. } else { // It's not "Description" so just append the new node. newXMLDataNode.append("<"+ this.attributes[ctr].name +">" + $(this.attributes[ctr]).text() + "</"+ this.attributes[ctr].name +">" ); } } Any ideas? Is there another way to add a cdata section? Here's a sample snippet of the source... <row pSiteID="4" pSiteTile="Test Site Name " pSiteURL="http://www.cnn.com" ID="1" Description="<div>blah blah blah since June 2007.&amp;nbsp; T<br>&amp;nbsp;<br>blah blah blah blah&amp;nbsp; </div>" CreatedDate="2010-09-20 14:46:18" Comments="Comments example.&#10;" > here's what I'm trying to create... <Site> <PSITEID>4</PSITEID> <PSITETILE>Test Site Name</PSITETILE> <PSITEURL>http://www.cnn.com</PSITEURL> <ID>1</ID> <DESCRIPTION><![CDATA[<div>blah blah blah since June 2007.&amp;nbsp; T<br>&amp;nbsp;<br>blah blah blah blah&amp;nbsp; </div ]]></DESCRIPTION> <CREATEDDATE>2010-09-20 14:46:18</CREATEDDATE> <COMMENTS><![CDATA[ Comments example.&#10;]]></COMMENTS> </Site>

    Read the article

< Previous Page | 23 24 25 26 27 28 29 30 31 32 33 34  | Next Page >