Search Results

Search found 243 results on 10 pages for 'belgin fish'.

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

  • Sort MYSQL Data By Number of Entries

    - by Belgin Fish
    Hi, I'm wondering how I can sort mysql data based on the number of entries. I'm doing this so I can have a page of the top purchases, so it would have to retrieve all the product_id's from a table, and then sort them by the most times one shows up, limiting it to 10 or something. Thanks!

    Read the article

  • Retrieve Specific Data/Value From Database 1 Line PHP

    - by Belgin Fish
    Hi, I'm just wondering how I can retrieve a specific value (only 1 thing will be returned) from a database using php. My query is mysql_query("SELECT balance FROM users WHERE username = '". $this->username . "'") I'm just looking for it to retrieve the data from that row so I can save it directory into a variable.

    Read the article

  • How to deny the web access to some files?

    - by Strae
    I need to do an operation a bit strange. First, i run on Debian, apache2 (which 'runs' as user www-data) So, I have simple text file with .txt ot .ini, or whatever extension, doesnt matter. These files are located in subfolders with a structure like this: www.example.com/folder1/car/foobar.txt www.example.com/folder1/cycle/foobar.txt www.example.com/folder1/fish/foobar.txt www.example.com/folder1/fruit/foobar.txt therefore, the file name always the same, ditto for the 'hierarchy', just change the name of the folder: /folder-name-static/folder-name-dinamyc/file-name-static.txt What I should do is (I think) relatively simple: I must be able to read that file by programs on the server (python, php for example), but if I try to retrieve the file contents by broswer (digiting the url www.example.com/folder1/car/foobar.txt, or via cUrl, etc..) I must get a forbidden error, or whatever, but not access the file. It would also be nice that even accessing those files via FTP are 'hidden', or anyway couldnt be downloaded (at least that I use with the ftp root and user data) How can I do? I found this online, be put in the file .htaccess: <Files File.txt> Order allow, deny Deny from all </ Files> It seems to work, but only if the file is in the web root (www.example.com / myfile.txt), and not in subfolders. Moreover, the folders in the second level (www.example.com/folder1/fruit/foobar.txt) will be dinamycally created.. I would like to avoid having to change .htaccess file from time to time. It is possible to create a rule, something like that, that goes for all files with given name, which is on www.example.com/folder-name-static/folder-name-dinamyc/file-name-static.txt, where those parts are allways the same, just that one change ? EDIT: As Dave Drager said, i could semplify this keeping those file outside the web accessible directory. But those directory's will contain others files too, images, and stuff used by my users, so i'm simply try to not have a duplicate folders system, like: /var/www/vhosts/example.com/httpdocs/folder1/car/[other folders and files here] /var/www/vhosts/example.com/httpdocs/folder1/cycle/[other folders and files here] /var/www/vhosts/example.com/httpdocs/folder1/fish/[other folders and files here] //and, then for the 'secrets' files: /folder1/data/car/foobar.txt /folder1/data/cycle/foobar.txt /folder1/data/fish/foobar.txt

    Read the article

  • .htaccess redirect, from old dirty URL to a clean new URL with parameters

    - by JustAnil
    I have the following 2 links, I'm not great with .htaccess rules yet. Old URL: http://www.mywebsite.org.uk/donate/donate.php?charity_id=885&project_id=18111 New URL: http://new.mywebsite.org.uk/donation/to/885/18111 I want all the traffic coming from the old URL to the new url (including the parameters charity_id & project_id). I'm trying to learn .htaccess rules, but finding the tutorials online to be kinda vague. I'd really like a simple explanation on the .htaccess rules. (Give a man a fish, feed him for a day, teach a man to fish, feed him for a lifetime). The correct answer will be the answer with a simple and useful explanation (along with the rules if possible!).

    Read the article

  • DIV is picking max-width value as width value for DIV.

    - by Lokesh
    I am facing a problem after applying max-width hack for IE7. In mozilla, width of the div is flexible and adjustable as per the image width in the div. But in IE7 it is taking the max-width as width of DIV. Below is my HTML code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <link rel="stylesheet" type="text/css" media="all" href="style/food.css" /> <!--[if IE 7]> <link rel="stylesheet" type="text/css" media="screen" href="style/ie7.css" /> <![endif]--> </head> <body> <div class="main_content_inner_ko"> <div class="product_item"> <img src="images/product_icons/BigNTasty.png" alt="Big N&rsquo; Tasty"/><div class="small_title">Big N&rsquo; Tasty</div> <table class="product_information" cellpadding="0" border="0" cellspacing="0"> <tbody> <tr> <td class="red_bold"></td> <td></td> <td class="small_italic">(Daily Value)</td> </tr> <tr> <td class="red_bold">Calories</td> <td>460</td> <td class="small_italic"></td> </tr> <tr> <td class="red_bold">Total Fat</td> <td>24g</td> <td class="small_italic">(37%)</td> </tr> <tr> <td class="red_bold">Carbs</td> <td>37g</td> <td class="small_italic">(12%)</td> </tr> <tr> <td class="red_bold">Protein</td> <td>24g</td> <td class="small_italic"></td> </tr> <tr> <td class="red_bold">Sodium</td> <td>720mg</td> <td class="small_italic">(30%)</td> </tr> <tr> <td colspan="3" class="notes">Note: Values shown are for the default size and/or flavor.</td> </tr> <tr><td colspan="3"><a href="#" class="acts_as_button en_learn_more_and_customize"></a></td></tr> <tr><td colspan="3"><a href="#" class="acts_as_button en_add_to_my_meal_builder"></a></td></tr> </tbody> </table> </div> <div class="product_item"> <img src="images/product_images/x115/chicken/PremCrispyChickenRanchBLT.png" height="115" width="115" alt="Premium Cripsy Chicken Ranch BLT"/><div class="small_title">Premium Cripsy Chicken Ranch BLT</div> <table class="product_information" cellpadding="0" border="0" cellspacing="0"> <tbody> <tr> <td class="red_bold"></td> <td></td> <td class="small_italic">(Daily Value)</td> </tr> <tr> <td class="red_bold">Calories</td> <td>460</td> <td class="small_italic"></td> </tr> <tr> <td class="red_bold">Total Fat</td> <td>24g</td> <td class="small_italic">(37%)</td> </tr> <tr> <td class="red_bold">Carbs</td> <td>37g</td> <td class="small_italic">(12%)</td> </tr> <tr> <td class="red_bold">Protein</td> <td>24g</td> <td class="small_italic"></td> </tr> <tr> <td class="red_bold">Sodium</td> <td>720mg</td> <td class="small_italic">(30%)</td> </tr> <tr> <td colspan="3" class="notes">Note: Values shown are for the default size and/or flavor.</td> </tr> <tr><td colspan="3"><a href="#" class="acts_as_button en_learn_more_and_customize"></a></td></tr> <tr><td colspan="3"><a href="#" class="acts_as_button en_add_to_my_meal_builder"></a></td></tr> </tbody> </table> </div> <div class="product_item"> <img src="images/product_images/x115/sandwiches/FiletOFish.png" height="115" width="99" alt="Filet O Fish"/> <div class="small_title">Filet O Fish</div> <table class="product_information" cellpadding="0" border="0" cellspacing="0"> <tbody> <tr> <td class="red_bold"></td> <td></td> <td class="small_italic">(Daily Value)</td> </tr> <tr> <td class="red_bold">Calories</td> <td>460</td> <td class="small_italic"></td> </tr> <tr> <td class="red_bold">Total Fat</td> <td>24g</td> <td class="small_italic">(37%)</td> </tr> <tr> <td class="red_bold">Carbs</td> <td>37g</td> <td class="small_italic">(12%)</td> </tr> <tr> <td class="red_bold">Protein</td> <td>24g</td> <td class="small_italic"></td> </tr> <tr> <td class="red_bold">Sodium</td> <td>720mg</td> <td class="small_italic">(30%)</td> </tr> <tr> <td colspan="3" class="notes">Note: Values shown are for the default size and/or flavor.</td> </tr> <tr><td colspan="3"><a href="#" class="acts_as_button en_learn_more_and_customize"></a></td></tr> <tr><td colspan="3"><a href="#" class="acts_as_button en_add_to_my_meal_builder"></a></td></tr> </tbody> </table> </div> <div class="product_item"> <img src="images/product_icons/BigNTasty.png" height="115" width="99" alt="Big N&rsquo; Tasty"/> <div class="small_title">Big N&rsquo; Tasty</div> <table class="product_information" cellpadding="0" border="0" cellspacing="0"> <tbody> <tr> <td class="red_bold"></td> <td></td> <td class="small_italic">(Daily Value)</td> </tr> <tr> <td class="red_bold">Calories</td> <td>460</td> <td class="small_italic"></td> </tr> <tr> <td class="red_bold">Total Fat</td> <td>24g</td> <td class="small_italic">(37%)</td> </tr> <tr> <td class="red_bold">Carbs</td> <td>37g</td> <td class="small_italic">(12%)</td> </tr> <tr> <td class="red_bold">Protein</td> <td>24g</td> <td class="small_italic"></td> </tr> <tr> <td class="red_bold">Sodium</td> <td>720mg</td> <td class="small_italic">(30%)</td> </tr> <tr> <td colspan="3" class="notes">Note: Values shown are for the default size and/or flavor.</td> </tr> <tr><td colspan="3"><a href="#" class="acts_as_button en_learn_more_and_customize"></a></td></tr> <tr><td colspan="3"><a href="#" class="acts_as_button en_add_to_my_meal_builder"></a></td></tr> </tbody> </table> </div> <div class="product_item"> <img src="images/product_images/x115/chicken/PremCrispyChickenRanchBLT.png" height="115" width="115" alt="Premium Cripsy Chicken Ranch BLT"/> <div class="small_title">Premium Cripsy Chicken Ranch BLT</div> <table class="product_information" cellpadding="0" border="0" cellspacing="0"> <tbody> <tr> <td class="red_bold"></td> <td></td> <td class="small_italic">(Daily Value)</td> </tr> <tr> <td class="red_bold">Calories</td> <td>460</td> <td class="small_italic"></td> </tr> <tr> <td class="red_bold">Total Fat</td> <td>24g</td> <td class="small_italic">(37%)</td> </tr> <tr> <td class="red_bold">Carbs</td> <td>37g</td> <td class="small_italic">(12%)</td> </tr> <tr> <td class="red_bold">Protein</td> <td>24g</td> <td class="small_italic"></td> </tr> <tr> <td class="red_bold">Sodium</td> <td>720mg</td> <td class="small_italic">(30%)</td> </tr> <tr> <td colspan="3" class="notes">Note: Values shown are for the default size and/or flavor.</td> </tr> <tr><td colspan="3"><a href="#" class="acts_as_button en_learn_more_and_customize"></a></td></tr> <tr><td colspan="3"><a href="#" class="acts_as_button en_add_to_my_meal_builder"></a></td></tr> </tbody> </table> </div> <div class="product_item"> <img src="images/product_images/x115/sandwiches/FiletOFish.png" height="115" width="99" alt="Filet O Fish"/> <div class="small_title">Filet O Fish</div> <table class="product_information" cellpadding="0" border="0" cellspacing="0"> <tbody> <tr> <td class="red_bold"></td> <td></td> <td class="small_italic">(Daily Value)</td> </tr> <tr> <td class="red_bold">Calories</td> <td>460</td> <td class="small_italic"></td> </tr> <tr> <td class="red_bold">Total Fat</td> <td>24g</td> <td class="small_italic">(37%)</td> </tr> <tr> <td class="red_bold">Carbs</td> <td>37g</td> <td class="small_italic">(12%)</td> </tr> <tr> <td class="red_bold">Protein</td> <td>24g</td> <td class="small_italic"></td> </tr> <tr> <td class="red_bold">Sodium</td> <td>720mg</td> <td class="small_italic">(30%)</td> </tr> <tr> <td colspan="3" class="notes">Note: Values shown are for the default size and/or flavor.</td> </tr> <tr><td colspan="3"><a href="#" class="acts_as_button en_learn_more_and_customize"></a></td></tr> <tr><td colspan="3"><a href="#" class="acts_as_button en_add_to_my_meal_builder"></a></td></tr> </tbody> </table> </div> <div class="product_item"> <img src="images/product_icons/BigNTasty.png" height="115" width="99" alt="Big N&rsquo; Tasty"/> <div class="small_title">Big N&rsquo; Tasty</div> <table class="product_information" cellpadding="0" border="0" cellspacing="0"> <tbody> <tr> <td class="red_bold"></td> <td></td> <td class="small_italic">(Daily Value)</td> </tr> <tr> <td class="red_bold">Calories</td> <td>460</td> <td class="small_italic"></td> </tr> <tr> <td class="red_bold">Total Fat</td> <td>24g</td> <td class="small_italic">(37%)</td> </tr> <tr> <td class="red_bold">Carbs</td> <td>37g</td> <td class="small_italic">(12%)</td> </tr> <tr> <td class="red_bold">Protein</td> <td>24g</td> <td class="small_italic"></td> </tr> <tr> <td class="red_bold">Sodium</td> <td>720mg</td> <td class="small_italic">(30%)</td> </tr> <tr> <td colspan="3" class="notes">Note: Values shown are for the default size and/or flavor.</td> </tr> <tr><td colspan="3"><a href="#" class="acts_as_button en_learn_more_and_customize"></a></td></tr> <tr><td colspan="3"><a href="#" class="acts_as_button en_add_to_my_meal_builder"></a></td></tr> </tbody> </table> </div> <div class="product_item"> <img src="images/product_icons/BigNTasty.png" height="115" width="99" alt="Big N&rsquo; Tasty"/> <div class="small_title">Big N&rsquo; Tasty</div> <table class="product_information" cellpadding="0" border="0" cellspacing="0"> <tbody> <tr> <td class="red_bold"></td> <td></td> <td class="small_italic">(Daily Value)</td> </tr> <tr> <td class="red_bold">Calories</td> <td>460</td> <td class="small_italic"></td> </tr> <tr> <td class="red_bold">Total Fat</td> <td>24g</td> <td class="small_italic">(37%)</td> </tr> <tr> <td class="red_bold">Carbs</td> <td>37g</td> <td class="small_italic">(12%)</td> </tr> <tr> <td class="red_bold">Protein</td> <td>24g</td> <td class="small_italic"></td> </tr> <tr> <td class="red_bold">Sodium</td> <td>720mg</td> <td class="small_italic">(30%)</td> </tr> <tr> <td colspan="3" class="notes">Note: Values shown are for the default size and/or flavor.</td> </tr> <tr><td colspan="3"><a href="#" class="acts_as_button en_learn_more_and_customize"></a></td></tr> <tr><td colspan="3"><a href="#" class="acts_as_button en_add_to_my_meal_builder"></a></td></tr> </tbody> </table> </div> <div class="product_item"> <img src="images/product_images/x115/sandwiches/FiletOFish.png" height="115" width="99" alt="Filet O Fish"/> <div class="small_title">Filet O Fish</div> <table class="product_information" cellpadding="0" border="0" cellspacing="0"> <tbody> <tr> <td class="red_bold"></td> <td></td> <td class="small_italic">(Daily Value)</td> </tr> <tr> <td class="red_bold">Calories</td> <td>460</td> <td class="small_italic"></td> </tr> <tr> <td class="red_bold">Total Fat</td> <td>24g</td> <td class="small_italic">(37%)</td> </tr> <tr> <td class="red_bold">Carbs</td> <td>37g</td> <td class="small_italic">(12%)</td> </tr> <tr> <td class="red_bold">Protein</td> <td>24g</td> <td class="small_italic"></td> </tr> <tr> <td class="red_bold">Sodium</td> <td>720mg</td> <td class="small_italic">(30%)</td> </tr> <tr> <td colspan="3" class="notes">Note: Values shown are for the default size and/or flavor.</td> </tr> <tr><td colspan="3"><a href="#" class="acts_as_button en_learn_more_and_customize"></a></td></tr> <tr><td colspan="3"><a href="#" class="acts_as_button en_add_to_my_meal_builder"></a></td></tr> </tbody> </table> </div> <div class="product_item"> <img src="images/product_icons/BigNTasty.png" height="115" width="99" alt="Big N&rsquo; Tasty"/> <div class="small_title">Big N&rsquo; Tasty</div> <table class="product_information" cellpadding="0" border="0" cellspacing="0"> <tbody> <tr> <td class="red_bold"></td> <td></td> <td class="small_italic">(Daily Value)</td> </tr> <tr> <td class="red_bold">Calories</td> <td>460</td> <td class="small_italic"></td> </tr> <tr> <td class="red_bold">Total Fat</td> <td>24g</td> <td class="small_italic">(37%)</td> </tr> <tr> <td class="red_bold">Carbs</td> <td>37g</td> <td class="small_italic">(12%)</td> </tr> <tr> <td class="red_bold">Protein</td> <td>24g</td> <td class="small_italic"></td> </tr> <tr> <td class="red_bold">Sodium</td> <td>720mg</td> <td class="small_italic">(30%)</td> </tr> <tr> <td colspan="3" class="notes">Note: Values shown are for the default size and/or flavor.</td> </tr> <tr><td colspan="3"><a href="#" class="acts_as_button en_learn_more_and_customize"></a></td></tr> <tr><td colspan="3"><a href="#" class="acts_as_button en_add_to_my_meal_builder"></a></td></tr> </tbody> </table> </div> <div class="product_item"> <img src="images/product_icons/BigNTasty.png" height="115" width="99" alt="Big N&rsquo; Tasty"/> <div class="small_title">Big N&rsquo; Tasty</div> <table class="product_information" cellpadding="0" border="0" cellspacing="0"> <tbody> <tr> <td class="red_bold"></td> <td></td> <td class="small_italic">(Daily Value)</td> </tr> <tr> <td class="red_bold">Calories</td> <td>460</td> <td class="small_italic"></td> </tr> <tr> <td class="red_bold">Total Fat</td> <td>24g</td> <td class="small_italic">(37%)</td> </tr> <tr> <td class="red_bold">Carbs</td> <td>37g</td> <td class="small_italic">(12%)</td> </tr> <tr> <td class="red_bold">Protein</td> <td>24g</td> <td class="small_italic"></td> </tr> <tr> <td class="red_bold">Sodium</td> <td>720mg</td> <td class="small_italic">(30%)</td> </tr> <tr> <td colspan="3" class="notes">Note: Values shown are for the default size and/or flavor.</td> </tr> <tr><td colspan="3"><a href="#" class="acts_as_button en_learn_more_and_customize"></a></td></tr> <tr><td colspan="3"><a href="#" class="acts_as_button en_add_to_my_meal_builder"></a></td></tr> </tbody> </table> </div> <div class="product_item"> <img src="images/product_icons/BigNTasty.png" height="115" width="99" alt="Big N&rsquo; Tasty"/> <div class="small_title">Big N&rsquo; Tasty</div> <table class="product_information" cellpadding="0" border="0" cellspacing="0"> <tbody> <tr> <td class="red_bold"></td> <td></td> <td class="small_italic">(Daily Value)</td> </tr> <tr> <td class="red_bold">Calories</td> <td>460</td> <td class="small_italic"></td> </tr> <tr> <td class="red_bold">Total Fat</td> <td>24g</td> <td class="small_italic">(37%)</td> </tr> <tr> <td class="red_bold">Carbs</td> <td>37g</td> <td class="small_italic">(12%)</td> </tr> <tr> <td class="red_bold">Protein</td> <td>24g</td> <td class="small_italic"></td> </tr> <tr> <td class="red_bold">Sodium</td> <td>720mg</td> <td class="small_italic">(30%)</td> </tr> <tr> <td colspan="3" class="notes">Note: Values shown are for the default size and/or flavor.</td> </tr> <tr><td colspan="3"><a href="#" class="acts_as_button en_learn_more_and_customize"></a></td></tr> <tr><td colspan="3"><a href="#" class="acts_as_button en_add_to_my_meal_builder"></a></td></tr> </tbody> </table> </div> <div class="product_item"> <img src="images/product_images/x115/chicken/PremCrispyChickenRanchBLT.png" height="115" width="115" alt="Premium Cripsy Chicken Ranch BLT"/> <div class="small_title">Premium Cripsy Chicken Ranch BLT</div> <table class="product_information" cellpadding="0" border="0" cellspacing="0"> <tbody> <tr> <td class="red_bold"></td> <td></td> <td class="small_italic">(Daily Value)</td> </tr> <tr> <td class="red_bold">Calories</td> <td>460</td> <td class="small_italic"></td> </tr> <tr> <td class="red_bold">Total Fat</td> <td>24g</td> <td class="small_italic">(37%)</td> </tr> <tr> <td class="red_bold">Carbs</td> <td>37g</td> <td class="small_italic">(12%)</td> </tr> <tr> <td class="red_bold">Protein</td> <td>24g</td> <td class="small_italic"></td> </tr> <tr> <td class="red_bold">Sodium</td> <td>720mg</td> <td class="small_italic">(30%)</td> </tr> <tr> <td colspan="3" class="notes">Note: Values shown are for the default size and/or flavor.</td> </tr> <tr><td colspan="3"><a href="#" class="acts_as_button en_learn_more_and_customize"></a></td></tr> <tr><td colspan="3"><a href="#" class="acts_as_button en_add_to_my_meal_builder"></a></td></tr> </tbody> </table> </div> <div class="product_item"> <img src="images/product_images/x115/sandwiches/FiletOFish.png" height="115" width="99" alt="Filet O Fish"/> <div class="small_title">Filet O Fish</div> <table class="product_information" cellpadding="0" border="0" cellspacing="0"> <tbody> <tr> <td class="red_bold"></td> <td></td> <td class="small_italic">(Daily Value)</td> </tr> <tr> <td class="red_bold">Calories</td> <td>460</td> <td class="small_italic"></td> </tr> <tr> <td class="red_bold">Total Fat</td> <td>24g</td> <td class="small_italic">(37%)</td> </tr> <tr> <td class="red_bold">Carbs</td> <td>37g</td> <td class="small_italic">(12%)</td> </tr> <tr> <td class="red_bold">Protein</td> <td>24g</td> <td class="small_italic"></td> </tr> <tr> <td class="red_bold">Sodium</td> <td>720mg</td> <td class="small_italic">(30%)</td> </tr> <tr> <td colspan="3" class="notes">Note: Values shown are for the default size and/or flavor.</td> </tr> <tr><td colspan="3"><a href="#" class="acts_as_button en_learn_more_and_customize"></a></td></tr> <tr><td colspan="3"><a href="#" class="acts_as_button en_add_to_my_meal_builder"></a></td></tr> </tbody> </table> </div> <div class="product_item"> <img src="images/product_icons/BigNTasty.png" height="115" width="99" alt="Big N&rsquo; Tasty"/> <div class="small_title">Big N&rsquo; Tasty</div> <table class="product_information" cellpadding="0" border="0" cellspacing="0"> <tbody> <tr> <td class="red_bold"></td> <td></td> <td class="small_italic">(Daily Value)</td> </tr> <tr> <td class="red_bold">Calories</td> <td>460</td> <td class="small_italic"></td> </tr> <tr> <td class="red_bold">Total Fat</td> <td>24g</td> <td class="small_italic">(37%)</td> </tr> <tr> <td class="red_bold">Carbs</td> <td>37g</td> <td class="small_italic">(12%)</td> </tr> <tr> <td class="red_bold">Protein</td> <td>24g</td> <td class="small_italic"></td> </tr> <tr> <td class="red_bold">Sodium</td> <td>720mg</td> <td class="small_italic">(30%)</td> </tr> <tr> <td colspan="3" class="notes">Note: Values shown are for the default size and/or flavor.</td> </tr> <tr><td colspan="3"><a href="#" class="acts_as_button en_learn_more_and_customize"></a></td></tr> <tr><td colspan="3"><a href="#" class="acts_as_button en_add_to_my_meal_builder"></a></td></tr> </tbody> </table> </div> <div class="clear"></div> </div> </body> Below is the css code: div.small_title { font-size: 10px; color: #929292; text-align: center; max-width: 115px; line-height: 13px; padding-top: 5px; margin: 0 auto; } .product_item { position: relative; float:left; min-width: 35px; max-width: 189px; width: auto !important; text-align:center; border: 1px solid #CCC; } Please help me! Cheers!! Lokesh Yadav

    Read the article

  • number->string and related procedures in GIMP scheme scripting

    - by dim fish
    I am frustrated with string-to-number and number-to-string conversion in GIMP scripting. I am runnning GIMP 2.6.8 in Windows Vista. I understand that GIMP's internal Scheme implementation changes over the versions and I can't seem to nail down the documentation. From what I can gather GIMP's Scheme is a subset of TinyScheme and/or supports the R5RS standard procedures. In any case, I usually just look in the packaged script directory for examples when I want to try something new, because that should work for sure, right? For example, grid-system.scm comes with the latest GIMP release and has the expression, (string-append (number->string obj) " ") which is exactly what I want. However, if I use number-string in my own script, or even type it into GIMP's script console (which is how I usually test out new stuff I want to do) it tells me number-string is an unbound variable: > (number->string 3) Error: eval: unbound variable: number->string Other standard procedures from, say R5RS, work just fine: > (string-append "frust" "rated") "frustrated" So, 1) Is there some lurking documentation for current GIMP Scheme scripting other than something drastic like searching GIMP's source code? 2) Can I use the GIMP console to spit out a list of all defined procedures to find something I need? 3) Anyone else confirm that number-string is not defined for the current Windows build, even though it appears in the packaged scripts? My web searches haven't turned up any related problems, and a complete uninstall of all GIMP versions, back to latest puts me in the same scrape.

    Read the article

  • Intercepting method with Spring AOP using only annotations

    - by fish
    In my Spring context file I have something like this: <bean id="userCheck" class="a.b.c.UserExistsCheck"/> <aop:config> <aop:aspect ref="userCheck"> <aop:pointcut id="checkUser" expression="execution(* a.b.c.d.*.*(..)) &amp;&amp; args(a.b.c.d.RequestObject)"/> <aop:around pointcut-ref="checkUser" method="checkUser"/> </aop:aspect> </aop:config> a.b.c.UserExistsCheck looks like this: @Aspect public class UserExistsCheck { @Autowired private UserInformation userInformation; public Object checkUser(ProceedingJoinPoint pjp) throws Throwable { int userId = ... //get it from the RequestObject passed as a parameter if (userExists(userId)) { return pjp.proceed(); } else { return new ResponseObject("Invalid user); } } And the class that is being intercepted with this stuff looks like this: public class Klazz { public ResponseObject doSomething(RequestObject request) {...} } This works. UserExistCheck is executed as desired before the call is passed to Klazz. The problem is that this is the only way I got it working. To get this working by using annotations instead of the context file seems to be just too much for my small brain. So... how exactly should I annotate the methods in UserExistsCheck and Klazz? And do I still need something else too? Another class? Still something in the context file?

    Read the article

  • Looking for a smarter way to convert a Python list to a GList?

    - by Kingdom of Fish
    I'm really new to C - Python interaction and am currently writing a small app in C which will read a file (using Python to parse it) and then using the parsed information to execute small Python snippets. At the moment I'm feeling very much like I'm reinventing wheels, for example this function: typedef gpointer (list_func)(PyObject *obj); GList *pylist_to_glist(list_func func, PyObject *pylist) { GList *result = NULL; if (func == NULL) { fprintf(stderr, "No function definied for coverting PyObject.\n"); } else if (PyList_Check(pylist)) { PyObject *pIter = PyObject_GetIter(pylist); PyObject *pItem; while ((pItem = PyIter_Next(pIter))) { gpointer obj = func(pItem); if (obj != NULL) result = g_list_append(result, obj); else fprintf(stderr, "Could not convert PyObject to C object.\n"); Py_DECREF(pItem); } Py_DECREF(pIter); } return result; } I would really like to do this in a easier/smarter way less prone to memory leaks and errors. All comments and suggestions are appreciated.

    Read the article

  • EJB3 with Spring

    - by fish
    I have understood that if I use EJB in Spring context, I get all the same benefits as if I was using it in "pure" EJB3 environment, is this true? I have googled but can't find a definitive, clear answer. For example, let's say I have a session bean that updates some tables in the database and it throws a System Exception. In "pure" EJB3 environment the transaction is rolled back. What if I for example @Autowire this bean using Spring, does Spring take care of the transaction handling same way as does the EJB3 container? Or what? Does it maybe require some specific configuration or is it fully "automatic"?

    Read the article

  • Passing data between android ListActivities in Java

    - by Will Janes
    I am new to Android! I am having a problem getting this code to work... Basically I Go from one list activity to another and pass the text from a list item through the intent of the activity to the new list view, then retrieve that text in the new list activity and then preform a http request based on value of that list item. Log Cat 04-05 17:47:32.370: E/AndroidRuntime(30135): FATAL EXCEPTION: main 04-05 17:47:32.370: E/AndroidRuntime(30135): java.lang.ClassCastException:android.widget.LinearLayout 04-05 17:47:32.370: E/AndroidRuntime(30135): at com.thickcrustdesigns.ufood.CatogPage$1.onItemClick(CatogPage.java:66) 04-05 17:47:32.370: E/AndroidRuntime(30135): at android.widget.AdapterView.performItemClick(AdapterView.java:284) 04-05 17:47:32.370: E/AndroidRuntime(30135): at android.widget.ListView.performItemClick(ListView.java:3731) 04-05 17:47:32.370: E/AndroidRuntime(30135): at android.widget.AbsListView$PerformClick.run(AbsListView.java:1959) 04-05 17:47:32.370: E/AndroidRuntime(30135): at android.os.Handler.handleCallback(Handler.java:587) 04-05 17:47:32.370: E/AndroidRuntime(30135): at android.os.Handler.dispatchMessage(Handler.java:92) 04-05 17:47:32.370: E/AndroidRuntime(30135): at android.os.Looper.loop(Looper.java:130) 04-05 17:47:32.370: E/AndroidRuntime(30135): at android.app.ActivityThread.main(ActivityThread.java:3691) 04-05 17:47:32.370: E/AndroidRuntime(30135): at java.lang.reflect.Method.invokeNative(Native Method) 04-05 17:47:32.370: E/AndroidRuntime(30135): at java.lang.reflect.Method.invoke(Method.java:507) 04-05 17:47:32.370: E/AndroidRuntime(30135): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:907) 04-05 17:47:32.370: E/AndroidRuntime(30135): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:665) 04-05 17:47:32.370: E/AndroidRuntime(30135): at dalvik.system.NativeStart.main(Native Method) ListActivity 1 package com.thickcrustdesigns.ufood; import java.util.ArrayList; import org.apache.http.NameValuePair; import org.apache.http.message.BasicNameValuePair; import org.json.JSONException; import org.json.JSONObject; import android.app.ListActivity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.Button; import android.widget.ListView; import android.widget.TextView; public class CatogPage extends ListActivity { ListView listView1; Button btn_bk; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.definition_main); btn_bk = (Button) findViewById(R.id.btn_bk); listView1 = (ListView) findViewById(android.R.id.list); ArrayList<NameValuePair> nvp = new ArrayList<NameValuePair>(); nvp.add(new BasicNameValuePair("request", "categories")); ArrayList<JSONObject> jsondefs = Request.fetchData(this, nvp); String[] defs = new String[jsondefs.size()]; for (int i = 0; i < jsondefs.size(); i++) { try { defs[i] = jsondefs.get(i).getString("Name"); } catch (JSONException e) { // TODO Auto-generated catch block e.printStackTrace(); } } uFoodAdapter adapter = new uFoodAdapter(this, R.layout.definition_list, defs); listView1.setAdapter(adapter); ListView lv = getListView(); lv.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { TextView tv = (TextView) view; String p = tv.getText().toString(); Intent i = new Intent(getApplicationContext(), Results.class); i.putExtra("category", p); startActivity(i); } }); btn_bk.setOnClickListener(new View.OnClickListener() { public void onClick(View arg0) { Intent i = new Intent(getApplicationContext(), UFoodAppActivity.class); startActivity(i); } }); } } **ListActivity 2** package com.thickcrustdesigns.ufood; import java.util.ArrayList; import org.apache.http.NameValuePair; import org.apache.http.message.BasicNameValuePair; import org.json.JSONException; import org.json.JSONObject; import android.app.ListActivity; import android.os.Bundle; import android.widget.ListView; public class Results extends ListActivity { ListView listView1; enum Category { Chicken, Beef, Chinese, Cocktails, Curry, Deserts, Fish, ForOne { public String toString() { return "For One"; } }, Lamb, LightBites { public String toString() { return "Light Bites"; } }, Pasta, Pork, Vegetarian } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); this.setContentView(R.layout.definition_main); listView1 = (ListView) findViewById(android.R.id.list); Bundle data = getIntent().getExtras(); String category = data.getString("category"); Category cat = Category.valueOf(category); String value = null; switch (cat) { case Chicken: value = "Chicken"; break; case Beef: value = "Beef"; break; case Chinese: value = "Chinese"; break; case Cocktails: value = "Cocktails"; break; case Curry: value = "Curry"; break; case Deserts: value = "Deserts"; break; case Fish: value = "Fish"; break; case ForOne: value = "ForOne"; break; case Lamb: value = "Lamb"; break; case LightBites: value = "LightBites"; break; case Pasta: value = "Pasta"; break; case Pork: value = "Pork"; break; case Vegetarian: value = "Vegetarian"; } ArrayList<NameValuePair> nvp = new ArrayList<NameValuePair>(); nvp.add(new BasicNameValuePair("request", "category")); nvp.add(new BasicNameValuePair("cat", value)); ArrayList<JSONObject> jsondefs = Request.fetchData(this, nvp); String[] defs = new String[jsondefs.size()]; for (int i = 0; i < jsondefs.size(); i++) { try { defs[i] = jsondefs.get(i).getString("Name"); } catch (JSONException e) { // TODO Auto-generated catch block e.printStackTrace(); } } uFoodAdapter adapter = new uFoodAdapter(this, R.layout.definition_list, defs); listView1.setAdapter(adapter); } } Request package com.thickcrustdesigns.ufood; import java.io.BufferedReader; import java.io.InputStream; import java.io.InputStreamReader; import java.util.ArrayList; import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; import org.apache.http.NameValuePair; import org.apache.http.client.HttpClient; import org.apache.http.client.entity.UrlEncodedFormEntity; import org.apache.http.client.methods.HttpPost; import org.apache.http.impl.client.DefaultHttpClient; import org.json.JSONArray; import org.json.JSONObject; import android.content.Context; import android.util.Log; import android.widget.Toast; public class Request { @SuppressWarnings("null") public static ArrayList<JSONObject> fetchData(Context context, ArrayList<NameValuePair> nvp) { ArrayList<JSONObject> listItems = new ArrayList<JSONObject>(); InputStream is = null; try { HttpClient httpclient = new DefaultHttpClient(); HttpPost httppost = new HttpPost( "http://co350-11d.projects02.glos.ac.uk/php/database.php"); httppost.setEntity(new UrlEncodedFormEntity(nvp)); HttpResponse response = httpclient.execute(httppost); HttpEntity entity = response.getEntity(); is = entity.getContent(); } catch (Exception e) { Log.e("log_tag", "Error in http connection" + e.toString()); } // convert response to string String result = ""; try { BufferedReader reader = new BufferedReader(new InputStreamReader( is, "iso-8859-1"), 8); InputStream stream = null; StringBuilder sb = null; while ((result = reader.readLine()) != null) { sb.append(result + "\n"); } stream.close(); result = sb.toString(); } catch (Exception e) { Log.e("log_tag", "Error converting result " + e.toString()); } try { JSONArray jArray = new JSONArray(result); for (int i = 0; i < jArray.length(); i++) { JSONObject jo = jArray.getJSONObject(i); listItems.add(jo); } } catch (Exception e) { Toast.makeText(context.getApplicationContext(), "None Found!", Toast.LENGTH_LONG).show(); } return listItems; } } Any help would be grateful! Many Thanks EDIT Sorry very tired so missed out my 2nd ListActivity package com.thickcrustdesigns.ufood; import java.util.ArrayList; import org.apache.http.NameValuePair; import org.apache.http.message.BasicNameValuePair; import org.json.JSONException; import org.json.JSONObject; import android.app.ListActivity; import android.os.Bundle; import android.widget.ListView; public class Results extends ListActivity { ListView listView1; enum Category { Chicken, Beef, Chinese, Cocktails, Curry, Deserts, Fish, ForOne { public String toString() { return "For One"; } }, Lamb, LightBites { public String toString() { return "Light Bites"; } }, Pasta, Pork, Vegetarian } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); this.setContentView(R.layout.definition_main); listView1 = (ListView) findViewById(android.R.id.list); Bundle data = getIntent().getExtras(); String category = data.getString("category"); Category cat = Category.valueOf(category); String value = null; switch (cat) { case Chicken: value = "Chicken"; break; case Beef: value = "Beef"; break; case Chinese: value = "Chinese"; break; case Cocktails: value = "Cocktails"; break; case Curry: value = "Curry"; break; case Deserts: value = "Deserts"; break; case Fish: value = "Fish"; break; case ForOne: value = "ForOne"; break; case Lamb: value = "Lamb"; break; case LightBites: value = "LightBites"; break; case Pasta: value = "Pasta"; break; case Pork: value = "Pork"; break; case Vegetarian: value = "Vegetarian"; } ArrayList<NameValuePair> nvp = new ArrayList<NameValuePair>(); nvp.add(new BasicNameValuePair("request", "category")); nvp.add(new BasicNameValuePair("cat", value)); ArrayList<JSONObject> jsondefs = Request.fetchData(this, nvp); String[] defs = new String[jsondefs.size()]; for (int i = 0; i < jsondefs.size(); i++) { try { defs[i] = jsondefs.get(i).getString("Name"); } catch (JSONException e) { // TODO Auto-generated catch block e.printStackTrace(); } } uFoodAdapter adapter = new uFoodAdapter(this, R.layout.definition_list, defs); listView1.setAdapter(adapter); } } Sorry again! Cheers guys!

    Read the article

  • SSE SIMD Optimization For Loop

    - by Projectile Fish
    I have some code in a loop for(int i = 0; i < n; i++) { u[i] = c * u[i] + s * b[i]; } So, u and b are vectors of the same length, and c and s are scalars. Is this code a good candidate for vectorization for use with SSE in order to get a speedup?

    Read the article

  • Virtual Cam - Cam Split .NET

    - by Fish
    I'm looking for a virtual webcam driver to use in a .NET project, this project will be GPL, and have no idea how many installations there will be The idea is that the application is using the webcam without locking the device. Found a couple of programs that do the job, but either in application and/or too expensive: * http://www.softservice.org/products_camsplitter.html (9.99$/installation) * splitcamera.com (program, no SDK available) All idea's are welcome

    Read the article

  • Save UIView's representation to file.

    - by fish potato
    What is the easiest way to save UIView's representation to file? My solution is, UIGraphicsBeginImageContext(someView.frame.size); [someView drawRect:someView.frame]; UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); NSString* pathToCreate = @"sample.png"; NSData *imageData = [NSData dataWithData:UIImagePNGRepresentation(image)]; [imageData writeToFile:pathToCreate atomically:YES]; but it seems tricky, and I think there must be more efficient way to do this.

    Read the article

  • Returning superclass of return type from remote EJB method

    - by fish
    Let's say I have remote interface A: @Remote public interface A { public Response doSomething(); } And implementation: @Stateless public class B implements A { public BeeResponse doSomething() {...} } Where: BeeResponse extends Response. Response is located in the EJB-API jar and BeeResponse is in the implementation jar. Response and BeeResponse have different serialVersionUID. My assumption is that the unmarshalling of the response from B will fail, am I correct?

    Read the article

  • Speed up math code in C# by writing a C dll?

    - by Projectile Fish
    I have a very large nested for loop in which some multiplications and additions are performed on floating point numbers. for (int i = 0; i < length1; i++) { s = GetS(i); c = GetC(i); for(int j = 0; j < length2; j++) { double oldU = u[j]; u[j] = c * oldU + s * omega[i][j]; omega[i][j] = c * omega[i][j] - s * oldU; } } This loop is taking up the majority of my processing time and is a bottleneck. Would I be likely to see any speed improvements if I rewrite this loop in C and interface to it from C#?

    Read the article

  • Why bother to limit the types imported from a python package?

    - by Fast Fish
    When using many IDEs that support autocompletion with Python, things like this will show warnings, which I find annoying: from eventlet.green.httplib import BadStatusLine When switching to: rom eventlet.green.httplib * The warnings go away. What's the benefit to limiting imports to a specific set of types you'll use? Is the parsing faster? Reduces collisions? What other point is there? It seems the state of python IDEs and the nature of the typing system makes it hard for many IDEs to fully get right when a type import works and when it doesn't.

    Read the article

  • How do you create a transaction that spans multiple statements in Python with MySQLdb?

    - by Fast Fish
    I know that with an InnoDB table, transactions are autocommit, however I understand that to mean for a single statement? For example, I want to check if a user exists in a table, and then if it doesn't, create it. However there lies a race condition. I believe using a transaction prior to doing the select, will ensure that the table remains untouched until the subsequent insert, and the transaction is committed. How can you do this with MySQLdb and Python?

    Read the article

  • Variable name as a string in Javascript

    - by fish potato
    Is there a way to get a variable name as a string in Javascript? (like NSStringFromSelector in Cocoa) I would like to do like this: var myFirstName = 'John'; alert(variablesName(myFirstName) + ":" + myFirstName); --> myFirstName:John -- added I'm trying to connect a browser and another program using JavaScript. I would like to send instance names from a browser to another program for callback method.

    Read the article

  • How to switch iostream from binary to text mode and vice versa?

    - by Mad Fish
    I want to read both formatted text and binary data from the same iostream. How can I do that? Why? Imagine this situation: You have different resources, and resource loaders for them, that take a std::istream as a parameter. And there are a "resource source" that provides these streams. Resources can be both text and binary and I need to handle both cases with resource loaders. Or other situation: Image that you have an archive with resources of mixed types. How can I get a text stream from inside the binary archive stream?

    Read the article

  • modalpopupextender and commas appearing in my textbox asp.net

    - by SLC
    Some weird stuff is happening, I am converting an application that used to use javascript to open another web page in a tiny window for data input to use a ModalPopupExtender. It seems to work fine, but in the OK event, when I do txtData.Text (the textbox in my modal popup), it comes back with a comma before the data, so if you type "Rabbit", it comes back as ",Rabbit". Also when I use it multiple times, in another place where I might click to show it, and type "Fish", it starts coming back with stuff like ",Rabbit,,Fish" I don't know why or how to stop it from doing this... any ideas?

    Read the article

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