Daily Archives

Articles indexed Sunday May 2 2010

Page 18/69 | < Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >

  • Question about Benchmark function in Mysql ( Incredible results ).

    - by xRobot
    I have 2 tables: author with 3 millions of rows. book with 20 miles rows. . So I have benchmarked this query with a join: SELECT BENCHMARK(100000000, 'SELECT book.title, author.name FROM `book` , `author` WHERE book.id = author.book_id ') And this is the result: Query took 0.7438 sec ONLY 0.7438 seconds for 100 millions of query with a join ??? Do I make some mistakes or this is the right result ?

    Read the article

  • Java: limit to nest classes?

    - by HH
    A very poor style to code but sometimes unavoidable. It is an extreme example. So is there some limit for nesting classes? are they equivalent? how do you deal with such situations? Create library? Code new FileObject().new Format().new Words().new Some().new Continue someThing; ((((new FileObject()).new Format()).new Words()).new Some()).new Continue someThing;

    Read the article

  • Resize form objects in Java

    - by PeerFull
    I have a Java applet, which is a form that draw shapes into it (Rect, Oval, Line). Each shape is represented by 2 points and can draw itself to the form. When the JApplet form resizes, I need to resize the shapes also while keeping the aspect ratio. I didn't find an high quality solution for doing this that solves this problem. Tried to write a solution from this, but it came up as lousy when tested, Can someone publish an example code for doing that please?

    Read the article

  • Overloading on return type ???

    - by Green Hyena
    scala> val shares = Map("Apple" -> 23, "MicroSoft" -> 50, "IBM" -> 17) shares: scala.collection.immutable.Map[java.lang.String,Int] = Map(Apple -> 23, MicroSoft -> 50, IBM -> 17) scala> val shareholders = shares map {_._1} shareholders: scala.collection.immutable.Iterable[java.lang.String] = List(Apple, MicroSoft, IBM) scala> val newShares = shares map {case(k, v) => (k, 1.5 * v)} newShares: scala.collection.immutable.Map[java.lang.String,Double] = Map(Apple -> 34.5, MicroSoft -> 75.0, IBM -> 25.5) From this example it seems like the map method is overloaded on return type. Overloading on return type is not possible right? Would somebody please explain what's going on here?

    Read the article

  • mean image filter

    - by turmoil
    Starting to learn image filtering and stumped on a question found on website: Applying a 3×3 mean filter twice does not produce quite the same result as applying a 5×5 mean filter once. However, a 5×5 convolution kernel can be constructed which is equivalent. What does this kernel look like? Would appreciate help so that I can understand the subject better. Thanks.

    Read the article

  • How to remove an item from a structure array in C++?

    - by Antik
    I have the following array structure (linked list): struct str_pair { char ip [50] ; char uri [50] ; str_pair *next ; } ; str_pair *item; I know to create a new item, I need to use item = new str_pair; However, I need to be able to loop through the array and delete a particular item. I have the looping part sorted. But how do I delete an item from an array of structures?

    Read the article

  • Does Javascript have classes?

    - by Glycerine
    A friend and I had an argument last week. He stated there were no such things as classes in Javascript. I said there was as you can say var object = new Object() he says "as there is no word class used. Its not a class. -- Whats your take on it guys? thanks.

    Read the article

  • Rails 2.3.5, Ruby 1.9, SQLite 3 incompatible character encodings: UTF-8 and ASCII-8BIT

    - by Daniil Harik
    Hello, I know that question with same title has been asked almost 6 month ago. I have Googled for this problem and I have not found any working solution. Has there been any fixes for this very critical problem? I need to get my website running ASAP. Just to get the site up and running I'm even ready to add utf8 conversion methods to all my variables or risk to upgrade to Rails 3 beta Thank You in advance!

    Read the article

  • exec() function doesn't rule svn checkout

    - by bahamut100
    Hi, I'm writing some functions in php using exec() to interrogate a svn. The commands exec("svn list ".$myurl) works. Now, I try to get a path on a svn repository with the checkout command. When I put the command "svn checkout http://core.wordress.org/tags/2.9.2/ last-version" directly in the console, it works. But when I do this from a php script using exec(), like this : exec("svn checkout ".$myurl, $dir) it doesn't work. Have you an idea ??

    Read the article

  • Mounting both /dev/sda and /dev/sda1 - how can this be?

    - by itsadok
    I work on an Amazon EC2 instance that somebody else set up. We have an EBS volume mounted on /dev/sda, even though the root device is already on /dev/sda1, and we're also using `/dev/sda2' user@server:~$ mount /dev/sda1 on / type ext3 (rw) ... (snip) /dev/sda2 on /mnt type ext3 (rw) /dev/sda on /vol type xfs (rw,noatime) ... This doesn't seem to fit with what I know about the way /dev/ works. How is this possible, and more importantly: will this cause trouble in the future? I'm running ubuntu 9.04 jaunty.

    Read the article

  • PHP & MySQL username validation and storage problem.

    - by php
    For some reason when a user enters a brand new username the error message <p>Username unavailable</p> is displayed and the name is not stored. I was wondering if some can help find the flaw in my code so I can fix this error? Thanks Here is the PHP code. if($_POST['username'] && trim($_POST['username'])!=='') { $u = "SELECT * FROM users WHERE username = '$username' AND user_id <> '$user_id'"; $r = mysqli_query ($mysqli, $u) or trigger_error("Query: $u\n<br />MySQL Error: " . mysqli_error($mysqli)); if (mysqli_num_rows($r) == TRUE) { echo '<p>Username unavailable</p>'; $_POST['username'] = NULL; } else if(isset($_POST['username']) && mysqli_num_rows($r) == 0 && strlen($_POST['username']) <= 255) { $username = mysqli_real_escape_string($mysqli, $_POST['username']); } else if($_POST['username'] && strlen($_POST['username']) >= 256) { echo '<p>Username can not exceed 255 characters</p>'; } }

    Read the article

  • Rails authlogic : How to make Levels?

    - by Oluf Nielsen
    Hello, i followed this tutorial fo setting Autlogic up properly. So, my site needs a form of level, like "Admin", "Moderator", "User", "Guest". So Admins can do everything, where Moderators may not can make site changes. And Users can't destroy, Update or Create. I've have googled a bit.. But nothing found, so i thought you guys might can help me out? Thank you.

    Read the article

  • symlink files newer than X age, then later remove symlink once file ages?

    - by bleomycin
    Hello everyone, i have a large number of files/folders coming in each day that are being sorted automatically to a wide variety of folders. I'm looking for a way to automatically find these files/folders and create symlinks to them all within an "incoming" folder. Searching for file age should be sufficient for finding the files, however searching for age and owner would be ideal. Then once the files/folders being linked to reach a certain age, say 5 days, remove the symlinks to them automatically from the "incoming" folder. Is this possible to do with a simple shell or python script that can be run with cron? Thanks!

    Read the article

  • Why does Python array moduel handle strings and lists differently?

    - by Casey
    I'm having trouble understanding the result of the following statements: >>> from array import array >>> array('L',[0xff,0xff,0xff,0xff]) array('L', [255L, 255L, 255L, 255L]) >>> from array import array >>> array('L','\xff\xff\xff\xff') Traceback (most recent call last): File "<stdin>", line 1, in <module> ValueError: string length not a multiple of item size

    Read the article

< Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >