Maggie Nelson

Archive for July, 2007

Primary sources

by maggie on Jul.19, 2007, under entry

While there are many Oracle-related blogs, articles, updates and random musings available on the Interweb, I keep coming back and back again to three sources.
1. Oracle Docs – everything you ever needed to know about Oracle is here. And by everything, I do truly mean everything. This is a very powerful tool, but great in size as well and as such, sometimes difficult to sift through.
2. Ask Tom – Tom Kyte has been using Oracle since 1988 and has been working for Oracle since 1993. This site is where you can ask Tom to provide answers to common questions and solutions to common problems you may encounter as a database developer. It is basically a place to turn the theory of Oracle Docs into practice.
3. The Art of SQL by Stephane Faroult with Peter Robson. Oracle documentation teaches you the skills to interact with Oracle and Tom Kyte teaches you how to interact with it wisely. This book takes the knowledge and skills you already have and makes you consider them in situations you encounter in real life.
Writing queries is not only about getting the data that you need. It is also about getting ONLY the data you need, making sure the data can be returned to you fast and that you can do so regardless of how large is the set of data you are querying. (And many others things – read the book to find out more!)
It is written beautifully and sometimes you will find yourself shamelessly using quotes from it, such as:

“denormalization advocates often suggest it at an early stage in the hunt for “performance” – and in fact often at a point in the development cycle when better design (or learning how to use joins) is still an option.”

Leave a Comment more...

How to (and how not to) pass an array from PHP to the database

by maggie on Jul.15, 2007, under entry

It would be really useful to have an easy way to pass arrays as bound parameters to queries or procedures from PHP. This would be especially useful if you’re letting Oracle handle most of your data manipulating (as you should).
One example I see time and time again about how to (mis)manage array functionality in PHP’s interaction with the database is the simple “insert more than one record” problem:

$userId = 'some user ID';
foreach($toys as $toy) {
$query = "insert into user_toy (user_id, toy_id) values (:user_id, :toy_id)";
$stmt = $dbh->prepare($query);
$stmt->bindParam(':user_id', $userId);
$stmt->bindParam(':toy_id', $toy['id']);
$stmt->execute();
}

Now let’s talk about what’s wrong with this implementation and how to fix it.

(continue reading…)

1 Comment more...

On the bandwagon

by maggie on Jul.04, 2007, under entry

I was planning on sticking with my Nokia E62. It calls people, it stores my address book, it can ssh. What more could you want from a phone? I thought having a pretty decent phone would make me immune from the iPhone madness. And it did – unfortunately only for approximately 8 hours of my husband having one and showing it off all day. By 8pm on Saturday, my patience and self-control were gone and I got one, too.
So far it’s pretty awesome. The beautiful thing is that there is only one button. I call it the panic button – you press it when you don’t know what to do!
Here are some downsides:
- no ssh (I have never been able to get away from pine for e-mail, so not being able to ssh into the machine with my mail is kind of sucky.)
- the camera should take videos as well
- not able to turn off the text auto-correct. While automatic typo fixing might be great in 95% of the case, it doesn’t work so well when you’re typing in a language that’s not English. Words such as “z” and “w” are real words in Polish and they really shouldn’t be auto-corrected into “a” all the time
- no visible file system – how files (e.g. photos) are stored is kind of auto-magical. It’d be nice to see more.
The upsides definitely outweigh the downsides, though. It’s as easy to use as everyone claims. Plus, there’s no doubt that most of the issues I have with this phone will be fixed in upcoming software and firmware updates. Hooray!
Yay, gadgets!

Leave a Comment more...

Going to Atlanta (via php|works)!

by maggie on Jul.02, 2007, under entry

Two of my proposals were accepted to the php|works 2007 conference! w00t!
The talks that were accepted were:
You Don’t Need a DBA or What Every PHP Developer Should Know about Database Development
No amount of optimizing can be a substitute for proper design. This talk will focus on good practices when designing a database, ranging from learning how to preserve referential integrity, through proper indexing to optimizing techniques such as denormalization. This talk is meant for developers who would like to make the jump from writing basic SQL queries to more advanced database tasks.
How to Optimize a Database Query
Through a series of examples, this talk will explore how a database query can be optimized for the specific task it is meant to perform. Common themes when optimizing queries: learning what kind of data to expect, assessing your needs, finding the balance between not enough and too many indexes, and utilizing alternate solutions such as denormalization. As the sample queries are dissected to make them better and faster, I will use Oracle’s EXPLAIN PLAN to illustrate how the database is attempting to retrieve data.
Now I gotta go practice public speaking…

Leave a Comment more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Tags

RSS Planet PHP

  • Getting started with the Midgard content repository
    I'm doing a talk today in the Bossa Conference about using Midgard as a content repository for mobile applications. As part of my presentation I wrote some simple example code for using the Midgard APIs in Python, and thought they would be good to share to those not attending the event as well. The idea of a content repository is that instead of coming […]
    Henri Bergius
  • Neural Networks in PHP
    Neural Networks in PHP By Louis Stowasser Neural networks allow emulating the behavior of a brain in software applications. Neural Networks have always had a too steep learning curve to venture towards, especially in a Web environment. Neural Mesh is an open source, pure PHP code based Neural Network manager and framework that makes it easier to work with […]
    PHP Classes
  • CMS Watch on their Midgard usage
    Which CMS does The Real Story Group Use? (Tony Byrne / CMS Watch): The answer is, we use an open-source platform called "Midgard." We picked it nearly ten years ago, and it has held up fairly well.... One of the things we like about Midgard actually makes it rather unsuitable for many simpler publishing scenarios: it is highly object-oriented. This […]
    Henri Bergius
  • Upgrades In Open Source
    PHP 5.3 has been out now for eight months, and in that time lots of projects have made decisions to begin developing against this version of PHP. Juozas Kaziukenas makes the argument that you shouldn’t be afraid of PHP 5.3 and he provides a number of excellent points to support his argument. I don’t dispute [...] […]
    Brandon Savage
  • Seed doc updates, and Gio async directory listing
    The documentation for seed gobject introspection is improving continually, I now have a jhbuild virtual machine, which is picking up the latest versions from git.In addition many of the documentation details have been expanded, includingInterfaces, Enumscallback methods are now documentedMore libraries have been added.More doc comments can be picked upWith b […]
    Alan Knowles