Sunday, December 09, 2012

Running a Script in a Loop without Cron

There are times when using cron is an over kill for a small task so it makes sense to whip up a small script and use one of the many system commands to repeatedly call it in a loop. BTW, if you have a better way of accomplishing this, I would like you to share it.

That said, here's is an example. I wanted to perform a copy task every 12 minutes whilst working on a sample project. One quick option is to use the watch command - but if you find yourself requiring more cycle then a while loop would also help. But for now, this seems to get the job done. Not the best... hey, but it did  what I required

while [ 1 ]
do
  cp source dest
  sleep 12
done
Surprisingly, this worked quite well allowing me to take control of the script an its execution without resorting to the cron system. Nice and handy tip.

Now over to you - how would you run a script every specified minutes without using cron. Please post your thoughts in the comments.

On a totally different topic: I just finished my second Twitter app for another client. That brings together a total of 5 custom apps I've developed for private clients in the last 2 years. 

This last one took me less than a day to finish it. They wanted a specific feature which was the only thing that took me a bit of backwards and forward to finally finish. So, this weekend I did quite a bit more than I wanted, and I'm pleased with myself.

Friday, November 09, 2012

oDesk Making Freelancing Easier

We all like it when companies pay you for doing what you do everyday. This is what oDesk. is doing lately. They have changed the way their freelancing process works - which means you can now pick more than 5 jobs at a time. These are good paying tasks that any self-respecting software person out there can do.

The even have videos to show you how to get started. I thought I should post it here because in the last couple of weeks, I've been seeing lots of traffic to this blog - all looking for information on getting started with oDesk.

If however, you already know how their new system works, you may also want to check out Hubpages as well. I've only spent a few months on and off getting to know the site well.

Which ever works for you, please leave a comment below and would like to know your thoughts.

Anyway, I recently got a notification that 21st Century C has been released. As a former C programmer, I thought I should get a copy.

This book is ok, it does not present any thing new other than talk about different approach you could take today to solve the problems you had decades ago. C has not changed, but programming techniques, technology and design patterns have evolved - so that's basically what this book is all about. One thing though that this book has going for it is the POSIX standard that its used through out.

So, if you are looking to brush up your C experience, you might find this book quite useful. And writing C code that is portable across many different platforms will not be an issue because this book focuses on standard C.

Sunday, November 04, 2012

Simple XML Processing with DOM and SAX

It's been a while since I last had any need to process XML on the browser. Most of my processing of late has been on the server side which takes care of all the necessary work.

So, this evening, it was nice when I one of the Django application I have been working on required a fair amount of XML processing. In an effort to move some of the load to the client, I have decided that some of the job should only be performed when the require it.

What the application does is that it uses Geo and IP-mapping to detect where the visitor is and then provide them with the appropriate XML. The next stage is to  process that XML. So, to give you a very simple of how that XML is processed, I have included here both the XML and the DOM script for it.
 var doc = null;

function loadXML() {
    doc = document.getElementById("XMLIsland")
}

function DoIt() {
   var output = ""
   var records = doc.documentElement.childNodes;
   for ( var i = 0; i < records.length; i++ ) {
      townName = records.item(i).firstChild.firstChild.nodeValue;
      tempValue = records.item(i).lastChild.firstChild.nodeValue;
      output += "
Temperature in " + townName + " is " + tempValue;
   }
   document.getElementById("output").innerHTML = output;
}
I'm not sure why blogger is deciding to strip out all the formatting in my code above. But will fix it and try to show the code in full. It would be nice to show how you too could move some of your backend processing to the client.

As it turned out, the stripping of HTML tags is also happening o my JRoller page as well - where I originally attempted to post this blog.

Will update it when I find a solution.

Sunday, August 19, 2012

Updated My Twitter Script Today To Run In Python

Sunday evening and not much to watch on the telly, so I thought I should go back to a few of the Java programs I wrote years ago and bring them into the 21st century. Wel, if you are not currently programming in Python or Django, I consider that as someone who is still hiding in a cave in the 20th century :-)

So, what better way to bring them up to date than to give then a full rewrite in Python. For me, the flexibility, syntax and power of Python is what really made me rewrite it. I love Python - having used it on many projects in the last few years, it's quite easy for me to introduce new developers into programming with Python.

However, today, the Java program I rewrote today was a Twitter program that ran from a shell. Taking search input from the user, connects to remotely to Twitter website, and collect the 10 most recent tweets containing the terms. It then goes ahead and prints the time, user name, the tweet containing our search term.

Today I added a few more features. It's now possible to configure it run continuously using your keyword, when a new tweet comes in containing the keyword, it can either send them a reply tweet, send you an SMS, email you or simply log all the tweets into a database which you can later analyse.

The cool thing about the latest script is that everything is run from a shell. Supply the necessary parameters and away you go. I got these ideas from oDesk when I used to take on on the side programming gig there. So, if you have a few hours in the evenings and on weekends, check them out for some cool and exciting quick programming task.

If anyone wants to poke around the code and probably help in polishing is a bit more or add new features, please let me know.

Now, I'm going for a Sunday evening bike ride I've been indoors since Friday night.

Sunday, August 05, 2012

How To Check Your Django Version In Ubuntu

If you have been working with Django for sometime, you will have noticed how fast the framework development has been going. So, once in a while you need to check that you are not using a very old version.

It is quite easy to upgrade, but believe me, some people never bother at all. There are different reason for not upgrading, - either you have some production code that rely on specific packages in that version - and upgrading means that you will need to rewrite all those code, or you are simply just too lazy to do it.

But if however, you want to know what version is running on your server, simply running this command should do the trick.

helen@helen-server:~$ python
Python 2.7.3 (default, Apr 20 2012, 22:44:07)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.

>>> import django
>>> django.get_version()
'1.4'
>>>

As you can see from the output above, our current version is 1.4, which at the time of this blog post was the latest version.

If you see that your version is a bit older, then simply upgrade by using this command.
This is best simply because it is short and easy to remember for beginners out there.
% sudo apt-get upgrade django


Enter your root password and the upgrade will commence.

On a different note though:

This is for starters - but if you are interested, then see the Free GitHub Tutorial Videos here. But please mind the photos of the naked ladies :) You might also want to check oDesk as for freelancing opportunity if you have free time and would like to earn yourself some income in the process.

You may want to make some cool cash right now as a developer on oDesk simply by helping people with the programming problems. If Java is not your thing, then check out Python or any other programming languages.

Update: it is interesting that since 2012 when this post was first published here, a number of people have found it useful enough that the amount of traffic to this post is fourth on the list of the highest read post on this blog. It goes to show that even a small tip on how to accomplish something can be quite useful.

I guess you can also check the version of your installed Django on any platform with the command above - it doesn't necessarily have to only be on Ubuntu. I was primarily working on Ubuntu back then when this post was written so simply checking your Django version on any platform should work regardless.

Sunday, July 01, 2012

How to Discover Your Linux Configuration

Ok, it has been a while since I posted something here. Been busy with stuff that I will be writing about later, they are mostly programming related stuff. All those weekend projects and small time affiliate marketing stints.

I have also written my response to this post for which I will post later this evening. But until then, I just wanted to show you a small Linux tip for those who use Linux for hosting for as their desktop.

This particular tip is quite handy if you've ever wanted to know more about the version and configuration of your Linux server.

There are a lot more commands that can do the same thing, but this very tip from Hazem Saleh is one of the best simply because it short and easy to remember for beginners out there.

cat /etc/*-release

Just fire up a terminal and enter this simple command:

This will print out your server specification. Give it a try now.

Thursday, May 03, 2012

Free GitHub Tutorial Videos

I know this is a little late, but I was going through some of the videos I saved on my iPad and thought I should post the links here. By the way I'm writing this on my shiny new iPad to see how it works with Blogger. Will leave a full blog post on that till some other time. If you are interested, please see some of the links to the right on some reviews posted by my boyfriend.

Anyway, here's the links - save or bookmark it for any upcoming events. A lot of people attended that last Webinar which was a great fun.

If you are new to Git and Github, you've been missing a lot. Github is the home of the world's most popular distributed revisioning system.

Update
Sorry, the link is broken so had to be removed - will fix shortly.
In the mean time you can check out these books on Git.


You can still find some videos over .
Until next time,
happy programming!

Saturday, March 17, 2012

Cracking the Coding Interview: 150 Programming Questions and Solutions - Great for prepping for CS Students

Cracking the Coding Interview: 150 Programming Questions and Solutions is NOT a coding review. However, as a Computer Engineering student, I found that it offered really awesome concept review.

I'm looking forward to getting some money together and ordering it from Amazon; a friend of mine lent me a copy of it, and I just absolutely LOVE it. I'm currently in my second round of interviews for my dream job - and honestly, this book really gave me the confidence to pull it off.

Even if you have to borrow a copy to "try" it, I seriously recommend it to all of my friends/classmates who are currently in the interview process.

My Breakdown:

Pros: Great general concept review! If you haven't coded in a while, or (like my university) you found that you didn't get much of an overview for a certain concept, then this book will show you algorithms and solutions to questions that you Need To Know. Very practical and otherwise easy to navigate.

Cons: I think it needs some sort of reference section. I realize that it isn't a reference book, but seeing as it appears to be more of an overview for what you Need To Know, I found that most of my review came from looking at the solutions in the back of the book to brush up on concepts I hadn't formally been introduced to or that I'd forgotten.

Saturday, February 18, 2012

The Start-up of You: Adapt to the Future, Invest in Yourself, and Transform Your Career

Steve Jobs once called Apple the "biggest start-up on the planet". Because of its success at systemizing disruptive innovation, it is the most scrutinized company in the world, especially by its competitors. As secretive as Apple is, there are plenty of books and articles that examine Apple's culture in great detail. So why are most companies -- especially large, established corporations -- incapable of applying these principles themselves?

I bring up this question because the first time I read this book, I was disappointed. So many of the strategies seemed so intuitive, so obvious, that I didn't feel like I had gleaned as much insight as I had hoped. But as I looked over my highlights, I realized that, like Apple's competitors, I'd missed the point.

What you need to adapt to the changing world of work aren't cheap tactics and off-the-wall ideas and quick fixes to hack your career. Often, the best ideas *do* seem obvious and familiar. But what is less obvious and less familiar and, thus, is arguably more important and more useful, is a framework or blueprint or system that makes it easier to build the habits required to consistently and sustainably implement those ideas with every decision you make, day in and day out.

The framework this book offers is this: you must think and act like you're running a start-up.

But what does that mean? Here's an example. One deceptively simple philosophy in the book is the idea of helping first -- that you should find ways to create value for others before seeking value for yourself. It's so simple and obvious that it's easy to gloss over it, and yet, it is fundamental to every successful entrepreneur or start-up in the world, because you'll never get a single customer until you solve a problem for someone.

So how does one apply this philosophy? Here's what Reid does: whenever he gets the chance, he asks a simple question again and again and again: "How can I help?" Think about it: It sounds simple, and yet most people don't approach their careers or their relationships with this empathetic mindset. How often do you find ways to solve problems for the people around you? And if it isn't often, how do you change that? What habits does Reid have that you need to do this, too?

"The Start-up of You" will give you Reid Hoffman's -- and Silicon Valley's -- secret sauce, but it's not enough to know it, just like it isn't enough for Apple's competitors to know its philosophies. You have to understand that an entrepreneurial mindset requires different habits of thought and action. This is what the authors mean when they say you have to think and act like you're running a start-up. If you were running a start-up, how would you create a culture that instills the habits of thought and action you want your people to have?

Well, it turns out you *are* running a start-up: your career. How do you train yourself to have the habits of thought and action you need to thrive in the 21st century?

Or, put another way, what would an entrepreneur do?

Monday, February 13, 2012

Coding Bundle (jQuery, JavaScript, CSS)

This bundle includes three eBooks that will help you master the various areas of CSS, JavaScript and jQuery. Get the full hang of CSS: be it layouts, !important declarations, advanced CSS selectors, CSS specificity and inheritance, media queries or experimental CSS properties. The CSS eBook is a full compendium of advanced CSS techniques for professional Web developers.

Improve your JavaScript knowledge with valuable lessons from practice and learn your way around the new jQuery techniques. Of course, all three eBooks are available in PDF, EPUB and MobiPocket formats.

“Mastering CSS” (eBook, 365 pages)
Are you stumped by the rather sophisticated nature of CSS? Getting a grip on this still dewy technology isn’t quite as hard as you might think. Connecting the dots is easier when you have all the vital facts within reach. And that’s what “Mastering CSS” is all about. This eBook offers 15 hand-picked articles that overflow with professional advice and that reflect the deep experience of the Smashing Magazine authors you trust — authors who know exactly what they’re writing about.

Stop hiding behind cross-browser compatibility issues, and launch a counterstrike. Tame those advanced CSS selectors; learn your way around CSS3 media queries; pioneer the field of CSS3 keyframe animations. Get in the game, and learn how to use advanced CSS typography, CSS3 pseudo-classes and modern CSS layouts, while devising back-up solutions for older browsers.

Tuesday, December 06, 2011

Pagination in PHP

As a developer, once in a while you come across a requirement in a project that requires you to go that extra mile. I recently moved from desktop development to web applications and have been enjoying the experience.

However, there are a few things we are used to on the desktops that are not available on web applications - like pagination, tabbing, portability and ease of development.

Whilst there are tons of examples of PHP Pagination online, only a few of them have a complete example that demonstrate how it actually works. The rest just show a little piece of code and  tells you to figure out the rest yourself...nothing of real substance that you can adapt to fit your need.

That said, I came across a nice jQuery version which does almost what I needed - problem is that I would need to learn to use jQuery to use this example. So, what this means is that I need to learn a new framework to learn to use another. Hmm, that's online tutorial for you.

If you know of any good example of PHP Pagination, please leave a comment below and share it with us all.

Sunday, November 20, 2011

You Should Get Yourself One of These Amazon Kindle Fire

After spending a few days with the Kindle Fire I have been very impressed. I don't think it will ever replace my e-ink kindle but it is a great little deice. I have owned multiple Kindles including the 2nd, 3rd, and 4th generation devices. I have also read on android Smartphones, an iPod touch, kindle for pc, and the cloud reader.

PHYSICAL: I love the size of the Fire, it can be held with one hand although after a while the weight forces some positioning adjustments. It is about the size of the past (non DX) kindles and around the size of a DVD case. The power button seems to be poorly placed in the center of the bottom of the device; Right where I want to put my hands. I frequently hit/hold the power button unintentionally. The speakers are surprisingly good for a device of this size although the max output could be louder. I miss the physical page forward/backward buttons of the earlier kindles and volume up/down buttons would make a nice addition. Overall, none of these problems are great enough to cause me to down-rate the device.

SOFTWARE: The carousel on the home screen is interesting. It is a good idea but can be too sensitive and spin when I intend to select an item. The favorites on the home screen remain stationary and are easier to navigate than the carousel for frequently accessed items. I currently have my favorite apps and the books I am currently reading as well as those on the top of my list.

NEWSSTAND: The pages of magazines are a little scrunched on the Fire's screen but zooming in helps a lot. I found that nearly half of my favorite magazines aren't available at all (yet). I don't tend to read magazines as much as I read books so this isn't a huge problem but for people looking at the Fire for magazine reading should check availability first.

BOOKS: The functionality of the reading is more like reading on a cell phone than reading on a kindle. The biggest missing feature seen on e-ink kindles and missing here are collections. There is very little ability to organize your books here. You can view all books you own (Cloud) or all books on the device. You can sort these listings by title, author, or most recently viewed. Kindle.amazon.com has a way rating books, listing books as want to read/reading/read/abandoned. It would be great if the Fire accessed this data and allowed for better user management of the list. My list contains just under 200 books and over time that number will only grow. Once you find the book you are looking for (I keep the ones I am currently reading and plan to read next in my favorites) reading is a simple and pleasant experience. The title of the current book is written at the top of the screen and other than that the only thing displayed during reading is text. A single tap in the center of the screen brings up the time, battery, network status, how far you have read, and various other buttons. The display color, margins, spacing, font size, and typeface can be changed through the menu. Font size cannot be changed by pinching.

MUSIC: The music plays well and can be organized into playlists. The music features are most useful if your music is on the amazon cloud drive. But music, and everything else in the cloud, can't be accessed when outside of wireless.

VIDEO: Watching free and purchased videos is a great experience on the Fire. Keeping track of the free Prime videos I want to watch is much more difficult. There is no queue or to watch list so every time you want to watch you have to search around for what you are looking for.

APPS: What's not to love about a free app every day? Some great android apps are still missing here but there are a lot of great options available and hopefully the list will grow.

Overall the Fire is a great product at a great price. A 3G options would be very nice.

Boomerang: Travels in the New Third World

Boomerang: Travels in the New Third World - Michael Lewis spins an entertaining yarn, traveling about the world and joking about the personality traits that led to the varying economic disasters of 2008. One can learn a certain amount about what transpired in each country, but the strictly factual material in this book could probably be spelled out in less than ten pages.

The bulk of the book is composed of amusing vignettes and Lewis's attempts to define each country's travails in terms of broad cultural stereotypes. The Icelandic crash, for example, follows from the that that Icelandic men think they are Vikings and don't listen to women.

The Greek crash results from their inability to trust each other. The German problem comes from their trust in process and their fascination with fecal matter (I am not making that up).

I don't know that my understanding of the world has been advanced by this book, though the book is an enjoyable, quick read.

Saturday, October 29, 2011

My Review of Steve Jobs by Walter Isaacson

I just finished reading Steve Jobs. Wow! I must say I'm breathless (once again). With the number of reviews already published, I'll focus on a few key points that made an impression.

1. Walter Isaacson tells a very engaging story. His narrative captivated me from the get-go. He elegantly wove the various angles of Jobs's work through the time-line, which wasn't an easy task when you consider all the projects that were developed concurrently. It's a magnificent read.

2. I found it interesting to read "Jobs in his own words." It was hilarious to discover how much he and Bill Gates cursed - something I could have guessed but was never made explicit in other works about him.

3. There wasn't all that much new information. I don't know if it's because of my interest in Steve over the past few years, but I already knew most of the content presented in the book. There were not that many "Damn, I was wondering about that!" moments during my read.

4. The book lacked a lot in terms of Jobs's personal life. I expected to read a lot more about it, given that Isaacson was an "authorized" biographer. I believed I would find more extensive interviews with the children and his wife. They appear to be completely peripheral to Jobs's life, although the book doesn't allow me to conclude that at 100%.

In summary, it's a great book on Steve Jobs. If you want to know more about the showmanship of Steve, there will be more interesting options on the market. I give it 5 stars because it is truly a fantastic read.

Thursday, October 27, 2011

Clean Code: A Handbook of Agile Software Craftsmanship

There is nothing particularly new in this book. It just discusses how to write "clean code" -- the code that is really easy to understand and maintain. Nevertheless this book is worth reading just to remind you another time how important "clean code" is!

This book provides lots of concrete advice how to make your code "cleaner". It discusses importance of proper naming, code formatting and testing. It stresses importance of constant refactoring and provides several extended refactoring examples. But the most important advice the book gives is to always commit better code then you have checked out.

Some advices given in the book can be disputed. Some chapters are weaker (in particular chapters on concurrent programming are quite superficial). Still overall book is definitely worth time spent reading it.

Thursday, October 13, 2011

JBuds J4 Rugged Metal In-Ear Earbuds Style Headphones with Travel Case

I have owned numerous "midrange" earbud headphones over the years, ranging from Sonys to Sennheisers. All of these earbuds delivered the same things: great sound quality for the price, and flimsy construction. I estimate that none of these products, no matter how many buzzwords adorned their packaging, lasted more than 1 year with normal use.

Finally, after my latest pair dropped a channel due to an internal cord break, I deliberately searched for something with rugged construction, and came across the JBuds J4 model. The words "kevlar-reinforced cord" sounded great to me, so I ordered up a set, hoping I would not have to get another for at least 2 years.

Like every other earbud in this price range, the JBuds arrived in a plastic blister pack with several different sizes of rubber tip pieces. My ear openings seem to be rather small, so the smallest tips are usually the ones I end up using, and these were no exception. I did not care for the double-style rubber tips, but I find that the noise isolation from the single-style are more than sufficient.

Sound quality is as good as any competing earbud. Having never listened to "high-dollar" ($150+) earbuds, I have no idea what sort of auditory experience I am missing out on, though I hope to try some soon. Regardless, these earbuds are not lacking compared to the others on the market in this price bracket.

The cord is undoubtedly the best feature of these earbuds, and was the main reason I chose them. It is a standard Y-style cord, which I strongly prefer to the asymmetrical type, with no adjustable slider. Cord length is ideal for me (6' 2" tall) to keep my iPod/phone in my pants pocket and still have enough slack to do workouts at the gym without any binding or catching. The cord's flat design is ingenious in that it does indeed prevent tangling as claimed. The two separate channels may get tangled around each other, but they are easily undone, and most of the time the cord just shakes out. That alone is probably the most notable feature of the J4. In addition, I have now been using these in my normal (moderate) fashion for over 7 months, and they have not missed a beat. I will be sure to update the review periodically to reflect how they hold up compared to prior sets, but they seem promising.

Now, the big downside: The headphones are not very comfortable. This is obviously a huge factor in the earbud market, and sadly the J4's suffer a minor and seemingly easily corrected design flaw which causes discomfort and/or frequent adjustment in the ear canal. The body of the earbuds, rather than having a somewhat half-spherical shape like many others, is a long cylinder with an end cap, that tapers on the ear side to the speaker port. The transition between the straight and tapered sections is a sharp, hard edge, and this edge tends to rub against the ear, causing significant discomfort. Over time, I have gotten more used to the earbuds, but unlike others that I never had to touch, I find myself frequently shifting these around to get that sharp edge off of my ear. I compared them side-by-side with my older broken earbuds and noted that those ones were smooth and curved, preventing such issues.

Two other details about the earbuds are worth noting. First, the cord is quite bulky. I don't mind, especially since the bulk is largely due to the kevlar reinforcing fabric, for which I am grateful, but it's not easy to see how thick it is in the pictures. Second, the plug is straight, not 90 degrees. This is no problem either, but a detail that some people wish to know.

Overall, I am happy with the JBuds J4 earbuds, but their unfortunate sharp-edged design really detracts from their overall rating, due to the discomfort it causes in the ear. If JBuds could reshape the J4 to more resemble the J3, or the Sennheiser CX300, this would solve the only problem I have with them, and would earn the J4 earbuds a 5 star rating in my book.

Sunday, September 11, 2011

Java EE 6 Development with NetBeans 7

In any technical work, the author's primary problem is to target an audience, and to maintain that focus throughout. This is every bit as important as accuracy.

With the title of this book, you expect that the operational pieces in the Java EE 6 spec will be explained within the context of the Netbeans IDE. That's all well and good, but how much prior knowledge of both these Java standards should be assumed? Here one must avoid too many screenshots, with a singular focus on step-by-step procedure. At the same time, it must be assumed that a really seasoned developer is probably already familiar with Netbeans and would just want an in-depth focus on the somewhat newer Java EE 6 spec.

In view of this, some coverage of the UI of the IDE, with due attention given to the whys and wherefores of the Java EE 6 components, is in order. It's reasonable to expect an substantial audience for a practical guide that explains how this IDE can help a developer who wishes to stick with the facilities provided in the EE 6 spec. Additionally, one can expect the reader has a technical bent but could use help integrating the technologies in the Java spec. In other words, a reader in the moderate knowledge range.

So now I have to say that I'm a member of the above target audience, and I really liked this book.

I won't re-list the table of contents here, but I have to mention some highlights here. It's my opinion that JSF has evolved to the point where it is a serious contender; especially since PrimeFaces hit the scene. So I was really happy with chapters 4 and 5. It's wonderful to see such a concise Facelet template explanation. PrimeFaces is there because it is included with Netbeans 7. Although one sees a lot of Hibernate, it's cool to have JPA included- and the author sails right on into session beans. There is a great discussion of Web Services development to wrap up.

The book has a good selection of topics; and is approachable- but it isn't a lightweight in that it really explores, to some depth, what the current iteration of Java EE can do. After reading it, you definitely gain a new respect for Netbeans, too.

Don't expect coverage of things outside of Java EE 6 (except for PrimeFaces)- there is only so much room in one book. Given the title, this isn't a surprise or really a problem. Just be advised.

This book promises to be practical in approach; to integrate Java EE and Netbeans; to be concise and comprehensive; and for a wide range of developers. I think it pulls it off. I have to recommend this one.

Reviewed by: Kenneth Tindle

Sunday, September 04, 2011

Trend Stetting: Hail to the Editor in Chief

Regardless of your contribution to Barack Obama’s approval rating, you have to admit one thing: The man can give a speech. And to the delight of professional wordslingers the world over, toiling under deadlines and character counts, he tends to write much of each address himself (like another fellow who’s spent some time on Pennsylvania Avenue used to say, he “feels our pain”).

To figure out why the 44th president’s speeches have such an explosive impact on listeners across the party spectrum, seasoned political analysts Mary Frances Berry and Josh Gottheimer tackled the impressive task of parsing his language. Their forthcoming book, Power in Words, walks us slowly through 18 of candidate Obama’s major addresses during his ascent to the White House.

It’s a fairly wonky read, as you’d imagine, with plenty of citations and endnotes and an occasionally excruciating level of detail: “After a few days in the country spent traveling with a twelve-car motorcade, Obama and his entourage flew to the rural area of Kolego in the Siaya District of Nyanza Province, about 175 miles east of Nairobi.” But Berry and Gottheimer temper their academic approach with lively anecdotes about backstage tension and last-minute rewrites, as well as insight into the symbiotic relationship between Obama and his head speechwriter, Jon Favreau (not the guy behind Cowboys & Aliens—look for his younger, prettier Googleganger).

Here’s what I learned from their efforts: The president’s political savvy and famous preacherlike cadence play a big role in his ability to stun a crowd, but delivery only goes as far as what’s in the package. Berry and Gottheimer close every chapter with the full text of the speech they’ve just analyzed, and the placement is apt. It drives home the force of the words themselves—clean and precise and startlingly emotional, even on a two-dimensional page. You may or may not agree with them, but they’re impossible to ignore.

Monday, August 29, 2011

Scriptin' with JavaScript and Ajax

There are lots of JavaScript and AJAX books out there now, but few really combine both skills into one book. A few books that do, are huge books (700+ pages) and really are impossible to read through and actually get through all the 'techo-jargen' to really get anything out of the book. Most people need a easy-to-understand, to the point with real-world examples book.

This book by Charles Wyke-Smith is the book you are looking for if you want to quickly get started learning JavaScript with all the latest features (including libraries) and how to incorportate AJAX features as well. Since AJAX is not a separate technology, but incorporate sepecific JavaScript objects to create AJAX-enabled websites.

The author assumes no previous JavaScript experience and goes through the basics of JavaScript covering variables, if statements, loops, arrays and how objects/classes work. Then the author goes into explaining the DOM works in modifying and referencing HTML elements of a web page as well as modifying CSS styles of elements (and child elements) of a page. This of course is the foundation of how to use AJAX properly and explained very nicely by the author will great examples to get anybody up and running easily.

The author then goes into explaining JavaScript events inrelation to how they affect an HTML page with window and mouse and keyboard events. The author also covers the Event object in talking about event delegation and working with the DOM in creating some complex JavaScript examples.

Then various JavaScript libraries such as jQuery, Adobe Spry, Prototype are explained with some really cool examples of using multiple libraries together which is very unique for most JavaScript books.

Finally, the author very nicely explains how the objects that work with AJAX work and how to create some really useful AJAX web pages with PHP.

Lots of good stuff to learn from this book and the author does a fabulous job doing it a relatively short book (300 pages).

A great book and worth buying if you want to learn JavaScript and AJAX the proper way!!!

The Linux Programming Interface

If your nose is a bit sensitive, the physical book might smell of chemicals, or at least the original copy that I received did. I was able to get a less strongly smelling copy from the publisher, which helped a lot. The hardcover edition is fat and pricey but worth it - looking at the sample code from the kindle version it came with it was kind of hard to keep track of what's going on while flipping through screens.

Also - I was confused on this point for a little bit - if you're looking for coverage of user space processes like systemd or command-line filters like less or grep, this is not the book for you - it covers only the underlying kernel system calls and C API which those filters are written with.

That said, I'm learning a lot about Linux through this book - and C as well. I learned C++ before I learned Linux, in some programming class where we used it to build a simple calculator and similar tasks. Learning C a bit later was a pain because it seemed so archaic and there was no proper motivation. Reading this book, though, made me realize how C actually makes a lot of sense in its proper context as a tool primarily for systems programming, for which it was created.

It's still slow and dense to read and digest (I still have a long ways to go with it), but I don't think there's any way around that - there's a lot of subtle and good information here, and it builds up the foundations progressively.

Be sure to get a copy if you are a serious Linux hacker.
Related Posts with Thumbnails