Daily Archives

Articles indexed Saturday April 24 2010

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

  • Need Urgent Help! Find a repeated numbers out of 3 boxes

    - by james1
    Hi guys, I really need help with finding a repeated number out of 3 boxes. Let's say that i have 3 boxes, each box contain 10 piece of numbered paper (1 - 10) but there is a number the same in all 3 boxes eg: box1 has number 4 and box2 has number 4 and box3 also has number 4. How to find that repeated number in java with an efficient/fastest way possible? Thanks in advance!

    Read the article

  • jQuery replaceWith(data) is not correctly doing his job

    - by Tristan
    Hello, i did a small ajax div refresh, but instead of replacing the values with the new ones, jquery adds the new data before the old ones. What possibily causes that please ? <script type="text/javascript"> $(document).ready(function(){ $('#AJAX').click(function(e){ e.preventDefault(); var hebergeur = $('#hebergeurJQUERY').val(); $.post("/statistiques/maj-bloc-commentaires.php", { hebergeur : hebergeur }, function(data){ // déclenchée seulement si succès $("#TOREPLACE").replaceWith(data).val( ); }); }); }); </script> The HTML : print '<div id="a_remplacer"> <div class="detail_commentaires"> <table class="tableau_detail_commentaires"> <tr> <td class="tab_space">Serveur <strong>'.$row['type'].'</strong></td> <td>Qualite</td> <td style="color:'.$c_vote.'">'.htmlentities($row['vote']).'</td> </tr> </div> </div> The PHP ajax echo : print '<div id="a_remplacer"><div class="detail_commentaires" > <table class="tableau_detail_commentaires"> <tr> <td class="tab_space">Serveur <strong>'.$row['type'].'</strong></td> <td>Qualite</td> <td style="color:'.$c_vote.'">'.htmlentities($row['vote']).'</td> </tr></div></div> Thanks

    Read the article

  • What are pros and cons to add line-height to body { }?

    - by metal-gear-solid
    Is it good to add line-height in body{line-height:1.5} or it would be better if i add separately for tag by tag like p{ line height:1em} etc. Edit: body {line-height:in em} create problem with if we put image with float inside Edit: 24 April 2010: If i have to add different line heights to elements like p {line-height: 1.4} h1 {line-height:1.6} h2 {line-height:1.2} ul li {line-height:1.1} then shouldn't i use line height in body {line-height:1.4} if body {line-height:1.4} and h1 {line-height:1.6} then what would be line height for h1?

    Read the article

  • How to define a predicate as a function argument

    - by devoured elysium
    I want to be able to write something as void Start(some condition that might evaluate to either true or false) { //function will only really start if the predicate evaluates to true } I'd guess it must be something of the form: void Start(Predicate predicate) { } How can I check inside my Start function whenever the predicate evaluated to true or false? Is my use of a predicate correct? Thanks

    Read the article

  • How to change the outlining hover color in VS 2010?

    - by RCIX
    If i hover over the thin vertical bar on the left, it highlights the entire scope of the block that's to the right. When this scope is large, my entire screen flashes white (a consequence of my custom color scheme). Is there a way to change that color? i don't recall there being one when i made the theme.

    Read the article

  • How can I use Performance Counters in C# to monitor 4 processes with the same name?

    - by Waffles
    I'm trying to create a performance counter that can monitor the performance time of applications, one of which is Google Chrome. However, I notice that the performance time I get for chrome is unnaturally low - I look under the task-manager to realize my problem that chrome has more than one process running under the exact same name, but each process has a different working set size and thus(what I would believe) different processor times. I tried doing this: // get all processes running under the same name, and make a performance counter // for each one. Process[] toImport = Process.GetProcessesByName("chrome"); instances = new PerformanceCounter[toImport.Length]; for (int i = 0; i < instances.Length; i++) { PerformanceCounter toPopulate = new PerformanceCounter ("Process", "% Processor Time", toImport[i].ProcessName, true); //Console.WriteLine(toImport[i].ProcessName + "#" + i); instances[i] = toPopulate; } But that doesn't seem to work at all - I just monitor the same process several times over. Can anyone tell me of a way to monitor separate processes with the same name?

    Read the article

  • Using PHP, can I put variables inside of variables?

    - by Rob
    For example, take this code: $ch = curl_init($resultSet['url']."?get0=get0&get1=".$get1."&get2=".$get2."&get3=".$get3); This of course, looks very ugly, and kind of a pain in the ass to read. So my question is, would I be able to use something like this: $allgets ="?act=phptools&host=".$host."&time=".$duration."&port=".$port; $ch = curl_init($resultSet['url'] . $allgets); Very simple question I suppose, but my server is undergoing maintenance, so I can't upload it and test it myself. I suppose a yes or no answer will suffice, but if you have a more efficient way of doing this, that would be even better. :)

    Read the article

  • Best placement for javascript in Asp.net MVC app that heavily uses partial views

    - by KallDrexx
    What is the best place for javascript that is specific to a partial view? For example, if I have a partial view (loaded via ajax call) with some divs and I want to turn those divs into an accordian, would it be better put the $("#section").accordion() in script tags inside of the partial view, or in a .js file in the function that retrieves that partial view and inserts it into the DOM? Obviously, common methods I will be keeping in a .js file, however I am more talking about javascript very specific to the partial view itself. Most things I find on the net seem to say to put all javascript into a separate .js but nothing addresses the idea of partial views.

    Read the article

  • Find a repeated numbers out of 3 boxes

    - by james1
    I have 3 boxes, each box contain 10 piece of numbered paper (1 - 10) but there is a number the same in all 3 boxes eg: box1 has number 4 and box2 has number 4 and box3 also has number 4. How to find that repeated number in java with an efficient/fastest way possible?

    Read the article

  • How can I initialize a QTMovie object with certain attributes using writable data?

    - by c-had
    I'm trying to create an empty QTMovie object that I can add segments to, and then play. This is easy to do with something like: movie = [[QTMovie alloc] initToWritableData:[NSMutableData dataWithCapacity:1048576] error:&error]; I can then use -insertSegmentOfMovie to insert segments from other movies into this one so I can play it back. The problem is that I also need to set a certain attribute when creating the QTMovie object. In particular, I need to set the QTMovieRateChangesPreservePitchAttribute attribute, so that I can alter playback speed during playback without changing pitch. This attribute cannot be written after the movie is initialized. So, I can create the QTMovie object like this: movie = [[QTMovie alloc] initWithAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:YES], QTMovieRateChangesPreservePitchAttribute, nil] error:&error]; Unfortunately, this is not editable. I've tried setting the QTMovieEditableAttribute as well on creation, but it does not help. I still get an exception when I try to insert anything into this movie. I presume this is because there is no writable file or data reference associated with the QTMovie. Any ideas on how to solve this?

    Read the article

  • CPU spikes on small site- possibly apache or php config related

    - by Mike
    Hello, I hope you can help me. I have a site that I'm moving to a new datacenter. The server is pretty much vanilla, no control panel, and also no optimizations. When I hit a page, the site takes an extremely long time to load, despite it being relatively light weight. I ran top to see what was happening, and the cpu jumps to 75%, and drops back down to about 20% while the rest of the page is loading. Someone suggested that I ran lsof -p on the offending processes, but I'm not sure what I'm looking at. I ran through my httpd.conf file and commented out a bunch of loaded modules that didn't seem necessary, but that didn't help either. Anyone have any ideas? Output of the lsof http://pastebin.com/mfa113f

    Read the article

  • Adding a MySQL StoredProcedure causes not responding state

    - by Omie
    Hello I'm on Windows 7 ultimate 32bit + xampp 1.7.2 [MySQL v5.1.37] This is my stored procedure : delimiter // CREATE PROCEDURE updatePoints(IN parentid INT(5),IN userid INT(5)) DECLARE chpoints INT(5); BEGIN SELECT points INTO chpoints FROM quiz_challenges WHERE id = parentid; UPDATE quiz_users SET points = points + chpoints WHERE forumid=userid; END; // delimiter ; At first it was showing error 1064 while creating stored procedure. I added delimiters part and when I tried running the query from phpmyadmin, Firefox went into not responding state. After that I started Internet Explorer and tried opening my pages which use the same database, it worked fine. However, I tried opening phpmyadmin and IE went into not responding state as well. I restarted both servers. Later restarted PC. Tried again but its same behavior. So whats wrong with this tiny little code ? Am I missing something which might be causing infinite loop ? Thanks

    Read the article

  • Why is Automator crashing on launch?

    - by zbrimhall
    I've run into an odd problem where Automtor.app on Snow Leopard crashes on launch. At some point in the past, I put a copy of iPhoto.app into my public directory to copy over to another machine. Now, Automator.app won't run unless my public directory has a copy of iPhoto.app in it. If I remove it, Automator.app crashes on launch. Here's what happens: Launch Automator.app After the Automator menu bar appears, but before any windows appear, I get the dreaded beach ball for a few seconds Automator crashes Here's the output from Console.app: 12/26/09 2:11:24 PM Automator[11736] The action “Add Movie to iDVD Menu” could not be loaded because the application “iDVD” was not found. 12/26/09 2:11:24 PM Automator[11736] The action “Get iDVD Slideshow Images” could not be loaded because the application “iDVD” was not found. 12/26/09 2:11:24 PM Automator[11736] The action “Initiate Remote Broadcast” could not be loaded because the application “QuickTime Broadcaster” was not found. 12/26/09 2:11:24 PM Automator[11736] The action “New iDVD Menu” could not be loaded because the application “iDVD” was not found. 12/26/09 2:11:24 PM Automator[11736] The action “New iDVD Movie Sequence” could not be loaded because the application “iDVD” was not found. 12/26/09 2:11:24 PM Automator[11736] The action “New iDVD Slideshow” could not be loaded because the application “iDVD” was not found. 12/26/09 2:11:24 PM Automator[11736] The action “New QuickTime Slideshow” could not be loaded because the application “QuickTime Player” was not found. 12/26/09 2:11:24 PM Automator[11736] The action “Set iDVD Background Image” could not be loaded because the application “iDVD” was not found. 12/26/09 2:11:24 PM Automator[11736] The action “Set iDVD Button Face” could not be loaded because the application “iDVD” was not found. 12/26/09 2:11:24 PM Automator[11736] The action “Set Movie Annotations” could not be loaded because the application “QuickTime Player” was not found. 12/26/09 2:11:24 PM Automator[11736] The action “Set Movie Playback Properties” could not be loaded because the application “QuickTime Player” was not found. 12/26/09 2:11:24 PM Automator[11736] The action “Set Movie URL” could not be loaded because the application “QuickTime Player” was not found. 12/26/09 2:11:24 PM Automator[11736] The action “Show Main iDVD Menu” could not be loaded because the application “iDVD” was not found. 12/26/09 2:11:25 PM Automator[11736] Can not ID UTI for path The value %@ is invalid.: The file “The value %@ is invalid.” couldn’t be opened because there is no such file. 12/26/09 2:11:25 PM Automator[11736] Can not ID UTI for path /Users/brimhall/Public/iPhoto.app: The file “iPhoto.app” couldn’t be opened because there is no such file. 12/26/09 2:11:25 PM Automator[11736] Can not ID UTI for path The value %@ is invalid.: The file “The value %@ is invalid.” couldn’t be opened because there is no such file. 12/26/09 2:11:26 PM Automator[11736] -[NSAttributeDictionary length]: unrecognized selector sent to instance 0x49c770 12/26/09 2:11:26 PM Automator[11736] -[NSAttributeDictionary length]: unrecognized selector sent to instance 0x49c770 12/26/09 2:11:38 PM com.apple.launchd.peruser.501[203] ([0x0-0x2ad2ad].com.apple.Automator[11736]) Job appears to have crashed: Segmentation fault I've tried deleting my Automator.app Preferences file and Application Support directory to get it to look for iPhoto.app in the system-wide Applications directory, but to no avail. Any suggestions on how I can get things working as normal?

    Read the article

  • Have powershell zip the contents of a bunch of folders, individual zip for each folder

    - by WebDevHobo
    Recently, I asked how to do this with a .bat file and an answer was provided. for /D %%d in (*.*) do "C:\Program Files\7-Zip\7z\7za.exe" a -tzip %%d.zip %%d However, this proved useful only for folders that have no spaces in their name. The reason being that batch will do the following: if the folder name is "jef's vacation pics", the variables will be: %%d = jef's %%e = vacation %%f = pics And then it tries to pass only %%d to the 7-zip program, which will not find such a folder and therefor will not create a zip file. I've tried looking up some tutorials, documentation sites and such, but I haven't been able to come up with an answer. There may be an answer, but I want to take this opportunity to try my hand at powershell. I was thinking that a function with 1 argument, that being the parent-folder of the sub-folders that need to be zipped, would be the best approach. So here's what I have, which doesn't work, probably due to my general in-experience with powershell: function zipFolders($parent) { $zip = "C:\Program Files\7-Zip\7z\7za.exe"; $parents | ForEach-Object $zip a -tzip }

    Read the article

  • Will SQL Server Partitioning increase performance without changing filegroups

    - by Tom
    Scenario I have a 10 million row table. I partition it into 10 partitions, which results in 1 million rows per partition but I do not do anything else (like move the partitions to different file groups or spindles) Will I see a performance increase? Is this in effect like creating 10 smaller tables? If I have queries that perform key lookups or scans, will the performance increase as if they were operating against a much smaller table? I'm trying to understand how partitioning is different from just having a well indexed table, and where it can be used to improve performance. Would a better scenario be to move the old data (using partition switching) out of the primary table to a read only archive table? Is having a table with a 1 million row partition and a 9 million row partition analagous (performance wise) to moving the 9 million rows to another table and leaving only 1 million rows in the original table?

    Read the article

  • data type trouble in php

    - by user225269
    I don't know why but the data type in this code makes a trouble when the id in the url starts with the number zero like this: http://localhost/exp/update.php?id=03A43 In this case the id is 03A43. And my query looks like this: mysql_select_db("school", $con); $result = mysql_query("SELECT * FROM student WHERE IDNO=".(int)$_GET['id']); ?> There is no problem in the design if the id does not start with the number zero. What might be the proper data type for numbers beginning in zero?

    Read the article

  • How can I get Rails to interpret a text field as a datetime

    - by doctororange
    My database has a datetime field, and I want to be able to create new entries. Obviously the Rails datetime_select helper isn't the most user friendly thing to have in your form. I'd rather have a text field for the datetime (or one for the date, and one for the time) and interpret the inputs like PHP strtotime can. I might just be searching the wrong keywords. Surely this has been discussed in great depth somewhere. Thanks :0)

    Read the article

  • Error while sending mail (attachment file)

    - by Surya sasidhar
    hi, in my application i am using to send mail with attachments i write the code like this Using System.Net.Mail; MailMessage mail = new MailMessage(); mail.Body = "<html><body><b> Name Of The Job Seeker: " + txtName.Text + "<br><br>" + "The Mail ID:" + txtEmail.Text + "<br><br>" + " The Mobile Number: " + txtmobile.Text + "<br><br>" + "Position For Applied: " + txtPostionAppl.Text + "<br><br>" + "Description " + txtdescript.Text + "<br><br></b></body></html>"; mail.From = new MailAddress ( txtEmail.Text); mail.To .Add (new MailAddress ( mailid)); mail.Priority = MailPriority.High; FileUpload1.PostedFile.SaveAs("~/Resume/" + FileUpload1.FileName); mail.Attachments.Add(filenme); SmtpMail sm = new SmtpMail(); sm.Send(mail); it is giving error at attachment like mail.Attachemts.Add(filena) like this 'System.Collections.ObjectModel.Collection.Add(System.Net.Mail.Attachment)' has some invalid arguments.

    Read the article

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