Tuesday, July 23, 2013

Possible Grade Manipulation in the 2013 Lebanese Official Exams

This year, like every year, grade 9 and grade 12 students sat for an official exam that would determine how they will continue their education. And like every year, the results are published online. This year, Naharnet  published all the results with no regard to student privacy. All you need to do is supply the number of the examiner and the type of exam done (SG, LS... etc), and instantly you get their name and detailed score.

So for fun, I produced a python script that uses the Mechanize library to connect to Naharnet and get the correct html form. It iterates through the student numbers and extracts the results in to a CSV file. After cleaning up for spaces and forward slashes ( /), the results were imported into Microsoft Excel for analysis. (Here is the file of you want to have a look at it.)  Look further down for the updated file.

1:  # -*- coding: cp1252 -*-  
2:  import re  
3:  import mechanize  
4:  import csv  
5:  import socket  
6:  br = mechanize.Browser()  
7:  def opensite():  
8:    try:  
9:      time_t = 6.01  
10:      print "Attempting Connection..."  
11:      br.open("http://www.naharnet.com/exam", timeout = time_t)  
12:      print "Connected."  
13:    except mechanize.URLError, exc:  
14:      if isinstance(exc.reason, socket.timeout):  
15:        print "timeout occurred!"  
16:        opensite()  
17:  def getform():  
18:    try:  
19:      br.form = list(br.forms())[1]  # The form we want is the second on the list
20:      br["exam_category"] = ["SG"]  
21:      br["candidate_id"] = str(n)  
22:      response2 = br.submit()  
23:      return response2.read()  
24:    except mechanize.URLError, exc:  
25:      if isinstance(exc.reason, socket.timeout):  
26:        print "timeout occurred!"  
27:        getform()    
28:  ### Numbers list ###  
29:  a = []  
30:  i = 1  
31:  while i < 1000:  
32:    a.append(i)  
33:    i += 1  
34:  i = 20000  
35:  while i < 21500:  
36:    a.append(i)  
37:    i += 1  
38:  i = 40000  
39:  while i < 40500:  
40:    a.append(i)  
41:    i += 1  
42:  i = 50000  
43:  while i < 52600:  
44:    a.append(i)  
45:    i += 1  
46:  i = 80000  
47:  while i < 80500:  
48:    a.append(i)  
49:    i += 1  
50:  i = 90000  
51:  while i < 90500:  
52:    a.append(i)  
53:    i += 1  
54:  ### END NUMBERS LIST ###  
55:  filename = "scores"+str(a[0])+".csv"  
56:  with open(filename, 'wb') as myfile:  
57:    c = csv.writer(myfile)  
58:    for n in a:  
59:      opensite()  
60:      print "Acquiring record number %s" %(n)  
61:      x = getform() + " "  
62:      sub_list = ["Mathematics", "Physics", "Chemistry", "Arabic", "Foreign language", "Philosophy", "History", "Geography", "Civil education"]   
63:      score_list = []  
64:      for p in sub_list:  
65:        math= x[x.find(p):]  
66:        #print p + ": "  
67:        #print math[math.find("result_grade") + 14 : math.find("result_grade") + 17]  
68:        score = math[math.find("result_grade") + 14 : math.find("result_grade") + 17]  
69:        score_list.append(score)  
70:      c.writerow(score_list)  
71:      print "Record %s appended to file..." %(n)  
72:      print score_list  
73:      myfile.flush()  
74:    myfile.close()  

The results were strange. I wouldn't rule out completely grade manipulation, but I would give my readers the benefit of the doubt and have them come up with their own conclusions.

The results so far are only from the SG series of exams. It takes some time for the program to give me all the records and it crashes sometimes leaving me with half a file. (At that point I see what was the last appended record, modify the list of numbers, and continue the program. This creates a new file called score#.csv and that explains line 55 in the code.)

As soon as I get the rest of the grades I will be publishing the results.

Let us discuss the anomalies:

There seems to be something wrong with the grade distribution of both Arabic and Philosophy. In the case of Arabic for example, not a single student got 16, 21, 26, 31, or 36 out of the total 40 marks. Please not that it IS possible to solve the exam in a certain way and attain those grades. The chart then looks like this:
The grades seem to have been divided into 5 distinct populations. 

In the case of philosophy, the graph looks even more bizarre. There are several possible attainable grades that seem to not exist; a statistical improbability. In fact all the grades are even numbers and there are NO odd numbers.
the rest of the subjects are in the supplied excel file below.

Enjoy the corruption, or the misunderstanding...
Expect more data soon.


All the SG data has been collected and the results have not differed at all.
The Civic Ed exam apparently was easy because the actual average and distribution are skewed to the right. That means a higher average and normal distribution.

Math was fairly distributed as there seems to be no irregular patterns in the distribution.
Physics has several spikes that I am yet to interpret. I'll need to divide the data by region and see where the anomaly occurs.

Here is the new updated file: [SG Grades Excel File]

Sunday, May 26, 2013

Mleeta - A review

On May 25, 2000 Israel withdrew unconditionally from the south of Lebanon in one of their most humiliating defeats in their history.
During July - August 2006, Israel launched an offensive against Lebanon in an attempt to eliminate Hezbollah's missile stockpiles. Considering that none of the Israeli objectives were met, and that war is a zero sum game, Hezbollah emerged victorious. They attributed their unimaginable victory to "heavenly intervention". Thus the motto of Mleeta: "Where the Land Speaks to the Heavens."

 The site is quite imposing with several areas (see map below). The entrance fee, 2000 Lebanese pounds or US$1.66 is barely enough to cover maintenance fees. The entrance is flanked by Lebanese and Hezbollah flags leading towards the central fountain.
To the left you find a spiral path circling around several Israeli war vehicles destroyed by the resistance movement as well as Hebrew letters, shells, helmets, etc... scattered around.
Merkava Mark IV destroyed by (possibly) an AT3 - Sagger missile.

The vehicles were mostly left as they are in the field. Others were transported to the site from nearby fields.


Also, newly exhibited, is one of Hezbollah's old declassified drones; Mirsad-1
Most of the Hezbollah gear shown is not exactly top secret, and is not the latest arsenal of course. 
Further more into the museum there is an exhibition of the different spoils of war from shells, to rifles, communications equipment and even espionage equipment caught with Lebanese and Israeli field agents.
 Israeli Army Structure.
 The museum...

 Spy equipment. Information is entered via the keyboard to the lower right and the corresponding encryption code is entered with the numpad in the top center. The black device towards the top right modulates and transmits the burst signals. To the right, one time pads to encode messages.

Beyond the exhibition, lies the natural preserve. It is dotted by several vehicles and launchpads used by Hezbollah during the 2006 war. As well as several bunkers and underground command centers.


The entire place is very well documented and there are several guides available in several languages.
Plates describing events or equipment are written in Arabic and English.
 Sleeping quarters in one of the underground tunnels. The tunnels were hand chiseled over the course of years. Preparation started in 1982.
Command center, preserved as much as securely possible. In the background you can hear recordings of radio conversations during the war.

The views are also quite nice and strategic.

In short, if you have any allergy towards Hezbollah, this is not a place for you. The whole place screams a mixture of "screw you Israel" and Hezbollah propaganda. The architecture is imposing, the place is very well kept, and parking is never an issue.

I recommend it to anyone who wants a further insight on the workings of Hezbollah of 2006 and the war that happened that same year.
If however you want an insight of today's Hezbollah gear and tactics, you're better off reading a newspaper.

Friday, May 3, 2013

Ghost of Christmas Past

While cleaning up I found something... a ghost of Christmas past if you will. This is a draft of the first issue of a school newspaper we used to publish. I was in grade 12 back then. The idea was supported by the administration. An issue would sell for 1000 LL.

This was an excellent exercise in freewriting, journalism, editing... And it made us feel rather special that we had such a cool project.
Any student could contribute content, and many did...

Here's the full draft:

Friday, March 15, 2013

Bring back the Gladiators

Everyday we yearn for that adrenalin rush but we don’t know where to get our fix. Some of us resort to extreme sports, other drive their cars really fast endangering the lives of the innocent. You even have those who join warring factions and fight others in proxy wars just for the fun of it, the good pay, and the glory.
My solution is nicer: Bring back the gladiator games of yore.
Before you start telling me how the gladiator games are barbaric and uncivilized, please note that our barbarism and lack of civility is pretty evident. We try to deny it, we try to say that we have risen above taking joy in the misery of others, in their pains, and suffering. All you need to do is see the myriad of wars that our modern civilization have started. Look at all the reality shows and movies that glorify violence.
This is how we can do it in Lebanon. (And later on we export that model to the rest of the world). The most suitable place would be La Cité Sportif du Camille Chamoun. (In Lebanese: Al Mal3ab Al Baladi). The contestants would be either convicts, or volunteers who long for fame and glory. They would either have to fight each other in a one-on-one battle, or group fights like red vs blue. And bonus rounds include fighting wild beasts like tigers, lions, and rhinos. There would be a wide range of melee weapons and shields to chose from. Of course an entire industry would evolve around this. The events will be televised on pay per view channels. Tickets would be sold for the live events. Commentators would be giving you the details second by second in various commenting styles (Egyptian, American, British…) which would sound something like this: “… and he swings his battle axe at his opponent but misses by a couple of inches… Well Jim, those battle axes are heavy and not that precise…” Before the games would begin, a picture of each individual warrior would be displayed next to a bunch of statistics and info. The flag of their faction waving in the background with lively music blaring though the speakers of your 40 – inch 3D LED TV. And after the match is over, an analysis would be displayed with 3D overlays projected virtually over the arena.
Oh and the merchandise… must not forget that! Towels, mugs, pencil cases, posters, action figures, trading cards, board games, videogames… the possibilities are endless. Even advertisements would be broadcast during the games, and companies can sponsor their own heroes that would sport a Mc Donald’s shield or a Samsung helmet (complete with supporting electronics).
Weapon makers and blacksmiths would flourish and perhaps the ancient art of crafting swords from Damascus steel would be revived. Experts from various parts of the world would be hired to fashion the most elaborate and sophisticated weapons.
We can even have someone dressed as Caesar and the warriors would stand before him and cry “Ave Caesar! Morituri te salutant” (Hail Caesar! We who are about to die salute thee.)
Just Imagine it, Michel Aoun and Samir Geagea duking it out in the arena, both bloody from the cuts they have sustained. Both suddenly finding themselves back to back, two mortal enemies, forced to team up against a pack of hungry lions.
Imagine Hassan Nasrallah and Ahmad Al Assir fighting to the death. One holds a trident and a fisherman’s net, while the other has a short sword, a Spartan shield and a helmet. Suddenly a referee blows his whistle. Soft music with an epic vioce come on: “Two long standing enemies are fighting for supremacy… but at the end of the day they both agree to one thing… the refreshing taste off Coca Cola…” Nasrallah and Assir at that point each open a chilling glass bottle of Coca Cola, drink a bit, and then say: “Ahhhhhhhh, Always Coca Cola!”
I would pay good money to see that. I would TiVo that match and watch it over and over.
Just imagine, and entire industry, employing thousands, creating amazing business opportunities. And of course… that adrenalin rush you’ve been dying for…

Saturday, March 2, 2013

Muslims of the world… Congratulations (then again, not)!



An open letter to Muslims around the world.


Congratulations; In a very sarcastic tone. But congratulations none the less! Why? Well look at your selves and you will know why. Islamophobia is on the rise in the world today. And the main culprit is not the western bigot. No! The one to blame is you; the common Muslim.

Allow me to elaborate.

When some idiot around the world comes up with some stupidly sounding fatwa that allows necrophilia, breast feeding grownup males, killing Mickey Mouse… what do you do? Nothing. Absolutely nothing. You do not protest the fatwa. You do not take to the streets in horror and disgust chanting slogans of how “they” are ruining the “good name” of Islam. In fact many of you celebrated when the terrorist attack on 9/11 happened. On the other hand, when anyone draws a silly cartoon, produces a B movie (which was a crappy production and was obviously dubbed), or even criticizes any aspect of your religion, you riot and take over embassies. Even if it is the embassy of the wrong country.
Your silence indicates either agreement or apathy. Both are unacceptable!

You care not about the latest scientific advancements, medical discoveries, philosophical and ethical arguments. All what you care about is finding the name of your god, or your prophet written inside a tomato or on a tree. You would rather believe fake stories that champion your view of religion rather than embrace common sense.

You are part of a nation that goes bezerk over how the “common Jew” is secretly plotting to control the world, and yet when it comes time to act and help your “fellow muslims” in Gaza, you shrug and label them as terrorists.

You would rather celebrate meaningless differences and demonize other Muslims that do not follow your creed rather than uniting and prospering in a solid “Muslim society”.

You claim that the “west” is conspiring against you only as an excuse to cover up your own ineptitude.

Islam may have been spread by the sword, but during the later golden ages, Muslim scientist, thinkers, philosophers, and writers contributed to the advancement of the sciences, and preserved Greek philosophy . All this was done while the “west” were passing through their darkest ages!

If you claim to be a “Muslim”, start acting like it and take some responsibility for the abysmal state to where Islam has plunged today!

Sunday, January 27, 2013

This is not a child's song!

It really amuses me when I find out that at a certain kid's birthday (usually girls), one of the featured songs had to be Aqua's 'Barbie Girl'. People; wake up! Have you heard the lyrics? This is not a kid-safe song!

The lyrics have a lot of sexual innuendo in them, and sometimes it's not even innuendo.
"I'm a barbie girl, in the barbie world
Life in plastic, it's fantastic!

you can brush my hair, undress me everywhere
Imagination, life is your creation
Come on Barbie, let's go party!
I'm a blond bimbo girl, in the fantasy world
Dress me up, make it tight, I'm your dolly
You're my doll, rock'n'roll, feel the glamour in pink,
kiss me here, touch me there, hanky panky...
You can touch, you can play, if you say: "I'm always yours"
Make me walk, make me talk, do whatever you please
I can act like a star, I can beg on my knees
Come jump in, bimbo friend, let us do it again,
hit the town, fool around, let's go party
You can touch, you can play, if you say: "I'm always yours"
You can touch, you can play, if you say: "I'm always yours"

Don't get me wrong. I love that song. I love its meanings. And I especially find the tune very cute. But if I ever have children, I would wait a bit before I would expose them to this R rated material

Thursday, April 5, 2012

Beggars and Little Urchins

Allow me first to dispense with the usual rhetoric: The government should do something about them. And I will not get into specifics like where the camps would be and what disposal procedures should be used. Or perhaps even give them an education and a future (I’m sure most of the kids are quite bright).


Oh, and giving them money only reinforces the idea that THIS is what they should be doing instead of being at school. So yes, you ARE a bad person if you give them money (even if it makes you feel better about yourself).

Assuming they grow up and some disease does not kill them, they will end up like this:

And eventually, they will die. A group of AUB students will probably decide to make a small statement, perhaps also put flowers on the spot on the street where they used to cumber, just to make themselves feel better (again). And their memory wiped out. Well not really. This blog will be there for a long time…

How sad; human life is worthless.

Sunday, November 27, 2011

2011 Beirut Marathon - Medical Team

Another year has passed and once again, Beirut is hosting it’s annual marathon. And like last year I decided to volunteer in the medical team. But this year I chose to go with the Red Cross on the 42-Km track riding an ambulance with the runners.


It was a lot of fun. A big thank you goes out to the Red Cross who seemed to be omnipresent and especially unit 276 who I was riding with.


This year, unlike the last one, the medical area was linked to the finish line in the Martyr’s Plaza DT. It was much more organized :D
It was worth waking up at 5:00 in the morning just to be there…

AUB medical team on our way back to AUBMC.
Tx courtesy of the Lebanese Red Cross


101_0014 DSC_6087 DSC_6091 DSC_6092 DSC_6093 DSC_6095 DSC_6112 DSC_6116 DSC_6121 DSC_6123 DSC_6125 DSC_6126 DSC_6129 DSC_6134 DSC_6136 DSC_6154