Showing entries 51 to 60 of 111
« 10 Newer Entries | 10 Older Entries »
Displaying posts with tag: coding (reset)
How Maatkit benefits from test-driven development

Over in Maatkit-land, Daniel Nichter and I practice test-first programming, AKA test-driven development. That is, we write tests for each new feature or to catch regressions on each bug we fix. And — this is crucial — we write the tests before we write the code.* The tests should initially fail, which is a validation that the new code actually works and the tests actually verify this. If we don’t first write a failing testcase, then our code lacks a very important guarantee: “if you break this code, then the test case will tell you so.” (A test that doesn’t fail when the code fails isn’t worth writing.)

Most of the time when I do this, I write a test, it fails because I haven’t written any code yet, and I then go do some kind of …

[Read more]
MySQL challenge: LIMIT rows accessed, not rows returned

Dear reader, this is a challenge. How’s your MySQL prowess? You know about LIMIT: it cuts off the results at the specified number.

mysql&gts; select actor_id from sakila.actor where actor_id % 5 = 0 limit 5;
+----------+
| actor_id |
+----------+
|        5 | 
|       10 | 
|       15 | 
|       20 | 
|       25 | 
+----------+
5 rows in set (0.00 sec)

But that query actually accessed 25 rows. What if I want to say “return up to 5 rows, but don’t read any more than 20 rows to find them?”

Right now I’ve got the following:

mysql> select actor_id, @rows
    -> from actor, (select @rows := 0) as x where
    ->    ((@rows := @rows + 1) <= 20)
    ->    and actor_id % 5 = 0 
    -> limit 5;
+----------+-------+
| actor_id | @rows |
+----------+-------+
|        5 | 5     | 
|       10 | 10    | 
|       15 | 15    | 
|       20 | 20    | 
+----------+-------+
4 rows in set (0.00 sec)

The …

[Read more]
MySQL Workbench progress update on Linux port

As you probably know, or at least heard, we are currently porting Workbench to Linux. Generally speaking the porting process is split in several stages. The first one is to compile non-GUI Back-End which represents about 80% of the total application code. The next stage is to ensure that unit-tests are run correctly for the ported stuff. The third is to create user interface and to bind it to the back-end/core. After that we will have alpha version of Workbench for Linux.
Regarding tests, actually a portion of unit-tests are already passed. These are 121 of 122 going well. At the moment we are working on non-GUI back-end, and core part is compiled and run, so now the modules and plugins are in progress. I must admit that process of porting is pretty smooth, most of the code has already been prepared with Linux/OS X ports in mind. I will be posting our progress on the porting efforts frequently, please keep checking our blog.

Live from the Workbench Kiev Meeting

It is 23:30 here in Kiev and we are closing the first day of our team meeting.

After my Kick-Off and general discussion of the road-map Tax took over and was discussing the QA aspect of our WB 5.0 releases so far. We analyzed the rate of incoming bugs vs. the number of bug fixes and the time spans between Alpha, Beta, RCs and GA releases. That helps us to make better predictions in the future.

After the lunch break Alfredo presented his conversion of the GRT (WB core system) from the current C implementation to a cleaner C++ version and we forgot about the time discussing all the details of this complex tasks. We will squeeze in the rest of the planned sessions for today (Linux Porting Challenges, Feature Discussion - Visual Query Builder) tomorrow morning - but this was a very important discussion to have.

We went out for dinner and just as we walked outside it started raining. The center of Kiev is very beautiful and …

[Read more]
MySQL Workbench Team Meeting Coming Up

After our MySQL Workbench 5.0 GA release and a hotfix release a week later it is time to start our efforts on the next releases. As many of you might already know, my team is highly distributed and when doing planning tasks it is always good to sit together in a single room. So we will be meeting in Kiev, Ukraine next week.We are going to discuss the progress we have already made on the Linux / OS X / Solaris ports but the main focus will be in the new features for the next main release.A big thank you to everybody who posted their ideas on the forum. If you have not posted yet you are welcome to do so. Everything that is submitted before next week will be considered.

Next MySQL Workbench 5.0.20 Release Almost Ready To Ship

As promised we are continuing our strong efforts after reaching GA and our announcement at the MySQL Users Conference (find a nice press article here).

Alfredo managed to fix a serious bug that almost seemed to be of random nature and happened on certain OnMouseDown and OnMouseUp events on the canvas.

Another thing that got improved is the drawing order of connections between table figures on the canvas. Previously the connections would be drawn on top of tables, resulting in a messy image. Now connections are always drawn behind tables. To make that work we had to remove the nesting of layers - a feature that does not really make sense for a database tool anyway.

The team will meet in the week of May 12th in Kiev where we are going to define the detailed plans for Workbench 5.1 and 5.5. Until …

[Read more]
Opensource GoogleGears

The last day I’m suffering from different thoughts. So I’ve decided to share’em with you.

It is really possible to create the application such as gears, but independent from Google, that will run on most platofrms and browsers. What we need:

  • Compile embeded MySQL (very lite edition) for most platforms (Windows, Linux and MacOSX, I believe that would be enough)
  • Create Java Applet and JNI-wrapping library to access MySQL
  • Create JavaScript library that will access MySQL through the applet

And that’s all. To use it you will need just to include the applet and JS-library into your page, after the first load applet will detect platform and will download embeded MySQL and native libraries.

How to install and maintain multiple WordPress blogs easily

My wife has a site that needs two WordPress blog installations. The URLs differ by a subdirectory name. Both blogs need to be (URL-wise) subdirectories of /blog/. They need to be completely independent of each other, yet use the same custom theme. And there used to be just a single blog, which was not in a subdirectory; its permalinks must not break. (It has nice URLs with the date and title in them, not post ID-style URLs). And because I’m the husband, I get to maintain it, so tack “easy to maintain” onto the requirements (it must be easy to upgrade WP in both blogs, for example). In this article I’ll show you how I did it with a single .htaccess file, a single copy of WordPress, two MySQL databases, and a single configuration file.

Fixing URLs

As I mentioned, there used to be a blog at /blog/ which must not break. Suppose this blog was about dogs and my wife has recently started blogging about cats. She wants two …

[Read more]
MySQL Workbench Release Candidate Coming Up

With the great help we receive from community and SE Beta testers we are marching towards RC quality with large steps. This week we hope to remove the last obstacles (mostly printing, some canvas problems and some synchronization problems) that are holding us back and to be able to close all open P1 & P2 bugs. If we achieve all this we will upload the RC1 (Release Candidate 1) build.

As a bonus we have now added the much requested “direct connection” notation between columns (better know as MS Access style notation) to the Standard Edition - a feature that has been requested since the old DBDesigner4 days. Personally, I am not so found of this notation because it limits the connection points to the left and right of the individual PK- and FK-columns which makes it harder to have a nice looking model. But given the flexibility of Workbench to hold an unlimited number of smaller diagrams this might solve this problem for most I hope. …

[Read more]
A very fast FNV hash function for MySQL

I wrote a User-Defined Function that implements the FNV (Fowler-Voll-No) hash function for MySQL. I’m not the first person to do this — in fact, I was inspired by the Google patches for MySQL. But my implementation is a little bit different from most, in a very important way that leads directly to much higher performance, especially suited for the Maatkit tools.

A bit of background: FNV hashing is a very fast hash algorithm that operates in fixed memory. It is widely used in lots of important areas in computer science. My implementation requires absolutely no malloc() calls, which is a darn good thing because I am not to be trusted with malloc(), having spent too …

[Read more]
Showing entries 51 to 60 of 111
« 10 Newer Entries | 10 Older Entries »