Sunday, January 24, 2021

January Diversions

Rabbit holes that I went down in January, largely thanks to Pocket:
The thing that stood out to me in the teaser pics for this article about the "new" oval office was the gorgeous blue carpet, but it turns out that what is shown in this office changes with every administration in order to make specific statements, and the change had to be done in 5 hours for Biden! https://www.washingtonpost.com/politics/2021/01/20/biden-oval-office/?utm_source=pocket-newtab
This article breaks "fortune favors the ready" into an actually pretty good detailed plan, and there is also a funny ancedote about a test that was done on two people on a british TV show: https://psyche.co/guides/how-to-open-up-to-serendipity-and-create-your-own-luck?utm_source=pocket-newtab
This article was supposed to be about new surveilance database mining techniques, but all of that seemed obscured by the missed elphant-in-the-room of how military intervention in civilian populations wholly fails: https://www.wired.com/story/palantirs-gods-eye-view-of-afghanistan/?utm_source=pocket-newtab
A fascinating article about how Josh Hawley's mentors and acquaintances mourned somebody who they had previously recognized as gifted.https://www.politico.com/news/magazine/2021/01/19/josh-hawley-senator-stanford-history-capitol-insurrection-ambition-460481?utm_source=pocket-newtab
It turns out that the difference in the look of the eyelids for asian faces has a name I had never heard of, "monolid", the insultingness of which this author does a great job of writing about. The fact that some people come up with ways to create eyelid "creases" artificially seems incredible and something I've never thought about. https://getpocket.com/explore/item/on-monolids-and-the-language-of-beauty?utm_source=pocket-newtab
This was just a fun attempt to analyze something that can be verified instantly to be true. Interestingly it doesn't dive any into how this analysis could help improve work environments, although I guess that people are experimenting with ideas related to this these days. https://www.bbc.com/worklife/article/20210114-why-youre-more-creative-in-coffee-shops
I was unaware that stromatolites were still present on Earth, but this article also does a great job of investigating other evolutionary curiosities that can also be seen: http://www.bbc.com/travel/story/20210117-stromatolites-the-earths-oldest-living-lifeforms?utm_source=pocket-newtab&referer=https%3A%2F%2Fgetpocket.com%2Frecommendations
I guess the mystery of the end of the Mayan empire has been solved. This drought must have been incredible. It was essentially a Mad Max story that actually happend! https://getpocket.com/explore/item/ancient-mud-reveals-an-explanation-for-sudden-collapse-of-the-mayan-empire
A google news search for the "mystery FM signal" from Ganemede, one of Jupiter's moons. The results are nearly all sensationalized reporting by Fox News stations. Mixed in are other legitimate articles about the Juno mission: https://news.google.com/stories/CAAqOQgKIjNDQklTSURvSmMzUnZjbmt0TXpZd1NoTUtFUWkwdTliVGtZQU1FYkVCMVZkMUtCY1JLQUFQAQ?hl=en-US&gl=US&ceid=US%3Aen
One of the articles with a fair amount of good detail: https://www.wpri.com/dont-miss/space-discovery-fm-radio-signal-found-coming-from-jupiter-moon/
The Space Race Chess Set!
The twitter post about it: https://twitter.com/timmermansr/status/1340318570471972864
The makerbot page with the source files: https://www.thingiverse.com/thing:2078833

Friday, January 1, 2021

December diversions

Misc links from rabbit holes run down in December 2020:
In the list of things everybody seemed to know about something I liked except me, George Harrison's (long running) affair with Ringo Starr's wife. Of course the full story once learned just seems sad, people lost in a maelstrom out of their control:
https://www.cheatsheet.com/entertainment/when-george-harrison-had-an-affair-with-ringos-wife-maureen.html/
https://en.wikipedia.org/wiki/Maureen_Starkey_Tigrett
https://startsat60.com/media/lifestyle/entertainment/pattie-boyd-george-harrison-affair-ringo-starrs-wife-maureen
"Curves not Combat Boots" an interestingly different approach to women's workout fashion: https://curvesncombatboots.com/products/
Info about some of the Myazaki movies that Nina was bingeing on once we got HBOMax:
The Secret World of Arrietty, which is based on The Borrowers. https://en.wikipedia.org/wiki/Arrietty
Arrietty's IMDB page. Supposedly the english language version had stuff added to mask over the typically sad Japanese ending. https://www.imdb.com/title/tt1568921/
Electron first stage recovery was a really interesting thing that happened in November.
The usual fact-laden article from NSF. The tininess of the payload and rocket diameter can be seen in the integration photo: https://www.nasaspaceflight.com/2020/11/rocket-lab-attempt-first-stage-recovery/
Also Launcher One finally made orbit too:
https://twitter.com/ChrisG_NSF/status/1350818131787309056

Wednesday, December 30, 2020

C++ pointers to 2D arrays

I'm dusting off the cobwebs to remember how to do pointers to arrays in C. I had to search for how to do it in C++ because Google is presently incable of returning useful links for C. In my case, I had a collection of predefined 2D arrays that I wanted to chose from to assign pointers to, but couldn't remember the syntax for assigning the pointers or referencing the values from the pointers. So, some research. This question was complicated by the problem that in C multidimensional arrays are actually just concatenated 1D arrays, and there are a couple of totally bonkers ways of getting around this baked into the language. First, the best hits from my searches:
First off, the primer on multi dimensional arrays: https://www.tutorialspoint.com/cplusplus/cpp_multi_dimensional_arrays.htm
This tutorial on array pointers seems lame at first because it starts with just pointers to 1D arrays which wasn't helping me, then I realized that I have to scroll down farther. Note: Check out the sizeof examples somewhere near the end: https://www.geeksforgeeks.org/pointer-array-array-pointer/
This link covers the exact same material, but somehow it seems less opaque. It was from this that I realized that what I needed was to define a pointer as a 1d array pointer of the same number of columns as the 2d array to get what I wanted. And then somehow it works to use that pointer with 2 indexes.https://www.programiz.com/cpp-programming/pointers-arrays
The wags at StackOverflow helped me learn the trick to finding the size of an array: https://stackoverflow.com/questions/10274162/how-to-find-2d-array-size-in-c
Here is the demo program that I tested out on the mbed simulator that has all of the erroneous ways of using array pointers removed, thanks to the above links:
int testme[3][4] = { /* rows, columns */
 {0, 1, 2, 3} , /* initializers for row indexed by 0 */
 {4, 5, 6, 7} , /* initializers for row indexed by 1 */
 {8, 9, 10, 11}
};

int main() {

 int arr[5] = { 1, 2, 3, 4, 5 };
 int *ptr = arr;

 int *ptr2;
 int (*ptr3)[4];

 ptr2 = &testme[0][0];
 ptr3 = testme;

 printf("%p\n", ptr);
 printf("%d\n", ptr[1]);
 printf("%d\n", *(*(testme + 2)));
 printf("%d\n", *(ptr2 + 5));
 printf("%d\n", *(ptr2 + 1));
 printf("%d\n", ptr3[1][2]);

 printf("array number of rows: %d\n",sizeof(testme)/sizeof(testme[0]));
 printf("array number of columns: %d\n",sizeof(testme[0])/sizeof(int));

 return 0;
}
Result of the above:
0x2e60
2
8
5
1
6
array number of rows: 3
array number of columns: 4

Saturday, July 4, 2020

Where are my Minecraft worlds on Android?

The phone in question doesn't have an SD card. The games/com.mojang/minecraftWorlds folder is empty in the phone's filesystem. Where are all the worlds that are clearly being stored somewhere?

The answer turns out that all of the worlds we've been creating for years have been stored under "Application" rather than "External". and this setting stores them in a protected area of the file system which cannot normally be accessed either by USB or even the built-in file browser.

There are apparently three methods of accessing this area. 1) gain root access to the phone. Most people are scared to try this step. 2) For each world, upload it to Realms (using the 30 day free trial) and then download it to external. There are a couple of tricky parts to make sure this goes properly. 3) Some boffins created a tool called "Worlds Explorer" which takes advantage of an android backup utility to pull the data out of the phone and then extract the worlds. This seems the most painless but requires java and there's a whole lot of linked together applications that are needed to make it work.

The links:

The first thread that I found with the clue as to what the issue was. The answers are not great, including misleading once which advise starting to save to "External" (doesn't actually recover previous worlds stored in Applications, just makes sure your new worlds are in the external location) and a terrible write-up of the Realms trick. https://www.trueachievements.com/forum/viewthread.aspx?tid=989031
Another forum thread with a groping understanding of the problem, but then the creator of WorldsExplorer posted a link to his app: https://gaming.stackexchange.com/questions/311137/where-do-minecraft-pe-can-save-worlds-other-than-sdcard-games-com-mojang-minecra
A reddit thread that explains the problem succinctly but with no helpful answers: https://www.reddit.com/r/MCPE/comments/677n3a/i_cant_find_my_world_folder_on_mcpe_android/
Another reddit thread that explains the issue well. This thread contained a much clearer description of the Realms trick. https://www.reddit.com/r/MCPE/comments/7azwvd/so_is_it_confirmed_that_minecraft_worlds_saved_to/dped2qa/
This angel from heaven posted a YouTube video that simply and unambiguously walks you through how to do the Realms trick. https://www.youtube.com/watch?v=fdFIXZ2rfJs
Here is a forum thread that has reports from people who have used both the Realms trick and WorldsExplorer: https://feedback.minecraft.net/hc/en-us/community/posts/360009322871-Moving-Resources-from-Application-to-External-Storage-bedrock-mobile-originally-but-any-
Here is the link to WorldsExplorer (it's apparently actually called World Exporter): https://tikolu.net/worldExporter/


Sunday, June 28, 2020

How to find AutoCAD drawings of parts on Digikey

Was it always this easy? How could I have not known?

First, know the manufacturer of the part I want a CAD file of the package of.

Then find that manufacturer on this list:

https://www.digikey.com/en/resources/3d-models

From the manufacturer's link on that page, again find the part. If the part has a CAD model, it will be findable when narrowing searches from this level down.

The part will have a link to the cat files on the manufacturer's site, which may or may not be correctly indexed.

Saturday, June 27, 2020

Kahoot

For distance learning, the teachers at N's school thought that Kahoot would work for fun quizzes. It's an odd idea; somebody has to project the quiz questions to a group that's all presumably in a room together and everybody has to have their own phone to participate. Add in Zoom and having only iPads on our end and the only way to make it work was to have one iPad for the Zoom and one for answering the questions.

https://kahoot.com/study/

It is interesting that kahoot quizzes can be created by anybody for free, and the system for scoring all the answers seems fairly easy to use.

https://kahoot.com/schools/how-it-works/

Wednesday, February 12, 2020

Python hints for gain comparison script

Sources for fixing my bad coding for making the data graphs:

Directly setting the tick labels in matplotlib. Haven't gone here yet but this is apparently not a simple tweak although there is a formula for getting it right: https://stackoverflow.com/questions/11244514/modify-tick-label-text
The .plot() method for matplotlib and how it so nicely allows for multiple lines on the same plot: https://matplotlib.org/api/_as_gen/matplotlib.pyplot.plot.html
Extracting a column from a 2D list. 3 methods: 1) list conprehension, 2) just use numpy 3) zip https://stackoverflow.com/questions/30062429/python-how-to-get-every-first-element-in-2-dimensional-list/30062458
Initializing a list for my x axis values, explained for babies: https://www.science-emergence.com/Articles/How-to-create-a-list-of-numbers-in-python-/
Doing multiplication and division between elements of three arrays: Just use numpy. https://stackoverflow.com/questions/10271484/how-to-perform-element-wise-multiplication-of-two-lists