2007-02-26

What is taught in schools...

I discussed with my little sister her university programming tasks again. Even if to abstract from the maxim «Pascal is the best language for teaching» ™ IMHO still there are two important problems:

1 Something is told prematurely — the necessity of such solutions can be understood only conforted by the problem by oneself
2 Not the process of how somebody came to the idea of a solution it is told but the result only.

The separation to a file system and an on-line storage is not necessary, binary number notation was chosen because it is easy to implement; if you so need to bind a program into one big execution file beforehand then you will need the separate compilation for really large projects only.

The modules support in the language is not better than the simple agreement: «do not call functions with names start with xxx».

The knowledge of the result only forms one-sided view of things — it can be done in this way only... misunderstanding of why the result is exactly like this leads to non-using it where it is really needed.

Next time I'll summon my strength and try to explain what the procedures and functions are, what is the black box abstraction and so on.
For my sister has no doubts any more that to write the whole program inside one switch is not good.


Update One more interesting point have come to the surface — students visit lectures, study algebra, math logic, analytic and differential geometry. Teachers say: would you like a bonus? Write a program... find how many non-isomorphic graphs there are for the given number of edges and vertices or factorize a symmetric polynom to prime factors.

Oh... in Pascal? I'm curious how many lines of code a student will write until he stops to understand what sort of FL1, FL2 means, where RuntimeError 210 occurs and what is required to get at all?

2007-02-16

What a wonderful world ....

It's hard to believe but it's true: If in the decimal representation of a fraction 1/p, where p is prime number and the length of a period is even then after adding the first half of the period with the last one we'll get only nines(!)

For example:

1/7 = 0.(142875) 142 + 875 = 999
1/13 = 0.(076923) 076 + 923 = 999

2007-02-12

You can't take a step without SQL

Cool problem at Project Euler - Find the sum of the only ordered set of six cyclic 4-digit numbers for which each polygonal type: triangle, square, pentagonal, hexagonal, heptagonal, and octagonal, is represented by a different number in the set.

I just felt that it is ideal for sql ... I used my brains and as a result I've got a small table and a small, absolutely dumb query.

I'd like to have a-la «implementation schedule» support in languages not relating to db.

RuPyRu - Ruby & Python conference

I've visited a conference dedicated to Ruby & Python. As opposed to Microsoft speakers were developers themselves that's why they told about bugs, little discrepancies and so on:)

Reports archives are already available.

Impressions of reports:
Gusarov Mikhail "OOP principles in Python"


Hum... It seemed that the speaker desired to manage in five minutes and threw away the most interesting things, only a compressed description of what dynamical languages are was left. And all the principles of projecting were brought to the necessary automate testing and to restate of Liskov Substitution Principle.

Rastyagaev Vadim "Introduction to Ruby"


A little description of syntax — it was not interesting... in the discussion that took place later a little bit more interesting explanations of closures vs ruby-blocks and scopes of made changes were sound.

Artamonov Igor "Python and Ruby in Java-projects"

Speaker was concentrated on weak places — productivity and correspondence of java-clones and native implementations in ruby and python. As a result everybody was deeply disappointed...
About the speed he told for nothing... everybody was scared of jruby productivity failure, but by the was jyton looks worthy enough.
But for the scripting in java projects I would choose Scheme or Groovy

Tarancov Andrew "Dynamic Languages Toolkit"

The project is interesting, promises a lot, written in Java. Wish them good luck. Looks like their goal is equivalent to creation own language interpreter, as it actually happened with Eclipse JDT. May be, in this way a good implementation of python and ruby in java will appear :)

Okoneshnikov Andrew "Python in business applications"

It were our honorable guests — guys use python since 2002 year in business applications and they are satisfied with their choice... a drop of optimism :)
By the way, this is not the only business system, which uses python. This is at least one more

Baburov Yuri "Python in C/C++ and C/C++ in Python"

A good review of everything. Choice to any taste.

Lyfar Dmitry "Boost.Python, Python in GameDev"

One more good report. What, how and why. But may be one should use Lua?

Coffee-break

That everybody looked forward — it justified the expectancies :) However I would like it happen in one or two reports earlier.

Nemytchenko Ivan "Introduction to Ruby-on-Rails"
A short retelling of standard tutorials. But those who followed carefully, obviously would like familiarize themselves with rails closer.

Yurevich Yuri "Python for Web"

Django, Twisted, Pylons — choose any. H'm, does Django _really_ so fast?? I have to try it. But I still have no doubts that for a very custom project Pylons is the right choice.

Yurevich Yuri "Using Unicode in Python"

Oh... why I have not thought about sity.py, since I have difficulties — just forget u in the line beginning and get errors :) I'm kidding — the report is absolutely correct.


In the end surprising news were sound - Iss Art is going to hold such conferences once in a three months. The next conference will be dedicated to the «extreme programming». Looking forward to it.

Update:
Photos are on flikr
With the «official» report and participants opinions are here

2007-02-05

Linux: Fun stuff

# man factor

NAME

factor - factor numbers

DESCRIPTION

Print factors of each NUMBER; read standard input with no arguments.