Geeks On PHP OOP Update

I want to give everybody a quick update on what is going on with Geeks On PHP and what to expect in the near future. As we talked about on our last episode we are putting together a series of podcasts focused on OOP in PHP. Unfortunately due to time constraints, work overload and other things out of our control we have had to push things back a bit. The series is still going to happen and we are excited to have Mitchell Hislop who is a friend of mine and a very talented developer / social media expert joining us for the series.

As soon as we are able to settle on dates to record I will provide updates via Twitter and our Facebook page letting people know what to expect. Thank you for your patience and we look forward to releasing a great series on OOP!

Follow both Stephen & Myself on Twitter and also subscribe via Tunes.

- Nicholas

  • Share/Bookmark

Read Users' Comments (2)

Geeks on Doctor Who : Episode 2 : Vincent and the Doctor

This week Janet joins us, but Vinita seems to have been taken on an adventure with the Doctor .. we are confident that he will return her before our next episode..

This week we start our recaps with Vincent and the Doctor .. we struggle with the pronunciation of Krafayis and wonder about how to pronounce Van Gogh ..

We talk about Time travel and the moral ramifications of changing the future as well as the wonderful validation that comes with being able to head several hundred years into the future to see how your work affected history.

Enjoy the show, and remember .. don’t blink

Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.

want to listen on your mobile device? [ Direct Link ]

  • Share/Bookmark

Read Users' Comments (1)

Episode 1 : in which we introduce ourselves & Janet takes a sick day

It’s the very first episode of Pandoricast : Signals from Gallifrey! We introduce ourselves and have our first special guests John Holzer [ twitter.com/johnholzer ] and Yvonne England [ twitter.com/evieruin ]. We revel in our Doctor Who love and get all set up to launch into our recaps next week and try to end the episode three times. Enjoy the show.

Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.

want to listen on your mobile device? [ Direct Link ]

We want to give a special thanks to Jason Howell [ twitter.com/raygun01 ] for doing the voice over at the beginning of the episode, and a huge thanks Alex Day [ alexdaymusic.com ] for allowing us to sample his music for the episode as well.

  • Share/Bookmark

Read Users' Comments (1)

Geeks on Beer : Deus Brut des Flanders : with Laurie Delk from 100 Beers 30 Days

June 3 : Deus Brut des Flanders : with Laurie Delk from 100 Beers 30 Days from New Brew Thursday on Vimeo.

Want to watch on your mobile device ? Mobile Version

This week we head back to our studio away from our studio, Stone World Bistro & Garden where we meet up with Laurie Delk, from 100 Beers 30 Days, for her final beer for the 100 beers 30 days challenge. We talk about why she is doing the challenge, and the various charities that benefit from her beerscapades, such as Parkinson’s Research and Feeding the Hungry.

Check out her blog at 100beers30days.wordpress.com and be sure to donate to the great causes that she is supporting.

For our master pairings with Dr. Bill, we pair up a traditional American brown ale with baby back ribs and cave aged Gouda and our Craft Beer Advocate this week is Dan from Seattle who found craft beer in Japan, and has a great story about it…

Brewed by:
Brouwerij Bosteels
Belgium

Style | ABV
Bière de Champagne / Bière Brut | 11.50% ABV

Here’s the complete email from Dan in Seattle : Follow him @seattletap


Hey guys! I really enjoy the show! I hope to start my own soon. My advocacy story starts in Japan. After a long time drinking Suntory, Asahi, Sapporo and, Kirin, I was hoping more was out there in terms of flavor and community. I googled bars in Japan and found a link on ratebeer to a bar called “doll dress” in Osaka Japan. Doll dress is a belgian bar/S&M clothing store. Why? I have no idea but I quickly became aquainted with the local and famous beers of belgium. The bar owners introduced me to a vast and growing community of craft beers (called “gee beer”) in Japan that are absurdly niche yet amazing right now. Before I left Japan, I stopped at a bar in Tokyo called “Dry Dock” that actually imported Stone beers. Having never had or heard of Stone, I asked the bartender which was his favorite. He gave me the Ruination IPA. I’ve never been the same. I advocate craft beer every day now. Craft Beer is about to explode everywhere, not just the USA!
-Dan (@SeattleTap)

ps. I’m attaching pictures of my adventures:) also: http://yfrog.com/bhp1040015bj and http://yfrog.com/j2p1040014aj

  • Share/Bookmark

Read Users' Comments (1)

Geeks on Beer : A Trip to the Cellar

May 27 : A Trip to the Cellar from New Brew Thursday on Vimeo.

Want to watch this on your Mobile Device ? Mobile version

This week we join Dr. Bill is his “Cellar of Amazingness”, which has become it’s formal name, and we try two very tasty brews.

The first, in honor of The Bruery’s second anniversary, is a the Rye Papier, one of the four versions put out as a celebration of the first year, signified by a silver wax color. The third anniversary year beer is leather … which doesn’t seem appetizing, but we know Patrick will create something magical yet again, and will likely name it “Cuir”, which sounds better then leather. ;)

We also want to say congratulations to The Bruery for 2 EPIC years, and a huge thanks for making awesome beer, and throwing an awesome 2nd anniversary party!

Dr. Bill pairs this with a Tiramisu, and a Blue Stilton cheese.

After that, we unleash the Dark Lord. However, since this is Dr. Bill’s cellar we don’t open a 2010 Dark Lord. The guys at 3 Floyds have traditionally chosen a different color wax for each year of Dark Lord. The Orange wax tells the drinker that they are about to travel back to the year 2005… which is where we land and enjoy this tasty beverage.

Thanks to DR000 for this great shot of various year Dark Lord and Behemoth bottles.

Dr. Bill pairs this with what’s left of the Tiramisu, and a Rochefort cheese.

It was an evening of decadence.

We weren’t able to include a Craft Beer Advocate this week due to time constraints, but we have a growing collection of amazing stories to share, and still want you to go and check out the Beer Wars movie. This amazing documentary will help you understand the struggle that craft beer brewers go through, and help you understand why now is the time to join the revolution!

The Bruery Papier Rye
Brewed by:
The Bruery
California, United States

Style | ABV
Old Ale | 14.50% ABV

3 Floyds Dark Lord
Brewed by:
Three Floyds Brewing Co.
Indiana, United States

Style | ABV
Russian Imperial Stout | 13.00% ABV

  • Share/Bookmark

Read Users' Comments (1)

Geeks on Beer : Raging Bitch : Flying Dog : on location with Matt Brophy

May 20 : Raging Bitch : Flying Dog : on location with Matt Brophy from New Brew Thursday on Vimeo.

Want to watch on your mobile device? Mobile Version Here.

This week we are in Fredrick Maryland, hanging with Matt Brophy, the VP of brewing operations of Flying Dog, and overall awesome dude! We drink Raging Bitch, a Belgian Style IPA, which is amazing, and talk about Hunter S. Thompson & Ralph Steadman and their connection to Flying Dog.

Flying Dog was our first stop on the East Coast road trip we took back in March. We were a little tired when we got there, but as soon as we saw how awesome the brewery was and how cool all the people were there, we perked right up, and got down to doing what we do best.. drinking beer. Raging Bitch has quickly become a favorite for all three of us, and we are grateful for the amazing way that Flying Dog received us and took care of us. Thanks guys!

We took a TON of pictures at the Flying Dog brewery .. check them out here : Flickr

Brewed by:
Flying Dog Brewery
Maryland, United States

Style | ABV
Belgian IPA | 8.30% ABV

Also this episode :

Dr. Bill brings us a Master Pairing with Spaghetti and one of our favorite amber ales from Anderson Valley Brewing Co .. yeah. Spaghetti. It’s awesome. Our Craft Beer Advocate this week is Erick from Yucaipa, and he get a free signed copy of the DVD Beer Wars. Do you want to be a Craft Beer Advocate? Send us your story, and we will read it on the show, and maybe you will win a free DVD of the Beer Wars movie signed by Anat Baron.

If you haven’t seen Beer Wars, you need to. Check it out on Demand from your cable company, from Netflix, or iTunes. Also, ask your local brewery to stock and sell Beer Wars so that the craft beer community can experience this amazing documentary as well.

Here is Ericks full email :
Hey guys,

Well this is erick or otherwise known as thor13 on the twitter. I will
try to make story short just like me. I recently began drinking craft
beer because, I really did not want to give to much money to the big
three beer makers in America. After having tried some the bigger
market beers like Guinness and Heineken. I thought maybe beer isn’t
for me. I then stumbled upon your podcast through Aric or best known
as phatemokid and began watching the show. At first it I was lost of
what you guys were talking about but, I had the same reaction when I
was watching Gary Vaynerchuk on his show, but you guys were just as
passionate about beer as Gary was about wine. I kept watching and you
guys have made try a few new craft beers when other wise I would have
never even thought about getting one. Thankfully I can say I have
never had a bud light or coors light. I could have honestly given you
how many beers, I have tried on one hand before meeting you guys. Now
I try to promote you guys where ever I go even though I still get lost
when I walk into a place like Bevmo.

Thanks for all that you guy are doing,
Stephen, John, and Brad.

Erick V.

  • Share/Bookmark

Read Users' Comments (1)

Geeks on Beer : Pints for Prostates with Chris Spradley

June 10 : Pints for Prostates with Chris Spradley from New Brew Thursday on Vimeo.

Want to watch on your mobile device? Mobile Device.

This week, we take a break from New Brew’s, and revisit an old friend while we talk with Chris Spradley about Pints for Prostates and being aware, and try not to make too many inappropriate jokes .. of course Stephen fails at that.

Chris is organizing an event to benefit the Pints for Prostates organization on June 19th. ; Tickets are going fast, so pause the show, and get over to http://www.pintsforprostates.com click on the Los Angeles Beer Fest to get tickets.

$45 – gets you great food, great beer, and a great sense of helping to defeat a disease that plagues thousands of men every year. Pay attention during the show for a special announcement of a beer that will also be available, for the very first time, at this event.

You can find Chris all over the interwebs :
Twitter : @beachbumchris
Examiner : LA Craft Beer Examiner

We also do a crazy Master Pairing with Dr. Bill, that includes Deschutes Black Butte Porter with an amazing Porterhouse steak. Yums!

Brewed by:
The Bruery
California, United States

Style | ABV

Berliner Weissbier | 3.10% ABV

  • Share/Bookmark

Read Users' Comments (1)

Geeks On PHP Episode 13

This week Stephen and I talk about strings and how they are accessed, manipulated and used in PHP.

We kick off the discussion talking about some differences between echo() and printf(). Below is an example of using both functions to populate a text field on a web form. We will start off with using echo():


.. input type="text" name="foo" id="foo"
[Inside PHP Block]
if(!empty($dbresult['foo']))
echo ' value="'.$dbresult['foo'].'" />';
else
echo ' value="" />';
?>

Here is the same end-result using printf():


... input type="text" name="foo" id="foo"
[Inside PHP Block]
printf(" value=\"%s\" ", !empty($dbresult['foo']) ? $aResults['foo'] : "");
?>

I tried to make the “argument” during the show that printf() allows for a lot more flexibility as well as resulting in slightly more compact code. Notice the usage of PHP’s ternary operator in the printf() example. It allows for a great deal of flexibility and power directly in-line w/ your output statement.

Regular Expressions were also a big topic of discussion this week and as promised here are some examples of commonly used RegEx’s in web application development:


$pattern_date = '#(0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])[- /.](19|20)\d\d#';
$pattern_email = '#^[a-zA-Z._]+@[a-zA-Z_]+?\.[a-zA-Z]{2,4}$#';
$pattern_email2 = '#^\w+([\.%-]\w+)*@\w+([\.-]\w+)*(\.\w{2,})+$#';
$pattern_phone = '#^(?:\([2-9]\d{2}\)\ ?|[2-9]\d{2}(?:\-?|\ ?))[2-9]\d{2}[- ]?\d{4}$#';
$pattern_time = '#(1[0-2]|[1-9]):([0-5][0-9])#';
$pattern_url = '#(http|https)\://[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,4}(/\S*)?$#';
$pattern_alphanum = "#^[a-zA-Z0-9\s]+$#";

To test matching on these patterns you can simply use the preg_match() function:

preg_match($pattern, $string, $matches);
if(!empty($matches))
    print_r($matches);

A couple of my favorite resources for regular expressions are:
The Online Regular Expression Testing Tool
The Regular Expression Library

Regular Expressions provide so much power and versatility when it comes to pattern matching and replacements that they just can’t be ignored. If you have questions about any of the above please let us know.

Follow both Stephen and Myself on Twitter and also subscribe via Tunes!

Enjoy the show and as always, stay geeky!

Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.

- Nicholas

  • Share/Bookmark

Read Users' Comments (1)

Geeks On PHP Episode 12

In this episode Stephen and I talk about database connections, retrieving results and making use of those results. Both MySQL and PostgreSQL are discussed in this episode so whichever open source database you are using we got you covered.

Here is a link to Stephen’s database class for MySQL. He discusses it’s usefulness and some of it’s functions in the show.

Here is some sample code for getting connected to and pulling out results from a PostgreSQL database. The database include file should be separate from your application code so that you can easily change connection parameters in one location without touching your application.

/* Example of PostgreSQL database include file
	named db.inc */

$host = "hostname";
$port = "port";
$dbname = "database";
$dbuser = "username";
$dbpass = "dbpass";

$hdb = pg_connect("host=$host port=$port dbname=$dbname
	user=$dbuser password=$dbpass");

/* How to include and open connection in script */
require_once("db.inc");

/* How to query a PostgreSQL database */
$res = pg_query($hdb, "SELECT name, email FROM table");

/* Close database connection */
pg_close($hdb);

/* Create associative array */
while($ares = pg_fetch_assoc($res))
{
	// do stuff
}

/* Create object */
while($ores = pg_fetch_object($res))
{
	// do stuff
}

Check both Stephen and Myself out on Twitter and also subscribe to us on iTunes!

Enjoy the show and as always, stay geeky!

Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.

- Nicholas

  • Share/Bookmark

Read Users' Comments (2)

Geeks On PHP Episode 11

In this episode we talk about everything from image manipulation, generating charts & graphs, classes and frameworks and even home invasions.

The charting libraries I discuss are Fusion Charts and pChart, both are very good libraries and have great documentation on how to get started.

The following is a code snippet that I wrote which takes in an associative array, parses it out for a data label ($a[0]) and a data value ($a[1]) and generates a Fusion compatible XML file.

function fnGenerateXML($scaption, $sxaxis, $syaxis, $adata)
{
  if(empty($adata))
    die("Empty data set passed to function.");

  $sdata = "\n";

  foreach($adata as $arow)
    $sdata .= " \n";

  $sdata .= "";

  $sfile_xml = "./chart.xml";
  file_put_contents($sfile_xml, $sdata);
  return $sfile_xml;
}

The function is called in the following fashion:

$sfile_xml = fnGenerateXML("Caption", "X Lbl", "Y Lbl", $a);

The Fusion Chart is generated using the following method call:

echo renderChartHTML("./Column3D.swf", "$sfile_xml", "",
      "ID", 650, 650, false);

Here is some sample code I wrote to generate a graph using pChart:

// Dataset definition
$pData = new pData;
$pData->AddPoint($a1, "s1");
$pData->AddPoint($a2, "s2");
$pData->AddPoint($alabels, "lbl");
$pData->AddSerie("s1");
$pData->AddSerie("s2"); 

$pData->SetSerieName("s1lbl", "s1");
$pData->SetSerieName("s2lbl", "s2");
$pData->SetYAxisName("Ylbl");

$pData->SetAbsciseLabelSerie("lbl");

// Init graph
$pGraph = new pChart(800, 340);
$pGraph->setFontProperties("./tahoma.ttf",8);
$pGraph->setGraphArea(50,30,680,200);
$pGraph->drawFilledRoundedRectangle(7,7,693,240,5,240,240,240);
$pGraph->drawRoundedRectangle(5,5,695,240,5,260,230,230);
$pGraph->drawGraphArea(255,255,255,TRUE);
$pGraph->drawScale($pData->GetData(),
   $pData->GetDataDescription(),SCALE_ADDALL,150,150,150,TRUE,0,2,TRUE);
$pGraph->drawGrid(4,TRUE,230,230,230,50);

// Draw the 0 line
$pGraph->drawTreshold(0,143,55,72,TRUE,TRUE);

// Draw the graph
$pGraph->drawStackedBarGraph($pData->GetData(),
   $pData->GetDataDescription(),TRUE);

// Finish
$pGraph->drawLegend(500,40,$pData->GetDataDescription(),255,255,255);
$pGraph->drawTitle(225,22,"Title",0,0,0);
$pGraph->Stroke();

As you can see pChart requires a bit more setup to get going but both are great libraries for getting the job done. Another free option for charting/graphing that we didn’t discuss on the podcast is the Google Chart API.

Check both Stephen and Myself out on Twitter and also subscribe to us on iTunes!

Enjoy the show and as always, stay geeky!

Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.

- Nicholas

  • Share/Bookmark

Read Users' Comments (1)

 Page 1 of 4  1  2  3  4 »