Are you looking for my non-technical blog?

This is now my technical-only blog, my non-technical blog is here.

23 June 2014

Python's Getters and Setters

You can read a better formatted version of this post here.

Just learn a new python feature called @property. Let's say we create a class called Circle as follows.

class Square:
    side = 2
    area = side * side
s = Square()

Now:
>>> s.side
2
>>> s.area
4

However:
>>> s.side = 3
>>> s.side
3
>>> s.area
4

Not cool! How to solve that?

class Square:
    side = 2
    @property
    def area(self)
        return self.side * self.side
s = Square()

See now.

>>> s.side = 3
>>> s.side
3
>>> s.area
9

09 February 2014

Introduction to Data Science

The AskDeveloper group organized this hangout about Data Mining, and Machine Learning in particular. The video is in Arabic, yet the slides are in English.


،شوية دردشة عن تنقيب وتحليل البيانات والتعلم الآلي، الفيديو بالعربي

إضغط على الصورة لمشاهدة تسجيل الحلقة

10 January 2014

Github Traffic Analysis

Github now shows traffic analysis to those who visit the repositories there.


The new traffic analysis page shows the top referring websites and the top visited files in the repo as well as a time-series chart for the visits and bounce rate.