Kung FuKung Fu

Fujian White Crane Kung Fu

ZopeZope

What I have and am doing with Zope

PhotosPhotos

Photoalbum, both old and new.

ReceptsamlingenReceptsamlingen

In Swedish only. About my "Collection of Recipes" website.

Contact meContact me

My contact details and how to contact me.

  Mobile version of this page Mobile version of this page

RSS

Hot topics

by michael: Interesting article. http://www.birminghamfriends.co.uk...

Google PageRank algorithm in Python

by hakan: thank you http://www.pyromus.com...

Google PageRank algorithm in Python

by rigas: Hello We produce an on-line journal in French called Revue d'anthropologie ...

My dissertation report

by termo: I think there is a bug because in the second example B should have better r...

Google PageRank algorithm in Python

by termo: Bug: in the second example B should have better PageRank than the others....

Google PageRank algorithm in Python

by Wing Wong: Sweet. Got a friend who's doing some python coding at http://www.wtwconsul...

Google PageRank algorithm in Python

by Mahmoud: I want Real Data to compute Page Rank...

Google PageRank algorithm in Python

by Mahmoud: dear all i want reaal data to compute Page Rank...

Google PageRank algorithm in Python

by Mahmoud: Dear all please tell me the no of iteration can be get the accurate result ...

Google PageRank algorithm in Python

by sandorf: Bug: the program doesn't work when any of the web pages has no outgoing lin...

Google PageRank algorithm in Python

Old entries


April, 2008
Releasing IssueTrackerProduct 0.9
The importance of the TITLE attribute
What I like and dislike about Grok
Mixing in new-style classes in Zope 2.7
pwdf - a mix of ls and pwd
Lesson learnt with creating DOM element with jQuery

March, 2008
One thing I hate about Linux: cron
How to uninstall nginx with apt
Tip: Printer friendly pages with Page Templates in Zope
apple.com/store doesn't work in Firefox (on Linux)
Mocking a Python standard library
See you at PyCon 2008
File check before delete
"Confessions of a College Callgirl" is the new "My Secret Life As A Prostitute"

February, 2008
January, 2008
2007
2006
2005
2004
2003

 

You're viewing blogs from Mathematics only.

View all different categories

20th of August

People who really can't think in numbers

http://www.theglobeandmail...UMBERS20/TPScience/ 

A lot of people say they're really bad in mathematics and number theory and I believe them, but after having read this article about a tribe in the Amazon I realise that the people I hear saying this are wrong.

These Amazonian people don't even have the notion of numbers.

"The word he [Gordon] translates as one means just a relatively small amount, the word for two means a relatively bigger amount," he said in an interview from Brazil.

And more interesting facts about the Piraha people:

"the Piraha are the only people known to have no distinct words for colours.

They have no written language, and no collective memory going back more than two generations. They don't sleep for more than two hours at a time during the night or day."

22nd of July

University results

Yesterday when I came back from my holiday in Crete I finally got my results from the last exams. I got a first with slightly less than 80% average on the last year. Should be happy now but I ain't. I studied hard during the last couple of weeks and I understood it should pay off.

Award Bachelor of Science Honours in Mathematical Science with Computer Science
Classification Class One

11th of June

SquareOneTV

http://www.squareonetv.org/ 

One Billion Is Big

SquareOneTV is some sort of kids tv show from the 80's that aimed to entertain and teach kids about math. I never watched it as a kid because it was probably never aired in Sweden. Shame.

The funniest thing on their website got to be the video clips. Be sure not to miss the "One Billion is Big" by "The Fat Boys". Really made me laugh.

30th of May

Can you add them all up?

Many many years ago our math teacher at school left us with a little quiz to think over until the next class. We mustn't use a calculator and back then MS Excel didn't even exist. He told the quiz as a story about the famous German mathematician Carl Friedrich Gauss.

When Carl went to school their math teacher gave the students a numerical task to solve and he who could calculate the answer the quickest would receive an apple as a price. The task was to sum up all the numbers from 1 to 100. So you start with 1, then 2 and the sum is so far 3. Next you add 3 so the sum is now 6 and so on. All the pupils started calculating really hard but Carl raised his hand and answer the correct sum without even writing anything down. The teacher of course asked if Carl had cheated or otherwise how he did it.

So what is the sum and how did Carl managed to calculate it so quickly? You won't need any formulas or any other advanced mathematics to work it out. If you want to use a computer, feel free but do you really have to?

23rd of May

No more university for me

Last Wednesday the 19th of May I finished my university degree with my final exam. It's been very stressful and I've studied hard the last couple of weeks despite the wonderfully tempting weather.

Three years of Mathematical Science with Computer Science at City University. Right now I feel a bit bored with the whole thing because it's been on my mind day and night for the past two weeks so I can't be asked to write anything lengthy on it. I doubt that I will miss it a lot. I've got a really good job which allows for much freedom so I do not fear getting stuck behind a desk from 9 to 5 every day.

On Monday morning I start work again. The company is still Fry-IT working as a web developer/programmer. It will be primarily to program Python server side code for the Zope web application server with email, SMS and relational databases.

19th of May

Google PageRank matrix calculator (graphically)

Some time ago I wrote about the Google PageRank algorithm in Python. It's a matrix algorithm for calculating the PageRank values for every page in a web. All you have to do is define which pages links to which and the algorithm calculates the PageRanks for every page for you.

Now I'm going to try to illustrate it in practise for those of you who don't know what to do with a Python script.

Start calculating!
See the gallery of previous calculations.


>Read the whole text (108 more words)

14th of May

Two done three to go

Today I had my second exam. This was Mathematical Methods. Something I had thought was going to be harder than it was. Next week on Monday I have Differential Equations; C++ on Tuesday and lastly Bottom Up Computing And Discrete Mathematics on Wednesday. So my whole BSc degree is all over on Wednesday!! Yippi!

Today after the exam we had a few drinks but I left earlier than most people, feeling both drunk (3 drinks :) and sleepy. Taking an exam plus all the pre-anxiety really tires you out. This weekend is going to be about studying. Sigh.

11th of May

Zurich tram service problem

This is a little thought problem I learned during the Quantum Mechanics course I'm taking. It was (supposedly) A Einstein who thought about it first when he was working in Zurich.

As we all know, the tram service in Zurich runs like clockwork; all day every day. Or at least, let's assume so. This question appeared on one of my exercise sheets:


>Read the whole text (210 more words)

8th of April

My dissertation report

http://www.peterbe.com/plog...40408-2/Project.pdf 

Now I have finished and submitted my dissertation. A great relief. The journey through it has been really interesting and I'm very please with it.

The title is: Building a web application for an on-line mathematics journal and the abstract reads:

"This project is about how to build an on-line journal for mathematics. This was done using the web application platform Zope and the programming language Python. It is now possible for people to register as members on the site and upload papers and write descriptive text for these papers that can be used in various abstraction methods. The report describes what technology techniques were used to accomplish this and the object structure that was applied. We will conclude by listing the shortcomings of the delivered web application and aspects that can be improved and some suggestions to possible solutions to this."


>Read the whole text (82 more words)

21st of March

Google PageRank algorithm in Python

There are many articles on the net about how the PageRank algorithm works that all copy from the original paper written by the very founders of Google Larry Page and Sergey Brin. Google itself also has a very good article that explain it with no formulas or numerical explanations. Basically PageRank is like social networks. If you're mentioned by someone important, your importance increases and the people you mention gets upped as well.

We recently had a coursework in discrete mathematics to calculate PageRank values for all web pages in a web matrix. To be able to do this you have to do many simplifications and you're limited in terms of complexity to keep it possible to do "by hand". I wrote a little program that calculates the PageRank for any web with no simplifications. The outcome is that I can quickly calculate the PageRank values for each page.

Here's how to use it:

 from PageRank import PageRanker
 web = ((0, 1, 0, 0),
        (0, 0, 1, 0),
        (0, 0, 0, 1),
        (1, 0, 0, 0))

 pr = PageRanker(0.85, web)
 pr.improve_guess(100)
 print pr.getPageRank()


>Read the whole text (312 more words)

15th of March

Finished the bulk of my dissertation

http://home.peterbe.com:8088/PCMJ 

This weekend I finished the bulk of my dissertation, which is a web application for academic staff to publish their academic papers online. The first target audience is for staff at City University Mathematics Department to whom I will deliver the project. The idea is that doctors and professors can submit their scientific papers on this web application. They enter some meta data about the paper such as title, abstract and co-authors and lastly upload the PDF or Word document that actually is the paper. The administrator will with time compile "Issues" which are basically bundles of papers published together with a little comment.

Registration is open to anyone but requires moderation. I.e. you can't log in straight after you have registered. Also all papers that registered members submit will need moderation too. This is done by a group of people (currently only me) who have administrator access.

My dissertation is about the computer science in building a web application. I.e. planning, data structures, algorithms, design, content management etc. It has "nothing" to do with mathematics even though I'm an undergraduate student of the mathematics department.

Please do go and visit the site and use it to help me get it as good as possible. There might still be bugs or spelling misstakes that needs to be taken out. When you register I will moderate you and please avoid rude words and try to make your example data as real as possible.

Now the last thing for me to do is to write the actual report about the project. That is what I will submit but my grade will based on the judgement of the web application. When I have finished my report I hope to show that on my web page too if I'm allowed.

23rd of January

MathML and displaying Math on the web

http://pear.math.pitt.edu/m...a/itex2mmlFrag.html 

My near-future hope is to set up my own weblog where each new blog item is my write-up of notes from my math lectures. The purpose of this is twofold:

  • Study my notes from lectures
  • Learn more about web development with odd content/format

I then need to be able to write mathematical expressions in my HTML using TeX syntax and have the expressions converted to images. TeX (father of LaTeX (father of Itex)) looks like this:

 \[ \sum_{n=1}^\infty \frac{1}{n} \text{ is divergent, 
 but }  \lim_{n \to \infty} \sum_{i=1}^n \frac{1}{i}
 - \ln n \text{ exists.}\]


>Read the whole text (147 more words)

21st of January

Same but new keyboard, lovely change

http://www.microsoft.com/ha...etails.aspx?pid=021 

Today I got my new keyboard. A Microsoft Internet Keyboard. It's exactly like the one I had before. The old one work just fine except that the keys were starting to get squeaky. The difference is very subtle but I felt I had to punch the keys from directly upwards. With this new one it's so much easier to type. Small difference on the outside but a really big difference for me.

Today I've also had my first "Object Oriented Programming in C++" lecture and lab. This is as far as we got today:

 #include <iostream>
 using namespace std;
 int main() {
    cout << "Hello world!\n";
    return 0;
 }

Actually we did a few more things. Next lecture I think we'll start with classes and stuff. A requirement for this course is that you already know programming (in Java) so we'll be able to skip while loops and if statements. Good.

Today was also the first lecture in Bottom Up Computing and Discrete Mathematics. A combination of elementary discrete math plus some general knowledge of how computers work. We'll even have a lab where we take apart a laptop to learn about the hardware inside. This lecture we spent discussing how Google's PageRank works. I'm looking forward to doing some serious math on algorithms like this. It will help a lot in understanding how Google does it.

11th of January

How old is Bettys dad?

Translated (by me) from a Swedish science magazine I bought when I flew back to the UK a couple of days ago:

"How old is your dad?" Karin asked, "he looks much older than my dad". "Ridiculous!", Betty replied somewhat angry over her friends insensitivity, "but now you'll see if you can work it out. His age is three times the first digit plus five times the last." How old is he?

If you can work it out. Don't just tell me an answer you've come up with by testing several numbers. Show me some proof!

30th of December

Two exams on the same day

At the moment I'm here in a snowy Sweden in my parents house, with a cold and worries about not studying enough during this break.

It now appears to be so that I have to take two exams on the same day and same hour. What they do then is that they arrange so that I can take one of the two exams later in the afternoon. It is only me who has this clash of two exams on the same day and hour.

They will then have to "supervise" during the day so that I can't have any contact with my fellow students. I wonder how they do that. In fact I'm now curious to find out. Are they going to have some goon to follow me around wherever I go? Will I not be able to have my mobile on?

Well, we'll see what happens.
For now: Happy New Year

 

Older entriesOrder entries