unix_time_1234567890


unix_time_1234567890

This was fun. I could manage to capture it again. This time it was with Vijay.

Previously, while at Dell, along with another friend, Raj, had captured 1111111111.

Capturing History

Sent Form 8233

For the PyCon Tutorial Compenstation.

I request you to print the attached PDF. Complete the Necessary
details (lower half) from PSF and please FAX

a) My Form 8233 with PSF details.
b) PSF Authorization Letter.

To my FAX Number: 91 80 30501090.

Bugs to Work

http://bugs.python.org/issue5040
http://bugs.python.org/issue5054

Bug-queue - http.client.HTTPMessage.getallmatchingheaders() always returns []

> Further investigation ( grep -r getallmatchingheaders Lib/* ) reveals
> that in addition to having no tests, and being implemented incorrectly
> in http.client, getallmatchingheaders() is called only once, in
> http.server; that code is also broken (I reported this yesterday in
> #5053).
>
> Maybe Python 3 is where getallmatchingheaders can make a graceful
> goodbye (and a 2to3 conversion added?).
>
> Python tracker http://bugs.python.org/issue5053

PyCon Tax information

On a go forward basis, we are taking the position that the PSF won't issue tutorial payments without a W-9 for US persons (US citizen or resident alien) or an 8233 with ITIN for foreign persons (but see below).


Non-US Taxpayers
============

For non-US persons ('non-resident aliens', in the IRS lingo) we need to withhold 30% of the payment unless they are citizens of a country which
has a tax treaty with the USA which allows a lesser rate on personal service income. e.g. for Canada, UK, DE the withholding rate is currently zero. The PSF has to file a 1042-S information return (which is equivalent to a 1099) regardless; there is no lower limit on the compensation.

http://www.irs.gov/publications/p515/ar02.html NRA Withholding
http://www.irs.gov/pub/irs-pdf/p519.pdf US Tax Guide for Aliens
http://www.irs.gov/publications/p901/ar02.html Countries with treaties

To avoid withholding we need to get a Form 8233 from each presenter each year, assuming they are citizens of a treaty country.

http://www.irs.gov/pub/irs-pdf/f8233.pdf On-line Form 8233
http://www.irs.gov/instructions/i8233/ Instructions

This is very easy to complete, except that it requires an ITIN ('individual taxpayer identification number) the first time, and that is a bother:

http://www.irs.gov/pub/irs-pdf/fw7.pdf On-line Form W-7
http://www.irs.gov/taxtopics/tc857.html Instructions - short
http://www.irs.gov/pub/irs-pdf/p1915.pdf Instruction Booklet

The catch on the W-7 is the US Social Security Administration has to deny a Social Security Number application and that denial has to be provided along with the W-7. That's a separate application to the SSA.

There is an exception to this: if the tutorial presentation compensation can be considered a honorarium, then a letter from the PSF to that effect will allow
the SSA denial process to be skipped, per Exception 2a (page 25 of p1915). The PSF has discussed this with the IRS, and they agree that the tutorial
compensation can be considered an honorarium. This means that the applicant would need a letter from the PSF requesting the tutorial presentation, and the applicant would fill in 'Python Software Foundation' on line 6g as the 'company' and provide a copy of the letter along with his/her W-7 application.

So the process would be as follows, assuming the presenter doesn't already have a US ITIN:

Fax the PSF an 8233 (without an ITIN) and a fax number. The PSF will complete the lower half and FAX a copy back along with the authorizing letter. Submit a W-7 with the 8233, acceptable identification documentation (see Pub 1915, typically a certified copy of a passport), and the authorizing letter to the IRS to get the ITIN. This should take 4 - 6 weeks. Send the ITIN back to the PSF on an updated 8233. This will allow the PSF to avoid the withholding. If the presenter has no other US source income, there would be no taxes owed on amounts lower than $3300, and no 1040NR need be filed in that case.

http://www.irs.gov/localcontacts/article/0,,id=101292,00.html

Without the ITIN, the PSF is required to withhold 30%. To get it back by filing a 1040NR plus Schedule C, the presenter would need an ITIN, anyway. So
if he is a citizen of a treaty country and cares about the 30%, he should get an ITIN, send the 8233, and avoid both withholding and filing (assuming no
other US income).

The PSF will offer the option of 30% withholding if the presenter chooses not to supply the document, or cannot do so in time. The presenter could later
acquire an ITIN and file for a refund up to three years after the due date of the return. At least, that is the filing deadline for a refund on a US 1040;
the foreign filer should confirm that deadline for a 1040NR. However, it is probably simpler for all concerned to delay payment until the ITIN is
available for the 8233.

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.