28 ms·
Singapore prime minister Lee Hsien Loong’s Sudoku solver (2018)
- idiocrat 5y ago> It passed all 6/6 test cases with a runtime of 1 ms. Pretty impressive for a prime minister, huh? I do not know the specific background of Mr Lee, but the thing I always tell myself is that you can teach programming to a microbiologist, but not microbiology to a programmer.
- s-lambert 5y agoI think it's because programming is not that much of a stretch to the brain if you've done any mathematics and are literate. The brain is used to combining structures through words to create sentences and programming runs along that same path (just more strictly).
- bigDinosaur 5y agoWhy can't you teach microbiology to a programmer?
- o_m 5y ago
- ComradePhil 5y agoWhat I have heard from them is that it requires "wet lab experience" to really learn it. Not sure how true it is. If you were to ask me, programmers can't learn it because what they are learning is based on complete misunderstanding of organic chemistry (which has not been updated with the modern understanding of physics)... so it is bound to drive anyone who tries to make sense of it crazy. The only way to learn it is to accept all the rules and ALL the exceptions to the rules as the foundation and go from there, which not a lot of people are willing to do.
- openknot 5y ago> what they are learning is based on complete misunderstanding of organic chemistry (which has not been updated with the modern understanding of physics)... so it is bound to drive anyone who tries to make sense of it crazy This sounds like an extraordinary claim, especially since organic chemists work along physical chemists and chemical physicists who presumably have a strong modern understanding of physics. It would be better for an expert to chime in, but I don’t see the incentive where organic chemists would be content to let their field stay out-of-date.
- ComradePhil 5y agoIf you think those who study microbiology study it with quantum chemistry of organic compounds as a foundation, you would be very wrong. I'm not saying they don't exist, I'm just saying it is way more uncommon than you'd think. Ask around your network and find out for yourself.
- openknot 5y agoIt looks like I may have parsed your comment in an unintended way. I read it as, roughly: 'To learn microbiology, a programmer must learn organic chemistry as a prerequisite [true for the university I attended]. However, the concepts to study organic chemistry are based on an outdated view of physics, which is why they have so many rules and exceptions.' I believe that any good organic chemist must have strength in physical chemistry (both to excel in the field, plus it's typically a degree requirement), and physical chemists are well-informed of quantum mechanics (also typically a degree requirement, with at least an introduction to QM in most introductory chemistry courses in the unit about atomic bonding). However, it's more plausible to believe the claim (re-interpreted) that many microbiologists don't have a strong foundation in organic chemistry or modern physics. Still, I'm skeptical that those who make it to a tenured professorship can still have these weaknesses, as I'm under the impression that the field is cross-disciplinary with collaborations with biochemists, who can then bring in their stronger background in chemistry (and thus organic chemistry, physical chemistry, and physics). Leading microbiologists (e.g. those tenured at MIT and other top institutions) who influence the field should also have familiarity with these subjects.
- openknot 5y agoYou absolutely can (an example includes programmers who decide to work in computational biology and learn more biology from textbooks to better understand the job). However, there is a substantial barrier for a programmer to switch careers and become a microbiologist: access to lab equipment. Part of the job of a microbiologist is to work with (usually expensive) scientific equipment to carry out and design procedures for experiments, and it’s hard to study independently without owning a lab space or the equipment. I’ve also found less educational material for self-study online. Contrast this with self-study in programming. The required equipment is also just a low-end computer, and you don’t need a laboratory environment to develop your skillset. Educational resources (e.g. Automate the Boring Stuff With Python) are also not only widely accessible, but often free.
- aksss 5y agoAlternative view: A) any microbiologist may eventually need to learn very basic coding to do their job/tasks effectively; B) a programmer likely won’t be interested in learning even basic microbiology unless hired by microbiologists.
- k_sze 5y agoI don’t think B) is necessarily true. I’m a software engineer/programmer by profession and schooling, but I have a life-long fascination with little critters, especially insects, and especially Apocrita and Lepidoptera among insects. I’m an avid participant on iNaturalist and have almost as much reputation on Biology StackExchange as on StackOverflow. I also enjoyed proofreading oncology papers for my brother in law when he was doing his PhD because that stuff is fascinating when you have somebody who can explain it to you. I’m not spending more effort in biology or entomology mainly for three reasons: 1. lack of time, especially since getting married and having kids; 2. lack of mental energy partly due to kids, partly because I’m tired enough fighting inane requirements or some stupid half-assed TypeScript “framework” du jour every day at work; 3. I’m not confident I can make as much money in entomology as in I.T. Lack of interest has never been one of the reasons for me.
- aksss 5y agoWell sure, there’s always a few whose random area of interest might land on microbiology. Most career developers I know are autodidactic obsessives who have no trouble finding fascinating rabbit holes to crawl down. Then life advances, gates close, time gets constrained and you have to pick your passions in life because you can’t do them all. I tried to use the word “likely” to avoid these points being perceived as absolute laws. I think it’s simply less likely that any random programmer will have motivation to learn microbiology than it is for a microbiologist to learn some programming techniques. The microbiologist may be compelled by functional requirements for their job to learn some coding while the programmer, unless working on business problems in that domain, would never be professionally compelled to learn microbiology to reinforce their profession aims.
- bajook 5y agoThe specific background of Mr Lee is that he was the Senior Wrangler at Cambridge University (essentially, the top mathematics student in the UK), and was a very promising mathematician who instead chose the family business of running Singapore.
- narrator 5y agoIt's not a bad business. Senior ministers in Singapore are paid multi-million dollar salaries. According to Transparency International, Singapore is one of the least corrupt countries. I'd guess that's because there's no need for side hustles because the job pays so well.
- laumars 5y agoThat doesn’t stop many western CEOs from being corrupt. From what I’ve experienced, the lack of corruption in Singapore is partly cultural and partly due to their heavy penalties for crime.
- twelvechairs 5y agoFor all of its many other issues, one thing clear is that Singapore is one of the few countries where being a public servant is a reputable and highly regarded career. It was described to me that Singapore inherited both from both the British public service and the imperial Chinese civil service systems - which have diminished or fallen apart in both of those countries and others which inherited them.
- throwaway2037 5y agoWhat other countries inherited the Chinese civil service system? Does Taiwan count? I would hardly say it has diminished or fallen apart. Of course, that is only my humble opinion.
- baybal2 5y agoUK civil service was actually modelled after Chinese one after missionaries brought news of how powerful, and well oiled Chinese bureaucratic machine was in comparison to contemporary British one.
- Andrew_nenakhov 5y agoWhen I was young, I thought that anybody could learn programming. I was horribly, horribly wrong.
- Cthulhu_ 5y agoI'm glad this realization exists. When I was in school, I quickly realized that most of my peers - the ones that came with me from an associate's degree course in IT, more sysadmin stuff - just couldn't keep up with software development, they didn't have the knack for it.
- Graffur 5y agoI thought this when I was younger too. Now I hate seeing the meme "code is the easy part". There are, of course, other hard parts too but to trivialize coding is silly.
- Andrew_nenakhov 5y agoFor the most part, code is, indeed, easy. For you or for me. But some people just can't. I've stopped trying to understand, and just accept is as a fact.
- aksss 5y agoFor me, it was “money for nothing”, best job in the world because it was also my hobby. Not everyone is that way. Easy as breathing for some, completely incomprehensible alternate dimension of reality for others.
- NikolaeVarius 5y agoCode is easy, the math is hard.
- knorker 5y agoFor many mathematicians code is hard, math is easy.
- jptech 5y agoJust as you can run any program on any machine given enough time and resources (memory), anyone not lacking intellectual ability can learn anything - some quicker, some slower.
- lanstin 5y agoThe intellectual part maybe but not the praxis. Some confidence, some unwillingness to stop searching for causes, some taste foe elegance, some ability to simulate things in the abstract space of solutions. The combination is as elusive to some as perceiving the mood of a room is to others.
- garbagetime 5y agoWhat makes you think that?
- jptech 5y agoWhat makes you think otherwise? Some people's brains are wired differently?
- garbagetime 5y agoYes my understanding is that different people's brains can be wired very differently. Roughly speaking, many areas of the brain require specific stimulus during puberty in order to develop a particular way.
- Cthulhu_ 5y agoWhile I agree that everyone CAN learn anything, it doesn't mean they want to. Motivation is a big factor. And when it comes to software development, the actual writing code part of it, I'm confident you need to have a knack for it. Mind you, there's plenty of jobs in software engineering that don't involve writing code. We're desperately looking for a manager for example, because our current "self-managing" team is far from effective.
- vanderZwan 5y agoWel gee, sorry that I was hired by a molecular neurobiology research group where all my colleages were at least PhD level biologists and that I didn't manage to catch up to their level in the two years that my contract lasted, dad. At least they appreciated me enough to give me sixth co-authorship on a paper published in Cell, even though I don't understand three-quarters of it. You want to complain that I'm not an Olympiad heart surgeon too? /s, obviously, my dad is actually very proud of me. edit: this attempt at a sarcastic jab pissed some people off I guess. My point was that sure, the critique that issue of "people who understand one thing think they understand everything" applies disproportionately to programmers (and STEM people in general), but trying to defend against that by acting smugly superior about your own domain of expertise isn't going to fix that, that just makes you a problem on the other side of the coin.
- oblio 5y agoYou probably know where this is headed, but, still: https://xkcd.com/435/ https://xkcd.com/435/
- vanderZwan 5y agoI did but the link is still very welcome :). While we're here we might as well add this complementary SMBC classic: https://www.smbc-comics.com/?id=2556 https://www.smbc-comics.com/?id=2556
- jamessb 5y ago> I do not know the specific background of Mr Lee As an undergraduate, he studied maths at Trinity College Cambridge. Béla Bollobás said [1]: > I certainly taught him more than anybody else in Cambridge. I can truthfully say that he was an exceptionally good student. I’m not sure that this is really known in Singapore. “Because he’s now the Prime Minister,” people may say, “oh, you would say he was good.” No, he was truly outstanding: he was head and shoulders above the rest of the students. He was not only the first, but the gap between him and the man who came second was huge. > I think that he did computer science (after mathematics) mostly because his father didn’t want him to stay in pure mathematics. Loong was not only hardworking, conscientious and professional, but he was also very inventive. All the signs indicated that he would have been a world-class research mathematician. I’m sure his father never realized how exceptional Loong was. He thought Loong was very good. No, Loong was much better than that. When I tried to tell Lee Kuan Yew, “Look, your son is phenomenally good: you should encourage him to do mathematics,” then he implied that that was impossible, since as a top-flight professional mathematician Loong would leave Singapore for Princeton, Harvard or Cambridge, and that would send the wrong signal to the people in Singapore. And I have to agree that this was a very good point indeed. Now I am even more impressed by Lee Hsien Loong than I was all those years ago, and I am very proud that I taught him; he seems to be doing very well. I have come round to thinking that it was indeed good for him to go into politics; he can certainly make an awful lot of difference. He then did the (now-discontinued) Diploma in Computer Science at Cambridge. [1]: https://web.archive.org/web/20180722130213/https://www2.ims.nus.edu.sg/imprints/interviews/BelaBollobas.pdf https://web.archive.org/web/20180722130213/https://www2.ims....
- xvilka 5y agoQuite sad he didn't pursue science career, it might have brought a few amazing discoveries to the world.
- secondaryacct 5y agoInstead he rotted as an actor of change, represented his citizens, protected his country and solved sudokus. I dont know if he's good for Singapore but I mean, he did one of the most noble thing a human can do so I wouldnt blame him. I hope to do 1% of what this politician tried to do in my lifetime.
- Al-Khwarizmi 5y agoHow much of that is because programming is easier, and how much because for programming there are plenty of free resources (books, tutorials, documentation, etc.) while other disciplines are much more hermetic?
- samuel 5y ago> I do not know the specific background of Mr Lee, but the thing I always tell myself is that you can teach programming to a microbiologist, but not microbiology to a programmer. I don't know if microbiology is special in some sense, but I have witnessed several times during my career cases of programmers turned into domain experts(in Logistics for example). Obviously you don't became an MD that way, if that was your point.
- throwaway2037 5y agoYes, Wall Street (high finance) also has many people (traders & quants & risk controllers) who do not have financial engineering degrees, yet deeply understand the field as practitioners. Some common "alternative" degrees: economics, mathematics, physics, chemistry, microbiology, computer science/engineering. The previous generation was even less specialised -- many had liberal arts degrees!
- vmception 5y agomy university made other hard sciences a prerequisite to a computer science degree so I feel like I learned that topic well enough I see utility in focusing on interdisciplinary skills
- gypsyharlot 5y agoUh, okay. People like John Carmack (programmer) have proven you wrong.
- cm2187 5y agoOn the other hand you can teach finance to a programmer but I had a really hard time teaching finance people to code.
- verinus 5y agoInteresting. Programming yes, Software Development no- imho there is a huge difference between writing compiling code and writing maintainable code and/or designing stable and resiliant systems.
- mr_toad 5y ago> I do not know the specific background of Mr Lee, but the thing I always tell myself is that you can teach programming to a microbiologist, but not microbiology to a programmer. You can’t teach height.
- sethammons 5y agoAre you agreeing and saying that learning some skills, like your height, comes from innate genetic wiring - or - Are are you saying that height is something you can't teach and of course anyone can learn microbiology?
- knorker 5y agoEveryone says that about their field, though. In the telco industry I've heard several people say "I think it's easier for someone used to circuit switched to learn packet switched than the other way around". Every single time I heard that was from someone who knew circuit switched, and did not have one single clue about how packet switching worked, but thought they did. If it's your field it's very easy to see people come in and think they've learned it when they haven't. I've seen it in mathematicians, too. They very often think they can program when they can't. Or in other words: You can teach a programmer to be a microbiologist to the point where I will believe they're a microbiologist. But I am not one. And same with programming, except you'll only convince the microbiologist that you succeeded.
- pdonis 5y agoWhere are the 6 test cases? I only see one on the leetcode page, but I might be missing something.
- schoen 5y ago(2018)
- wdb 5y agoThere are companies that ask you to write a sudoku solver after a day of interviews :(
- barbecue_sauce 5y agoI don't even know how to play Sudoku.
- marginalia_nu 5y agowhile (!isSolved(sudoku)) { sudoku = generateNextPermutation(sudoku); } Solved (eventually).
- Cthulhu_ 5y agoA bogosolver is a valid approach. I mean it'll take forever, but it's valid.
- marginalia_nu 5y agoI plead the halting problem.
- wccrawford 5y agoThere are a limited number of permutations. Assuming it's not choosing them randomly, it'll finish eventually... If the hardware doesn't die first.
- tonyedgecombe 5y agoYou can solve it via brute force if you cut off branches that don't satisfy the rules: https://github.com/tonyedgecombe/Sudoku/blob/master/Sudoku/Program.cs https://github.com/tonyedgecombe/Sudoku/blob/master/Sudoku/P... It's not 1ms but it's not that slow either.
- Cthulhu_ 5y ago
- pjc50 5y agoThat's so last year! Where's his Wordle solver?
- bncy 5y agoDon't get me wrong but I think that's one of the reasons why Singapore is one of the fastest growing countries in the world.
- dragonwriter 5y ago> Don’t get me wrong but I think that’s one of the reasons why Singapore is one of the fastest growing countries in the world. It’s not. (Unless you have a really expansive view of “one of”.) Whether you mean population or economy.
- skywal_l 5y agoThat and the tax heaven. /s
- markdown 5y agoThe US (multiple of your states) is more a tax haven than Singapore. By far.
- secondaryacct 5y agoSingapore is as much of a tax heaven as Hong Kong is. When you live there, it's not. Now if you re a chronically over spending under budgeted country and look at Singapore you're like "how can they be so rich with so little tax, they re robbing us", but that may hide a few things you could try on your side.
- dragonelite 5y agoDoes it really matter for 99% of us who are just working class people. If Singapore can be a tax heaven and the profits are distributed more in the public sector i'm all for it.
- martneumann 5y agoYou take taxes away from other countries where the profits would be distributed - and where the actual companies operate.
- nathell 5y agoIt’d be great to learn about other code by prominent politicians. Off the top of my head, I only recall one other example: COBOL on Wheelchair [0], a web micro-framework for GNU COBOL, written by Adrian Zandberg [1], a Polish MP. [0]: https://github.com/azac/cobol-on-wheelchair https://github.com/azac/cobol-on-wheelchair [1]: https://en.wikipedia.org/wiki/Adrian_Zandberg https://en.wikipedia.org/wiki/Adrian_Zandberg
- imron 5y agoThomas Massie https://mobile.twitter.com/RepThomasMassie/status/1082457242966913024 https://mobile.twitter.com/RepThomasMassie/status/1082457242...
- boredumb 5y agoThis is actually quite cool, I figured someone bugged him about a github or something and I scrolled down to see.... twitter has to be dangerously close to 100% comprised of political propaganda bots repeating the talking point of the week and calling one another bots these days.
- unfocussed_mike 5y agoAudrey Tang is a minister in the Taiwanese government: https://en.wikipedia.org/wiki/Audrey_Tang https://en.wikipedia.org/wiki/Audrey_Tang https://metacpan.org/author/AUDREYT https://metacpan.org/author/AUDREYT (And of course she is the initiator of the PUGS Perl 6 implementation project)
- charlieyu1 5y agoHer article on 500 lines or less is a great read.
- dolmen 5y agoI recommend to listen to her interview by Tatsuhiko Miyagawa on his Rebuild.fm podcast: "Monads Are Not Required For My Job" (June 2020) https://rebuild.fm/271/ https://rebuild.fm/271/
- yread 5y agoI don't understand all of the code but this bit > int valbit = Possibles & (-Possibles); // Lowest 1 bit in Possibles is pretty neat
- toxik 5y agoI think there’s an Intel intrinsic for this, but nonetheless neat.
- Cthulhu_ 5y agoIt's the kind of thing that I would expect a compiler to know about and use; when writing code in a high level language you shouldn't have to think too much about what happens on the hardware level.
- xxs 5y agoIt's done in Java, Integer.lowestOneBit(int), citing HD 2-1. Java defines ints to be 2-complimentary. I can't recall if it's compiled tzcnt[0], though [0]: https://www.felixcloutier.com/x86/tzcnt https://www.felixcloutier.com/x86/tzcnt
- hyperbovine 5y agoIt's a standard trick, e.g. https://stackoverflow.com/questions/12247186/find-the-lowest-set-bit https://stackoverflow.com/questions/12247186/find-the-lowest....
- jlebar 5y agoIf you like that you may also like https://graphics.stanford.edu/~seander/bithacks.html https://graphics.stanford.edu/~seander/bithacks.html (Also "Hackers Delight" if you really can't get enough of it.)
- t8y 5y agoI almost had a heart attack when I read this. I've been using bitwise operations to speed up the Wave Function Collapse algorithm... and the prime minister of Singapore has done something very similar years before!
- jb1991 5y agoIt's a very common technique when seeking performance, so don't have a heart attack please.
- martneumann 5y agoWhen I read posts like this I'm reminded I actually studied computer engineering, not computer science ;)
- tgv 5y agoHe doesn't place braces around single statement conditional/loop bodies. Would not vote for him. While pretty unexpected from a politician, he did graduate in Maths & CS at Trinity College. Senior Wrangler, no less.
- WithinReason 5y agoI would not vote for him because the last for loop has unnecessary braces
- cm2187 5y agoAnd is he using space or tabs?
- WithinReason 5y agoIt seems to be spaces so I wouldn't try to actively sabotage his campaign
- baybal2 5y agoHe is a very boring PM, and lacking ambition of his father. Singapore under him is in "maintenance only mode."
- dskloet 5y agoIs that a bad thing?
- baybal2 5y agoI would say it's a good thing when the size of ambitions matches the size of ones mouth. He certainly inherited the size of the mouth of his father, and tried to imitate his tirades heavily 12 years ago when I lived there, but so far nothing really came out of it. Sing in last 12 years: losing vestiges of its industry, and getting more, and more reliant on mainland money.
- capableweb 5y agoReleased under MIT no less (https://drive.google.com/drive/u/0/folders/0B2G2LjIu7WbdfjhaUmVzc1lCR2hUdk5fZllCOHdtbFItbU5qYzdqZGVxdmlnRkJyYVQ4VU0?resourcekey=0-D2Vpv_-JlV4qo2aSDdGFLA https://drive.google.com/drive/u/0/folders/0B2G2LjIu7Wbdfjha...). Great to see more government (employees) using open source licenses :) Edit: apparently, you can't directly link to the files inside the Drive, as the URL doesn't change when you open it in their file browser. What's the point even?
- thrdbndndn 5y agoYou can. Right click and get link. https://drive.google.com/file/d/0B2G2LjIu7WbdNkZ5aW96ODNxNms/view?usp=sharing&resourcekey=0-7dJHvDTHi7jGZDfv-F9Qyg https://drive.google.com/file/d/0B2G2LjIu7WbdNkZ5aW96ODNxNms...
- capableweb 5y agoAh, great, thanks for that. One would expect URLs to be able to be used for locating resources uniquely on the web, but maybe that expectation is too much today. Edit: That link you put misses the context of the directory you're in (unless I'm missing something else unintuitive again), for some reason. Seems the UX of Drive is essentially broken for files living inside directories.
- thrdbndndn 5y agoI don't know for sure, but the "missing context" part might be intentional, at least this behavior matches what I want. This way, you can share multiple files in a same folder to different people and they won't see other files. OneDrive works similarly.
- capableweb 5y agoMakes sense and doesn't. Ideally, you can navigate to the file from a directory and copy the link that is in the address bar, and share a direct link to the file with the context of the directory. And if needed, right-click to share like you did to share that file and that file only, like what it does now.
- Graffur 5y agoThat's awesome. Really impressive. Is he a good PM? My country's current PM is a school teacher but unfortunately doesn't seem to bring any of the good traits associated with that to the country. The last PM (and who will be PM again soon) was a doctor. Unfortunately he was is just a media/attention addict who won't tackle any big issues like housing costs or homelessness.
- ValentineC 5y ago> Is he a good PM? Singaporean here. Not if we take the recent performance of our COVID task force into account — it's run by a bunch of bumbling ministerial clowns (one who might potentially become the next prime minister) that can't seem to agree which direction to take Singapore, end up toeing the middle line between endemic and COVID zero, and wrecking everything including the mental health of most Singaporeans staying in their small public flats. Lee Hsien Loong's main involvement during the pandemic/endemic (Singapore still can't decide how to treat COVID) seemed to be encouraging people, especially the elderly, to get vaccinated.
- swyx 5y agoi mean, have some sympathy, easy to criticize from the cheap seats. (and yes, they are paid a lot, so what, decisionmaking under uncertainty is still hard) in retrospect, LHL distancing himself from covid policy is pretty brilliant/convenient, as whoever proves a credible leader through this mess will have demonstrated the qualities we'd probably want for PM
- lgvln 5y agoSympathy for _what/who_? They implemented a unnecessary, ineffective lockdown for two months and a mandatory nationwide tracking system (which differs wildly from the open sourced version they published) without any published efficacy data, went back on their word regarding data collected (without any zero consequences) and will now be using that data for future “policing”.
- forgingahead 5y ago
- sva_ 5y agoPerhaps we should send some of our politicians through the LeetCode hoops.
- gtsop 5y agoWhy is 1ms impressive? How much time does a simple solver take?
- pdonis 5y agoThe solution time can vary quite a bit depending on the difficulty of the puzzle. 1 ms for a single puzzle for a program written in C could actually be fairly slow for an easy puzzle, but would be quite fast for a hard puzzle. (It would also depend, of course, on how fast a CPU and how much memory was being used to run the program.)
- 53x15 5y agoFor a casual effort this solver is quite fast. On most datasets it's significantly faster than a C++ port of the Norvig solver and it's often in the same league as well-tuned DLX solvers (though still not in the major league). Relative to DLX it's faster on the easiest puzzles and slower on hard ones, though its performance degrades significantly in two specific still-easy cases: (1) 17-clue puzzles since these punish solvers that don't propagate hidden singles, (2) 0-solution puzzles since the solver doesn't check for consistency during initialization (something the author acknowledges in a comment). For context see these benchmarks from a modern laptop (https://github.com/t-dillon/tdoku/blob/master/benchmarks/results_i7-1065G7/best_results.txt https://github.com/t-dillon/tdoku/blob/master/benchmarks/res...) and compare lhl_sudoku to the other simple solvers tdev_basic_heuristic, zerodoku, fast_solv_9r2, kudoku, and norvig. For details on the solvers and datasets used in these benchmarks see here (https://github.com/t-dillon/tdoku/tree/master/other https://github.com/t-dillon/tdoku/tree/master/other) and here (https://github.com/t-dillon/tdoku/tree/master/benchmarks https://github.com/t-dillon/tdoku/tree/master/benchmarks)
- throwaway4good 5y agoI guess he was born into politics so kudos to him for learning and mastering another field.
- hestefisk 5y agoHe is obviously a smart person. I wouldn’t vote for him though. He recently sued and won a “libel” case against a blogger who reposted a link to a Malaysian web site claiming the PM is involved in the 1MDB scandal. Singapore is a one-party police state with zero press freedom and a poor track record of respecting human rights (being gay is still illegal). So whilst it’s impressive that politician can code, I don’t like him, his views, or his political party. https://asia.nikkei.com/Politics/Singapore-blogger-crowdfunds-99-000-to-pay-PM-defamation-damages https://asia.nikkei.com/Politics/Singapore-blogger-crowdfund...
- hestefisk 5y agoHuman Rights Watch have a very good write up on Singapore here: https://www.hrw.org/report/2017/12/12/kill-chicken-scare-monkeys/suppression-free-expression-and-assembly-singapore https://www.hrw.org/report/2017/12/12/kill-chicken-scare-mon...
- throwaway4good 5y agoAnd Singepore wasn't invited to Biden's summit for democracies ...
- hestefisk 5y agoSource?
- throwaway4good 5y agoYou can google it. The point is; Singapore doesn't toe the US line on China and therefore gets HRW and similar thrown after them. Which is absurd as Singapore is by far the best-governed country in the neighbourhood.
- teh_klev 5y agoI don't normally do this but...it's "toe the line". https://en.wikipedia.org/wiki/Toe_the_line https://en.wikipedia.org/wiki/Toe_the_line
- dave333 5y agoI'm having trouble following the code - does this just brute force the solution by trying all possibilities?
- throwaway4good 5y agoIf you are interested in politics, in particular the relationship between the US and China, this is a very interesting interview: https://www.youtube.com/watch?v=SOTWKAMyFBY https://www.youtube.com/watch?v=SOTWKAMyFBY PM Lee Hsien Loong at the Bloomberg New Economy Forum 2021
- truthwhisperer 5y ago
- tragomaskhalos 5y agoWrt any politician coding, I am reminded of the old proverb "The marvel is not that the bear dances well, but that the bear dances at all."
- jeffreyrogers 5y agoHe was the top math student in his year at Cambridge, also Lee Kuan Yew's son.
- sssk 5y agoA current minister in the Government of India was "a member of the architecture teams that invented the 486 chip and later, Intel’s signature Pentium chip" - https://magazine.iit.edu/fall-2012/ahead-curve https://magazine.iit.edu/fall-2012/ahead-curve
- pratik661 5y agoThe former Indian Prime Minister Narasina Rao used to code as well. https://princeezraj.medium.com/the-indian-prime-minister-who-knew-software-coding-4d230ec1e84b https://princeezraj.medium.com/the-indian-prime-minister-who...
- lol1lol 5y agoIndia's Prime Minister PV Narasimha Rao writing computer programs in 1990s https://princeezraj.medium.com/the-indian-prime-minister-who-knew-software-coding-4d230ec1e84b https://princeezraj.medium.com/the-indian-prime-minister-who...
- deleted 5y ago[deleted]
- sairahul82 5y agoNarasimha Rao is brilliant in other aspects as well. He spoke 17 languages. Apart from 8 indian languages, he can speak fluently English, French, Arabic, Spanish, German and Persian. https://en.wikipedia.org/wiki/P._V._Narasimha_Rao https://en.wikipedia.org/wiki/P._V._Narasimha_Rao
- missedthecue 5y agoIt's crazy to me how you can keep those all straight. I quickly lost a lot of ability in a second language after not speaking it for a relatively short period of time.
- betaby 5y agoAre there any videos of him speaking German or French? Two ex-presidents of two different small European countries had ~5 languages listed in wikipedia, yet in reality they were speaking native + some euro-english only. Now I'm very skeptical about multilingual politicians.
- lol1lol 5y agoPM Narasimha Rao would speak in the local language of the states he visited during his tenure in politics. After his premiership, wrote a fiction novel indirectly sharing his experience in politics. His skill in language translation helped in climbing the political ladder because so few national politicians could speak more than their regional language. It's quite amazing that he learned COBOL and BASIC and wrote UNIX programs during his career in politics. He's credited with liberalizing industrial policies that helped Software/IT services industry dramatically grow in the following decade after his tenure. His secretary BN Yugandhar is the father of Microsoft CEO Satya Nadella. https://twitter.com/spignal/status/749534530856517632 https://twitter.com/spignal/status/749534530856517632
- hestefisk 5y agoMy comment on the PM and his relationship with poor human rights in Singapore was flagged. It got 70 upvotes. Seriously. :/ —- Here it is: He is obviously a smart person. I wouldn’t vote for him though. He recently sued and won a “libel” case against a blogger who reposted a link to a Malaysian web site claiming the PM is involved in the 1MDB scandal. Singapore is a one-party police state with zero press freedom and a poor track record of respecting human rights (being gay is still illegal). So whilst it’s impressive that politician can code, I don’t like him, his views, or his political party. https://asia.nikkei.com/Politics/Singapore-blogger-crowdfund https://asia.nikkei.com/Politics/Singapore-blogger-crowdfund...
- yaacov 5y agoOne of the most interesting parts of Lee Kuan Yew’s book for me was when he talked about all the critics he sued for libel. He justified it as “of course I sued them for libel, otherwise why would anyone believe me when I said they were lying?”
- digianarchist 5y agoThis is how the PAP keeps the opposition suppressed in Singapore.
- xxpor 5y agoAnd when that doesn't work: https://en.wikipedia.org/wiki/Internal_Security_Act_(Singapore) https://en.wikipedia.org/wiki/Internal_Security_Act_(Singapo...
- ValentineC 5y agoThese days, it's POFMA [1] and FICA [2], two laws that put a lot of power into the hands of the cabinet, especially our Home Affairs Minister [3]. [1] https://en.wikipedia.org/wiki/Protection_from_Online_Falsehoods_and_Manipulation_Act_2019 https://en.wikipedia.org/wiki/Protection_from_Online_Falseho... [2] https://en.wikipedia.org/wiki/Foreign_Interference_(Countermeasures)_Act_2021 https://en.wikipedia.org/wiki/Foreign_Interference_(Counterm... [3] https://newnaratif.com/shanmugams-stealth-coup-in-singapore/ https://newnaratif.com/shanmugams-stealth-coup-in-singapore/
- gfd 5y agoThat might explain why Singapore is surprisingly strong in CS. For example in the last olympiad (IOI) they managed to get 3 gold and 1 silver medals despite their relatively small population size: https://stats.ioinformatics.org/results/2021 https://stats.ioinformatics.org/results/2021
- ValentineC 5y agoSingapore has a fairly good education system for rote learning, but pre-FAANG, computer science was seen as a dumping ground [1]. [1] https://www.reddit.com/r/SGExams/comments/azb9rq/uni_why_is_computer_science_so_popular/ https://www.reddit.com/r/SGExams/comments/azb9rq/uni_why_is_...
- swyx 5y agocausal link is very tenuous here. i dont think he's ever been involved in the education system and this code is pretty much the only code related thing we've seen out of him since he got his CS degree in 1974
- AussieWog93 5y agoTo be fair, Singapore is surprisingly strong in everything. Google "little red dot" and you'll get a window into their mindset.
- pelasaco 5y agoMeanwhile I'm sure Olaf Scholz don't know even how to write an email.
- schwanky 5y agoBarack Obama wrote one line of Javascript code once. It made the world news.
- nsonha 5y agoLet me guess what the line is
- alephnan 5y ago"Obama became the first president ever to write a computer program. It was a very simple program — all it does is draw a square on a screen—but that's the point" https://www.wired.com/2014/12/obama-becomes-first-president-write-computer-program/ https://www.wired.com/2014/12/obama-becomes-first-president-...
- dan-robertson 5y agoAs I recall, he did mathematics first and performed very well at it but, despite the efforts of the academics who knew him to convince him to become a mathematician, he had to go to get a practical qualification (something in computer science I guess) and then return to Singapore to be prime minister. But that story does come from the maths department so is likely exaggerated a little.
- nsonha 5y agoThe existence of this code simply says this guy has an engineering degree, not necessarily CS. Shocking. What are people trying to make out of this? That he is a tech expert and and therefore should be trusted with tech policies?
- thorwawayrus53 5y agoLee Hsien is a smart dude. But the success of Singapore is due to non-religous legal framework. Compare this with Malaysia which formed at the same time but it is too poor due to religious policy. I wonder if India would have been more non-relgious it too would have become hugely successful. Although relatively its better compared to Pakistan which is too religious than India. Looks like Islamic nations work great under a monarch rather than democracy.