Python for Haiku

This bug tracks the effort to include Python on Haiku
<http://bugs.python.org/issue4933>
I find this effort interesting as people are working to bring up an
interesting OS up again! I would try Haiku at some-point, now that
Python should be available.

My musts for an OS are:
1) sh
2) vim
3) net
4) mutt
5) python
6) gcc
7) X Window System
8) firefox

Guido's response on supporting Python on Haiku:
>
> I'm with Martin. In these days of distributed version control systems, I
> would think that the effort for the Haiku folks to maintain a branch of
> Python in their own version control would be minimal. It is likely that
> for each new Python version that comes out, initially it is broken on
> Haiku, and then they have to go in and fix it. Doing that in their own
> version control has the advantage that they don't have to worry about
> not breaking support for any other minority operating systems, so I
> expect that all in all the cost will be less for them than if they have
> to submit these patches to core Python; and since that will definitely
> be less work for core Python, I would call that a win-win solution.
>

Py3K, what to look for in brief

This article was referenced by Guido in the Python-Dev indicating certain interests from academic community.

Actually thats a good article summarizing what to look for in Py3k.

1) Simpler built-in types.
Instead of having a built-in type for int and then for long as in Py26, have a single built-in type int in py3k, which will behave like long and serve for int as well.

2) In py26, you and str and unicode. Now Its just str, which is internally unicode. So all strings are unicode in py3k.
There is a separate bytes type for bytes of characters.

3) 1/5 will be 0.2 in Python3k. If you want the result to be 0, like in Python26, do 1//5

4) No comparisons supported between incompatible types. Documents from time immemorial advised the users to not to rely and it can change anytime. Well the change has happened.

5) its print() function for output now, just like input() function input.
Two things here. Previously in py2x, input() expected an object and raw_input() was actually used to input. Now in py3k, its just input() which will behave just like raw_input() before.

And in py2x, print was a statement, now its a function.
The article mentioned at the start gives a good rationale.

All you have do is, as soon as you type print, your fingers should automatically now get used to typing ( and proceed with what you were doing. More details on print function in py3k can be found in docs.

6) Everything is a new style class. All classes that you define will implicitly be derived from the object class.


7) There is refactoring tool developed by python hackers which can be used to port your py2x code to py3k. Everyones resounding advice is Use It!. This will help in migration as well fix any issues with the refactoring tool.

Greedy vs Non-Greedy in Re - Good Example

Here is a good example to explain greedy vs, non-greedy search using module re in Python.



*?, +?, ??

The '*', '+', and '?' qualifiers are all greedy; they match as much text as possible. Sometimes this behaviour isn’t desired; if the RE is matched against '<H1>title</H1>', it will match the entire string, and not just '<H1>'. Adding '?' after the qualifier makes it perform the match in non-greedy or minimal fashion; as few characters as possible will be matched. Using .*? in the previous expression will match only '<H1>'.

Once in a blue moon

A Blue moon is a name given to an irregularly timed full moon. Most years have twelve full moons which occur approximately monthly, but each calendar year contains those twelve full lunar cycles plus about eleven days to spare. The extra days accumulate, so that every two or three years there is an extra full moon (this happens every 2.72 years). (Source: Wikipedia)

So, its frequency of occurrence would be:

1/ 2.72 * 365 * 24 * 60 * 60) = 1.16580118 × 10 ^ -8


Now, this one is good. Excellent humor!

But don't get how they arrived at that number. Average considering the leap year does not result in that either.

Python Types and Obects

http://www.cafepy.com/article/python_types_and_objects/python_types_and_objects.html

Good article to understand new style classes.

Discussing English Grammar in the bug report.

Follow the discussion in this Python Documentation bug report.
Its for correct usage of English and grammar.


Terry J. Reedy added the comment:

Benjamin: I thank you too for verifying that I was not crazy.

Martin: I noticed native/non-native split too, and chalked it up to a subtle difference between German and English.

For future reference, the problem with the original, as I see it now, is a subtle interaction between syntax and semantics. The original sentence combined two thoughts about has_key. The two should be either
coordinate (parallel in form) or one should be clearly subordinate. A subordinate modifier should generally be closer to the subject, especially if it is much shorter. Making that so was one of my suggestions. The coordinate form would be 'but it is deprecated'. But this does not work because 'it' would be somewhat ambiguous because of the particular first modifier.

The following pair of sentences illustrate what I am trying to say. Guido was once a Nederlander, but he moved to America. Guido was once a student of Professor X, but he moved to America.
In English, the second 'he' is ambiguous because of the particular first modifier.

So, to me, 'but deprecated' at the end of the sentence reads as either a misplaced subordinate form or as an abbreviated coordinate form that is at least somewhat ambiguous because of the meaning of the other modifier.

git

Linus Torvalds has quipped about the name "git", which is British English slang for a stupid or unpleasant person:
“ I'm an egotistical bastard, and I name all my projects after myself. First Linux, now git.”

This self-deprecation is certainly tongue-in-cheek, insofar as Torvalds did not, in fact, name Linux after himself (see History of Linux).

http://en.wikipedia.org/wiki/Git_(software)

RFC Hierarchy for Related URL parsing

RFC Hierarchy for Relative URL formats
RFC3986(STD066) - This is the current and is the standard.
|
RFC2396 - This was previous one.
|
RFC2368
|
RFC1808 - urlparse header says, it follows this. But this has been upgraded a lot times.
|
RFC1738 - It started with this.

console font and resolution in ubuntu (Hardy Heron)

When ubuntu (Hardy Heron) booted by default, the console resolution and font ( ALT-F[1-6]) were really awful. Searched a lot to arrive at this solution.

To change your Console Resolution:

sudo vim /boot/grub/menu.lst


Go to your default kernel line and remove splash and add vga=791
The vga argument can take values from 791 to 795, google for the resolutions.
You have to remove splash term from that line, otherwise it wont get set.

To change your console font.

sudo dpkg-reconfigure console-setup

Follow the interview screens and choose the font to your preference.
For me, VGA with Size 16 worked best.

Proposed Python 3.0 schedule

> 19-Nov-2008 3.0 rc 3
> 03-Dec-2008 3.0 final