Friday, August 3, 2012

MySQL VS Oracle SQL

Listed below are ways to achieve the same in Oracle SQL as in MySQL:

The equivalent of LIMIT in MySQL is ROWNUM in Oracle SQL:
MySQL: SELECT * FROM table LIMIT 10;
Oracle SQL: SELECT * FROM table WHERE ROWNUM <= 10

Solution found at: http://www.delphifaq.com/faq/databases/oracle/f594.shtml

Thursday, July 26, 2012

Stop Firefox download window from blinking

The window that opens when you download a file in Firefox may sometimes be annoying, either because it pops up when you're trying to do something else or that the button/window on the windows taskbar starts to blink.

Firefox lets you disable these features through its advanced properties. Enter about:config into the address bar of Firefox, accept the "I'll be careful, I promise!" warning. Then enter one of the following in the Search field at the top:

browser.download.manager.flashCount - set to 0 (zero) to disable blinking in windows taskbar.

browser.download.manager.showWhenStarting - set to false to prevent the download window from showing at all (it won't open if it's not already open) when you start a download.

browser.download.manager.focusWhenStarting - set to false to keep the download window from stealing focus/showing when a download starts.

Almost directly copied from http://superuser.com/questions/63762/is-there-way-to-disable-download-bar-blinking-in-firefox, thanks to Adam Ryan. :)

Tuesday, May 29, 2012

Windows Phone 7 podcast workaround

In any other country than the U.S., podcasts are not available in the WP7 marketplace. To get podcasts you can either use a third party app (like Simply Podcast which streams your podcasts when you requests them) or use the Zune software on your computer.

This might sound horrible, "I have to connect my phone to my computer to get podcast like some ipod". However, once you've added the podcast to your phone in the Zune software you can then go to Music+Videos on your phone, select Subscribe and have your phone automatically download the latest episodes when it is connected to a Wifi network.

Just slightly annoying. :)

Tuesday, March 27, 2012

Android SMS & MMS Backup

If you want to backup your SMSes and MMSes from your Android phone I found 2 apps to do this:

SMS Backup & Restore by Ritesh Sahu - Excellent for backing up your SMSes to an XML with included XSL file for easy reading in a webbrowser.
Save MMS by Andrew Schwimmer - Let you save MMS images one by one, ok if you don't have more than maximum a couple of hundred MMS images to save.

They both save data to your SD card which you can then copy when connecting your mobile to a computer or just pop in the SD card in a pc with a card reader.

Thx to for SMS backup: http://androidforums.com/htc-droid-incredible/281188-sms-mms-back-up.html,

WP7 Marketplace app not available

When first trying to use the Windows Phone 7.5 Marketplace you might get the message "This might be because your phone software needs to be updated, the application is exclusive to a different mobile provider, or the app is not available in your region". Especially if you live outside of the US or UK.

To fix make sure your regional settings on the phone (Settings -> system -> region + language) are set to the same as your Windows Live ID that you are using for your phone.
Apparently you might also want to set region settings for Zune.net (I did not have to do this).

Read this on http://answers.microsoft.com/en-us/winphone/forum/wp7-sync/market-place-not-availavle-for-your-region-yet/74c7a9fd-34cd-4bd7-8349-59f07fcf923a#1a7f23cc-80ef-473a-9f94-e2d7fcac7379

Wednesday, March 21, 2012

MySQL specify index without FORCE INDEX

Here's a blog post from Shlomi Noach which displays some useful steps to consider when optimizing MySQL querie where MySQL chooses an inefficient index.
It helped me. Especially the part about tricking MySQL to not use an index, without using USE INDEX or FORCE INDEX (which can be very bad if you have a dynamic query or your tables change/grow, something they usually do).

http://code.openark.org/blog/mysql/7-ways-to-convince-mysql-to-use-the-right-index

Note that Solution #7: Make MySQL think the problem is harder than it really is can also be applied to GROUP BY. e.g. GROUP BY id, type, level

Tuesday, March 6, 2012

Notepad++ Replace using Regex

One of the best features of Notepad++ is the search and replace. You can either use normal search, extended (so you can search for newlines (\n) and tabs (\t)), or regular expressions.

Regex is great for massaging data into the form you want to input into another program.

One case I often have is long lists of output from a PHP script using var_dump() which I want to paste into an Excel spreadsheet. But I need to remove the preceding "string '" and the trailing "' (length=<length of string>)" for the data to make sense.

To remove the starting "string '", just use a normal search (since the string is the same on all lines). To remove the ending we need to use regex since the <length of string> value can vary, using the regular expression search \' \(length=.* should do the trick.