Home |  MySQL Buzz |  FAQ |  Feeds |  Submit your blog feed |  Feedback |  Archive |  Aggregate feed RSS 2.0 English Deutsch Español Français Italiano 日本語 Русский Português 中文
Previous 30 Newer Entries Showing entries 61 to 90 of 103 Next 13 Older Entries

Displaying posts with tag: coding (reset)

Maatkit on Ohloh
+0 Vote Up -0Vote Down

Sheeri wrote a post (now a 404 error) referring to Maatkit on Ohloh, which I have never heard of before. I took a look at what Ohloh thinks about Maatkit. It's kind of neat. Beyond just the obvious "social website" stuff that's all the rage these days, it actually looks at the project's SVN history, analyzes the codebase, and so on.

It also estimates 8 person-years of work have gone into the project, and says that at $55,000/year it would cost $450,702 to write the code as it currently exists, which is kind of funny. It took me a whole lot less than 8 years to write. (Perhaps this is why that salary strikes me as unrealistic).

It has a couple of other interesting things, like a visual timeline of source

  [Read more...]
Progress on Maatkit bounty, part 2
+0 Vote Up -0Vote Down

Ironically, the Stream algorithm I wrote as the simplest possible syncing algorithm does what the much more efficient algorithm I wrote some time ago can't do: sync a table without a primary key, as long as there are no duplicate rows. In fact, it's so dumb, it will happily sync any table, even if there are no indexes.

The flash of inspiration I had on Friday has turned out to be good...

Progress on Maatkit bounty
+0 Vote Up -0Vote Down

My initial plans got waylaid! I didn't pull out the checksumming code first, because the code wasn't at all as I remembered it. Instead, I began writing code to handle the more abstract problem of accepting two sets of rows, finding the differences, and doing something with them. I'm ending up with a little more complicated system than I thought I would. However, it's also significantly simpler in some ways. Instead of just passing references to subroutines to use as callbacks, I'm object-ifying the entire synchronization concept...

Maatkit bounty begins tomorrow
+0 Vote Up -0Vote Down
Tomorrow is the first of five days I will spend working on mk-table-sync, the data synchronization tool I developed as part of Maatkit. The first thing I’ll do is pull the row-checksumming code out into a module and write a unit test suite for it. I’ll probably add the code to the module [...]
Growth limits of open-source vis-a-vis MySQL Toolkit
+0 Vote Up -0Vote Down

Si Chen wrote recently about the growth limits of open-source projects. He points out that as a project becomes larger, it gets harder to maintain. I can only agree. As the MySQL Toolkit project has grown, it's become significantly more work to maintain, document, and enhance.

How I built the NOW_USEC() UDF for MySQL
+0 Vote Up -0Vote Down

Last week I wrote about my efforts to measure MySQL's replication speed precisely. The most important ingredient in that recipe was the user-defined function to get the system time with microsecond precision. This post is about that function, which turned out to be surprisingly easy to write.

Google Test Automation Conference, Day 1
+0 Vote Up -0Vote Down

I'm attending the Google Test Automation Conference (GTAC 2007) in Manhattan, New York right now. It's a two-day single-track event hosted by Google, with mostly non-Google speakers. It's okay, but not great.

Luhn (scheme implementation)
+0 Vote Up -0Vote Down
(define luhn-check
  (lambda (ccn)
    (define csum 0)
    (define num 0)

    (do ((i (string-length ccn) (- i 1)))
      ((<= i 0) (print csum))

      (set! num (string->number (substring ccn (- i 1) i)))
      (if (> (modulo i 2) 0)

                         (set! num ( * 2 num))
                         (if (> num 9) (set! num (- num 9)))))

      (set! csum (+ num csum))
;; test case
(luhn-check “4561261212345467″)

And here is implemented with MySQL.

storm being added to the pybots project
+0 Vote Up -0Vote Down

Of course you’ve heard about the fabulous pybots project, where community members have a distributed network of computers continuously testing every change in the development version of python against the development version of many different python applications. This ensures that any compatibility problems are caught early, well before the next version of python is released.

I’ve just about finished getting storm, the newly open sourced python object-relational mapper that we are using with Launchpad and Landscape, added into the pybots test suite. Just need to finish reading through an 18MB test log to figure out what I did wrong in the test script for the psycopg2 installation, and we should be all set, with storm being tested against MySQL, Postgresql, and SQLite. Rumour has it that Firebird support is coming soon (perhaps even ahead of Oracle?).

MyWebEr - creating documentation on the fly
+0 Vote Up -0Vote Down

In my last post I’ve asked for any help on my project. So, tanks to Jay Pipes for his tip.
One of most developer problems is documentation. And a good solution was initially appeared in Java with javadoc. At now many languages have special javadoc-like tools. I’ve made a little research, and decided to use jsdoc and phpdoc in my project. I am still open for any suggestions

MyWebEr - info
+0 Vote Up -0Vote Down

So, now I am working on this project. This project is a part of google SoC. I believe in the end it should be something like mysql workbench, but web-two-zerofied. At current moment there is not much to look into (http://myweber.googlecode.com/svn/trunk/). But I will be very grateful to you for any comments, questions and suggestions.

Why I write Free Software
+0 Vote Up -0Vote Down

Brian Aker was a recent guest on the LinuxCast podcast with Don Marti. Brian has some interesting thoughts in this podcast and elsewhere on his blog, on motivations for writing Free and/or Open Source software. Here's why I do it myself.

A challenge: partition a character set in MySQL
+0 Vote Up -0Vote Down

How good are your SQL and/or general coding skills? I have a specific challenge I'd like your help solving. I am not sure it's possible, but I'd love to be proven wrong.

I need your advice on how to package MySQL Toolkit as one file
+0 Vote Up -0Vote Down

Since starting the innotop and mysqltoolkit projects on Sourceforge, I have learned a lot about how to use source control more effectively -- especially how branching and tagging can be used. Still, I have limited experience. I want to package all the tools in MySQL Toolkit together and release them in one archive, but I don't know the best way to do it; every idea seems to have drawbacks. Read on for the details, and if you have suggestions, would you please leave comments for me?

PowerShell + MySql
+0 Vote Up -0Vote Down

Today, doing one small task I thought: “Why can’t I do it with PowerShell?”
So, here is a small example:


$myconnection = New-Object MySql.Data.MySqlClient.MySqlConnection
$myconnection.ConnectionString = "server=localhost;user id=test;password=test;database=test;pooling=false"

$mycommand = New-Object MySql.Data.MySqlClient.MySqlCommand
$mycommand.Connection = $myconnection
$mycommand.CommandText = "SHOW TABLES"

$myreader = $mycommand.ExecuteReader()

while($myreader.Read()){ $myreader.GetString(0) }

c:\devel\mysql\ps\MySQL.Data.dll - that is a connector

PowerShell is a quiet new thing, so I believe it could be helpfull.

Luhn algorithm
+0 Vote Up -0Vote Down

Luhn algorithm can be used on Credit Card number verification stage.
So, probably, it could be usefull for somebody else.
Here is my implementation:

  DECLARE i, mysum, r INT;

  SET skip = TRUE;
  SET mysum = 0;


  WHILE i > 0 DO
    IF NOT skip THEN
      SET r = SUBSTRING(CC, i, 1) * 2;
      SET mysum = mysum + IF(r > 9, r - 9, r);
      SET mysum = mysum + SUBSTRING(CC, i, 1);
    END IF;

    SET i = i - 1;
    SET skip = NOT skip;

RETURN IF((MOD(mysum, 10) = 0) AND mysum  0, TRUE, FALSE);

More elegant solutions are welcome.

And here it is implemented with PLT Scheme.

The tricky thing?
+0 Vote Up -0Vote Down

… is how to get the last day of current quarter.

RETURN last_day(CONCAT(YEAR(thedate) , ‘-’, QUARTER(thedate)*3, ‘-01′));

And I can not find other solutions. It is interesting if it is the only way.

that dream where you are working or are a computer
+0 Vote Up -0Vote Down

This person dreamed that they were trying to compile part of Firefox, and the compile button was actually the snooze button on the alarm clock. I experienced a similar dream years ago: I dreamt I was a debugger, and this breakpoint kept firing (the breakpoint turned out to be my alarm clock).

Anyone else had dreams that you were a computer? Or a MySQL storage engine? Or a compiler?

Good paper about distributed development teams.
+0 Vote Up -0Vote Down

Distributed development teams are becoming more and more commonplace - truly distributed teams with individual members living around the globe, not just a big company which happens to have independent teams in several different countries. The MySQL development team is organized this way, as are many other projects.

A new paper is available from Andrew Bennetts about distributed development: Coding in a Distributed Team: Testing, Reviewing, Sharing and Merging Code Without Going Crazy. This is definitely worth reading for anyone who does MySQL development even if you don’t consider yourself a developer - there are ideas in this paper which can make the life of both developers and operations folks much better.

  [Read more...]
what does it really mean to improve development processes?
+0 Vote Up -0Vote Down

Every day I talk to many engineers and managers who want to be better. Better at developing software, better at shipping software, better at reacting to change in the marketplace, better at preserving backward compatibility, better at integrating new technologies, better at working efficiently, better at preventing and detecting bugs and errors, and so on.

I have often heard arguments that essentially say “all we need is a formal written process and things will be better”. I’ve consistently argued against that mindset, since I believe that principles are much more enduring than rules, and writing many rules often prevents people from doing the right thing.

You should all read this post from Jeff Patton why the best software design

  [Read more...]
linux on laptops
+0 Vote Up -0Vote Down

I bought a new personal laptop a few weeks back, and I’ve been using it enough to final post a short review. I’ve run linux on several different laptops over the years, and it’s always been kind of tough. Even supergeeks endure a lot of teasing at conferences about getting wireless networking configured.

This time, I went with System 76, who offer laptops with Ubuntu preinstalled. Definitely the right choice! I chose a Gazelle, which is not quite as sleek as my previous MacBook. It is blazing fast. I was amazed at how quickly I was able to be productive with Ubuntu preinstalled and working perfectly: NetworkManager means my wireless connection works even better than on the MacBook, suspend to RAM and hibernate to disk worked flawlessly, and it

  [Read more...]
MySQL case sensitivity
+0 Vote Up -0Vote Down

A good rule to remember - all is case sensitive (talking about identifiers), even if it is false it will help you to avoid many problems. But really in MySQL are case sensitive only table and database identifiers and only on platforms with case-sensitive filenames (Linux/Unix). It is so because tables and databases are represented as files (filenames are used as identifiers). And I think there is nothing good in such behavior because it complicates databases portability.

It is interesting, and what about MSSQL and Oracle.

Five great Perl programming techniques to make your life fun again
+0 Vote Up -0Vote Down

If you're a programmer, you know the difference between a beginner and a master is the ability to write succinct code that does a great deal with very little work. If you can do this, you can easily raise your productivity and the quality of your work by an order of magnitude. Much more importantly, you can have a lot more fun writing code. Read on to learn how.

MySQL new password problem
+0 Vote Up -0Vote Down

This morning is rich for troubles
Some PHP script was to act with MySQL database, but it failed with: “Warning: mysql_connect(): Client does not support authentication protocol requested by server; consider upgrading MySQL … Client does not support authentication protocol requested by server; consider upgrading MySQL client“.
I’ve digged a bit and solution was very simple -
SET PASSWORD FOR user@localhost = OLD_PASSWORD(?newpassword?);
This updates password to use old authentication protocol.

Python 2.5 released, the new ?with? statement will be great for database use
+0 Vote Up -0Vote Down

The final release of python 2.5 is out! The list of what’s new is pretty impressive, but I’m especially happy to have the new “with” statement. Ruby has block methods, or closures, which can be used for doing very clean setup/cleanup. While full-blown Anonymous block statements were rejected from Python, the new “with” statement handles the part I care about: making it easier to write code that works correctly in the case of failures.

The 3 typical use cases are a file that needs to be closed, a lock that needs to be released, and and a database

  [Read more...]
MySQL python connector now being tested in PyBots project
+0 Vote Up -0Vote Down

The PyBots project (http://pybots.org/) is a way for people to run tests for python applications using Python binaries built from the very latest source code from the Python subversion repository. The idea is brilliant, and has application far beyond the Python project.
As Grig Gheorghiu previously announced on his blog, I’ve set up a buildslave testing MySQLdb, the python connector for MySQL. I’ll probably try to set up tests for SQLAlchemy next. You can see the builder status page here, my builder is named ‘amd64 Ubuntu Dapper trunk’.
Instructions for how to set up a

  [Read more...]
Role-based access control in SQL, part 2
+0 Vote Up -0Vote Down

This is my second article on how to build a role-based access control system in SQL. In the first article I gave a high-level overview of access control systems in general, especially in the web-application context, and talked about how some are implemented. I introduced the problems I designed my system to solve, and gave a roadmap for where this series of articles will end. I finished that article with a sketch of some basics to provide row-level read, write, and delete access control.

This article picks up where I left off. I want to revisit some things I swept under the rug in the first article, because I didn't want to throw all the complexity in at once. I'll explain my current system's full functionality, which includes roles, type checking, table-level and set-level privileges, and more. I will show you the design in great detail, and give working

  [Read more...]
How to build role-based access control in SQL
+0 Vote Up -0Vote Down

The posts I've been reading and writing recently have reminded me how Object-Relational Mapping (ORM) systems make it fun and convenient to interact with databases. For some of the reasons they're a developer's favorite, they can be a database administrator's nightmare (think surrogate keys). But designing tables with a consistent set of columns has its benefits. Just because the columns are meta-data that have no intrinsic meaning doesn't mean they have no value. In this series of articles I'll show you several ways to use such "meaningless" meta-data to enable powerful, efficient application-level role-based access control (RBAC) in the database, with a focus on web applications, though you could do this for any application.

The systems I've built are complex, so I'll split this into at least two articles. This first

  [Read more...]
Four types of database abstraction layers
+0 Vote Up -0Vote Down

Quite a few people have chimed in on a recent discussion about PHP, MySQL, database abstraction layers, and performance. I think enough viewpoints have been covered that I don't need to comment, but one question I don't see answered is "what are the qualities of a good SQL abstraction layer?" I think it's a very interesting -- and complicated -- question. As it turns out, the term has several meanings, and I think it's important to understand them. In this article I explain one way to categorize different types of database abstraction layers, the goals for each, and some useful success criteria.

So you think your code is in version control?
+0 Vote Up -0Vote Down

"My code is all in version control," Joe said proudly. "Everything is versioned. I'll never lose any work." But then he lost some "other" code he didn't realize was critical. This article is about how to find and safeguard all the hidden code you don't know your business relies on.

Previous 30 Newer Entries Showing entries 61 to 90 of 103 Next 13 Older Entries

Planet MySQL © 1995, 2014, Oracle Corporation and/or its affiliates   Legal Policies | Your Privacy Rights | Terms of Use

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.