Google will be providing a preview of their Chrome OS to the media today. If you'll recall, Google first announced the Chrome OS back in July, but we haven't heard much about it since then.
Scala, Java, Unix, MacOS tutorials (page 376)
Wow, you'd think a large website like ibibo.com would have enough people to write their own content, but recently I learned that they've been copying and pasting devdaily.com content onto their website. (And I really do mean copying and pasting.)
If you perform the following Google search:
I just read that a judge rejected AT&T's request to pull Verizon's ads off the airwaves. The judge said the ads might be sneaky, but they're not misleading.
Even funnier to me, the judge offered this quote:
"Most people who are watching TV are semi-catatonic"
Perl array examples FAQ: Can you share some Perl array examples (Perl array programming examples)?
After doing a lot of work with Perl arrays recently, I thought I'd post a little collection of Perl array examples out here today. The Perl array syntax isn't too hard, but there are a few common mistakes you can make, so hopefully a simple reference page will help.
It's funny, when I first started working with PHP, the first thing I wanted to know is "What is the PHP comments syntax?" (It reminds me of learning to ride a motorcycle, where the first thing you want/need to learn is how to stop.)
Fortunately, if you have a Unix/Linux and/or C programming background, the PHP comment syntax will seem very familiar, and I'll share some simple PHP comment examples here.
Perl array copying FAQ: Can you share some examples of how to copy a Perl array?
Copying a Perl array is actually so simple it seems like a trick question, but unfortunately it's one of those things that is only easy once you know how to do it. (Personally I find the syntax a little non-standard.)
A Perl copy array example
To copy a Perl array named @array1 to a Perl array named @array2, just use this syntax:
So, you're sitting there, looking at your Mac Finder window, and you see the file you need to work with, but wait ... what is the path to the directory you're looking at?
The Finder is a clever interface -- especially now that it sports four different views -- but at times like this, it just leaves you hanging. I run into this problem all the time when I go to upload a file using any of my web-based email clients, or when I upload a file using a web form.
CakePHP SQL debug tip: If you're a CakePHP newbie, one of the surprising things about seeing your first CakePHP view pages is seeing the CakePHP debug output (the SQL debug output) at the bottom of your view pages. It's definitely a nice feature for when you're learning CakePHP, and also for any time you're trying to understand what queries CakePHP is running for you, but it's a surprise at first.
Perl reverse array FAQ: Can you show an example of how to reverse a Perl array (reverse the Perl array contents)?
Sure. I just create a Perl script to print the contents of a text file in reverse order. I named this program rcat (for "reverse cat"), and I use it as a helper program with my transport command (a replacement for the Linux cd command). We can use it to demonstrate the Perl "reverse array" technique.
CakePHP page title FAQ: I'm still a CakePHP newbie, but I just figured out how to change the page title on my CakePHP view pages (i.e., the HTML TITLE tag on my view pages), so I thought I'd share that process here.
Setting the CakePHP page title
The first step in setting a CakePHP view title is to set the pageTitle variable in your CakePHP controller method. Here's an example where I set the page title in a typical CakePHP controller index method:
In an effort to get more CakePHP find query examples out into the world, here are two examples of how to perform SQL "SELECT BETWEEN" queries using the CakePHP find method.
In my first find query example, I'm trying to find all the records from the logfile_records database table where the date column is between the two dates specified:
PHP MySQL FAQ: Can you share an example of how to use the PHP addslashes function when creating a SQL INSERT statement?
When you're inserting records into a database table with plain PHP (as opposed to using a PHP framework), some of the fields you're inserting may have characters in them that will cause problems during the SQL INSERT process. Characters that will cause problems on database INSERT statements include the single quote, double quote, backslash, and NUL characters.
I just started working with CakePHP in the last two weeks, and as a newbie, I've found a simple debug strategy that I like. I've used this CakePHP debug technique several times when trying to formulate a CakePHP find query.
When working with CakePHP, one of the hardest things for me has been getting used to formulating SQL queries with the CakePHP find method syntax. Today I needed to run a SQL query where I limited the amount of records returned from the database, and after a little trial and error, I found the correct CakePHP SQL LIMIT syntax, and thought I'd share that here today.
There seems to be a crime wave at Champion Farms, the apartment complex where I currently live in Louisville, Kentucky (and where I'm anxiously ready to move away from), and I'm very concerned about the safety and security here.
Last Thursday night when I came home police cars were all over the Champion Farms parking lot. I didn't stop to talk to any of them; I just went straight to my apartment and locked the doors.
CakePHP error log FAQ: Where is the CakePHP error log, and how do I write to it?
CakePHP error log file location
The CakePHP error log file is named error.log, and it is located in the $app/tmp/logs directory of your CakePHP application:
$app/tmp/logs/error.log
(Where $app represents the name of your CakePHP application.)
As a CakePHP newbie, I'm spending a lot of time learning how to formulate SQL queries with the CakePHP find function syntax. This morning I need to create a "select distinct" SQL query in CakePHP. Fortunately this wasn't too hard once I figured out how to piece it all together.
In my case, I have a database table named logfile_records, and I wanted to run a SQL "select distinct" query against that table. If I was going to write the query in plain SQL I'd write it like this:
PHP FAQ: Can you share an example of the PHP Base64 encode and decode functions?
Every once in a while when you're working on a web application you'll run into data that can cause you some problems, and when that happens, the PHP base64_encode function can come to your rescue. Here's a quick look at a problem I ran into yesterday using CakePHP, and how the PHP base64_encode and base64_decode functions helped me encode a URL (URI) and bail me out of my predicament.
iPad/iPhone FAQ: How do I create an iPad or iPhone screenshot (screen capture)?
iPad/iPhone screenshot - short answer
Yesterday I sent an iPhone screenshot (screen capture) to a friend of mine, and he remarked on how cool it is that you can create a screenshot on an iPhone, and asked how I did it.
It's pretty easy to an iPhone or iPad screenshot. All you have to do is:
CakePHP SQL query FAQ: How can I run a standard SQL query in CakePHP?