ainar-g's recent activity

  1. Comment on The underappreciated else keyword in Python in ~comp

    ainar-g
    Link Parent
    Wirth himself calls it (PDF) “Dijkstra's form”, although Google doesn't seem to know that name. So you could do something like: EWD m > n DO m := m – n ELSIF n > m DO n := n – m END

    Wirth himself calls it (PDF) “Dijkstra's form”, although Google doesn't seem to know that name. So you could do something like:

    EWD m > n DO
    	m := m – n
    ELSIF n > m DO
    	n := n – m 
    END
    
    2 votes
  2. Comment on The underappreciated else keyword in Python in ~comp

    ainar-g
    Link
    N. Wirth's Oberon-07 had a different use case for the ELSIF keywords in loops. They delimited different exit conditions and the corresponding code blocks. Example (the Euclidean algorithm): WHILE...

    N. Wirth's Oberon-07 had a different use case for the ELSIF keywords in loops. They delimited different exit conditions and the corresponding code blocks. Example (the Euclidean algorithm):

    WHILE m > n DO
    	m := m  n
    ELSIF n > m DO
    	n := n  m 
    END
    

    This is equivalent to the C code:

    while (true) {
    	if (m > n) {
    		m = m - n;
    	} else if (n > m) {
    		n = n - m;
    	} else {
    		break;
    	}
    }
    

    (There is another way of writing it in C, but this one is closer to the Oberon-07 version.)

    5 votes
  3. Comment on Is C++ fast? in ~comp

    ainar-g
    Link Parent
    Look at the code though. There are still bound checks. He uses assert for that.
    I'd also be very hesitant to replace something like std::vector with my own implementation, though as the extra programming overhead of bounds checking and pointer arithmetic is easy to get wrong and difficult to maintain. (…)

    Look at the code though. There are still bound checks. He uses assert for that.

    2 votes
  4. Comment on Little Big - Uno in ~music

    ainar-g
    Link
    Probably not going to win, but definitely will be remembered. Also, I wonder, if the 1970s æsthetic and the moves are a reference to one of the best ESC winners of all time?

    Probably not going to win, but definitely will be remembered.

    Also, I wonder, if the 1970s æsthetic and the moves are a reference to one of the best ESC winners of all time?

    2 votes
  5. Comment on KEiiNO - Black Leather (ft. Charlotte Qamaniq) in ~music

    ainar-g
    Link
    The official video is here. And it's exactly as it should be.

    The official video is here. And it's exactly as it should be.

  6. Comment on Oil prices just fell 31% (and counting) with single biggest drop since Gulf War in ~finance

    ainar-g
    Link
    *giggles* I'm in danger!
    Russian Rouble jumping from 72 ₽/€ to 85 ₽/€.

    *giggles*

    I'm in danger!

    4 votes
  7. Comment on KEiiNO - Black Leather (ft. Charlotte Qamaniq) in ~music

    ainar-g
    Link
    https://www.scandipop.co.uk/song-keiino-black-leather/ I guess that's where “looking like a snack” line comes from, heh. I really like this song. Among the boring stream of suck-wave crap, KEiiNO...

    https://www.scandipop.co.uk/song-keiino-black-leather/

    (…)

    And what to they have to say about all this? The press release reads that the song is “a power-pop tribute to the Berlin club-scene. Written on the same night as the infamous men-only SNAX party, it portrays a future where gender and gender expression is no longer a barrier to fulfil your hearts’ desires. ‘Black Leather’ is the first pop-banger that includes traditional singing from two indigenous cultures; Sami Joik and Inuk throat singing. KEiiNO’s highest value is unity in diversity, and the northern lights, dancing colourful and free, serve as a symbol of how the trio believes everyone should be allowed to feel.

    (…)

    I guess that's where “looking like a snack” line comes from, heh. I really like this song. Among the boring stream of suck-wave crap, KEiiNO really know how to make a banger.

    1 vote
  8. Comment on Happy International Women's Day! in ~talk

    ainar-g
    Link Parent
    It's the 23rd of February in Russia. Link to my previous comment about it.

    It's the 23rd of February in Russia. Link to my previous comment about it.

    2 votes
  9. Happy International Women's Day!

    From the Wiki: International Women's Day (IWD) is celebrated on the 8th of March every year around the world. (…) (…) The day was then predominantly celebrated by the socialist movement and...

    From the Wiki:

    International Women's Day (IWD) is celebrated on the 8th of March every year around the world.

    (…)

    (…) The day was then predominantly celebrated by the socialist movement and communist countries until it was adopted by the feminist movement in about 1967. The United Nations began celebrating the day in 1977.

    It is a federal holiday in Russia, at least. (Since it's Sunday this year, the following Monday is made a holiday as well). Do you have any special plans for today?

    32 votes
  10. Comment on Fortnightly Programming Q&A Thread in ~comp

    ainar-g
    Link
    Are there any programming languages that support symmetric and stackless coroutines? Most languages I've seen so far support asymmetric coroutines, which can only yield back to parent. And most...

    Are there any programming languages that support symmetric and stackless coroutines? Most languages I've seen so far support asymmetric coroutines, which can only yield back to parent. And most dynamically-typed languages prefer stackfull coroutines.

    4 votes
  11. Comment on Putin introduces constitutional amendments banning same-sex marriage and mentioning God in ~news

    ainar-g
    Link Parent
    I'll probably be able to move out on my own in a few years—god bless the new tech bubble—but thanks anyway, heh.

    I'll probably be able to move out on my own in a few years—god bless the new tech bubble—but thanks anyway, heh.

    4 votes
  12. Comment on Putin introduces constitutional amendments banning same-sex marriage and mentioning God in ~news

    ainar-g
    Link Parent
    That's the plan. Once I've gathered enough resources and got my health in decent shape.

    That's the plan. Once I've gathered enough resources and got my health in decent shape.

    4 votes