Daily Archives

Articles indexed Thursday May 20 2010

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

  • Javascript variables are not working

    - by linkcool
    Hi, my problem is that my variables are not working in javascript. all variables need names without some character at the beginning, this is the stupid thing...Anyways, im trying to make a funtion that makes "select all checkboxes". It is not working so i looked at the page source/info and found out that the variables were not changing. this is my input: echo "<input onclick='checkAll(1);' type='checkbox' name='master'/><br/>"; My function: function checkAll(i) { for(var i=1; i < <?php echo $num; ?>; i++) { if(document.demo.master[i].checked == true) { document.demo.message[i].checked = true; } else { document.demo.message[i].checked = false; } } } so yes that's it. I can tell you that i also tried without the <i> in: checkAll("i") Thanks for the help.

    Read the article

  • Python and database

    - by axl456
    hello.. Am working on a personal project, where i need to manipulate values in a database-like format.. Up until now, am using dictionaries, tuples, and list to store and consult those values. Am thinking about starting to use SQL to manipulate those values, but I dont know if its worth the effort, because I dont know anything about SQL, and I dont want to use something that wont bring me any benefits (if I can do it in a simpler way, i dont want to complicate things) if am only storing and consulting values, what would be the benefit of using SQL? PS: the numbers of row goes between 3 and 100 and the number of columns is around 10 (some may have 5 some may have 10 etc)

    Read the article

  • Beginner's Question about accessing mysql using OOP

    - by user345690
    I am reading the PHP and mySQL web development book and so far been doing all the PHP and mysql using procedural. But then it talks about accessing mysql with objects. This works for me: //I define $db so can connect $query="select * FROM testing"; $result=mysqli_query($db,$query); while($row=mysqli_fetch_array($result)){ //echo the data } But when I try to do it with classes, it doesn't $query="select * FROM testing"; $result=$db->query($query); $row=$result->fetch_assoc(); Do I have to write my own class so it defines what query and fetch_assoc does? Or what?

    Read the article

  • Caching with Spring Framework

    - by Francois
    Spring Modules had a @Cacheable annotation: org.springmodules.cache.annotations.Cacheable Now that Spring Module is deprecated, what is the recommendation for caching? And is still still possible to work with ehCache?

    Read the article

  • Why are these divs repelling each other?

    - by Terminal Frost
    <html> <div style="width:200px;"> <div style="background:red;height:5px"></div> <div style="background:yellow"> Magnets? </div> <div style="background:green;height:5px"></div> </div> </html> Rendering with "Magnets?" wrapped in h3 tags How come the divs cease to be contiguous if "Magnets?" is wrapped in a paragraph or heading tag?

    Read the article

  • How do I let main thread wait for the Timer.timer

    - by Kelvin
    Hi I am using System.Timer.Timer I always get NULL after running my programme and it only works if I add this.sleep(6000). Suppose the reason is the main thread ends but the timer hasn't finished ... Here is the class and I call the class from my main form. Class class1 { string finalResult = ""; public string getNumber() { RunTimer(); return finalResult; } pubic void RunTimer () { timer = new System.Timers.Timer(6000); timer.Interval = 1000; timer.Elapsed += new System.Timers.ElapsedEventHandler(cal); timer.Start(); } private void cal(object sender,System.Timers.ElapsedEventArgs e) { finalResult = READFROMCOMPORT; } }

    Read the article

  • jQuery fadeIn is not working in Internet Explorer

    - by Nazaf
    I have the following HTML DIV which does not work using FadeIn in IE: $(".tip").fadeIn("slow"); /* Is not working in IE. */ $(".tip").show(); /* Works well in IE, that's weird. */ <div class="tip" style="width: 220px; display: none;"> <div class="tip-header"> <span><b>Title</b></span> <div class="right close"><a href="javascript:void(0);">close</a> <img alt="" src="/Images/close-normal.png"/></div> </div> <div class="tip-content">EBody comes here.</div> </div> .tip { display: block; z-index: 99999; position: fixed; background-color: #ffffff; -moz-box-shadow: 2px 2px 10px 2px rgba(0, 0, 0, 0.6); -webkit-box-shadow: 2px 2px 10px 2px rgba(0, 0, 0, 0.6); border:solid 1px #82C2FA; -moz-border-radius: 8px; -webkit-border-radius: 8px; } .tip-header { padding: 8px; min-height: 10px; -moz-border-radius-topleft: 8px; -moz-border-radius-topright: 8px; -webkit-border-radius-topright: 8px; -webkit-border-radius-topleft: 8px; background-color: #CFE6FD; border-bottom: 1px solid #82C2FA; } .tip-header span { font-size: 14px; color: #666666; } .tip-content { padding: 8px; text-align: left; font-size: 12px; } .close, .whats-this { cursor: pointer; } .close a { color: #085FBC; text-decoration: none; } .close img { vertical-align: bottom; }

    Read the article

  • LInux (Ubuntu Karmic) equivalent to Pawsense

    - by LRE
    I now work from a home office - much to the delight of my cats. One in particular likes to come for a hug several times a day. That in itself is fine but he tends to sit on my laptop keyboard whilst I'm working on my desktop and vice-versa. Also he'll walk across any keyboard I'm actually using at the time. I've found Pawsense and would like to know if anyone can suggest a Linux equivalent (or some incantations to achieve the same). Training him out of sitting on the keyboard is likely to prove fruitless (a suggested here). He's far more pig-headed than I am. This conversation discusses some utilities like xlock et al but I'd prefer if possible to have something more along the lines of Pawsense that doesn't lock the keyboard but "simply" intercepts cat-like typing. Thanks

    Read the article

  • Dell XPS 1530 DVD-RW firmware problem

    - by josecortesp
    Hello everyone. I have this XPS laptop since a year and a half ago. About 2 months ago, with the waranty expired, i tried to run the optiarc slot load DVD-RW firmware update, and said everything was okay. Then I restarted it and the problem started: Now, every single time I turn on my computer, it get stuck at the BIOS POST until the drive sounds like "ready" and then the computer starts normally. And this happen EXACTLY the same when it's getting back from sleep. I'm pretty sure is not a software issue, because I tried with Vista Home Premiun 32 bits, Ubuntu (from 8.10+)32 & 64, and with W7 64. Already tried to run the firmware installer like a million time, in case it is a failing install with no luck. Also, google it to see if someone has the same problem, and again, no. The Drive performs pretty okay once the System is on, but waiting to the drive to be ready everytime is really annoying. The Firmware I updated was this, and the drive is: K937C Assembly, Dvd+/-rw, 8, SLOT, 1530 Sony Nec Optiarc Inc. I'll apreciate any help you can give me

    Read the article

  • Collision detection problems...

    - by thyrgle
    Hi, I have written the following: -(void) checkIfLineCollidesWithAll { float slope = ((160-L1Circle1.position.y)-(160-L1Circle2.position.y))/((240-L1Circle1.position.x)-(240-L1Circle2.position.x)); float b = (160-L1Circle1.position.y) - slope * (240-L1Circle1.position.x); if ((240-L1Sensor1.position.x) < (240-L1Circle1.position.x) && (240-L1Sensor1.position.x) < (240-L1Circle2.position.x) || ((240-L1Sensor1.position.x) > (240-L1Circle1.position.x) && (240-L1Sensor1.position.x) > (240-L1Circle2.position.x))) { [L1Sensor1 setTexture:[[CCTextureCache sharedTextureCache] addImage:@"SensorOk.png"]]; } else if (slope == INFINITY || slope == -INFINITY) { if (L1Circle1.position.y + 16 >= L1Sensor1.position.y || L1Circle1.position.y - 16 <= L1Sensor1.position.y) { [L1Sensor1 setTexture:[[CCTextureCache sharedTextureCache] addImage:@"SensorBad.png"]]; } else { [L1Sensor1 setTexture:[[CCTextureCache sharedTextureCache] addImage:@"SensorOk.png"]]; } } else if (160-L1Sensor1.position.y + 12 >= slope*(240-L1Sensor1.position.x) + b && 160-L1Sensor1.position.y - 12 <= slope*(240-L1Sensor1.position.x) + b) { [L1Sensor1 setTexture:[[CCTextureCache sharedTextureCache] addImage:@"SensorBad.png"]]; } else { [L1Sensor1 setTexture:[[CCTextureCache sharedTextureCache] addImage:@"SensorOk.png"]]; } } Basically what this does is finds m and b in the well known equation: y = mx + b and then substitutes coordinates of the L1Sensor1 (the circle I'm trying to detect if it it intersects with the line segment) to see if y = mx + b hold true. But, there are two problems, first, when slope approaches infinity the range of what the L1Sensor1 should "react" to (it "reacts" by changing its image) becomes smaller. Also, the code that should handle infinity is not working. Thanks for the help in advanced.

    Read the article

  • Select a row having a column with max value - On a date range

    - by Abhi
    Excuse me for posting a similar question. Please consider this: date value 18/5/2010, 1 pm 40 18/5/2010, 2 pm 20 18/5/2010, 3 pm 60 18/5/2010, 4 pm 30 18/5/2010, 5 pm 60 18/5/2010, 6 pm 25 19/5/2010, 6 pm 300 19/5/2010, 6 pm 450 19/5/2010, 6 pm 375 20/5/2010, 6 pm 250 20/5/2010, 6 pm 310 The query is to get the date and value for each day such that the value obtained for that day is max. If the max value is repeated on that day, the lowest time stamp is selected. The result should be like: 18/5/2010, 3 pm 60 19/5/2010, 6 pm 450 20/5/2010, 6 pm 310 The query should take in a date range like the one given below and find results for that range in the above fashion: where date = to_date('26/03/2010','DD/MM/YYYY') AND date < to_date('27/03/2010','DD/MM/YYYY')

    Read the article

  • Mimic an HTTPRequest and HTTPResponse object in Java

    - by Ankur
    How do I mimic an HTTPServletRequest and HTTPServletResponse object. The reason is I want to test the behaviour of some servlets. I know JUnit probably provides this functionality but I don't know how to use it (I will learn soon) and need to do this reasonably quickly. HTTPServletRequest and HTTPServletResponse are both interfaces so they can't be instantiated. There is a HttpServletRequestWrapper which implements HttpServletRequest but it doesn't seem to have any setParameter() type methods and HttpServletResponse doesn't seem to have any implementing classes at all. How can I test my code by passing a suitable HttpServletRequest object and then checking that the received HttpServletResponse object matches what I expect?

    Read the article

  • Error : The Type Initializer of Daemon.Global threw an exception in c#

    - by srk
    I am using the below class file, where some variables are declared to use in the entire application. Now I used that variable BlockLogOut in another class file to make the value true. I just put this below line and getting error in it.. TypeInitializationException Global.BlockLogOut = True; The weird thing is, it was working fine for many months and i am getting this error now on the above line. Of course i was modifying some other stuffs in the application, but surely not this class file. What would have been the problem? namespace Daemon { class Global { public static bool BlockLogOut = false; } }

    Read the article

  • Cannot get UISearchBar Scope Bar to appear in Toolbar on iPad

    - by Jann
    This is really causing me fits. I put a toolbar on the IUView on the iPad. I added the following: Search Bar (not Search Bar and Search Display) to the toolbar. I set the options to be as follows: Show Cancel Button, Show Scope Bar, Scope Button Titles are: "Title1" and "Title2" (with Title2's radio button selected). Opaque, Clear Context and Auto Resize are checked. I hooked up the delegate of Search Bar to the "File's Owner" and linked it to IBOutlet theSearchBar. In my viewWillAppear I have the following: [theSearchBar setScopeButtonTitles:[NSArray arrayWithObjects:@"Near Me",@"Everywhere",nil]]; //Just in case: [theSearchBar setShowsScopeBar:YES]; //doesn't seem to do anything: //[theSearchBar sizeToFit]; searchDisplayController = [[UISearchDisplayController alloc] initWithSearchBar:theSearchBar contentsController:self]; [self setSearchDisplayController:searchDisplayController]; [searchDisplayController setDelegate:self]; [searchDisplayController setSearchResultsDataSource:self]; //again--does not seem to do anything..but people have suggested it: [theSearchBar sizeToFit]; Okay, so far, I thought, so good. So, I made the File's Owner .m file to be a delegate for: UISearchBarDelegate, UISearchDisplayDelegate. My issue: I have yet to implement the delegates necessary to do the search but still... shouldn't I be seeing the scopeBar next to the search field when I click into the search field? Just so you know I DO see the log of the characters I type, so the delegate is working. I have the following dummy functions in the .m file (just in case) // called when keyboard search button pressed - (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar { NSLog(@"Search Button Clicked\n"); [theSearchBar resignFirstResponder]; } // called when cancel button pressed - (void)searchBarCancelButtonClicked:(UISearchBar *)searchBar { NSLog(@"Cancel Button Clicked\n"); [theSearchBar resignFirstResponder]; } - (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText { NSLog(@"Search Text So Far: '%@'\n",searchText); } - (BOOL)searchBarShouldBeginEditing:(UISearchBar *)searchBar { return YES; } - (BOOL)searchBarShouldEndEditing:(UISearchBar *)searchBar { return YES; } Why doesn't the Scope Bar appear? A results UIPopoverController appears with the title "Results" and "No results found" (of course) when i type the first character in my search...but no scope bar. (not that i expect anything other than "No Results Found". I am wondering where the scope bar is supposed to appear...in the titleView of the UIPopover? In the toolbar to the right of the search area? Where?

    Read the article

  • help me pick the right iPhone audio class - MPMoviePlayer vs AVAudioPlayer vs MPMusicPlayer

    - by huevos de oro
    Does anyone know of a good tutorial on the distinction between the MPMoviePlayer vs AVAudioPlayer vs MPMusicPlayer? I want to play audio from an mp3 file available at an external URL. Ideally it is played in an iPod-like audio view. I toyed with MPMoviePlayer but it appears to be more suitable for video, as when audio starts a "movie playing" message displays, the controls disappear and a white quicktime splash page displays. I would like the standard ipod audio controls to display all the time, and to customize the image behind them.

    Read the article

  • Can't access form elements

    - by linkcool
    Hi, my problem is that my variables are not working in javascript. all variables need names without some character at the beginning, this is the stupid thing...Anyways, im trying to make a funtion that makes "select all checkboxes". It is not working so i looked at the page source/info and found out that the variables were not changing. this is my input: echo "<input onclick='checkAll(1);' type='checkbox' name='master'/><br/>"; My function: function checkAll(i) { for(var i=1; i < <?php echo $num; ?>; i++) { if(document.demo.master[i].checked == true) { document.demo.message[i].checked = true; } else { document.demo.message[i].checked = false; } } } so yes that's it. I can tell you that i also tried without the <i> in: checkAll("i") Thanks for the help. EDIT: each checkbox for each messsage has this code:echo "<input style='margin-left:-15px;margin-top:20px;' type='checkbox' name='message' value='$rid' /><br/>";

    Read the article

  • How to open a nested child PreferenceScreen in Android.

    - by Mike
    Hello, I have a PreferenceScreen that is defined in XML that serves all the preferences for my application. This PreferenceScreen also has a child PreferenceScreen nested within it. My implementing class is called PreferencesActivity. I know I can open the main Preferences window via startActivity(new Intent(this, PreferencesActivity.class)); but how do I go about opening the child PreferenceScreen via an Intent?

    Read the article

  • VB6: assign javascript function to a dom element

    - by Fuxi
    hi, i'm using the mshtml library for parsing out html via MSHTML.HTMLDocument. my question: is there a way to assign a javascript function to a dom element? i've tried something like: div.onmouseover = "function(){alert('mouseover')}" and div.setattribute "onmouseover" , "function(){alert('mouseover')}" without success (no error but no effect either). anyone knows if its possible? thx

    Read the article

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