Daily Archives

Articles indexed Wednesday April 7 2010

Page 2/131 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • How to Uncheck A radio button

    - by user281867
    Hi, I have two forms, one with a radio button that users must select to edit. [form name="A"] [input type="radio" name="BookItem" value="1" /] [input type="radio" name="BookItem" value="2" /] [input type="radio" name="BookItem" value="3" /] [form] After "BookItem" is selected from form (A) I call the $("#EditFormWrapper").load("callEditData.cfm? ID="+ID); function to load the second form (B) [form id="editForm" name="B"] 2 Hours AM 2 Hours PM 2 Hours AM 2 Hours PM [input type="image" src="images/submit-btn.gif" id="addBTN" name="addBTN" class="buttons" alt="SubmitRrequest" /] [input type="image" src="images/cancel-btn.gif" id="editBTNcancel" name="editBTNcancel" class="buttons" alt="Cancel Request" /] [/form] I want to uncheck the radio button on form (A) when user click on cancel button (editBTNcancel) in form(B). Here s my script: $("#editBTNcancel").live("click", function(event){ event.preventDefault(); $("#EditFormWrapper").slideUp("fast").empty(); //$('.TOR2Hours').removeAttr('checked'); $('.TOR2Hours').attr('checked', false); }); I hope I clearly state my problem, any suggestion would be greatly appreciated!

    Read the article

  • How do I repass a function pointer in C++

    - by fneep
    Firstly, I am very new to function pointers and their horrible syntax so play nice. I am writing a method to filter all pixels in my bitmap based on a function that I pass in. I have written the method to dereference it and call it in the pixel buffer but I also need a wrapper method in my bitmap class that takes the function pointer and passes it on. How do I do it? What is the syntax? I'm a little stumped. Here is my code with all the irrelevant bits stripped out and files combined (read all variables initialized filled etc.). struct sColour { unsigned char r, g, b, a; }; class cPixelBuffer { private: sColour* _pixels; int _width; int _height; int _buffersize; public: void FilterAll(sColour (*FilterFunc)(sColour)); }; void cPixelBuffer::FilterAll(sColour (*FilterFunc)(sColour)) { // fast fast fast hacky FAST for (int i = 0; i < _buffersize; i++) { _pixels[i] = (*FilterFunc)(_pixels[i]); } } class cBitmap { private: cPixelBuffer* _pixels; public: inline void cBitmap::Filter(sColour (*FilterFunc)(sColour)) { //HERE!! } };

    Read the article

  • Background image layout issue

    - by gnomixa
    A client wants to have an image that takes up entire screen, on mouse over the menu would appear. The problem is the height vertical alignment for various screen sizes....What would be the most common sleek looking solution to this issue? Let's assume that the most common screen resolution for the site's audience is 1024x768 but it should look good on smaller resolutions too (specifically for laptops). Thanks!

    Read the article

  • How to prevent DOS attacks using image resizing in an ASP.NET application?

    - by Waleed Eissa
    I'm currently developing a site where users can upload images to use as avatars, I know this makes me sound a little paranoid but I was wondering what if a malicious user uploads an image with incredibly large dimensions that will eat the server memory (as a DOS attack), I already have a limit on the file size that can be uploaded (250 k) but even that size can allow for an image with incredibly large dimensions if the image for example is a JPEG that contains one color and created with a very low quality setting. Taking into consideration that the image is uploaded as a bitmap in memory when being resized (ie. not compressed), I wonder if such DOS attacks occur, even to check the image dimensions it has to be uploaded in memory first, did you hear about any attacks that exploited this? Am I too worried?

    Read the article

  • how to handle DOM in PHP

    - by From.ME.to.YOU
    my PHP code $dom = new DOMDocument(); @$dom->loadHTML($file); $xpath = new DOMXPath($dom); $tags = $xpath->query('//div[@class="text"]'); foreach ($tags as $tag) { echo $tag->textContent; } what i'm trying to do here is to get the content of the div that has class 'text' but the problem when i loop and echo the results i only get the text i can't get the HTML code with images and all the HTML tags like p, br,img... etc i tried to use $tag-nodeValue; but also nothing worked out any help !!?

    Read the article

  • How to change this C++ code to make input work better

    - by Phenom
    cout << "Input street number: "; cin >> streetnum; cout << "Input street name: "; cin >> streetname; cout << "Input resource name: "; cin >> rName; cout << "Input architectural style: "; cin >> aStyle; cout << "Input year built: "; cin >> year; The problem with the above code happens if you enter in spaces between words. For example if I enter "Ampitheater Parkway" for streetname, then it puts "Ampitheater" in streetname, skips the prompt for resource name and enters "Parkway" into the next field. How can I fix this?

    Read the article

  • sIFR problem in IE document.defaultView.getComputedStyle

    - by Jai Ivarsson
    I have sIFR 3 r436 working perfectly in all browsers except IE. IE throws 2 errors. The first is: 'document.defaultView.getComputedStyle' is null of not an object This is on the sifr.js file The second is: 'sIFR' is null or not an object This one is happening I think due to the fact that the sifr.js script is failing in it's load. Has anyone had anything like this before? Thanks, Jai

    Read the article

  • How do I open an already opened file with a .net StreamReader?

    - by Jon Cage
    I have some .csv files which I'm using as part of a test bench. I can open them and read them without any problems unless I've already got the file open in Excel in which case I get an IOException: System.IO.IOException : The process cannot access the file 'TestData.csv' because it is being used by another process. This is a snippet from the test bench: using (CsvReader csv = new CsvReader(new StreamReader(new FileStream(fullFilePath, FileMode.Open, FileAccess.Read)), false)) { // Process the file } Is this a limitation of StreamReader? I can open the file in other applications (Notepad++ for example) so it can't be an O/S problem. Maybe I need to use some other class? If anyone knows how I can get round this (aside from closing excel!) I'd be very grateful.

    Read the article

  • cpanel dns only / rdns questions

    - by Clear.Cache
    I started getting IPs from ARIN directly, instead of the data center I'm colocated at. Now I have to start applying rdns myself for my clients upon request, instead of having the NOC at the DC do this. That is obvious, since I am in full control over the IP delegation and therefore have nameserver authority. The question is, how do I "create" ptr / rdns records for my clients? My current server uses Cpanel / WHM with ns1/ns2.mycompany.com I also applied those as dns nameservers in the ARIN IP's whois record. How do I create rdns for my clients? Should I install Cpanel DNS Only on a entirely separate server and use this method instead? http://layer1.cpanel.net/ If so, how can I seamlessly transition over the dns records to that new dns server, retaining my ns1/ns2.mycompany.com and their ns1 and ns2 IP addresses? Even more important: I have to change the ns1/ns2 IPs to the new ones I retrieve from ARIN. How can this be done, avoiding downtime during the dns transition? On a side note, would it be easier to just install Cpanel DNS Only on a dedicated server and just use dns1.mycompany.com and dns2.mycompany.com with their own dedicated ns1/ns2 IPs from ARIN - and utilize this dns server for customers who request rdns? Would this be a more viable solution than using our current ns1/ns2.mycompany.com Nameservers? Is Cpanel DNS Only a standalone software that does not require Cpanel/WHM on another server? Is it possible to have redundant dns servers setup using this software solely, ns1 on one server and ns2 on another? Thanks.

    Read the article

  • Why do Java/C# edge out C++ as the recommended language to learn OOP on S.O?

    - by viksit
    I noticed after reading the answers/discussion to this question (What is the best language to learn OOP on?) - that more and more people are recommending C# or Java over C++ to learn OOP on. A simple term search on that answer page results in 10 hits for C++, 21 for C# and 27 for Java. Now, I understand that these 2 languages fix a lot of quirks and issues with C++, and looked up these resources that relate mostly to performance, JVM vs native implementation, systems focus vs applications, manual memory management vs automated et al. My question is - are there any fundamental differences in the OO capabilities of Java/C# vs C++? Or are the former recommended purely due to their generic ease of use/improvements over the latter? Thanks. PS, I'm aware of Java interface inheritance vs C++ multiple inheritance as a difference. I would consider that an implementational one rather than functional.

    Read the article

  • How do I modify an attribute across all rows in a table?

    - by prgmatic
    Hi folks, My apologies for asking such a novice question but, I need help building a script using either PHP or directly in MySQL that can do the following: Take the values of a column in a table (text) Change them into capitalized words (from "this is a title" to "This Is A Title") Replace the old values (uncapitalized) with the new values (capitalized). Thanks for the help and support.

    Read the article

  • Resolve sibling folder in JavaScript Function

    - by Jamen Chu
    Hi, I am trying to pass into an JavaScript function two paths for an XML and XSLT. It would appear that in the sample HTML below that the use of "../xsl/filename" does not work for me in the xslt() function. If I specify the path as being "./filename" though this does work. Does anyone know how I can work around this or find some way that I can specify a sibling folder without an absolute path reference? I would prefer not to have to change my file paths as my development environment is set up with the xslt's, sample data and source code structured in a particular way. Thanks in advance Jamen <html> <head> <title></title> <script type="text/javascript" src="../lib/jsunit/app/jsUnitCore.js"></script> <script type="text/javascript" src="../lib/jquery-1.2.3.js"></script> <script type="text/javascript" src="../lib/jquery.xslt.js"></script> </head> <body> <div id="bla"></div> <script type="text/javascript"> $('#bla').xslt("../sampledata/response1.xml", "../xslt/resultFormatter.xsl"); //function testjQuery() { // $('#bla').xslt("../sampledata/response1.xml", "../xslt/resultFormatter.xsl"); //} </script> </body> </html>

    Read the article

  • Is there a standard Java utility to parse XSD files at runtime?

    - by Andrew
    I've been looking around for a way to programmatically parse XSD files to generate an XML mapping so that I can take any XSD file and create a parser that will parse any XML file that conforms to it, and my google-fu has been coming up short. XSOM looks promising, as it will parse an XSD file and make all its attributes available in a straight forward way. Are there any other options or standard libraries available that will produce an XML file parser from an XSD file? [Conclusion] Thanks everyone for your responses, they were a real help. I was able to write implementations using JAXP, Eclipses EMF and in XSOM that all worked as desired. JAXP was very straight forward and easy to learn and do. EMF was actually a pain to get going properly, there were so many jars that had to be included for it to work standalone that I would not recommend it. XSOM was even simpler than the JAXP implementation, so I went with it in the end.

    Read the article

  • Taking a comma separated list and creating a unordered list

    - by mmsa
    I've got a simple list which is generated by a checkbox list. The generated code is simply this white,blue,red,black I need to use jquery to wrap each of these elements in a < li tag. How do you go through the list and use the comma as a separator? I also will need to delete the comma. Sometime there will be 1 item, sometimes 3, etc. Thanks in advance!

    Read the article

  • Android - Calling getJSONArray throwing JSONException with no stack trace

    - by Agathron
    Hi all, I'm currently working on an android app that pulls a list of forums from a JSON feed. I'm trying to parse the feed and immediately upon calling getJSONArray a JSON exception is being thrown with no stack trace. The JSON being returned is stored in an JSONObject jobj with the format as follows: { "Forum": [ {"ForumName":"CEC Employee Communications Forum","ForumId":"105"}, {"ForumName":"CEC External Stakeholder Relations Forum","ForumId":"109"}, {"ForumName":"See All...","ForumId":"0"} ] } However when running the following code, I get an immediate exception without a stack trace: JSONArray jarray = new JSONArray(); jarray = jobj.getJSONArray("Forum"); Running jobj.GetJSONArray("Forum").toString(); returns what looks to be a correct array of the format: [ {"ForumName":"CEC Employee Communications Forum","ForumId":"105"}, {"ForumName":"CEC External Stakeholder Relations Forum","ForumId":"109"}, {"ForumName":"See All...","ForumId":"0"} ] I also tried JSONArray jarray = new JSONArray(jobj.GetJSONArray("Forum").toString()); and had the exception thrown immediately. Any help would be greatly appreciated. Thanks!

    Read the article

  • What are the performance implications of wildcard mapping all requests through IIS 6.0?

    - by slolife
    I am interested in using UrlRewriter.NET and noticed in the config page for IIS 6.0 on Win2k3, that they say to map all requests through the ASP.NET ISAPI. That's fine, but I am wondering if anyone has good or bad things to say about this performance wise? Is my web server going to be dragged down to its knees by doing this or will it be more of a small step up in server load? My server currently has room to breathe now, so some performance hit is expected and acceptable.

    Read the article

  • Change User Agent in UIWebView (iPhone SDK)

    - by Steve Murch
    Hi everyone, I have a business need to be able to customize the UserAgent for an embedded UIWebView. (For instnace, I'd like the server to respond differently if, say, a user is using one version of the app versus another.) Is it possible to customize the UserAgent in the existing iPhone SDK's UIWebView control the way it is, say, for an embedded IE browser in a Windows app? Thanks for any guidance.

    Read the article

  • Is it safe to use Select Top and Delete Top in sequence?

    - by Rob Nicholson
    I often write T-SQL loops that look like this While Exists (Select * From #MyTable) Begin Declare @ID int, @Word nvarchar(max) Select Top 1 @ID=ID, @Word=[Word] From #MyTable -- Do something -- Delete #MyTable Where ID=@ID End Works a treat but I noticed the new Delete Top function which would be useful when #MyTable is just a list of strings. In this case, would this work: While Exists (Select * From #MyTable) Begin Declare @Word nvarchar(max) Select Top 1 @Word=[Word] From #MyTable -- Do something -- Delete Top(1) #MyTable End Well yes, it works in my test script but is this safe? Will Select Top 1 and Delete Top(1) always refer to the same record or is Top a little more vague. Thanks, Rob.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >