Archive for category Books

ctypes – Python’s awesome low-level library

Last week I purchased the book Gray Hat Python, by Justin Seitz. Though, I’m somewhat skeptical that I’m going to be finishing reading the book anytime soon, I started reading it’s first chapter. It appears that the book is going to be mostly based on Python’s ctypes library. Which in short, this really cool library lets you create complex C datatypes and low-level memory manipulation in pure Python code. One thing that really impressed me about cytpes is its ability to call functions in dynamically linked libraries. For example, with ctypes, you’re able to call the printf function from both Linux’s and Windows C runtime libraries, which I think it’s really cool.

Linux


from ctypes import *

love = CDLL('libc.so.6')
msg = 'Hello Baby'

love.printf("Testing: %s\n", msg)

Outputs:

Testing: Hello Baby


MS-Windows


from ctypes import *

msvcrt = cdll.msvcrt

msg = 'Hi'

msvcrt.printf('Message: %s', msg)

Outputs:

Message: Hi

What’s in my bookshelf?

As always I’m pretty late in writing my book reviews. This time it’s been well over 6 months since I finished reading the book “Beginning Ruby” (first edition) by Peter Cooper. I have to say is this by far the best Ruby book that I’ve read so far. (This is out of a 13 book collection that I own on Ruby programming.) I’ve always been a fan of Apress “Beginning” title’s, and this book is definitely not the exception. Although this book is technically considered for beginning/intermediate programmers wanting to dive to the wonderful world of Ruby, I feel this book is perfect for all levels of programming expertise. The authors does a wonderful job explain the concepts of each chapter and slowly building you to what will be the next chapter. Like Apress’ “Beginning Perl” book help me tremendously in learning the language, I have to say this book taught how to program in Ruby.

I’ll definitely come back to this book and use as a reference. Anyone new or already experienced using Ruby, will definitely benefit from reading this book. I hope this book (all editions) gets the high praise from the Ruby community, which it deserves, as in my eyes this is a classic programming book and I see this title as the Llama/Camel book for the Ruby World.

Chapter 1: Let’s Get it Started: Installing Ruby
Chapter 2: Programming == Joy: A Whistle-Stop Tour of Ruby and Object Orientation
Chapter 3: Ruby’s Building Blocks: Data, Expressions and Flow Control
Chapter 4: Developing a Basic Ruby Application
Chapter 5: The Ruby Ecosystem
Chapter 6: Classes, Objects, and Modules
Chapter 7: Projects and Libraries
Chapter 8: Documentation, Error Handling, Debugging, and Testing
Chapter 9: Files and Databases
Chapter 10: Deploying Ruby Applications and Libraries
Chapter 11: Advance Ruby Features
Chapter 12: Tying it Together: Developing a Larger Ruby Application
Chapter 13: Ruby on Rails: Ruby’s Killer App
Chapter 14: Ruby and the Internet
Chapter 15: Networking, Sockets, and Daemons
Chapter 16: Useful Ruby Libraries and Gems

Beginning Ruby (2nd Edition)
5/5

Tags: ,

Charles Bowden – Murder City

As always, Charles Bowden slaps everyone in the face with logic and common sense.

What’s in my bookshelf?

It’s been a couple of months since I finished reading “Murder City Ciudad Juarez and the Global Economy’s New Killing Fields” by Charles Bowden and I just realized it’s injust to not write a review to a truly amazing book.

Unfortunately the general public does not know that Mexico is on its way of become a full fledge Narco state. According to United Nation’s advisor and expert in international organized, Dr Edgardo Buscaglia, “the state’s institution and Mexico’s civil society is in as criminal organizations are undermining the legitimacy of the Mexican state and getting legiticay approval and acceptance by society.”
In reality is that Mexico is in a verge a civil war, caused by the failed US drug prohibition policy and many other key decisions made by the governments surrounding it.

The book Murder City is primarily focused in Ciudad Juarez, Chihuahua and it’s surrounding border cities.

The book consists of three different protagonists; Miss Sinaloa, Emilio Gutierrez, and El Sicario. In short Miss Sinaloa is a pageant queen who goes to a private party in Ciudad Juarez and she gets raped by the police and goes insane, which eventually she in ends up in a mental asylum on the outskirts of Ciudad Juarez. The second protagonist is Emilio Gutierrez. He is a journalist who published stories about the crimes that the Mexican army was committing to local residents. Eventually until receiving death threats warnings from elements of the Mexican army. The author Charles Bowden mostly describes on how the United States doesn’t want to face facts and admit that Mexico is not a country that respects human rights. What impacted on me the most on Emilio’s Gutierrez story is how currently the United States hypocritically critizes other nations for human rights abuses and when a person like Emilio Gutierrez asks for alysum, the US see’s and treats him like a criminal. The third and final protaganist on this book is “El Sicario”, which in English translates to “The Hitmen”. El Sicario’s story in my opinion is what makes this entire book a classic. Charles Bowden interviewed El Sicario, and painted his before, during and after life, after working for a drug cartel and organized crime for over 20 years.

This book is definitely the best non-fiction piece of literature that I’ve read in my life thus far. Although I don’t fully agree with all of Charles Bowden views, specially his views about illegal immigration. He deffinetly portrayed and informed on other things about Ciudad Juarez and Mexico to that matter, which I wouldn’t really thought or think about. The most notable being the affect of the North America Free Trade Agreement (NAFTA). This is the primary reason why he added the “Global’s economy’s Killing Field’s” subtitle to the book. Essentially what NAFTA has done in Ciudad Juarez is to, attract hundreds of thousands of peasants from southern Mexico to essentially work on American slave factories. Of These factories almost 100% turnover in a city of poverty where it’s social society is faced with the inability of being able to take care of their young, and create a culture where theres 500 – 900 street gangs. Thus creating Ciudad Juarez the most dangerous and voilent city of the world. Where it’s violence exceeds of those in Iraq and Afghanistan.

Charles Bowden and Emilio Gutierrez on the “Narco State” National Geographic documentary.

An Italian filmmaker interviewed “El Sicario” on the truly amazing documentary called “El Sicario – room 164″. (German subtitles)



BookTV has two really good interviews made to Charles Bowden about the book.
LATimesFestival of Books Interview and Calling with Charles Bowden Murder City Ciudad Juarez and the Global Economy’s New Killing Fields
BookTV – Charles Bowden Interview

References:
http://www.youtube.com/watch?v=SBQGZrZY1Rg&feature=related
http://www.youtube.com/watch?v=jT0HD_6hfq4&feature=related

What’s in my bookshelf?


I finally finished reading my first book on Ruby programming. Ruby: Visual QuickStart Guide, by Larry Ullman has to be the perfect introduction book for anyone trying to learn the Ruby programming language, even though sadly it only has 3 five star reviews on Amazon. The author writing thoroughly explains the concepts in a friendly and easy to understand manner. This being the third book that I’ve read from this same author, the other titles being for MySQL and PHP (no reviews on these yet since I’m not fully finished reading them).

One thing I would’ve like changed the author to change was on the database chapter, as it was mainly focused on SQLite. It would have been better if the author used MySQL instead. Also it would have been better if the author removed the dedicated chapter to Rails, and instead extended the chapter to have more generic web related like Net::HTTP, given how powerful that single class is.

Chapter 1: Getting Started
Chapter 2: Simple Scripts
Chapter 3: Simple Types
Chapter 4: Array, Ranges, and Hashes
Chapter 5: Control structures
Chapter 6: Creating Methods
Chapter 7: Creating Classes
Chapter 8: Inheritance and More
Chapter 9: Modules and Includes
Chapter 10: Regular Expressions
Chapter 11: Debugging and Error Handling
Chapter 12: Rubygems
Chapter 13: Directories and Files
Chapter 14: Databases
Chapter 15: Networking
Chapter 16: Ruby on Rails
Chapter 17: Dynamic Programing

I would highly recommended this book to anybody starting or wanting to learn Ruby.
Ruby-Visual-QuickStart
4/5

What’s in my bookshelf?


I finally finished reading my second book on Perl. Unlike Apress’ Beginning Perl, Learning Perl 5th Edition by Randal Schwartz, Tom Phoenix, and brian d foy is not a book for someone new to programming.
With a solid understanding of dynamic languages like PHP and Ruby, I found most of the material covered on this book very comprehensive, thus said, at times I found myself re-reading portions of the chapters just to understand concept the authors were trying to cover.

For the most part, I read this book jointly with Apress’ Beginning Perl and I found this book to have more practical real word code examples (at least if you’re a sysadmin). The most notably difference on how this book was written for someone who is new to programming with Perl, but to not new to programming are the three chapters the authors dedicate to regular expressions.

Chapter 1: Introduction
Chapter 2: Scalar Data
Chapter 3: Lists and Arrays
Chapter 4: Subroutines
Chapter 5: Input and Output
Chapter 6: Hashes
Chapter 7: In the World of Regular Expressions
Chapter 8: Matching with Regular Expressions
Chapter 9: Processing Text with Regular Expressions
Chapter 10: More Control Structures
Chapter 11: Perl Modules
Chapter 12: File Tests
Chapter 13: Directory Operations
Chapter 14: Strings and Sorting
Chapter 15: Smart Matching and given-when
Chapter 16: Process Management
Chapter 17: Some Advanced Perl Techniques
Chapter 14 Introduction to CGI
Chapter 15: Perl and DBI

I would only suggest this book to someone with a solid knowledge of another scripting language.
Learning Perl, 5th Edition
3/5

What’s in my bookshelf?


It only took me exactly two years to read the Apress book Beginning Perl by James Lee, and I would have to admit this is the best programming book that I’ve read so far. I would need to give this book high praise as it was easy and fun to read ( pretty much taught me programming in Perl. Even tough I don’t use Perl on a daily bases, nor is Perl my prefer language of choice to write scripts ) but thanks to this book I could confidently read other programmers perl code and have an understanding on what’s going on in their program.

Chapter 1: First Steps in Perl
Chapter 2: Scalars
Chapter 3: Control Flow Constructs
Chapter 4: Lists and Arrays
Chapter 5: Hashes
Chapter 6: Subroutines/Functions
Chapter 7: Regular Expressions
Chapter 8: Files and Data
Chapter 9: String Processing
Chapter 10: Interface to the Operating System
Chapter 11: References
Chapter 12: Object-Oriented Perl
Chapter 13: Modules
Chapter 14 Introduction to CGI
Chapter 15: Perl and DBI

I would highly recommended this book to anybody starting or wanting to learn perl.
Beginning Perl, Second Edition
5/5

Quest towards self-taught computer programming

After a three week hiatus I’ve got back againg reading my PHP and Bash shell programming books.

Bash