|
SQL
|
|
Saturday, 24 September 2011 14:47 |
|

In this short article I will describe how I went about deleting multiple database tables quickly without using the DROP DATABASE dbName statement. Feel free to skip right to the solution if you like. Background StoryAs part of changing one of our sites over to a new server I had to delete the existing Joomla database and import the sites actual database, which was exported as a mysql dump. Easy right? All you need to do is drop the database and create a new database. But I did not have permission to do this. In fact, I had very little knowledge of the environment and how it was initially set up, I was called to help get the site back online again. At this point it was obvious that I would need to use DROP TABLE tableName statements, but since joomla has quite a few tables and its extensions also have their own table. There were about 102 tables in total. Doing this manually seemed insane (we programmers do not like hard work :) ). So the first thought that jumped to mind was, I know, I will write a program to do this. But wait, what about input for that program? Well, there is a command to list all the tables in mysql SHOW TABLES which will list all the tables in the currently selected database. Great, so now all I have to do is to parse the data, maybe add it to a list, python's comma seperated list syntax should do. Finally, as I was manually going over the output I got from the show tables command, changing it to be an list in python, it hit me. Why do I need to do all this work to begin with? There is a much better way.
|
|
Last Updated on Sunday, 25 September 2011 15:32 |
|
|
Javascript
|
|
Saturday, 20 August 2011 16:07 |
Turns out it is not as easy as one might think to get the
correct z-index of an element using a javascript call like
$(element).css(‘z-index’). The problem is how browser vendors apply the z-index
to an element. But, no worries I have created a jsfiddle page to demonstrate
the problem and more details on how it works will follow below.
|
|
Last Updated on Wednesday, 24 August 2011 22:12 |
|
Python
|
|
Tuesday, 17 May 2011 22:36 |
|
This article will walk you through creating a python script to download all files on a web-page as fast as possible. The same script can then be used to download all sorts of content on the web, especially when combining the code with a web crawler.
Fig 1. Automatic Downloader output on Windows 7
|
|
Last Updated on Tuesday, 16 August 2011 22:49 |
|
|
C/C++
|
|
Saturday, 20 November 2010 13:37 |
|
OpenGL is a very powerful graphics library that is more commonly used for 3D graphics, but what about 2D graphics? Well there is little to no documentation on how to use it for a pure 2D application. This is exactly where this article comes-in.
|
|
Last Updated on Monday, 27 December 2010 18:56 |
|
PHP
|
|
Tuesday, 27 July 2010 23:03 |
|
If you ever tried inserting javascript into a Joomla article you may find it is a very difficult task; so, I went a head and made a plug-in to make this fast and easy. The reason why joomla makes it so difficult is because cross site scripting (XSS) vulnerabilities are very devious and can compromise the entire application. In this very short article I will explain how I created the plug-in and when and how you should use it.
|
|
Last Updated on Monday, 18 April 2011 14:13 |
|
|
|
|
|
|
Page 1 of 2 |