This deserves a break from my self-imposed exile: Toyo (ang bandang may Toyo) has their Eleksyon na Naman video up on YouTube:
Colegio de la Purisima Concepcion website
Thursday, February 18, 2010
The Colegio de la Purisima Concepcion website runs on my as-yet-still-in-development CMS: Mazungumzo, which is in turn powered by the truly truly wonderful CodeIgniter PHP framework.
Mazungumzo is a Swahili term meaning conversation, and at its core, the Mazungumzo platform is meant to be an enabler for conversation: between students, between teachers and administrators, between the alumni, and everybody else in-between. A lot of the features — the social network, data sharing, grade/performance tracking and collaboration to name a few — are still in early alpha, and are not yet implemented in the live site, but hopefully will be soon ™ :D
Manny Villar and the World’s Smallest Violin
In the spirit of Chiz Escudero Real Ultimate Facts, I give you: Manny Villar and the World’s Smallest Violin — Real Ultimate Facts!
Storing a CSV text file into a C Struct
Monday, September 28, 2009
I came across a problem where I wanted to grab some data off a CSV text file (see sample below) and plug it into a data structure, but — and there’s always a “but” — I had to do it in ANSI C. Eyeroll. Doing it in Python would be a snap:
1 2 3 4 5 6 7 8 9 10 | path = "players.txt" dbfile = file(path, "r") players = [] for line in dbfile: temp = line.split(",") temp[4] = float(temp[4]) players.append(temp) dbfile.close() |
Since I *had* to do it in C anyway, I decided I wanted to use Structs; I haven’t used those in a while (ok, never — but I love structs!) and since this is a learning exercise anyway, I thought (as I am wont to do) why the hell not? Of course I immediately threw that line of reasoning out the window by arbitrarily setting the struct array to 5 items because I didn’t want to shoot a bullet in my brainpan *squish* do a bunch of malloc()s and calloc()s. Anyway…
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | #include<stdio.h> typedef struct Player{ char *name; char *team; char *position; int number; double salary; } My_Player; int main(void){ My_Player players[5]; char *path = "players.txt"; char tmpstr[254]; FILE *dbfile; int line_counter = 0; int parse_counter = 0; char *temp; dbfile = fopen(path, "r"); while(!feof(dbfile)){ if(fgets(tmpstr, 255, dbfile)){ temp = strtok(tmpstr, ","); while(temp != NULL){ switch(parse_counter){ case 0: players[line_counter].name = temp; break; case 1: players[line_counter].team = temp; break; case 2: players[line_counter].position = temp; break; case 3: players[line_counter].number = temp; break; case 4: players[line_counter].salary = atof(temp); break; } parse_counter++; temp = strtok(NULL, ","); } printf("%s", players[line_counter].name); parse_counter = 0; line_counter++; } } fclose(dbfile); return 0; } |
Now I *seriously* hope there’s a better way to do the strtok() without passing it through a clunky switch statement and resetting the parse_counter variable after every line; reader (yes, singular), enlighten me please!
Here’s the sample data file (players.txt)
Jason Kidd,Dallas Mavericks,Point Guard,5,21000000 Kevin Garnett,Boston Celtics,Power Forward,5,22000000 Kobe Bryant,LA Lakers,Shooting Guard,24,19000000 Shane Battier,Houston Rockets,Small Forward,31,6864200 Andris Biedrins,Golden State Warriors,Center,15,9000000
Mar Roxas: A Failure of PR or a Failure of Humanity?
Friday, August 21, 2009
Apparently, a failure of PR, according to the following tweets:
Re: Quintuplets, story going around is completely inaccurate. We never abandoned them. We never stopped giving assistance…
Thanks to commenter keefedelacruz for the head’s up :)
Mar Roxas has never been, despite numerous recent attempts to be otherwise, “one of us.” Be it because of his pedigree, bearing, wealth, demeanor, education, the man just isn’t the “everyman” that his barfable campaigns — from Mr. Palengke to the Padyak ads to the heretofore unseen public displays of emotion — try to make him out to be. In my home province of Capiz (or Capis, if you’re a historian), his family is practically royalty; unfortunately not in the lovable mold of King Arthur with his holy hand grenades and water-logged tarts giving away swords, but rather the aristocratic mold of Louis the XVI. They are, to use the locally bastardized Spanish term, alta sociedad: the highest of the high in high society, the kind that social climbers have wet dreams of, kissing their feet. Old rich, and growing richer. Needless to say, empathy and charisma are not his strong points.
Unfortunately, Philippine politics being what it is — a rat race of wolves trying to look like sheep (George Orwell, I hope you’re proud) — charisma plays a key role in one of the three pillars of power: goons, gold and good looks (guns, goons and gold are so last century). To get elected, even in the local baranggay, a candidate must have a healthy dose of each pillar, or, as in the case of the 2004 presidential elections, an overwhelming advantage in one (Garci was the penultimate goon). Breaking it down, this means, as Al Capone once said: “You can get further with a kind word and a gun than you can with just a kind word.”
- Goons — not always thugs; more appropriately labeled as henchmen, people with more than the normal amount of power willing to further your candidacy. Lower-tier goons serve as enforcers while those higher up serve as fixers, financial backers, middlemen, and all around movers and shakers. See also: Garcillano, Virgilio; Bolante, Jocjoc; Ver, Fabian.
- Gold — money, and lots of it to pay off the goons and other people, as well as run your political machinery. Most often used to buy votes.
- Good looks — not necessarily referring to one’s physical attributes; more appropriately labeled as “looking good”, this generally involves a lot of public relations work and spin, since voters still need a sense of connection. This is the reason why everybody from Mar Roxas and Manny Villar try so damn hard to project an “everyman” image, something that only Erap has ever managed to pull off. Has reached new heights since Obama became US President.
Of the three, the cheapest to implement is the third, and when done right and effectively, can more than compensate for deficiencies in the other two pillars (see Aquino, Cory). Unfortunately, we’ve already seen that it doesn’t work for everybody; the candidate needs to have “IT”, that elusive x-factor that makes even the hollowest of platitudes seem like the holy word of <insert deity here>. It’s the hardest to employ because the slightest misstep, even in the decades past, will come back to bite you in the ass.
Case in point: the issue regarding the country’s first quintuplets, and how Mar Roxas allegedly abandoned them after the photo-op despite making public promises of support. Now, there are some thoughts I’d like to clarify first:
- The man is not obligated, morally or otherwise, to open up his ginormous wallet for every Tom, Dick and Harry that comes to him, hat in hand. In fact, this goes for all politicians. We would do well to understand that our elected officials are not the feudal lords and hacienderos that our forefathers would go to for financial assistance. The money they give you is likely not even their own, but rather comes from allocations of the taxes we pay.
- But open up their wallets they do, these politicians, particularly the new ones (see Bolante, Jocjoc). It’s always done grudgingly, but with a smile plastered on their faces, saying that that’s what they’re there for, that they’re there to help and some such bullcrap. They do it because they don’t really have a lot of choice, particularly during election season — they don’t need the bad press of appearing to be insensitive to the needs of their constituents. In short, they need to look good.
- That, unfortunately, means that they’ll be taking out more from the public coffers to recoup their losses; the sheet (shit?) must be balanced.
- Of course, none of that matters to a parent whose kids will die or go hungry without financial support. Ultimately, it doesn’t matter where the money comes from. Kapit sa patalim, as it were. Principles and righteous indignation are for those who can afford it; after all, rich people don’t need to steal bread and sleep under bridges.
- Never mind that the main reason so many people are in dire straits in the first place is because these very same politicians are corrupt, squeezing the life’s blood out of our economy. Some even retard economic growth in their areas, just to ensure that they remain dominant. It’s a vicious cycle that will, at best, take generations to break.
As human interest stories go, Mar Roxas’ pledge of financial support for the treatment of the Fernandez quintuplets would have been a public relations coup; it should have humanized him — previously one of the country’s most eligible bachelors, now engaged to a minor celebrity on the wrong side of menopause, taking care of poor sick kids. But it didn’t work, and if the reports are to be believed, now we know why.
Because for all his pretensions at being Mr. Palengke, Mr. Padyak, whatever, we all know deep down that Mar Roxas just isn’t that guy. We know, in our heart of hearts, that it’s like Dick Grayson taking on the mantle of Batman — it’s not really him, it’s just a show. He’ll probably do when all else fails, but we’re still waiting for Bruce Wayne to show up.
So he’s not a cuddly bear. But is he, as others have indicated, a ruthless MOFO? While I certainly agree that it takes a certain kind of SOB to be successful at politics, I think it’s pushing the boundaries of reason to suggest that the Senator intentionally witheld financial assistance and let those kids die. After all, he’d see this kind of backlash coming, certainly. And he’s still human (right?); you just don’t let kids die when you can do something about it.
I think he forgot, or just didn’t see the urgency. After all, this is a guy born with a diamond-encrusted set of silver spoons in his mouth. It’s probably exhausting to drive a pedicab. Somebody from his staff probably did a major fuckup and forgot to update him on the dying quintuplets. Hell if I know what really happened.
But happen it did, and that’s because, really, the caring Mar? The one trying to convince you he feels what the other 90% is going through? That’s not real. Those quintuplets were just another photo-op in a long list of photo-ops. That’s just Mar Roxas trying to look good. Unfortunately for him, looks can’t deceive us anymore.
August 12 ‘09 Bullets
Wednesday, August 12, 2009
- Jun Bautista takes the time to clarify the moves by UP Law Professor Harry Roque, et al → “We were led to think that Congress finally crafted a mandate for full automation in the coming 2010 elections, but a review of the amendatory law will reveal that it provides for a hybrid election (partly automated and partly manual) only.”
- Mon Casiple sees 2010 as Gloria’s endgame, much as 1986 was Marcos’ → Today, the Arroyo family faces the same endgame that the Marcoses faced in 1983. The political logic of 1983 led to 1986. How will GMA choose?”
- Parts two and three detailing the dubiosuly-acquired Arroyo wealth; apparently, GMA is either one hell of a stock broker, or a liar. Hmmmm.
- Ellen Tordesillas, on Dinnergate → “…nakapagpakain ng tatlong beses sa isang araw sa halos 9,085 na Pilipino na hindi na nakakain ng sapat, dahil sa sobrang kahirapan. P35 lang may kanin at ulam na. Sa P18 bawat kilong NFA na bigas, 53,000 kilong bigas ang mabibili ng $20,000.”
PCIJ Report on GMA Wealth part 1
The declared wealth of President Arroyo has increased the fastest, and by amounts much bigger, than the net growth in the declared wealth of three presidents before her — Corazon Aquino, Fidel Ramos, and Estrada — combined. Read part one of the PCIJ Report.
Alternative locations for your Grey Poupon, Madam President
Sunday, August 9, 2009
So, okay, maybe they didn’t have any Grey Poupon; the thought remains the same, and Steven Tyler’s advice is still very much valid.
Days after this report from the PDI, indicating that “more than nine million Filipino families consider themselves poor, while nearly two in five say they are “food poor,” according to the latest Social Weather Stations (SWS) survey,” this happens:
A million pesos is a lot of money; no, seriously, it is. That’s a shitload for us, the other 80%. With my teacher’s salary, without deductions and assuming I get paid during the summer (which I don’t), it’d take me twelve frikkin’ years to get that much. A million pesos can feed a family of six every day for over five years. A million pesos can buy twelve 72 sq.m. lots for the urban poor. A million pesos is enough to put you through the five years of college at the University of Asia and the Pacific twice, the most expensive school in the Philippines. It’s enough to pay for a year’s worth of tuition in Primary or Secondary school for almost two hundred kids.
Would even just the illusion of prorpriety be too much to ask?
Cory envy: CARPer signed into law
Saturday, August 8, 2009
It’s become a fad, of late, to compare and contrast our two female Presidents Cory and Gloria, although it strikes me as more than a little sad that it was only after she died that Cory clearly gained the upper hand in that contest. Lost and politically discarded in the years after her term ended, Cory was often openly dismissed. It was only after her death that we were forced to remember her legacy, and it’s ironic that one of her greatest contributions (after being, y’know, the symbol of EDSA) to Philippine Democracy is the very same reason she was rendered politically impotent: her desire and belief in the peaceful transition of power.
She never pushed to stay in Malacañang past her term; it wasn’t even an issue. Instead, she passed the baton so gracefully that it was probably the only time that an incumbent President’s blessing wasn’t a political kiss of death. But because she gave up power, she was rewarded by being discarded, while those who hungrily sought it still remain (somewhat) relevant.
Go figure.
Someone said to me that it was rather sexist to compare just the two women Presidents, and that it was ultimately unfair to GMA to compare her to someone who just died. Certainly, a GMA-Erap comparison would be a closer race; why set gender as a parameter? But the thing is, at least in my mind, gender was never an issue. I compare Gloria to Cory not because they’re both female, but because the comparison illustrates the two ends of a post-Marcos political spectrum: Cory represents the best in our system, and Gloria, the worst. Where Cory chose to to step down after doing her job, Gloria chose to call Garci. Cory faced a seemingly endless number of coups with real honest-to-gosh bullets flying, but never gave in the the temptation of Martial Law. Gloria, faced with protest marches and scrutiny, issues Executive Order 464 and Proclamation 1017, and has a professor arrested. Where Cory was often portrayed as a simple, humble woman, Gloria dines in style to the tune of a cool $20,000 (or roughly a MILLION PESOS), not to mention her husband Jose Pidal err Mike Arroyo regularly attends Paquiao fights, with courtside seats and rooms at the MGM Grand. At Cory’s funeral, people lined up and walked for hours to pay respects, depsite the bad weather. At Gloria’s? There’s an SMS joke circulating that people will line up to see her casket, but only to make sure that she’s really in it.
On the bright side (for PGMA), there is one area where she has the opportunity to one-up Cory: Agrarian Reform. She recently signed on Friday, August 7 2009, the law extending the Comprehensive Agrarian Reform Program (CARP) began by Cory, extending it until 2014. But while Cory never pressed for true reforms vis-a-vis her family’s ancestral holdings vis-a-vis Hacienda Luisita, Gloria has the opporunity to do so on her own lands. Tribune reports:
Akbayan party-list Rep. Riza Hontiveros said the sincerity of the President would not be measured by the signing but by the immediate distribution of the Arroyo lands in Negros. “We challenge her to order the distribution of the 1,000-hectare properties of the Arroyos in Negros. The program has been resuscitated, it has been reformed, and the government has no excuses anymore,” she stressed.
“That will be the real barometer of her sincerity. She has to distribute the lands of her own family, and pave the way for the redistribution of more than one million hectares of private landholdings,” Hontiveros said.
So do it, Madam President. Don’t pussyfoot. Prove us wrong; show us that there are some things you can do better than Cory. Show us that you can do more for your country than a dead woman.
The conceit of higher education
The conceit of higher education is in thinking that we are solely responsible for achieving it. That it is through our intelligence, or diligence, that we succeed. Ignoring the countless opportunities we’ve had, by simply being born to a family that can afford to put us through school.


Subscribe via Email