La Boina Roja

The struggles off a future RHCE….


Leave a comment

Recommendation: Hacking Secret Ciphers with Python

Want to learn Python and learn how to hack at the same time ?

Then this book is for you photo thumbsup.gif
cover_hackingciphers_thumb

This is a beginner book in Python 3, while learning this you also learn hacking. Cryptography is a subject touched in this book, now I know that a lot of cryptography courses require a decent understanding of math.  But When I asked Al Sweigart about this, he came with this reply:

You only need to know basic arithmetic. The book covers the mod operator, greatest-common-divisor, and everything else math-related. There really isn’t that much to it.

So basically, any 10 year old would be able to follow along.

I most likely will not be doing this course null  I am recommending this book because during my initial searches about Python beginner courses, his earlier books came highly recommended by several communities. The other reason why I recommend him is, he is willing to answer questions from people who are going through the books and he is honest null Another quote:

Basically, this book uses crypto as a way to make learning programming interesting. It’s good for a complete beginner, but not comprehensive for becoming a programmer.

Now, if only other people were as honest about their beginner courses null

Ooh, did I mention you can get this book for free null You can get this book in various formats too!( HTML, PDF and mobi).

When you finished the book, you should check out Mystery Twister C3 it is a platform, created by Al Sweigart, where you can test your cipher skills and discuss your methods.  The last part is very important if you want to become a (better) programmer, imho.

Advertisements


1 Comment

Python vids at Khan Academy

cliccie for larger piccie

cliccie for larger piccie

Notice how I don’t call it a course and not recommend it? Let’s just say it is a good thing Salman Khan let other people deal with teaching others to program. These vids are hidden well, you cannot find them under “Computer Science” but you find them in “Science & Economics” called “Computer Science“. In my opinion it doesn’t deserve that name  photo talktothehand.gif

To be fair, I find it a bit awkward to be so harsh  photo bloos.gif as Salman Khan does a miraculous job at explaining math. Thanks to him and his great math vids I am considering programming. I am not going to say the vids are horrible, but he should just have some vids removed and the other vids regrouped somewhere else.

I will leave you with a list of pro’s and cons.

Pro’s:

  • vids are usually not longer then 10 minutes
  • you don’t have to register to follow the “course”, if you do you get badges photo kwijl.gif
  • even though he uses mathematical concepts, mathematical knowledge is not required. He explains the concepts he uses really well, in his own brilliant way photo worshippy.gif
  • there are subtitles available for the vids
  • he visualizes Python concepts, those are the better vids, the best vid imho is where he explains binary numbers. I finally understand those!

Cons:

  • it starts at beginner level and somewhere,  somehow it becomes complicated
  • there is no a real structure
  • even though I have gained some valuable insights, I miss the point of this course
  • it seems like he gave up on the course half way
  • some vids are useless, like “Python 3 Not Backwards Compatible with Python 2”. Really  photo pidown.gif a vid to explain that? In which he also discusses one single difference,  if I am not mistaken, between Python 2 and 3? Also why is this the 10th vid?
  • some vids are too long, like the “Insertion Sort Algorithm” vid
  • towards the end this “course” seems rushed photo nooo.gif

My overall opinion on this “course” is, don’t follow it from the beginning to the end, it is not worth your time. I would not recommend this “course” to a beginner. If you have difficulties grasping the concepts which he happens to discuss, just watch those instead. Especially the ones where visualizes those concepts.


2 Comments

Coursera starts a Python course on the 15th of April!

The course is called “An Introduction to Interactive Programming in Python”   and it’s free  photo thumbsup.gif  The course will cover Python 2.

Coursera is unfortunately one of those institutions that hasn’t implemented signing in by Google, Facebook etc. yet. But from what I’ve heard and read they give awesome classes. So it I think it is worth going through another sign up process again.

Since you’ve asked  photo piwink.gif no, I will not be joining that class.


Leave a comment

Recommendation: A first programming language by Brian Will

This a video course by Brian Will, it is a part of his learning to program tracks. This course consists of two videos the first one is 45 minutes, the second 30 minutes.

It’s an introduction to programming and he seems to suggest to watch this before learning to program. Well I disagree, I remember to try to watch these vids before learning Python. I gave up  photo emo.gif while Brian Will is a great tutor he is also slightly boring and when he discussed the code (which was nothing but gibberish to me at the time) all I could think “dafuq did I just read”.

Why did I start this course again? Well,  I finished some Python classes and Brian Will is a great tutor  photo thumbsup.gif I know myself well enough to know, that the moment the stuff starts to click in my head I will overcome the fact that he can be boring.

I would suggest to watch this vid, after you had a couple of classes in programming. If you just learned about loops, functions, if, elif, lists and dictionaries for the first time. But still don’t entirely grasp these concepts, these two vids are for you.

In the first vid he starts with a brief introduction about hardware and he introduces you to a language he made up; pigeon.  But don’t worry about him using pigeon, it won’t conflict with the language you are learning. After watching the first vid I had more understanding of the elif statement.

The second vid touches the subject of good programming practices and explains some basic programming principles like local and global and gives a more in depth explanation of functions. The most important thing I learned however in this vid was that the data type number is immutable. To quote Brian will:

“None off the arithmetic operators actually modify number values, they create a new value instead.”

I must admit this was quite the insight  photo redface.gif

If you want to have the lecture slides or read some additional notes on this course go to his site.


Leave a comment

Am I being tested?

 photo emo.gif

Seriously, almost 2 weeks ago I got my act together. I lowered my alcohol intake, started to eat healthy, work out each morning and I decided to treat learning to program as a job.

So I decided to restart the my Python course at Codecedemy, only to run in to these screens all the time  photo bonk.gif:

deargodwhy

whyyyyyyyyyyyyyyyyyyyy

Codecademy recently implemented some major changes to their site and it is having trouble ever since. Take a look at their twitter:

codecademytwitter

To be fair, even though this frustrates me to no end, I do feel bad for the people behind Codecademy. They don’t deserve this photo smile.gif


Leave a comment

Compare that code!

If you are using Codecademy, I strongly suggest after each exercise that has more then 10 lines of code, to compare it with your fellow “virtual” classmates. Even if you wrote the code successfully all by yourself.

Why you ask? One of the beauties of programming  photo heart.gif is, you can write the solution to a problem in a gazillion ways. Reading other peoples code helps in learning to program.

Down on the left side of Codecademy there is a button called “Q&A Forum” it leads you straight to the relevant part of the forum.

cliccie for larger picce

cliccie for larger picce

Yes people ask for help on there, but they also post their code. It really pays off to check, I for one learned how to write shorter code  photo thumbsup.gif


Leave a comment

Slicing in Python

sword

Ha! Another trickety trick that is used on Python newbies is slicing. The trick is in getting the correct characters(in case of a string) or the correct items(in case of a list). They often make your mind boggle  photo piangry.gif by asking you first to use len() to check the length of a list(or string).

Let’s say you have this list:

the_list = [“Master Chief”, “James”, “Miranda Keys”, “Cortana”, “343 Guilty Spark”, “Deja”]

As you know, that even though there are 6 items in the list but Python will only index 5 items. That’s because Python starts indexing from 0. Don’t be fooled by len(), however!

lenismean

As you can see len() returned 6, this is what makes slicing so tricky!

Always remember:

“Python counts from 1, but indexes from 0.”

And of course there is another thing to keep in mind( you really didn’t think it would be that easy right  photo emo.gif ), in case of slicing Python will always returns the before last index.

So if you would like to get a slice containing only the first two items, you should type this:

first_two = the_list[:2]

Why didn’t I type the 0? When your slice needs to have the first item in it there is no need to type the 0, you can do it though if you want.

Check the following screen shot where I’m attempting  photo piwink.gif to slice the first  two items (“Master Chief”, “James”).

first_two

Now, you know Python always returns the before last index. The next question will be to include the last item in your slice. Now what  photo redface.gif

You get the last item by typing the index of the first item you want and leave the space after the colon blank.(In this specific case we are talking about the 5th index, which happens to be the 6th item.) It looks like this:

ai = the_list[3:]

listai

Remember slicing does not affect the original list! originallist

(You can always do the cliccy for a larger piccie!)