International Women’s Day
8th March 2008
Posted in Life, Society | No Comments »
6th March 2008
Posted in Links, Programming, Web | No Comments »
27th February 2008
Get it here.
It adds Referrer of the person who’s leaving comment on your WP blog. May help to take the right action for seemingly legit, but really spam comments (e.g. if someone was just searching for blogs with enabled commenting to leave a comment with name linked to their biz-website).
Posted in Software, Web, WP PlugIns | No Comments »
25th February 2008
Problem report at menalto forum. Another one, also with no solution.
I can confirm – URL rewrite + DHTML Album Select produces two forward slashes in the Matrix theme, in my gallery 2.2.4 setup, after a single use of the Recalculate button in Disk statistics tab in Statistics plugin from Community repository.
Read the rest of this entry »
Posted in Software, Web | No Comments »
24th February 2008
ExpressionEngine (EE) by EllisLab (see dislaimer). EE is available both as free and as paid-for: free has somewhat limited functionality, but enough to start the simple news site or blog. ExpressionEngine is suitable both for content-centric and news-centric (blog-like) projects, though in my opinion it’s more geared towards news/blog-like sites.
Read the rest of this entry »
Posted in CMS, Software, Web | No Comments »
16th February 2008
Posted in Links, Notepad, Programming, Society, Web | No Comments »
11th February 2008
Note: this a collection of scraps, describing how values (de)referencing works in Python, and describing when your variable is either a value or a reference. Primary source of knowledge for this post (also here).
Python passes references-to-objects by value (like Java), and everything in Python is an object. This sounds simple, but then you will notice that some data types seem to exhibit pass-by-value characteristics, while others seem to act like pass-by-reference… what’s the deal?
It is important to understand mutable and immutable objects. Some objects, like strings, tuples, and numbers, are immutable. Altering them inside a function/method will create a new instance and the original instance outside the function/method is not changed. Other objects, like lists and dictionaries are mutable, which means you can change the object in-place. Therefore, altering an object inside a function/method will also change the original object outside.
Immutable variables – such as integers [strings, numerics and tuples are immutables] – are passed by value. That is, if your function accepts some integer argument, you are safe assuming that your function won’t be able to modify your integer. Mutable variables – such as dictionaries and lists – are passed by reference, and so if your function accepts mutable argument, it may modify the contents of that mutable variable outside the scope of the function.
When doing :
s = “Hello ”
s += “World”
… you are not modifying the string object bound to s, but creating a new string object and binding it to s.
If using object’s methods within a called function, variable is considered “passed by reference” – it is modified out of the function’s scope. If using assignment on a mutable object, it is created a-new within the function, and global value isn’t modified.
When you call a function with an arg, a “local variable” is created, which references the object passed as the argument. (well… an entry with the formal parameter name as key and a reference to the object passed in is created in the ‘local’ dict).
So, rebinding this local symbol does not impact the binding in the caller’s namespace – because the symbol lives in another namespace.
*But* – and if the object referenced is mutable of course – modifying the object in the function… well, just modifies the object, because it’s the *same* object that is bound to (‘referenced by’, if you prefer) both symbols (the one in the caller’s namespace and the one in the function’s namespace). So yes, the object *is* modified when the function returns.
Posted in Links, Programming, Python | 3 Comments »