Thursday, July 31, 2014

Wednesday, July 30, 2014

Corner Case

So I'm merrily playing breakout with a slow ball and ten lives. Now the fun tweaking
part begins. One does have to read the small print on those functions though: on one of my
trials, the ball started moving left to right and there was nothing I could do about it. That is because I seeded my movement, vertical and horizontal, with a random multiplier 'between 0.0 and 0.1'
and - luck would have it - must have scored 0.0 on the y...

There are suggested improvements, like changing velocity, different scoring for certain bricks, lasers
and so forth. All very tempting!
The library reference above is for c++. It works for C, but the remove function has to be
stated as removeGWindow(...) to do the job in C.

Monday, July 28, 2014

Onward!

There has been some advance in today's work on Breakout. The ball now bounces at an angle
when it hits the sides of the window, or the paddle.

The key observation here is that, in a collision, the width or height velocity will change sign,
but not both at the same time. If it did, our ball would merely go front and back monotonously.

I am worried about the erratic movement. Here is the test paddle looks like:

Map of Gaza

http://www.lemonde.fr/les-decodeurs/visuel/2014/07/28/gaza-geographie-d-une-enclave-etranglee_4463949_4355770.html

Prototype


Sunday, July 27, 2014

Sunday Afternoon

Turns out that the game of breakout , which was so popular in the Golden Age
of Children's games, was originally the work of Steve Jobs and friend Wozniak, on a request
from their then boss at Atari. Who knew?

Pset4/Hacker for 2013 lets one play with making an implementation on the Standford
Library learners project. Very nice and clear. So far:

Staff looks liked this:
 
While mine is:

 
Sure would be nice if those loop numbers could be made to yield differently colored regions of bricks!!


 
The window is 400 pixels wide and 600 in height, as per the assignment, and
one needs ten columns and five rows. The rest is up to the designer.

Saturday, July 26, 2014

Stress

My exercice program for pset6 gets a clean bill of health on memory from
Valgrind when I integrate a free memory program:
 
 
 

 
When I remove the call to this function in the program, I have not actually leaked memory but there
is still heap memory occupied at the end of the run.


Heap memory, it will be recalled , is leftover reserve memory when one discounts the stack.
The thing about the stack is that it cleans up after itself: everything disappears once the
particular function has run. Not so with the heap.

The situation is not serious; this memory is 'reachable'. But poor form.

What happens when the program terminates? In a modern os, memory should be released. So
we have a memory problem so long as the program runs (and it might be a background task, or
a program on an embedded device with little memory...etc). Thus, a de facto memory leak.

This usage of Valgrind is the default; i.e. memory leakage. It can much more sophisticated
things , handle large programs , integrate gdb for debugging and so forth. One appreciates such features when one needs them and pros  end up 'learning' how to use such software a good deal of their time, I would guess in stressfull situations...

The Vim code editor is much appreciated because it runs the same on all platforms. It is customizable
and well documented. Here is my Binary_tree program, which was put together on gedit but
opened in Vim for the asking. Vi was the original Unix editor and vim is the much improved descendant.

   
 
Work for the week-end!

Sunday, July 20, 2014

IGetAround


The traceroute command is an easy to use utility on Unix-family computers which allows
one to see how one's communications with the internet are being routed. (In effect, it is
a diagnostic tool, if one is running into trouble ) . The first three columns are slow, average,  fast
numbers for one's packet to reach intermediate stations.  These numbers are in the milliseconds:
the internet is fast.

Note: the Web is the community of interlinked sites and access points. The Internet is a service 
that includes email and others.
 
To use this command, one goes to the shell command utility and merely types:
traceroute name of the destination site
for windows tracert name of the destination site


Sunday, July 13, 2014

Going Digital


source: Le Monde, 13.07.2014
translation: doxa-louise

STARTING IN SEPTEMBER, COMPUTER PROGRAMMING WILL
BE OFFERED AT THE PRIMARY LEVEL

Courses covering programing languages will be offered at the primary level
starting this year on an optional basis, announced the Minister of education
BenoƮt Hamon.
...

ON ACTIVITIES TIME

He is hoping that will be proposed ‘in primary grades an initiation to programming,
as an option and on time reserved for extra-curricular activities. We have launched on the 
19th of June an invitation to associations to put together a national offer’.

‘Such an initiation should be part of the curriculum in secondary grades’, according 
to the minister, who believes that ‘certain teachers, more naturally than others, could
be pedagogues for code: those from technology and mathematics’.

‘In conjonction we are also introducing, with Arnaud Montebourg, an important program 
to develop the french computerized learning industry’ adding that by 2020 70% of students 
in primary grades and colleges and 100% of teachers will be equipped with computers and 
tablets for computer learning .

Priority in national education goes to ‘ fundamental learning (reading, writing, counting, 
calculating, composing and decomposing numbers in mathematics’), but ‘schools can no 
longer ignore the importance of digital which intevenes today in all disciplines’  puts
forward BenoƮt Hamon to justify these advances.

MOVING TO HIGH SPEED

In his view, ‘ it is no longer a question of wether computing and its languages should be taught, 
but knowing how, to what ends, and at what level in school this learning should happen’.

‘If mastering French is indispensable to thinking, forming a judgement, expressing
oneself and communicating, mathematics as well as computing are other forms of language, 
which teach logical thinking, facilitate the manipulation of concepts. Computing helps 
communication within the classroom, stimulates the participation of all, including the less gregarious.’ 

Given these considerations, the minister also announced that ‘starting in September,
we will be exending through hertzien means high speed internet to 9 000 schools in zones 
not covered by fiber. He recalls that ’16 000 schools out of 54 000 do not
presently have access to high speed in France’.

Tuesday, July 8, 2014

Transform





Luminance

Jpeg is an encoding algorithm, and uses fairly sophisticated
mathematical tools. And lossy to boot, notions not always
comprehensible to the layman. What gives.

I was struck yesterday by an article int the Guardian wherein a
commentator was wondering why the fashion inductry indulges in
expensive and elaborate fashion shows, which showcased clothes
that were unrealistic, and when business revenues came mainly
from accessories anyway. Apart form seeing these as advertising, the
more interesting question might lie with the will to show clothes
and fabrics as aesthetic experiences.

The same thing is at work with jpeg images. One is not concerned
with the color of a dress so much as the visual experience
of someone wearing it in a particular light, time of day, movement.
Jpeg images are photographs.

Indeed, one could go on to consider many fabrics as embodiments of
the reflective nature of light, where objects mirror each other
and the shirt whith the pineapple motif is in on the joke. And
beauty is everywhere, as all that distressed demim we have been
wearing for a while will attest. But aggressively, photographed in
fashion magazines which really are part of the businees of selling
us something new to wear.

So the first step in the making of a jpeg image is often conversion
to a different color space, from RGB to a Lab variety. Those serious
technicians make a point of emphasing the differences between the
lossy and non-lossy versions of the algorithm less a confrĆØre end
up with a product that might be solely machine-read and thus derail on
the unfortunate information loss of a lossy. And further accounts of
the luminance, red-channel, blue-channel color scheme are reluctant to reveal
what is really at work in the use of a luminance channel. Here it is:



http://www.whydomath.org/node/wavlets/imagebasics.html

Tuesday, July 1, 2014

Itsa CDAY!

                                              HAPPY CANADA DAY !