Browsed by
Category: Technical

Choosing something: the 37% rule

Choosing something: the 37% rule

It was the year 1960 and a brainteaser was formulated as “The Secretary Problem”. You need to hire a secretary; there are n applicants to be interviewed. You meet each of them in a random order. You can rank them according to suitability, but once rejected an applicant they cannot be recalled. How can you maximize the probability of picking the best person for the job? 

Other versions of this include the “fiancé problem” (same idea, but you’re looking for a fiancé instead of a secretary) and the “googol game” – in which you are flipping slips of paper to reveal numbers until you decide you’ve probably found the largest of all.

The answer is… surprisingly predictable, it turns out.

“This basic problem has a remarkably simple solution,” wrote mathematician and statistician Thomas S Ferguson in 1989. “First, one shows that attention can be restricted to the class of rules that for some integer r > 1 rejects the first r – 1 applicants, and then chooses the next applicant who is best in the relative ranking of the observed applicants.”

So, when faced with a stream of random choices and wanting to pick the best, the first thing you do is reject everyone. That is, up to a point. Once you reach that point, just accept the next applicant, suitor, or slip of paper, that beats everything you’ve seen so far.

The statistics are fascinating; and it says that you reject the first 37% of applicants and then take the next one that’s better than what you’ve seen in the rejected pool.

This works if it’s apartments, job candidates, or potential life partners.

Article:

Loading Collada files for Maya and 3DSMax

Loading Collada files for Maya and 3DSMax

Collada was an interchange file format for 3D application that started around 2004 and largely died around 2016. I actually worked in a group with Remi Arnaud when it was being used for a project at Intel.

It was a sound idea. With lots of 3d packages and engines out there, getting files from one tool or engine to another was never easy. Since every authoring tool and game uses different structures for storing mesh, material, animation data, etc – the Collada format tried to define a open-standard format to store these relationships in an XML style text file. This allowed maximum flexibility to define relationships; but had the unfortunate side effect of generating sometimes gigantic files that were extremely slow to load.

While it was an extremely flexible format for exchanging data between packages or game engines, once you got there, it was dramatically faster to use a native binary format. Trying to load or save a XML based file format to load a block of content often took 10-100x longer than a binary version. The speed alone meant that it wasn’t practical for any realtime purposes.

Additionally, supporting the entire Collada spec would mean supporting every kind of data relationship – even if the tool or game didn’t need it. It meant that loaders often only implemented the desired features – which meant that you were almost back to where you started from. Custom loaders and savers with limited features. Except Collada files were gigantic and slow to load/save. A real problem when your primary costs are the speed of your content development.

Collada’s practical use was therefore primarily in one or two time transfers between tools. As time went on, and tools and engines consolidated on a few efficient binary formats, formats such as Collada became less and less useful. By the early 2010’s, development and work on it largely died. The last loaders were apparently updated in 2018 and the github site that hosts the binary versions is kind of broken.

At any rate, if you do need to load an old Collada file (.dae, etc) then you’ll need a copy of 3D Studio Max or Maya, and a plugin loader. You can download one of the last collada loaders here.

Install the plugin (make sure Maya is closed) and then start your tool (Maya in my case).

Ensure the Collada plugin is loaded. Go to the Windows-> Settings/Preferences -> Plug-in Manager in Maya and ensure the fbxmaya, FBX, or ColladaMaya pluings are loaded and/or set to auto load:

When you want to import a Collada file, go to File->Import and select the fbx/collada file you want to load and it should load it up.

Links:

8″ floppy drive adventures

8″ floppy drive adventures

I recently acquired not one, but 2, 8″ floppy drives. Behold a Data System’s Design DSD 440:

To get this all working in my experiments, I used the following guides

Parts and equipment

IBM 5140 PC Convertible

IBM 5140 PC Convertible

Cathode Ray Dude did a great rundown on the IBM 5140 Convertible. It was the first PC computer my dad got after the Radio Shack TRS-80 Model III and the first one that had a floppy drive. We even had the serial/parallel port and the thermal printer.

But probably the most amazing thing is that this 8088 XT, floppy based computer actually had a method to sleep and wake right where you left off. As far as we know, it was the very first instance of the technology.

Dark Realities of Buying Crunch overseas

Dark Realities of Buying Crunch overseas

As Nike and Apple learned the hard way, outsourcing your work overseas can have serious ethical concerns.

Sadly, workplace abuse (both mental and physical) is a reality in many low-cost countries. People Make Games reveals some highly disturbing cases of abuse and punishments that are subjected to game dev workers at these outsourced locations. In one case, a young developer is told to record slapping herself in the face 100 times as punishment.

It’s disturbing, but definitely something people should be aware is happening when companies outsource to low cost geos.

Google report on using AI for internal code migrations

Google report on using AI for internal code migrations

Google published a report on it’s effort to migrate code to the latest dependencies – an often thankless task fraught with risk. Google’s code migrations involved: changing 32-bit IDs in the 500-plus-million-line codebase for Google Ads to 64-bit IDs; converting its old JUnit3 testing library to JUnit4; and replacing the Joda time library with Java’s standard java.time package. The 32-bit ID’s were particularly rough because they were often generically defined types that were not easily searchable.

They used a collection of AI tools as well as manual code reviews and touch-ups to achieve their goal. They emphasize that LLMs should be viewed as complementary to traditional migration techniques that rely on Abstract Syntax Trees (ASTs), grep-like searches, Kythe, and custom scripts because LLMs can be very expensive.

The results?

With LLM assistance, it took just three months to migrate 5,359 files and modify 149,000 lines of code to complete the JUnit3-JUnit4 transition. Approximately 87 percent of the code generated by AI ended up being committed with no changes. For the Joda-Java time framework switch, the authors estimate a time saving of 89 percent compared to the projected manual change time.

Links: