http://www.valuedlessons.com/2008/04/events-in-python.html
Events in python [reblog]
October 20th, 2011Bandwidths reality, bylan –> hib
October 8th, 2011Reference:
89-10-207-101:~ technocake$ iperf -c 89.10.206.196
————————————————————
Client connecting to 89.10.206.196, TCP port 5001
TCP window size: 129 KByte (default)
————————————————————
[ 3] local 89.10.207.101 port 56153 connected with 89.10.206.196 port 5001
[ ID] Interval Transfer Bandwidth
[ 3] 0.0-10.5 sec 515 MBytes 412 Mbits/sec
89-10-207-101:~ technocake$
root@snapp:/home/technocake# iperf -c 89.10.206.196
————————————————————
Client connecting to 89.10.206.196, TCP port 5001
TCP window size: 16.0 KByte (default)
————————————————————
[ 3] local 158.37.91.141 port 39666 connected with 89.10.206.196 port 5001
[ ID] Interval Transfer Bandwidth
[ 3] 0.0-10.1 sec 42.5 MBytes 35.1 Mbits/sec
root@snapp:/home/technocake#
say whoot?
History of tty: reblogpost
September 27th, 2011http://www.linusakesson.net/programming/tty/index.php
Read :)
September 12th, 2011http://www.linuxjournal.com/article/6340
Reincarnation of Random Pizza Generator :)
September 11th, 2011Per Harald Knudsen-Baas tok i sin tid til å starte kodingen på den berømte “Random Pizza Generator”. Her er hans historie om bakgrunnen for denne:
Konseptet:
Vi som en gang gikk i 06HKOM hadde en tendens til å kjøpe mye pizza på pizzabakeren, men det oppsto alltid krangel om hvem som skulle hente pizzaen etter at den var bestilit. “RandomPizzaGenerator” ble derfor svaret.
Det eneste dette programmet gjorde var å hente inn navnene på de som var med på pizza. Hvert av navnene som tastes inn får en id. Deretter ble en av disse trukket ut til å måtte hente pizzaen. Trekningen utførte jeg ved å hente et tilfeldig tall tilsvarende en av id’ene ved bruk av randseed-funksjonen i C++ . Tallet som trekkes tilsvarer en person, og denne personen må lunte ned på pizzabakeren.
Konseptet er enkelt, men er jo mange muligheter for å lage det mer avansert enn dette og på andre plattformer. F.eks. Java applikasjon med GUI, web-basert, eller å lage en Android-app med mer tillegsfunksjonalitet? Går jo an å lage noe som kan hente inn menyen til Pizzabakeren, la en gruppe med brukere stemme over pizzavalget, trekke ut en til å hente godsakene, for deretter å la applikasjonen dele regningen basert på hva som er bestilt til hvem, og hvem som har lagt ut for hva… er jo bare fantasien som setter grenser;-)
Lykke til med Code::Phun!
Får håpe det blir bra oppmøte i morgen:)
Nå har jeg laget en reinkarnasjon skrevet i Python.
Bruksmekanismen er enkel:
Fyr det igang, skriv navn på dem som er der, skriv quit og den velger ut en stakkars for dere.
#!/usr/bin/python # @description: Random Pizza Generator reincarnation based upon the rumors of the # previous legendary version from Per Harald Knudsen-Baas # # Purpose: To decide who is going to get the pizza from the restaurant. from random import * from urllib import * def RandomPizzaGenerator(Persons): return Persons[int(round(randrange(len(Persons))))] #in python 3, raw_input is renamed to input. In python v <3. input does something else. def prompt(text): try: return raw_input(text) except: try: return input(text) except: exit() def nerds(persons = []): global nerd persons.append(nerd) return persons if __name__ == "__main__": while True: nerd = prompt("Nerd present: "); if nerd == "quit": break nerds() print (urlopen("http://fiikus.net/asciiart/pizza.txt").read() ) print (""" The wise judgement of the randomPizzaGenerator has been made: Thou shall be the pizza-carrier: %s May the steps be with you. Fare well, young lad! """ % (RandomPizzaGenerator(nerds()), ) )
Sjekk ut via svn:
svn co http://svn.technocake.net/repos/dev/python/random-pizza-generator
Topics of discussion for Sigma
September 9th, 2011semantically related topics
Sigma, is supposed to be syntezising diverse, distributed but semantically related topics
into a new context – relevant for learning what you are learning.
We have a dynamic source of sources: the web.
They are all very different by nature. Articles, videos (youtube), lexical articles,
examples, reflective thoughts about a topic, wolfram’s computed knowleedge model and
far far more. The amount, shape and content will continually keep changing and new arises every day.
How can we achieve recognizing what is relevant, and where to find it?
Another topic to be discussing, is the following. We don’t have any control over the
sources. They are fully self-operating. How can we be recognizing relevant content over
spooky content with this in mind: We don’t host the content, others do.
from “semantic search algorithm for peer-to-peer open hypermedia systemssm”
“”"
In addition, our algorithm does not take into account the trust mechanisms
between individual peers. As highlighted by [3], the peer-to-peer approach in
OHS is subject to the existence of adequate trust mechanisms, as is the case
with evolving peer-to-peer networks in general. The DDLS relies on the faithful
delegation of trust between the participating peers, which requires further
investigation.
“”"
A third topic I would like to discuss is this:
Sigma wants to grow, and let everyone share their knowledge.
How can we avoid letting bad content wrongfully propagate through the system?
(“Example, a user posts an entry: a super site for discovering mechanical physics: , but in reality it’s a spam site..”)
Fremmed for refleksjon?
August 11th, 2011Under de voldsomme rystelsene vi fikk oppleve den 22. juli, var det noen som tenkte: “Det var muslimer!”. Denne forutintatte oppfatningen er helt bak mål og samling.
Så var det en, som hadde tenkt nettopp slike tanker. Puttet alle muslimer i en bås, med utelukkende negative konotasjoner. Helt til det gikk opp for ham: Verden er mer nyansert!
Les om hva han tenker:
i dagbladet
Using python to interract with diverse interactive shells
July 15th, 2011I really like the flow of pexpect – a python module to spawn child processes and interact with them. In fact, the flow of a python script is the most intriguing feature of the language. It’s all about flow, I sometimes think as I type the solution to a problem like writing a letter.
[url=http://pexpect.sourceforge.net/pexpect.html]http://pexpect.sourceforge.net/pexpect.html[/url]
The essence of pexpect is summed up in these three lines: (Copied from the above link).
child = pexpect.spawn(’scp foo myname@host.example.com:.’)
child.expect (‘Password:’)
child.sendline (mypassword)
My heuristic approach – personal thoughts about the progress around project sigma
May 30th, 2011MY HEURISTIC APPROACH
//As is per 29.05.2011 – This is a work in progress, that is destined to go through many a revision before publishing. Please bare with all the misspelling, bad grammar and inconsistency of thought narrative.
In the present, I have been occupying my time mostly devoted to a project that is ever growing. It’s size is starting to look more like a major paper (Bacheloroppgave) then a simple midterm project as it is supposed to be.
Never the less, it is really exciting. I’m discovering new sides about my self, and those around me. Creative and constructive in ways I would never imagined. The ability to draw connections between seemingly unrelated fields has proven a tremendous source for insight and new inspiring ideas.
For instance, I’m reading a lot. It spans from biology, psychology, physics, mathematics, sociology, the invention of the web, as exposed by Tim Berners Lee [Weaving the web] too linguistics, medicine and even fiction. If I where to be restricted to each “fields” supposed paradigms, borders and limit actions, I would never have seen which connections that are there. So obvious and clear now that I have found them, yet so diverse and loose related at first glance.
WHAT IS KNOWLEDGE?
How to obtain new knowledge, how to teach formal known knowledge, and where does knowledge come from?
As a student currently enrolled in the communication engineering bachelor program at Bergen University College (HIB), these questions has been very present in my everyday. I seek reflection and increased perception and understanding of it all. To me, it has always been an awareness about “ That unjudgently following a set approach to learning already known knowledge is not good enough.
In class, it seems the given atmosphere is to be taught new concepts in a denotative fashion. You are being given the method, procedure or formula on how to USE it. The mentality seems to be lacking the will to seek understanding. Do we know a concept merely because we can recite it?
I’ve come across a book by coincidence. “How to solve it” by George Polya [~1941]. It was first written down in around 1941 ca. He wrote about how the world was neglecting to seek understanding. How each new generation was taught to not evaluate what it was learning. The short-termed goal to pass the exam, to handle in the task at work or to really just get through with it. This was dominant then, and unfortunately, it still is. Why do we not appreciate seeking full broad understanding?
My thesis now [early march 2011], is that we actually do. In fact I think most of us wants to figure out more. To understand, and not only simply touch a subject. It may on the other hand not be clear how to.
Well what about it?
To lay down a foundation for why the idea behind what is currently going under the name: Prosjekt X, I present to you the initial dialogue between me and Gaute Midtun : recited as I remember it now. [later it got a name: sigma]
Gatue: Have you heard of Khan Academy Robin?
Robin: Yes, I like it quite a lot. It has great videos explaining concepts easy. Its really helpful in constituting what we learn at our lectures in class.
Gaute: Indeed. We also have something called Forelesning.no (LECTURES), which have great videos directly tailormade for the content in the courses we take at HiB. Especially in mathematics.
Robin: Wow, neat. I have been keen on gaining some more knowledge about mathematics and networks and such, and I found that youtube has its own educational channel. I really love the lectures from Stanford University there.
…
We had here laid down a foundation for something to appear; the need to collect all these external learning resources, and make them available for us to use. Not only Gaute and me, but especially our fellow class mates.
…
In the atmosphere of this conversation, the idea pops out in my head –
Robin: Gaute, how about we make a website to collect all these materials that we know are useful and great; yet by the absence of awareness about their existence, many of our classmates are missing out.
Gaute: That’s a great idea, lets do it! I have a lot of great sites to share.
…
To make one thing straight; the idea had never formed had we not made that talk. It was in the sequence of thoughts and associations created there and then between us that made the need for something like this so clear and obvious. I am not quite sure which of us who first formulated the idea or concept; but then again that’s not the important thing. The idea had long before being uttered by one of us; already been formed in both our minds. It was neither one of us’ achievement alone that made it, it was our collaboration of thoughts that made it in that conversation.
Polya lays down four phases in the path not only to solve a problem, but to increase greater understanding of it and similar/related problems.
I – Understand the problem
It’s hard to give the answer to a problem which you don’t quite understand. By grasping synopsis, a clear overview, you lay a foundation for being able to draw relations and ultimately draw a plan on how to solve it.
2 – Make a plan
Be aware of approaches that may lead to a solution. Seek from your understanding and relations to other relevant problems a possible pathway to find a solution. Don’t be afraid to consider any ideas.
3 – Execute your plan
In this phase, you have already made the plan to follow. You will find an interesting new vision and hopefully you made a discovery on the way that solves the problem. If not, you still will; after reflection be even more closer to finding a solution.
4 – Think back (evaluate and reflect)
When you have found a solution, think back on the path that lead you to it. Which obstacles did you overcome that took you some way? Which thoughts did help you sort things out? Did you ask yourself some helpful questions?
The whole purpose to these phases – or merely a ordered list of helpful questions – referred to as “the list” in the book; is to point out that starting with something unknown, and ending up with something known – does not happen by itself. There is a path you traverse in order to get there. Or maybe not a linear path, but a set of mindful states that help you think. To discover the solution by own means. Not being given the end result, and supposedly be able to withdraw the foundation which made it from the result alone. You build that foundation yourself, but in collaboration with others.
March 2011 – Robin G. Aaberg