KBD

Keith Devens .com

Saturday, July 5, 2008 Flag waving
Mistakes were made. – Ronald Reagan

Archive: February 26, 2005

← February 25, 2005February 27, 2005 →

Daily link icon Saturday, February 26, 2005

  1. Tim Newman has an excellent post on the Kyoto Protocol, via Amy.

       (0) Tags: [Opinions/Politics]
  2. Amy Ridenour: Conservatism Not Splitting:

    First, the social conservatives want smaller government. Aka, Grover Norquist's "leave us alone coalition." Small-government/libertarian conservatives love to threaten social conservatives with departure in part because many moderates are embarrassed about being aligned with the un-hip social conservatives. (By the way, are we still in high school?) If the libertarians ever out-recruit the social conservatives the social conservatives will probably just ask them if they plain to support the appointment of activist judges. If they don't the social conservatives will be happy and if they do they actually are liberals.

    Fourth, political movements that stop having debates (modern American leftism, I am speaking about you) sicken and die. Differences of opinion among groups and individuals in the conservative coalition are a sign of intellectual strength and vitality. If you consider yourself part of the conservative coalition but have a point of view, whatever it might be, that is not currently dominant within the coalition, here's two possibilities: 1) You and your allies aren't very good at explaining why you are right, or 2) You're not right. Work on it.

    Awesome.

       (0) Tags: [Opinions/Politics]
  3. David Warren: The new wave:

    The liberation of Afghanistan from the Taliban was still too little, and too far away, for any Arab to really care. But Iraq is located near the heart of the Arabic-speaking mind, and what happens there cannot be concealed from anybody. Just now, dramatically in Lebanon and Syria, but also in Egypt and elsewhere, the Arab world is monitoring Iraq.

    Eight million people defied terrorist intimidation to reach the polls, and the government they elected is now taking power. For the first time since the Europeans checked out of the region, an alternative to Islamism is established. For the first time, a future has become visible to large masses of oppressed people, other than being nailed into the Islamist coffin.

    President Bush pulled that off, by force of will, in the face of the world's contrary opinions. I cannot offer him a crisp enough salute.

    Via Glenn.

       (0) Tags: [Opinions/Politics]
  4. lgf: Is the Intifada Truly Over? One of the most interesting things about this attack is that rather than taking credit for the bombing in Tel Aviv, most things I've seen indicate that everyone is pointing fingers at each other. That's a huge change. See also LGF and Roger Simon.

       (0) Tags: [Opinions/Politics]
  5. Music thing: The hamster powered MIDI sequencer, via Simon.

       (0) Tags: [Random]

Dynamically allocated multi-dimensional arrays in C

In C, a multi-dimensional array for which you know the size in advance can be iterated through how we'd expect (i.e. using double subscript notation m[i][j]):

void printMatrix(float m[SIZE][SIZE]){
    int i,j;
    for(i=0; i<SIZE; i++){
        for(j=0; j<SIZE; j++)
            printf("%f ", m[i][j]);
        printf("\n");
    }
    printf("\n");
}

(I'm using all square matrices for simplicity). But the signature for printMatrix has to specify the size of the matrix (though, the first dimension can be left out). That's because when you have a multi-dimensional array it's actually just an ordinary array with each row one after another. When the compiler compiles m[i][j] it actually translates it into something like m[i*n+j], and you have to specify the size in advance so it knows what n is.

Now, if you have a dynamically allocated multi-dimensional array (or if you simply want to write a function that doesn't have to know the size in advance), you essentially have to do some of that compilation yourself. printMatrix becomes:

void printMatrix(float *m, int n){
    int i,j;
    for(i=0; i<n; i++){
        for(j=0; j<n; j++)
            printf("%f ", m[i*n+j]);
        printf("\n");
    }
    printf("\n");
}

And you can allocate m with:

float *m = (float*) calloc(d*d, sizeof(float));

More winds of change... this time, in Egypt!

It semes the winds of change are still ablowin', as they may have reached Egypt. Of course, it would be foolish to expect things based on what these people say, but the fact that they're saying it is itself a huge change.

Here's what the news story TigerHawk links says:

CAIRO, Egypt - In a surprise and dramatic reversal, President Hosni Mubarak took a first significant step Saturday toward democratic reform in the world's most populous Arab country, ordering the constitution changed to allow presidential challengers on the ballot this fall.

An open election has long been a demand of the opposition but was repeatedly rejected by the ruling party, with Mubarak only last month dismissing calls for reform as "futile."

The sudden shift was the first sign from the key U.S. ally that it was ready to participate in the democratic evolution in the Middle East, particularly historic elections in Iraq and the Palestinian territories. Mubarak's government has faced increasingly vocal opposition at home and growing friction with the United States over the lack of reform.

Unfortunately, the "reform" includes the measure that political candidates have to be approved by parliament, which of course Mubarak's party runs, so the article's choice of words is probably apt when it calls this a "cosmetic" change. But this still represents a huge change, and maybe they can be pushed further.

Read TigerHawk's post to find out what he thinks precipitated this change. Via Glenn.

Update: Roger Simon comments:

Of course, we should be skeptical, but that's the obvious. Hosni and his buddies were probably panicked about their aid checks. But more astonishing is the whirlwind-like power of this movement toward democracy. Even though elections in Egypt (still a big if, of course) would likely produce some form of Islamic government, it would at least be an elected one. Different patterns might emerge. The status quo was wretched, for the Egyptians and for everybody else in the region. Change, as they say in the I-Ching, is good. Let's see if it is real.

Update: Charles comments. Deacon at Power Line too.

Update: Captain's Quarters writes:

Once again, we see the transformative power of democracy and the fulfillment of the so-called "neocon" philosophy of security through democratization. Egypt has produced some of the most radical -- and dangerously Westernized -- terrorists of the past generation, including Ayman al-Zwahiri, al-Qaeda's number two under Osama bin Laden. With the ability to express political dissent through the ballot box instead of the bomb, Egypt's moves hold the promise of defusing one of the main intellectual producers of terror in the region,

Some will credit Mubarak himself, who defended and promoted the Palestinian elections of last month as a means to peace in Southwest Asia. However, without the pressure that the free elections of Iraq and Afghanistan provided, the peoples of the region would not have organized for their own opportunity for self-determination. Mubarak is smart enough to get ahead of the curve, while Bashar Assad and the Iranian mullahs sit uneasily in Damascus and Teheran hoping that the entire movement dies down before toppling them from power.

  1. Captain's Quarters, on what sounds like an interesting interview with Colin Powel, via Lorie at PoliPundit.

       (0) Tags: [Opinions/Politics]
← February 25, 2005February 27, 2005 →
July 2008
SunMonTueWedThuFriSat
 12345
6789101112
13141516171819
20212223242526
2728293031 



RSS feed RSS feed for Keith's Weblog
Atom feed Atom feed for Keith's Weblog
Weblog archive
Recent comments
  on 5 posts

Recent comments XML

Girls, please don't get breast implants

> And no, you will not be receiving​a picture.

:-(...

Keith: Jul 2, 6:05am

Javascript clone function

This is a clever way to clone an​object if you are using YAHOO UI.​Same tec...

Antonio: Jul 1, 12:47pm

I hate Norton Antivirus

Oh just one other thing norton is​great at keeping people out of your​compu...

kevin.sands: Jul 1, 12:50am

Terminator 3 was awful

I think the biggest reason why T3​totally blew was because Edward​Furlong g...

76.167.172.64: Jun 29, 3:06am

Generated in about 0.071s.

(Used 7 db queries)

mobile phone