development
Announcing Bloomington PHP
by chance on May.28, 2010, under php, user groups

- Image of PHP Community
I'm going to be ganking some of the announcement structure from Jeremy Kendall's Memphis PHP Announcement who apparently ganked stuff from @ramsey.
I'm proud to announce that Bloomington, Indiana now has a PHP user group. We also acknowledge the greater Central Indiana area.
The goal of this organization is to take over the world help out php users, dabblers, students , and professionals in the surrounding area while encouraging an active developer community. So far we've garnered a decent amount of members in our google group.The amount of activity behind the scenes of the group has been awesome. Matt Hottell, a Lecturer at Indiana University for the School of Informatics has promised to shamelessly plug notify his students of the PUG (in retrospect, I could've probably shortened the group name) and @_drogers has created a Bloomington Web Developers google group to include more developers in our area that work with more than just PHP. I hope to see more growth in the future and appreciate the efforts given so far. This is, after all, a community effort and I can not do this without the support of the community.
Origin Story
PHP has always been a community experience for me. From the start of learning PHP in my Informatics classes to the mentorship I received from the Resite Sproutbox team, I've seen just how awesome the PHP Community is. It wasn't until last year's php|tek that I wanted to branch that community out into the area I live in. This year's tekx gave me that final push to put things in motion to achieve that dream. I'd like to thank @caseysoftware and @dragonbe for their help and encouragement that made this a reality.
Details
- Since the current members of the google group already meet every Thursday evening at The Alley Bar, I figure why break with tradition. We'll just meet there until the time and need for selecting a quasi-formal arrangement.
- As of right now, we're just using the google group.
- You can follow @bloomingtondevs for community updates and such
- If you're wondering about the kanji (養) that is used for the user icon, it translates to: foster; bring up; rear; develop; nurture. Edit: The romanji for it is "you", which is pronounced "yo" with a long o.
- If you want to be in the the bloomington php user group twitter list that I've made, let me know.
- We have no hashtag, I'd like feedback. So far I'm thinking #btownphp or #bloomingtondevs
Thank you and welcome to Bloomington PHP.
Related articles by Zemanta
- tek x- closing remarks (phpprotip.com)
tekx – lig’s talk on scalability and mysql
by chance on May.20, 2010, under mysql, php, phptek, tekx
@lig will be talking about mysql 5.5 and scalability this session She is Senior Technical Support Engineer for MySQL.
We will be covering
- semi-synchronous replication
- performance schema
- SIGNAL/RESIGNAL
- more partitioning options
- InnoDB - LOTS of InnoDB (performance and scalability improvements)
In 5.5 InnoDB will be the default!!! WOOT.
Default replication is asynchronous. Meaning master writes to binary log and the slave connects and "pulls" contents of the binary log. Bad thing is if the master crashes, there's no guarantee that a slave has all committed transanction.
Simi-Synchronous Replication is an alternative to asynchronous replication. Midway point between asynchronous and fully syncronous. Master only waits for a slave to receive an event. Don't have to wait for slaves to actually commit.
Performance schema tracks at an extremely low level. Just like Information schema, tables are views or temporary tables. Activation doesn't cause any change in server behavior. This is designed for advanced users.
Think of SIGNAL as an exception, a way to "return" an error. You get exception-handling logic for stored procedures, stored functions, triggers,events and db apps.
RESIGNAL lets you pass error information up. Think of it as a catch. Requres an active handler to execute. Lets you program on your PHP side to catch that very specific handling.
tekx – xdebug
by chance on May.20, 2010, under development, php, phptek, tekx

- Image via Wikipedia
Today's session is given by derick rethans, the author of xdebug so he might know what he's talking about.
Xdebug provides protections against things like stack overflow in PHP and infinite recursion. You can set this by setting the nesting level. It also provides a pretty formatted errors but not only is it pretty but it provides more information such as memory usage, time, function name and location on items in the call stack. It can also collect parameter information which shows the type with options to display the variable name (if possible) or values. It opts to minimal information to prevent crashing html displays with the browsers.
Another hot option is the ability to link to the files. The var_dump is overloaded to create a pretty, color-coded output. You can turn this off by setting the overload vardump option to 0.
tekx – getting git
by chance on May.19, 2010, under phptek, tekx, version control

- Image of Travis Swicegood
@tswicegood's talk is for people who aren't familiar with git or version control. They won't be delving into the the internals.
Installation of git for ubuntu can be done with apt. If I heard correctly (busy setting up to blog), Windows installation will require cygwin. OSX can be done with homebrew. Be sure to verify the install no matter which installation method you. One thing to keep in mind about git is that it started out on the command line and will always be heavily entrenched there. So hopefully your team is comfortable with that.
When you start using git, you should set up your user and email. Config also allows you to enable colors.
mysql alter table add foreign key
by chance on Jul.13, 2009, under mysql
I recently ran into a situation where I needed to add a foreign key to a table. This seems easy at first but was actually a 3 step process compared to the couple of lines it takes in a create table sytax.
Short version: when creating your FK column, it helps to have the column definition of the FK match the column definition. In retrospec, this seems like a no-brainer but was the heart of my problem.
So, you want create a FK to an existing table. Lets start by creating our table.
CREATE TABLE IF NOT EXISTS Role( Id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, Name VARCHAR(255) NOT NULL UNIQUE, Description TEXT DEFAULT NULL, PRIMARY KEY(Id) );
Pretend we pooped data into it and now it's a big pain in the ass to do a drop/create with how we want things.
First we add our column that will be the Foreign Key.
ALTER TABLE Role ADD COLUMN Parent int(11) UNSIGNED DEFAULT NULL;
Next we add an index. Why? because mysql says so and FKs rely on indexes
ALTER TABLE Role ADD INDEX Parent (Parent);
Now we add our constraint.
ALTER TABLE `Role` ADD CONSTRAINT `Parent` FOREIGN KEY(`Parent`) REFERENCES `Role`(`Id`) ON DELETE SET NULL ON UPDATE SET NULL;
For fun, do
ALTER TABLE Role ADD COLUMN Parent int(11) DEFAULT NULL;
for the first step. Everything will look awesome until you get to the the last step. You'll get a wonderful "Errno 150" error and spend a bunch of time googling various key words trying to figure out what went wrong. Well, at least I did.
Installing Citrix client onto Ubuntu 64-bit
by chance on Jan.12, 2009, under *nix
Recently at work, I was told to install the citrix client. This was fine since citrix has a linux install, which did not work or spit out any error message. After 68 tabs (not exaggerating) worth of googling, I found the reason for this was that citrix hates freedom only works on 32bit linux and that there is no 64bit version out yet. YAY! after a couple thousand (exaggerating) more tabs, I was able to track down the correct way to install citrix onto ubuntu 64-bit.
INSERT INTO `table` (`column`,`col2`) VALUES isn’t completely worthless
by chance on Nov.14, 2008, under mysql, web dev
In most cases, when doing an insert statement I use SET to increase readability. It is also nice because I can make dynamic statements with insert/update. It is because of these two reasons I never saw any value (for lack of a better term that isn't punny) to using VALUES. That is until I ran into a situation where I wanted to have a database level solution as opposed to making an application layer solution. The situation is as follows:
- create an entry in the parent table
- create entries in the child table that depends on the last insert id of the parent table.
Now that I think about it, there may have been a way to do it procedurally in SQL but the first solution I was stuck on how to make my next INSERT statement fulfill my criteria and be readable. This is where VALUES comes in. By using VALUES instead of SET, you can do a multi-row insert statement.
example:
INSERT INTO Resource SET ModuleID=LAST_INSERT_ID(), Name='contact', Description='Contact resource in the default module'; /* multi-row insert */ INSERT INTO Privilege (ResourceID,Name,Description) VALUES (LAST_INSERT_ID(),'*','All privileges for this resource'), (LAST_INSERT_ID(),'browse','Browse only privilege for this resource'), (LAST_INSERT_ID(),'read','Read only privilege for this resource'), (LAST_INSERT_ID(),'edit','Edit only privilege for this resource'), (LAST_INSERT_ID(),'add','Add only privilege for this resource'), (LAST_INSERT_ID(),'delete','Delete only privilege for this resource');
So now, VALUES isn't completely useless after all.
stupid *nix tricks
by chance on Nov.07, 2008, under *nix, noobtip
[Edit: Seems like the -u flag is on debian systems such as Ubuntu. Did a man on a FreeBSD system and saw it didn't have the flag available.]
I use the cp and mv a lot that the -r and -f flags almost always accompany them. I also now realize I've used them for so long with so little thought that I forgot that there were other flags. My newest infatuation is the -u flag.
Basically -u lets you do a merge, which came in handy when I had to manually update wordpress for the first time. I could tell you more or you could RTFM
iPhone 2.1 firmware impressions
by chance on Sep.12, 2008, under iPhone
Update: so far the battery life is holding out to be good. I'm getting less call fails but not sure if that's just a coincidence. Installs are definitely faster. Mail seems the same. Genius is awesome. Texting and contacts seem the same. Going to keep checking things out over the weekend.
Like anyone else who owns an iPhone 3G, I've been excited about today. I would like to right a full review on this but need to get work done so impressions will have to do. I did find a 2.1 firmware review at iSmashPhone.com.
Let's start with what this update is according to the apple site, we get the following:
- Decrease in call set-up failures and dropped calls
- Significantly better battery life for most users
- Dramatically reduced time to backup to iTunes
- Improved email reliability, notably fetching email from POP and Exchange accounts
- Faster installation of 3rd party applications
- Fixed bugs causing hangs and crashes for users with lots of third party applications
- Improved performance in text messaging
- Faster loading and searching of contacts
- Improved accuracy of the 3G signal strength display
- Repeat alert up to two additional times for incoming text messages
- Option to wipe data after ten failed passcode attempts
- Genius playlist creation
The big thing (for me) out of this update is the "Dramatically reduced time to backup to iTunes" and OMG it is amazing. It still takes a while to back up but comparatively to before, it is like comparing a 28.8 modem to a T1. As for everything else, I haven't had time to test and will probably play with things over the weekend. Below is a quick overview of what I noticed.
My reception at works sucks so can't really say much on the "Decrease in call set-up failures and dropped calls" part until I get to a good area, even then, it would be best to test over the week end. The same goes with the battery claim, time will tell if that holds true. Actually everything else would also require a brief test period to have a proper impression. Though one thing I can 'test' is the Genius playlist, which I'm going to play with now and will update this post later.
jQuery+AJAX+JSON
by chance on Sep.09, 2008, under jQuery
update: I really should RTFM. dataType can go in any place when listing options. If I had read the docs a bit more carefully, I would've noticed that the reason I started getting a JSON object back instead of a XMLHttpRequest is that I specificed 'success' with a callback instead of 'complete'.
Though I did figure out a better way of parsing the returned object
var myCallback=function(jsonObj){
for (k in jsonObj) {
if (iWantToCheck(k)) {
useValueOfK(jsonObj[k]);
}
}
}
Found out something interesting today. I normally try to stick to a simple AJAX return such as html or xml that is easy to manipulate. Today, I couldn't accomplish my task without the help of JSON. I'm sure there's other ways I could've told JS how to react on different succeed or fail conditions but JSON was the first one that came to mind. On to the story...I set the dataType on my ajax options to 'json' and was surprised to find that I was still getting a XMLHttpRequest object instead of the expected JSON object. I tried sending 'Content-Type: application/json' header, tried a bunch of other things I can't remember at the moment.
(continue reading...)
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!
Archives
All entries, chronologically...
![Reblog this post [with Zemanta]](http://img.zemanta.com/reblog_a.png?x-id=b6848667-f894-4cf5-8801-a65f32f9f7cf)
