"Najmlađi najboljić" – How programmers from elementary school's 2nd grade are treated by Croatian institutions

HRVATI: Pogledajte video na kraju članka. Pred kraj videa je otipkana ova priča koju u nastavku pišem na engleskom. (Također, ispod videa, još malo teksta na hrvatskom.)

IN ENGLISH: For my foreign readers, here’s a VERY quick overview of how very talented kids got treated during the last several years, and how well national computer science competition’s official rules are handled by the National Competition’s Committee for computer science, and the Croatian Education and Teacher Training Agency, are handling a super-smart second grader.

Usually, in Croatia, kids that go to computer science competitions do so in elementary school from fifth to eight grade, as well as during the entire high school. That’s fine. Dorijan Lendvaj was, however, a second-grader in 2012.

Nowhere was it said that children younger than fifth-grade can’t compete. It’s not forbidden. There is no limitation for children to compete from fifth-grade upwards. And as far as I know, so it was since 1992, when the national competition was first held. Rules definitely did not change during the 2000s, the decade when I competed between seventh grade and high school’s fourth grade. There were always some fourth-graders. Younger kids didn’t compete because they did not yet understand programming well enough to understand the problems, much less solve them.

At least during 2000s, there was always a division between P1 and P2 — fifth and sixth grade, and seventh and eight grade. That’s fine. Pre-fifth-graders simply competed in P1. That is no longer the case.

So what’s the problem? Since AZOO (that’s the agency) took over the organizing, they took on the task of setting the rules. Let’s see what’s up in the elementary school. There was the rule that the ranking list for INVITATION from county to the national level is based on several age groups: pre-fifth and fifth grade, sixth grade, seventh grade and eight grade. Does that make sense? Little, but let’s go with the flow. There is a small number of pre-fifth-graders, so it perhaps makes little sense to organize a separate competition.

During AZOO era, problems were also written based on those groups instead of P1 and P2. That’s also fine, for the same reason.

But that makes it more shocking that AZOO decided they did NOT need to apply the rule that AZOO EXPLICITLY DID NOT CHANGE. That rule says: ALL RANKING LISTS AT NATIONAL LEVEL ARE BASED ON CHILD’S GRADE. That is, even if Dorijan is the sole second-grade competitor on the national level, he wins the competition.

He should have won in 2012, when he was a second-grader, right? The same year that Dorijan and a third grader (Ivan Jambrešić) were given special, one-shot “recognitions” for being young competitors, right?

NO. HE AND IVAN JAMBREŠIĆ WERE RANKED AS IF THEY WERE FIFTH-GRADERS. DORIJAN WAS RANKED AS FIFTH, and denied the national-level award called “Oscar of Knowledge”.

This blatant disregard for THEIR OWN RULES was quickly remedied during the current school year 2012/2013, just before the 2013 competition. How?

NEW RULES STATE THAT ONLY FIFTH-GRADERS AND UP CAN COMPETE. Dorijan, who successfully competed with FIFTH-GRADE-LEVEL TASKS AS THE SOLE SECOND-GRADER has for his success been rewarded with A TWO YEAR BAN FROM THE COMPETITION. The only second-grader that managed to reach the state-level competition based on county-level competition lists which included him in fifth grade level (rightfully, according to the rules) has not only been rewarded with incorrect reading of very clear rules (“national-level ranks are categorized by grade”) but by BAN FROM COMPETING UNTIL HE REACHES FIFTH GRADE.

I also saw some signs that fifth and sixth graders may also soon be done away with. There is absolutely no doubt about it that this is about Dorijan.

What’s more to say? Deterioration of computer science competitions in Croatia seems to be near completion. They have transformed from a celebration of youth and intellect into a teacher’s point-scoring fest, in which teachers (MANY OF WHOM DON’T WORK WITH CHILDREN OR WORK VERY POORLY WITH THEM — I applaud the exceptions, of course) fight for points, which they are then promoted with and earn a better paycheck.

That’s right: teachers who are blatantly preferring getting better paychecks than advancing their students’ minds. Teachers who prefer fighting for their pockets against anyone who is truly interested in children’s wellbeing. Teachers who prefer BANNING SECOND AND THIRDGRADERS over relenting and SIMPLY AWARDING THE KID the award that is RIGHTFULLY his, according to the RULES THEY THEMSELVES WROTE.

Should the right to correct a wrong be allowed to expire? I don’t think so. Especially with talented kids like Dorijan.

Here’s a video about Dorijan in which you can see that, as a second grader, he understands equations, square roots, fractions, multiplication and division better than many adults in the room! It’d be awesome if you could speak Croatian, but even if you don’t, it’s an interesting video.

If he doesn’t deserve a separate category and to win the national competition, who does? If he wasn’t the best second-grader in the state, who is?

Or is Dorijan magically only the fifth-best fifth grader in the state? (And if you know to perform this act of age-shifting, please do tell me. I’d love to adjust my age a bit or do other wondrous transformations. Like turning a piece of paper into an iPad.)

“Dorijan Lendvaj obožava sekicu Doru i brata Vilima, mamu i tatu te jako voli programiranje. Iznimno je vješt u programskim jezicima Logo i C++. Odličan je učenik, sklon matematici, i voli se igrati, a ponekad i tako da programira robote.

On je najmlađi najboljić u povijesti državnih natjecanja iz informatike u Republici Hrvatskoj, a još uvijek nije upisan u listu državnih pobjednika.

Ako ga pitate koji je bio na posljednjem državnom natjecanju (ožujak 2012.), on će reći da je bio peti, jer tako još uvijek u službenim evidencijama i piše, iako dobro zna da je bio prvi. Više nego dobro zna da je najmlađi pobjednik državnog natjecanja iz informatike u povijesti.

Dorijan Lendvaj, divan i predobar daroviti Čovjek iz Popovače. Zlatni CROCalien za 2012.”

Još o fantomskim priznanjima


Dorijan Lendvaj je u 2012. bio drugi razred. Pravilnik državnog natjecanja iz informatike je, otkad je Agencija za odgoj i obrazovanje preuzela organizaciju, zadržao pravilo “rangiranje na državnom natjecanju se radi po razredima”. I tako je izričito pisalo do prosinca 2012.

Što znači da kad se Dorijan Lendvaj natjecao kao jedini drugašić koji je uopće uspio doći do državnog natjecanja, trebao je adekvatno biti rangiran i pobijediti, je li tako?

Ne, naravno da nije. Nekoliko zadnjih godina za redom, organizatori državnog natjecanja uporno ponavljaju grešku i ne čitaju svoj pravilnik kako spada. Dorijan je rangiran u “dobnoj skupini” koja je nazvana “do 5. razreda”. Nažalost, ne postoji razred “do 5. razreda”, a takve dobne skupine definirane su samo za, primjerice, pozivanje na državno natjecanje ili za sastavljanje zadataka. No kad učenik dođe na državno natjecanje, pravilo je bilo (i trebalo se poštovati) da se konačna rang ljestvica formira po razredima.

Dorijan je pobijedio, trebao dobiti nagradu “Oskar znanja”, ali magično se transformirao u petaša i zaradio peto mjesto. Kakva je to magija? Može se to negdje naučiti?

E sad, nije to jedina nagrada koju je dobio od državnog povjerenstva i organizatora. O, ne ne! To bi bilo prejednostavno. Dorijan je dobio i nagradu koju možemo nazvati “natjecati se mogu samo učenici petog razreda naviše”, UVEDENA U PROSINCU 2013.

Naravno, u tu nagradu nisu uključeni ni kipić ni medalja nagradu. Bogme nije ni uključeno PRIZNANJE kakvo je POČETKOM natjecanja Dorijan dobio 2012. kao jedan od najmlađih sudionika ikada (ako ne i najmlađi).

I nije Dorijan jedini. Iste 2012. u istu skupinu (isto priznanje) stavljen je i Ivan Jambrešić.

Zašto pričam primarno o Dorijanu, a ne toliko i o Ivanu? Gore je zgodan filmić u kojem se vidi da ako itko NE ZASLUŽUJE TAKAV TRETMAN, onda je to ipak netko pametan poput Dorijana.

Dakle u drugom razredu dečko kuži jednadžbe, korijene, razlomke i “brojeve veće od 10”. Na kraju videa je isto i tekst, sažetak cijele priče.

Ovogodišnji rezultati kluba iz Popovače

Thoughts?

Little tips on writing portable plugins (and rant on MSVC)

Having written a smallish plugin for a cross-platform database program FileMaker using a template that included projects for Xcode and VC, here’s a few tips on what you should think about when you start writing a plugin that should work on multiple platforms.

  1. Work on the Windows version first. If you’re at home on non-Windows platforms, MSVC will surprise you in numerous ways with its oddities and weird, outdated support for C.
  2. Write as much code in C for portability.
  3. Write in C90. Microsoft Visual Studio will barf a lot at you otherwise.
  4. If you disregarded #3 and wrote the code in C99 (for example, you declared variables during the function body instead of on the top of the function), you’ll have to switch to C++ to avoid changes to your code.
  5. Don’t write smart code. For example, MSVC barfs at the following:

    typedef struct _IVRect
    {
      int x, y, w, h;
    } IVRect;
    
    IVRect r = { .x = 5, .y = 6, .w = 7, .h = 8 };
    
    // but the following is ok. just don't change the order of
    // struct members. if you do -- woe upon you:
    IVRect s = { 5, 6, 7, 8 };
    

    and it especially barfs at the following:

    // given int IVRectSurfaceSum(const int rectCount, Rect * r):
    int surface = IVRectSurface(2, (IVRect[]) 
      {
        { .x = 5, .y = 6, .w = 7, .h = 8 },
        { .x = 1, .y = 2, .w = 3, .h = 4 } 
      });
    
  6. Use as many open source libraries available for majority of your platforms.
  7. …but always check what MSVC can swallow and what your target app uses. I have used version of libxml2 that depended on the newer zlib1.dll than has shipped with FileMaker. The only solution I found is — replacing FileMaker’s zlib1.dll. That’s nasty.
  8. Always write a small test C program that uses the same functions as your plugin. Port that to every platform first. On Windows, I couldn’t get stdout from my plugin once it ran under FileMaker. If I could’ve, I would’ve saved about a day of frustration why signing with xmlsec didn’t work. (xmlsec’s debug output wasn’t displayed anywhere, either).
  9. Get used to #ifdef _MSC_VER. Get really, really, really used to it.
  10. Since I’m not sure you could figure that out… I have a very low opinion about Visual C++. I did hear it produces nice, fast code. But that doesn’t change the fact that it’s terrible to use with low coverage of modern C. Actually, scratch that: nonexistent coverage of modern C.

    I mean, it’s so nasty that I’m wondering if I should have built a helper static library (or a DLL) which contained the C code using MinGW, and then used this helper library in the plugin itself.

    Visual C++ was — for me — slow, had little conformance with modern standards, and every time I had to copypaste something somewhere using GUI, a little part of me died. A slightly larger part if I had to overwrite something else, as was the case with zlib1.dll.

    I don’t know. Sure, it’s mostly familiarity-with-other-IDEs speaking out of me. Sure, tons and tons of people prefer and absolutely love Visual C++. Good for them.

    But, I apparently love modern language features far, far more. So, if you are like me, and if you are forced to build something with MSVC (an example might be — the SDK you’re writing the plugin with chose to use C++, hence the ABI is locked into MSVC), you really, really, really should constantly doublecheck if MSVC will eat up what you try to serve to it.

    Because if you used to work with Windows, and if you are nowadays mostly targeting another platform (or at least another compiler), and if you think you’re writing portable code — you may be in for a nasty surprise.

    Especially if you use third-party libraries!

First-chance exception at {address} (ntdll.dll) in {exename}.exe: 0xC0000139: Entry Point Not Found

Writing a plugin for a Windows application using Visual Studio?

You had the smarts to define the application’s exe as the debug executable in Visual Studio project options?

While reading the output, you saw the error from the post’s title?

First-chance exception at 
(ntdll.dll) in .exe: 0xC0000139: Entry Point Not Found

You’ve probably got a classic case of app-uses-one-version-of-dll-while-one-of-my-plugin’s-dependencies-wants-another-one. In my case, I had to replace zlib1.dll in the app with the one that came with Igor Zlatković’s Win32 builds of libxml2, xmlsec, etc.

Read a bit more about the error, including different causes.

Symbolicating Mac app's crash reports — manually

You will need your released app’s dSYM bundle. Since you are a good developer, whenever you release a version of your software, you use Xcode’s built in Archive functionality, so you don’t have a problem with that. (Right?)

So open Xcode’s Organizer. Right click on your archive, and pick “Show in Finder.” Then right click on the archive, and choose “Show Package Contents”.

Enter the “dSYMs” subfolder, and find the sole .dSYM bundle in there. Right click on it, and “Show Package Contents”. Open Contents, Resources, DWARF — and you’ll reach the file that actually contains the debug symbols. For example, “GeorgesGreatApp”, without any extension. Wheeee!

Now, open Terminal. Punch in atos -o and drag and drop the “GeorgesGreatApp” file (the one that contains the debug symbols) into the terminal. Then punch in -arch x86_64 (or whatever architecture the crash occurred on). Finally, paste the address that you want to know more about.

For example, given the following line in the crash log:

1   net.vucica.GeorgesGreatApp    	0x0000000100001e91 0x100000000 + 7825

you’d take the first hex number that appears on that line, and have this on the command line:

atos -o /Users/YOURUSERNAME/Library/Developer/Xcode/Archives/2012-02-29/GeorgesGreatApp\ 29.02.2012.\ 00.40.xcarchive/dSYMs/GeorgesGreatApp.app.dSYM/Contents/Resources/DWARF/GeorgesGreatApp -arch x86_64 0x0000000100001e91

and you’d get this output:

-[GGAppDelegate generateThumbnailsForJpeg:] (in GeorgesGreatApp) (GGAppDelegate.m:326)

Extremely handy when Xcode screws up symbolication or outright refuses to import the crash log. Maybe it’s Xcode’s fault. Maybe Spotlight did not correctly index dSYM’s location. Maybe Spotlight did not correctly index .app’s archived location. Whatever it is, I don’t really care — if symbolication is broken, it’s broken. But at least I can use the underlying mechanism in atos.

Mini tip on clearing iCloud bookmarks and starting over

I’ve got a backup of my several thousand bookmarks (mostly junk, but who’s got time to dig through it?), but I’ve played a bit with importing and exporting bookmarks from all over the place so the syncing with iCloud never ends. Too many changes!

So, how did I just finish dealing with that?

What follows is error prone, and if followed, may cause data loss. I’m not documenting this for your benefit, but for my own. Consider this a letter to myself in the future. Please don’t follow this unless you yourself know exactly what you’re doing and have three backups of your important data. Everything that has to do with syncing is error prone out of the box, even without a user messing with it.

As previously discussed, iCloud’s bookmark sync actually involves WebDAV and XBEL. It also involves a file containing all bookmarks: ~/Library/Safari/Bookmarks.plist.

So after ruthlessly murdering the SafariDAVClient process (and ensuring it doesn’t wake up until I want it to: watch -n1 killall SafariDAVClient), I opened the aforementioned file. There were over 30000 pending changes. That’s unacceptable.

So I went and deleted all bookmarks using Safari, for convenience. The plist editor I used didn’t allow selection of multiple items, so deleting bookmarks would take a while. I left alone the Reading List, because I didn’t have a proper backup of that. I took note of what the remote folder name of the Reading List was.

Then I mounted the root WebDAV mount point, and went and deleted every folder and bookmark except for the Reading List — thus bringing iCloud into sync with the local dataset.

Then I watched the progress as the changes were applied, and imported the bookmarks several times using a certain tool I use that also reduplicates bookmarks and keeps a copy of bookmarks, etc. I watched the progress by opening Bookmarks.plist and looking at how many changes were in the ./Sync/Changes array.

iCloud Bookmarks: WebDAV + XBEL format

Just a few small notes and random thoughts.

iCloud Bookmarks are stored in WebDAV, as evidenced by the name of the syncing process: SafariDAVClient. Some googling revealed that you can find out the URL by opening the ~/Library/Safari/Bookmarks.plist file. (If you don’t have Xcode, convert it using plutil -convert xml1.) Each bookmark has a remote XBEL file associated with it; so just cut the part of the URL up to and including .../bookmarks.

Now you have URL you can browse using a WebDAV client. I didn’t have any success with Cyberduck; I kept getting ‘Unauthorized’ error. I presume it’s confused by the @ symbol in the username (the email address, y’know), but I don’t know.

Mac OS X’s built in WebDAV client (also known as ‘Finder’s WebDAV client’) can correctly mount the remote filesystem; but you can’t view the file list in Finder. Once it’s mounted, listing it through Terminal works very well.

It’s interesting that XBEL appears to originated within the Python community, as evidenced in its XML namespace: http://www.python.org/topics/xml/xbel/.

Apple really, really, REALLY likes to use existing standards wherever possible. The original push notification system was done via XMPP, for example, but noone dug deep into it; and FaceTime is suspected to be RTP deep inside. The strategy may be embrace, extend and lock down, but it’s ok. If I start having problem with it, the data is still accessible, I can still take it out.

And not just because they use WebDAV and XBEL for their cloud storage, but because I actually have the data on my local machine. Which brings me to another topic: knowing they use WebDAV and XBEL would have been useless, since you ordinarily would not be touching that directly. It would have been far better to actually mess with Safari, whose bookmark sync support is more-or-less documented. Via SyncServices.framework. Except it is not. Since that magical underused technology has been deprecated in 10.7.