Oracle: How to search for a table or column in a big database

I needed to find columns containing a certain string. That is, the name of the column should contain that string. Actually not too difficult to do :)

SELECT TABLE_NAME, column_name
FROM all_tab_columns
WHERE column_name LIKE '%FOO_ID%';

That gives you a nice list of all columns containing FOO_ID and what tables you find them in. Fantastic! Now, back to work…

MySQL: How to clone a table

Ever wanted to, for some reason, clone a database table? Don’t really want to export anything or figure out what statement was used to create that table? Turns out that’s a lot easier to do than I thought it was.

Continue reading

Anti-patterns

In software engineering, an anti-pattern (or antipattern) is a pattern that may be commonly used but is ineffective and/or counterproductive in practice. — Wikipedia

If you go to that Wikipedia article, I discovered that you’ll also find a very good list of common anti-patterns. I really recommend that you go read them. Familiarize yourself with them. I’ve seen several of them in projects I have been on, and I have most definitely fallen for several of them myself as well.

Knowing about anti-patterns will most likely make you a better software developer and if you’re a software developer, I sure hope you wish to become better at it! I guess some people might not want to get better, but I sure do. And if you feel the same, go now and read that list :)

How to set JAVA_HOME and where is whereis on Solaris?

To set the JAVA_HOME environment variable you first need to find where your Java installation is located and then set it somehow.

Continue reading

PHP: cURL SSL Verification

While trying to figure out of PayPal Payment Data Transfers I came over an issue that caused my cURL requests to fail.

Continue reading

AppleScript: Get name of files in a folder without extension

Have been dipping my toes into some AppleScript today. Boy do I prefer languages that are not so wordy and English… And boy is some things not the easiest to do… Anyways, I wanted to get the names of all files in a certain folder. This is quite easy, but the twist is that I didn’t want the file extension. This was not so easy…

So, in case anyone else needs to do this, or if anyone would happen to have a better, or faster, or more robust way to do this, I share it here. Please comment if you do know of anything which can improve it.

Continue reading

MySQL: Filtering with Regular Expressions

Today I wanted to list all all users in a database who had been too lazy to uppercase the first letter in their name. But how can you do that in MySQL? With regular expressions such a check would be easy to write, but this was in MySQL, not in for example PHP… but wait a minute… MySQL actually supports Regular Expressions? Yes, it does! I honestly had no clue.

Continue reading