Tuesday, May 01, 2018

Pytest warning: How to fix Pytest plugin warnings

If, like most of the guys I know, you use Pytest for testing, you will at some stage run into different warnings when running your tests. Mine for some reason started issuing a warning like this:
pytest_funcarg__cov: declaring fixtures using "pytest_funcarg__" prefix is deprecated and scheduled to be removed in pytest 4.0.  Please remove the prefix and use the @pytest.fixture decorator instead.

Although, this did not stop the test from passing - it simply changed the colour to yellow instead of green to indicate that your tests passed successfully.

In my case, the issue was due to an outdated version of pytest-cov plugin that was installed as part of the original pytest installation. As it turns out, pytest won't upgrade it even when you upgrade your pytest version. So, you are left to not only figure out what the issue is, but how to fix it.

In most cases where similar warnings are shown, it can easily be fixed by first identifying which of the plugins is causing the issue rather than suppressing it; and attempt to upgrade it separately. This should hopefully fix it.

Again, in my case a simple command like this:
pip install --upgrade pytest-cov

helped to fix the issues and returned my test results to green.

Sunday, January 07, 2018

Sorting Python Dictionary By Values

First, I would like to say happy new year to you and hope you had a great 2017 and looking forward to a more rewarding and better year ahead. My 2017 started not very well, but ended on a high. I changed jobs. I will write about it later.

For now I just wanted to document something I hope will be useful to others as much as it has been for me.

There are times when something quite seemingly quite simple can be nothing but. In MySQL, it's simple to group by a field but didn't think I could do the same thing in Python. A quick search led to this example that I quickly adapted to fit my need. Hence this post... not only to share but to also document it just in case the original link disappears like some sites do these days.

from operator import itemgetter
from itertools import groupby
rows = [
    {'address': '5412 N CLARK', 'date': '07/01/2012'},
    {'address': '5148 N CLARK', 'date': '07/04/2012'},
    {'address': '5800 E 58TH', 'date': '07/02/2012'},
    {'address': '2122 N CLARK', 'date': '07/03/2012'},
    {'address': '5645 N RAVENSWOOD', 'date': '07/02/2012'},
    {'address': '1060 W ADDISON', 'date': '07/02/2012'},
    {'address': '4801 N BROADWAY', 'date': '07/01/2012'},
    {'address': '1039 W GRANVILLE', 'date': '07/04/2012'},
]
# Sort by the desired field first rows.sort(key=itemgetter('date')) # Iterate in groups for date, items in groupby(rows, key=itemgetter('date')): print(date) for i in items: print(' ', i)
Then: https://stackoverflow.com/questions/9198334/how-to-build-up-a-html-table-with-a-simple-for-loop-in-jinja2

Thursday, April 20, 2017

Learning R

A few years ago I was a very active Java developer and advocate. I loved it, helped to organise meetup events and even spent many nights answering questions in the now-defunct Java forum. I'm sure some old time Java developers here will still remember those days.
It used to be quite fun; I learnt a lot myself just by researching and helping people with their issues. You can't provide a solution if you haven't compiled and ran the code yourself - which is a great way to learn.
 
But sometime in 2009, I discovered Python by share chance. In one of the many forums online, someone was asking about open source anti-virus software - and if they were any good compared to paid software.
A few people suggested that Clamwin was quite good and it was open source. This got my thinking that it would be nice to see how real-world open source applications were developed.
 
Downloaded the code and studied just about every file in the project folder. That was my very first exposure to Python and it was surprisingly easy to understand the code. The C code on the other hand was bit trickier and somewhat confusing to say the least :)
This led to me learning Python and eventually getting a job as a developer using the language; and slowly using less of Java.

However, in the last 6 months or so, I have started messing about with R and I'm blown away at how quickly you can knock things together especially when it comes to data.

I will be adding more R code here as time goes on - this is mainly for me to document my progress and to share something that others can hopefully find useful.

Wednesday, July 01, 2015

Parsing JSON With Python

Ok, in the last couple of weeks I've been working with Google Geocoding but realised how easy it is to parse the return JSON in Python. In fact, I was parsing the JSON result with Javascript - which does a very nice job, but i needed or rather prefered to have better control than what Javascript provides.

And this is where Python comes in. If you have been working with Python for a while, you will have noticed that JSON is nothing more than a Python Dictionary. This makes accessing the key/value quite effortless. To give you a simple example, here's an output of a simple address query using Google's Geocoding API: http://maps.googleapis.com/maps/api/geocode/json?address=8-10%20Broadway,%20London%20SW1H%200BG,%20United%20Kingdom&sensor=false

{
   "results" : [
      {
         "address_components" : [
            {
               "long_name" : "8-10",
               "short_name" : "8-10",
               "types" : [ "street_number" ]
            },
            {
               "long_name" : "Broadway",
               "short_name" : "Broadway",
               "types" : [ "route" ]
            },
            {
               "long_name" : "Westminster",
               "short_name" : "Westminster",
               "types" : [ "sublocality", "political" ]
            },
            {
               "long_name" : "London",
               "short_name" : "London",
               "types" : [ "locality", "political" ]
            },
            {
               "long_name" : "Greater London",
               "short_name" : "Gt Lon",
               "types" : [ "administrative_area_level_2", "political" ]
            },
            {
               "long_name" : "United Kingdom",
               "short_name" : "GB",
               "types" : [ "country", "political" ]
            },
            {
               "long_name" : "SW1H 0BG",
               "short_name" : "SW1H 0BG",
               "types" : [ "postal_code" ]
            },
            {
               "long_name" : "London",
               "short_name" : "London",
               "types" : [ "postal_town" ]
            }
         ],
         "formatted_address" : "8-10 Broadway, Westminster, London, Greater London SW1H 0BG, UK",
         "geometry" : {
            "location" : {
               "lat" : 51.49873430,
               "lng" : -0.13312210
            },
            "location_type" : "ROOFTOP",
            "viewport" : {
               "northeast" : {
                  "lat" : 51.50008328029150,
                  "lng" : -0.1317731197084980
               },
               "southwest" : {
                  "lat" : 51.49738531970850,
                  "lng" : -0.1344710802915020
               }
            }
         },
         "types" : [ "street_address" ]
      }
   ],
   "status" : "OK"
} 
 
What is displayed above is the result of the URL we supplied to Google's
 Geocoding API. Of course, we couldn't display that to our users - that 
would be daft. Most of the time you'd want to parse this info and use 
the values in your application.
 In our case we had to extract the Lat and Long for our application. 
There was no need to display the JSON - Python makes this a breeze and 
all we need is to use Python's urllib2 module to open up the URL and 
read the result. 

So, to parse that and display the full address in human-readable format, it's as simple as doing something list this:

>>> import json
>>> import urllib2
>>> j = urllib2.urlopen('http://maps.googleapis.com/maps/api/geocode/json?address=8-10%20Broadway,%20London%20SW1H%200BG,%20United%20Kingdom&sensor=false')
>>> js = json.load(j)


Please note that we used load() instead of loads(). You would typically 
use loads() for strings, but load() is designed for resources such as 
files and - and in our example - a URL.

Now to display the address, we simply loop through our dictionary like so:

>>> ourResult = js['results'][0]['address_components']
>>> for rs in ourResult:
...     print rs['long_name']
...
8-10
Broadway
Westminster
London
Greater London
United Kingdom
SW1H 0BG
London
>>>


With that out of the way, what about our main focus which is to print the coordinate of a particular address? Well, it turns out that that is even a lot simpler.
This time we just navigate our way down until we find what we're after. Which in this case is the latitude and longitude. 

>>> ourResult = js['results'][0]['geometry']['location']
>>> print ourResult['lat'], ourResult['lng']
    51.4987343 -0.1331221
>>>


One other cool thing about parsing JSON with Python is that you can 
quickly and easily map the results into your Django Model and do 
anything dangoey with it. Here's an example:
objs = json.loads(request.POST)
# Iterate through the stuff in the list
for o in objs:
    # Do something Djangoey with o's name and message, like
    record = myDjangoModel(name = o.name, message = o.message)
    record.save()


Now, if you are looking to mix Python, JSON and Django together - it is as simple what we've just shown above.
                     

Sunday, January 25, 2015

Testing Python: Applying Unit Testing, TDD, BDD and Acceptance Testing

This is a long overdue book. Python has been steadily growing in popularity in multiple industry verticals over the past decade and the different sub-cultures have brought a variety of programming styles and methodologies to the language. As more and more Python code is powering today's production and mission-critical systems it becomes essential to ensure quality and reliability while maintaining efficient and agile development practices.

There has been a flurry of literature written in recent years about the overall benefits of agile methodologies and test-driven development. To a large extent, however, individual developers and teams have been left on their own to figure out how to put this philosophy to practice and extract maximum benefit from it in their trade.

David Sale's book alleviates this issue for Python developers by providing extremely pragmatic, timely and well-organized guidelines as well as many specific examples on how to approach the development and testing of complex systems in a way that amounts to building better software.This is not an academic work - it focuses exclusively on practical solutions to real-world industry problems.

Fairly short and to the point, the book mixes equal portions of justification and tutorial-style examples to work through.

The author has picked some of the best Python tools that are currently available for the various tasks at hand, but the reader will be well equipped to make their own choices once they understand the basic concepts.

Thursday, July 24, 2014

Working with Peewee ORM

Wow, it's been a long while since I last posted something here. As always work and family have been taking a huge chunk of my free time - making it almost impossible to drop by to update this blog.

That said, I have been playing around with Peewee. It is a very small ORM (Object Relational Mapping) framework for working with your database. It is fits very well with things like Flask or Bottle Python frameworks. If you've spent time developing in Django you will feel very much at home. All the models and queries are basically the same except a few that make the Peewee stand out.

It currently supports PostgreSQL, MySQL and SQLite. Installation is a breeze - just use pip at a command prompt like so:

$pip install peewee

Here is a sample application that defines our models, creates the tables, inserts the data and prints them all out again.

################### Example of using the Peewee ORM ########################

from peewee import *
db = SqliteDatabase(app.db)
class BaseModel(Model):
    class Meta:

        database = db        
class Person(BaseModel):
    name = CharField(max_length=100, index=True)    
class StatusUpdate(BaseModel):

    person    = ForeignKeyField(Person, related_name='statuses')
    status  = TextField()
    timestamp = DateTimeField(default=datetime.datetime.now, index=True)

Person.create_table()
StatusUpdate.create_table()    

#------ Inserting into our new tables --------
huey = Person(name='Nkem')
huey.save()

#or
charlie =  Person.create(name='Charlie')
StatusUpdate.create(charlie, status='First status')

#----- querying -----

people = Person.select().order_by(Person.name)
for person in people:print person.name
    print person.name 
    for status in person.statuses.order_by(StatusUpdate.timestamp):
        print '*', status.status

        
 
For those who like to take control of their SQL, Peewee also allows you to run raw SQL commands. Here is an example of it:

db = SqliteDatabase(':memory:')

class Person(Model):
    name = CharField()
    class Meta:
        database = db

# let's pretend we want to do an "upsert", something that SQLite can
# do, but peewee cannot.
for name in ('charlie', 'mickey', 'huey'):
    db.execute_sql('REPLACE INTO person (name) VALUES (?)', (name,))

# now let's iterate over the people using our own query.
for person in Person.raw('select * from person'):
    print person.name  # .raw() will return model instances.
I find it quite interesting mixing it with Flask. There are a few ideas I have and will explore them over the weekend and post the result here. There are tons of things you can do with this little framework - so go explore and see what you come up with. Good luck!

Saturday, March 22, 2014

The New Speaking JavaScript

I bought this book despite having other general-purpose Javascript references because I've always really liked Dr. Rauschmeyer's precise writing style on his blog. This book does not disappoint. It's a clear, complete, and unambiguous reference to an sometimes misunderstood and often confusing language.

This is an authoritative guide to the language that doesn't complain or split hairs. There's a tremendous amount of information here presented by a subject matter expert who's adept at explaining sometimes difficult and nuanced concepts with remarkable clarity and terseness. He doesn't gloss over anything or make assumptions; he simply tells it like it is.

This isn't a difficult book to read, in fact it's refreshingly easy, but it's probably not going to be great for novices. It assumes a certain capability on the part of the reader. If you're starting from ground zero, I'd recommend something more conversational or introductory. But if you're looking for a brilliantly organized and researched in-depth reference, you won't be disappointed with Speaking Javascript.

Tuesday, December 31, 2013

How I combined simple #Python list comprehension and JSON parsing

There are lots of very interesting things to discover in Python - especially if you've been working with Java or any other programming language for some time. For example this simple piece of code demonstrates how you can quite easily convert a list of of Strings of integers separated by comma - into a list of integers. What I particularly like about this small code is that it uses what Python developers refer to list comprehension.
string1 = "020783, 503553, 555204"
mylist = [int(n) for n in string1.split(',')]
>>>>>> mylist
>>> [020783, 503553, 555204]
Now, that piece of code was all I needed to get the API application I was working on to generate a nested list of integers. As it turns out, Python makes things really easy.
def parse_points(self, json_response):
        try:
            result = json.loads(json_response)
            if result.has_key('points'):
                the_points = result['points']['code']
                mylist = [int(n) for n in the_points.split(',')]
                return mylist 
            else:
                return result
        except ValueError, e:
            raise PlottingError('JSON Parsing Error: ' + e)
.... Further down the code, that returned value is eventually used to as an array of list:
     "waypoints":[020783,
                  503553,
                  555204]
This would not make much sense to a lot of people out there - that is deliberate because I don't want to show the code in full. Protecting the real code is vital here. However, the aim for this small code is to demonstrate how to parse a list of integers in string separated by comma. With time I will post a full blog with a complete working code on how this works.

Monday, December 02, 2013

Python 3 Object Oriented Programming - The Review

Prior to reading Python 3 Object Oriented Programming I was already familiar with advanced OOP concepts and Python 2 in particular; as well as with Java and other languages. So, I expected the book to enforce my thinking and help me to understand new features provided by Python 3 as compared to version 2. I think the book managed to do this in an excellent manner.

I think the approach used by the book is well suited for a wide range of readers. It explains enough theory and provides useful examples that help to understand how to apply OOP in practice. People new to Python and/or OOP have a lot to gain from reading Python 3 Object Oriented Programming. More experienced users of the language may find the book ideal as reference material.

It's important to note that the book focuses on OOP particularly in the context of Python. Don't expect any history lessons or theory on various OOP approaches (prototypes vs. classes, ie.) beyond the one (class based approach) used in Python. Despite this the book provides excellent value. I do recommend checking out several other languages (Java, Lua, JavaScript, Smalltalk) and paradigms (AOP, traits) for further inspiration.

You can get a copy here >>

Tuesday, January 08, 2013

Gray Hat Python for Windows

In my career, Python was the first programming language that I have learned. I then learned programming in Java and C++. I looked back to Python for it's simplicity and versatility. That is why I decided to pick up Gray Hat Python for Windows to learn what Python can do in hacking and reverse engineering since that is something I am interested in.

The author's writing style is clear, direct, and mature. The format of the book is clean and well structured which makes it easier to maneuver. The problem I had with the book was that the code in the book is unreliable. The code in the book and the code in the website do not match. Also, the book is Windows oriented which may be a disappointment for some people.

Overall, there was an abundance of valuable information in the book that grabbed my attention such as fuzzing and the debugging. The book covers a lot of subjects such as debugging, hooking, code injection, and more. The author does a very good job with consolidating the information in the book.

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.
Related Posts with Thumbnails