News for hackers. Stuff that matters.

jcfields

Next week: making a tic-tac-toe game look decent using JavaScript.
Re:Dusting Off Dreamcast Linux on Monday February 20, 2023 @04:44AM (#34866626)
The main mistake with the Sega CD was adding a bunch of expensive new hardware to it. It gave the Genesis a second, faster Motorola 68k and a special ASIC to handle sprite scaling and rotation effects (to compete with the SNES), but these inclusions effectively doubled the price of the add-on and were seldom used by developers. The Turbo-Grafx CD, on the other hand, just added a CD-ROM drive to the Turbo and cost half as much. The Turbo CD was also much more necessary since the console used HuCards that were much more limited in space than the cartridge ROMs used by the Genesis.

That said, the Sega CD was reasonably successful for what it was, and I don't think it contributed much to Sega's downfall (if anything, it helped Sega foster an impression with customers of being on the cutting edge of things back then). Far more egregious were the 32X, since it confused customers about the company's direction after the Genesis and was abandoned so quickly, and the Saturn's architecture being so much more expensive and complicated than the PlayStation, especially for 3D games. The cost let Sony undercut them because they knew Sega couldn't match them without losing money on each console, and the complexity was such a hurdle that even Sega's first-party developers had trouble figuring it out (they had to release "do-over" ports of Virtua Fighter and Daytona USA because the first versions were so rushed and buggy). Sega of America also pulled the plug on the Saturn way too early (because of Bernie Stolar's infamous interview where he said the console wasn't the company's future, which caused third parties to immediately cancel their releases for it), which left the company with basically no presence in their biggest market for about two years.

Re:Ask HN: Resources to Learn macOS Development? on Monday February 06, 2023 @03:52PM (#34684156)
I made a few simple Mac apps in Objective-C during the pandemic in 2020, and I was struck by how hard it was to find tutorials and examples on how to do anything in Objective-C. It's possible I was looking in all the wrong places, but it seems like everyone assumes you're using Swift at this point. I would advise against learning Mac development with Objective-C except to people who have a specific interest in it or need for it. I also think most people accustomed to newer programming languages would probably find it arcane in some areas and tedious in many others (although I personally like it for what it is and don't regret the time I spent with it, I definitely felt like I was making things harder on myself by using it).
Re:Show HN: A self-updating list of the most current useragents on Saturday December 17, 2022 @09:56PM (#34034654)
What’s so hard to understand about Edge pretending to be Chrome pretending to be Safari, using Blink pretending to be WebKit pretending to be KHTML pretending to be Gecko, all pretending to be Netscape Navigator? I’m the dude playing the dude disguised as another dude.
The article quotes a Stack Overflow post with the conditions under which V8 will optimize the switch statement:

> @LGB actually in V8 (JS engine used by google chrome) you need to jump through a lot of hoops to get switch case optimized: All the cases must be of same type. All the cases must either be string literals or 31-bit signed integer literals. And there must be less than 128 cases. And even after all those hoops, all you get is what you would have gotten with if-elses anyway (I.E. no jump tables or sth like that). True story.

In the case of this emulator, it wasn’t being optimized because it had more than 128 cases.

There’s a Japan-only game for the Sega Game Gear called Kinetic Connection that plays similarly but involves rearranging a scrambled picture rather than moving colored blocks into a pattern.

https://segaretro.org/Kinetic_Connection

“Game 3” is the mode that rotates rows and columns like a Rubik’s Cube.

There are probably earlier examples, but that’s the one that I’m familiar with. I imagine a clever person could adapt it into a simple word game as well. Old computer and console games are a gold mine for ideas for simple puzzle games.

Re:How do you fix a stroad? on Friday December 10, 2021 @03:53AM (#29507845)
You can we we advocate for this position in a less snobbish way. It’s times like this I feel like a real idiot for expecting more from this site than the average Reddit trainwreck comment thread.

Guess what, you’re not that much better than everyone who disagrees with you.

Re:Monday was my 46th birthday and likely my last (2013) on Wednesday August 11, 2021 @11:01PM (#28151234)
"And yet death is the destination we all share. No one has ever escaped it. And that is as it should be, because death is very likely the single best invention of life. It is life's change agent. It clears out the old to make way for the new. Right now the new is you, but someday not too long from now, you will gradually become the old and be cleared away."
Re:Calculus Made Easy (1910) on Wednesday July 28, 2021 @10:16PM (#27992077)
The YouTube channel 3Blue1Brown has an "Essence of Linear Algebra" series that I found helpful (along with an Essence of Calculus series and videos on other tricky subjects such as differential equations and Fourier transforms). I found that the visual approach of the videos helped make the concepts more intuitive.
I have a script that changes the Terminal to the directory of the frontmost Finder window. Then I use touch to create empty new files.

The script, for whoever's curious: https://gitlab.com/jcfields/shell-scripts/-/blob/master/cdf

Back when I used Windows, I actually used the New > Text Document item discussed in the article all the time. It created an empty, 0-byte file, so I'd rename it to whatever file extension I needed. There was a folder that contained the templates for this menu so you could add or remove blank files for any type, but I only ever used the .txt file one.

Re:PHP has been removed in macOS Monterey on Thursday June 17, 2021 @06:42AM (#27538168)
They've actually been warning users since Catalina (if not longer) when the following are run:

python

irb

php --version

tclsh

For PHP, it also shows up in Apache's server string:

Apache/2.4.46 (Unix) PHP/7.3.24-(to be removed in future macOS) mod_perl/2.0.9 Perl/v5.30.2 on hostname

Personally, I've been hoping they'd do this for a while since it's annoying having two versions of each interpreter installed (the system one that can't be updated and the one I installed myself via Mac Ports). Anyone who uses these languages much probably already has a package manager installed. I think they should leave Perl, though, since it's as much as Unix system utility like awk or sed as a programming language.

Re:I Miss the Old Internet (2019) on Sunday June 13, 2021 @05:10PM (#27496529)
The UI changes weren't especially popular, but I don't think they were the cause of a mass exodus. I think it's more that Reddit was gaining in popularity. Slashdot posts had to go through their "editors," who were kind of laughingstocks who regularly let dumb mistakes through, reposted old articles, and regularly posted low-quality, flamebaity articles and thinly disguised advertisements. People put up with it since the articles were largely an excuse for a discussion topic. But then Reddit bypassed this and let people submit things directly. And the quality of Reddit posts and comments was a lot higher since it drew a more cerebral crowd in those early days, which made it more of a threat to Slashdot than the more mainstream Digg (which it also replaced ultimately).
Re:I Miss the Old Internet (2019) on Sunday June 13, 2021 @04:54PM (#27496360)
Slashdot tried to solve this problem by making mod points limited and requiring you to give a reason for moderating a comment. Then there was a metamoderation system where you decided if the moderation someone gave was fair or not. If someone consistently doesn't use the moderation system correctly (and the metamoderation system is successful in identifying this), they don't get mod points anymore.

It didn't work perfectly (obviously the site is still highly opinionated in favor of certain things, like Linux and free software), but it also wasn't the smooth-brained hivemind that Reddit comments sections are. I can't think of another site that's even tried to come up with a better moderation system than simple up/down votes. At best, there are some behind-the-scenes algorithms that decide how exactly to prioritize comments based on the voting, but that's derived from popularity as well. An immeasurable side effect of this is that many heterodox comments simply aren't posted at all since people know they're going to be downvoted to oblivion anyway.

Re:Wapp – A Web-Application Framework for Tcl on Friday June 11, 2021 @04:43PM (#27478229)
I haven't used Tcl for anything in ages, but I have a book on it that I thumb through sometimes because it's so bizarre and fun to read about.

For example, you can delete or rename procedures on the fly, including built-in procedures. So you can rename a built-in like puts to something else, create your own puts procedure, and then call the old one (under its new name) in your new procedure (in case you wanted to override it to do some pre- or post-processing each time). You can even redefine procedures within themselves.

You can use variables in variable names (PHP does this as well).

The comment character # is a valid name for a variable or a procedure.

"Everything is a string" extends to even lists and code blocks.

Even though we've moved away from the hyperflexibility of languages like Tcl and Perl, they certainly served their purpose, and a lot of their better ideas were refined in their more orderly successors.

Re:Why I prefer making useless stuff on Sunday May 23, 2021 @09:05PM (#27260160)
There’s definitely something uniquely satisfying about knowing that code you wrote is saving other people time or helping them create things. The beautiful thing about programming is you can solve a problem once for yourself and also end up end up solving it forever for everybody.
Re:GameStop missed out on capitalizing on the Reddit rally on Thursday February 11, 2021 @08:41AM (#26101378)
The short squeeze happened two weeks ago when the stock ballooned from $20 to $480. That's a 24x increase; VW's "infinity squeeze" comparatively only grew 5x from $200 to $1000.

People on WSB had some arbitrary price targets in mind and are in denial that the stock hasn't squeezed yet because they haven't hit those (completely made-up, with no basis in anything) targets.

Re:PfSense Is Closed Source on Tuesday January 26, 2021 @02:25AM (#25913401)
I understood it that way since Stallman has criticized the term "open source" and distanced it from "free software": https://www.gnu.org/philosophy/open-source-misses-the-point....
Re:Brad Cox has died on Saturday January 23, 2021 @10:11AM (#25882747)
Swift uses the Objective-C runtime.
I forgot all about Comic Chat. It was fun (and also the most appropriate use of Comic Sans MS ever).
Re:51 Star Flag (2011) on Thursday January 14, 2021 @02:10AM (#25773148)
If we're separating the federal district, why not just give the rest of it back to Maryland the same way the area on the other side of the Potomac was given back to Virginia?
That’s how I hear it in my head, probably from years of reading it as a stand-in for profanity on Slashdot and the like.
Re:HTML5 still doesn't replicate what mattered about Flash on Wednesday December 30, 2020 @08:03PM (#25588347)
My experience was that Flash ran like garbage on anything but Windows/Intel. Linux/Intel? Trash. Mac/PPC? Trash. The web at the time was unusable on my PowerBook G4 without FlashBlock. Maybe Flash would still be around if Adobe bothered to make it run well on anything but one platform.
Re:One red paperclip on Sunday December 27, 2020 @07:36AM (#25550602)
Honestly, most of the trades are baffling to me. A generator is a lot more valuable than a camp stove. A snowmobile is a lot more valuable than a keg and a sign. I'm not sure there's any insight to be gleaned from this except that people in the early 2000s were willing to make illogical trades at their own expense to be part of a wacky internet thing.
Re:What comes after Git? on Friday December 25, 2020 @10:44AM (#25537058)
Mac OS has had a built-in file versioning system (separate from Time Machine) since Lion or so that works with any program that uses the standard document saving APIs. Most Mac users probably aren't aware that their computer stores potentially hundreds of previous versions of their documents (in evictable space, of course). The interface for it is kind of trash and isn't accessible in every app, though.

(Over the summer, I made a command-line [https://gitlab.com/jcfields/versions] and a GUI program [https://gitlab.com/jcfields/restore] for accessing this system outside of the standard UI, if anyone's interested, though the binaries are not notarized so the OS will show a scary warning the first time you use them.)

Granted, it's not exactly the same thing since you're not making commits at discrete and meaningful points like in a software version control system and since it works on an individual file level, which might not be ideal for every workflow, but it's still really useful when you realize you need to roll something back to an earlier state.

I think modern versions of Windows use the Volume Shadow Copy service to store backups of files at given snapshot points (such as when your computer runs a scheduled backup or creates a System Restore point), which can be pulled up in the file properties. I use to use NTBackup to do basically the same thing in a more crude way back in the Windows XP days. This isn't as nice as the Mac Versions feature since it requires setting up periodic backups, but it's something.

I'd be curious if any of the free desktops have come up with a simple and user-friendly solution to this. I feel like this is an area where there's a lot of room for improvement, since the majority of users would probably benefit from these systems but most aren't even aware they exist.

I would guess that Apple doesn't want any controversy from their media side harming the reputation of the other parts of the company, which is probably a sensible decision. Netflix is in a different position since the "media part" of the company is the entire company. Not sure how Amazon fits into all this because I'm not familiar with their offerings.
Re:How the self-esteem craze took over America (2017) on Saturday November 28, 2020 @06:54PM (#25241660)
I agree that there's a middle ground here. I think the point of the "you can do anything if you try" sentiment is to push people to overcome their self-limiting beliefs. I've certainly accomplished a lot of things I didn't think I could because I was dumb enough to try anyway. Most people have no idea what their limits are because they've never hit them.
Re:FreeBSD should not adopt launchd (2015) on Saturday November 07, 2020 @03:29AM (#25013823)
They wrote it, so they could close its source regardless of the license (which was actually Apache 2 and APSL before that).

It looks like 10.9 (released in 2016) was the last release on https://opensource.apple.com/ that included launchd. The original author left Apple in 2014, so maybe it had something to do with that (similar to why they abandoned MacRuby and CUPS), though one would think that they still update it internally.

Re:What's new in PHP 8? on Sunday August 16, 2020 @06:55PM (#24182093)
PHP requires escaping quotes and literal backslashes (i.e., backslashes not used for metacharacters or escaping other characters). For many cases, it doesn't affect anything, but it can turn into a bit of a nightmare if you're matching anything involving backslashes since you need four backslashes to match one literal backslash. Perl's regular expression literals are also nicer for things like splitting a long expression over multiple lines.
Re:What's new in PHP 8? on Friday August 14, 2020 @04:34AM (#24155370)
PHP half-copied Perl a lot. Another example is implementing arrays and hashes, but not as separate types. So you have odd behavior like the array sort functions sorting values but not renumbering keys because there's no distinction between an array and a map. Or copying Perl's string interpolation and concatenation operator but not its regular expression literals, so writing regexes in PHP requires an extra layer of escape sequences.
Re:You may finally use JSHint for evil on Tuesday August 04, 2020 @03:45PM (#24053761)
The part that explains why this clause (originally written by Douglas Crawford in the JSON license) is a problem for free software:

> If you’re not versed in legal matters, that probably seems like an odd restriction. By rejecting JSHint, are people admitting that they want to do evil? And is that clause actually enforceable, anyway?

> The answer to the second question is “no,” and that helps answer the first question. Legally-conscious objectors aren’t betraying their own dastardly motivations; they’re refusing to enter into an ambiguous contract. Put differently: they’re not saying, “I’m an evildoer,” they’re saying, “I don’t understand what you want.” This consideration disqualified JSHint from inclusion in all sorts of contexts.

Older »