HNHacker News
TopNewBestAskShowJobs

salomon812

266 karma · joined January 22, 2014

submissionscomments
salomon812··on New Mexico is losing a form of Spanish spoken nowhere else
Absolutely not. If it was just an accent, I'd like back all those times my father couldn't help with my Spanish homework.
salomon812··on New Mexico is losing a form of Spanish spoken nowhere else
Northern New Mexico uses "vosotros." No one told us not to. (Or so I'm told, see my main comment.)
salomon812··on New Mexico is losing a form of Spanish spoken nowhere else
This is my family. Sadly, the language dies with my generation. My father speaks this dialect of Spanish... or at least, he used to. We moved to Northern California when I was very little. But, if we had stayed in New Mexico, my cousins don't speak it either. I asked Dad why he didn't teach me. "What would I do? Speak it to myself?" I took Spanish in high school. My father really couldn't help me, some of the basic phrases were different. As more immigrants moved into our area, Dad connected with them and started to learned the more modern Spanish to communicate with them.

I mean, this dialect formed because Northern New Mexico was so isolated. The Manhattan Project changed a lot of that. Suddenly, Los Alamos labs and Sandia labs connected New Mexico with the rest of the world. It wasn't as isolated anymore.

People have told me I could learn it, but I've tried. It's hard when I talk with my family, I'd rather have an adult conversation now rather than basically a preschool level one to learn the language. They say to really learn it, you have to immerse yourself. I lived with my grandmother for several months once while working at Sandia Labs. She insisted on speaking English with me, she was stubborn about it, and I was having a hard enough time understanding her in English.

Let me leave you with a funny story. My uncle had hired a contractor to help with his house. The contractor spoke common Spanish. And he angrily confronted my uncle in Spanish: "You stole my belt!" or at least that's what my uncle heard. "[You stole] mi cinta!" However, in New Mexico "cinta" means belt, but in Mexico it's short for "cinta métrica" or tape measure. (or so I'm told, I don't speak Spanish!) My uncle assured him he did not steal it and went ahead and gave him one of his own.

salomon812··on Ask HN: Small scripts, hacks and automations you're proud of?
I have a Python script, called t.py and a bash alias "t" that calls it. I use it for quick navigation in the terminal instead of "cd" and "pushd/popd".

The basic format is: "t <shortcut" while just "t" prints out all the shortcuts and waits for user input.

So, "t 1" goes to parent directory, faster than "cd .." Then, "t 4" goes to "cd ../../../.." And of course "t" will print out all the options.

"t a" goes to my main development git worktree, while "t b" goes to place I build from.

But the real star is the history. I embedded "`save_t_history`" into my bash prompt. That's another scropt that saves the current directory to a history file, then removes duplicates so staying in the same directory doesn't accumulate. Typing "t h" shows the history back to about 25 unique directories. Typing "t h1" goes to the last directory you were in. "t h5" goes five ago. I be working in tmux in one pane, and then jump to another and type "t h0" to bring it to the same directory.

This is basically my bread and butter for getting around.

I would post the code, but a.) it's on a work computer so technically property of my company and b.) it's a mess so I'd recommend others just build their own version.

A hint to get started is that the "t" alias is an alias for "cd `python3 /opt/t.py`"

salomon812··on I've procrastinated working on my thesis for more than a year
I've been here before. I did manage to get my PhD. It wasn't easy and I'm so happy the author is getting therapy because I needed it too. But I don't think the underlying cause is procrastination. At least it wasn't for me.

It was perfectionism.

And because I'm a perfectionist, I even managed to absorb the "nobody's perfect" message while still trying to be perfect, and that's part of the problem. For me, the issue arose when "tasks [took] longer than anticipated" and I started to beat myself up for it. But every massive project that's worthwhile has those issues. Time estimating is difficult especially within research. But taking it personally that we couldn't avoid the estimation problem that so many others have failed at, especially since a PhD thesis is typically the first project of it's scale for an individual, is a recipe for disaster.

I got so burnt out by my PhD project that I literally stared at a blank screen for more than a week trying to force myself to do anything. But I managed with my therapist's help to get out of the death spiral. How did I get out of it? Two simple but difficult objectives.

Self forgiveness and accepting it's going to be shit.

I'll explain the acceptance part first despite that I think people should practice forgiveness first. There's a meme I can't find for book authors that shows a cross-stitch with a beautiful image marked "what the reader sees" and then it's flipped to reveal the mess of thread on the back and marked "what the author sees." Everyone is their own worst critic, so consider that massive issues might only be rough edges and the core of the thesis is likely inact and you need to share it with the world.

The second part is self forgiveness. You did not waste the student's time or resources with a slow project. Every project is over budget and behind schedule. And yes, mistakes were made, but everyone makes mistakes, especially on PhD theses. We used to have a joke amongst the other graduate students "you know, I'll get this right on my next PhD." It's literally everyone's first time.

So, know you're not alone. I walked this path as well. Take a true week long break, and when you come back, form a plan to do a one-week long task. Then take two weeks to do that task. Practice self forgiveness on that task itself. Then formulate the most bare-bones plan for the rest of the PhD. One very silly thing that helped break me out of my death spiral was I started to panic that I couldn't even come up with a title for my thesis. So, I did the word vomit approach others mentioned. It wound up being really really bad because it was kinda sing-songy with unintentional rhyming words. I kept it that way for three months as a joke until I did come up with real final title.

salomon812··on Lessons I wish I had learned before I started teaching differential equations [pdf] (1997)
I loved my differential equation course, and it was a community college course I took senior year of high school. One of the chapters in the book was using diff eqs to solve physical systems and it was an eye opening experience. For a hobby project, I'm writing a video game that requires some unusual behaviors so an off-the-shelf physics library won't cut it, I have to roll my own and most of the math I'm using is directly from that course.

One additional note, the author mentions not being able to motivate the Laplace transform. The Laplace transform is really critical when designing robotic control systems. It's to the point that in diagrams, one usually draws "1/s" instead of an integral sign.

salomon812··on Ask HN: Programming and dyslexia
Dyslexic programmer here! Here's some of my tips I use.

ALWAYS ALWAYS close your parenthesis/brackets/quotes as soon as you open them then go back to write what's in them. So, if I write: func(arg), the keystrokes for me are: f u n c ( ) <- a r g and it's muscle memory at this point.

Color syntax highlighting is a must! It lets you know your keywords are correct.

Copy-and-paste variable names. Write them once and then get fast at copying them.

And then some preferences I like, not sure if they're related:

I prefer coding styles with lots of vertical white-space. I also rotate my monitors to portrait.

Also, I've always used a dark mode theme. I thought that was a nostalgia for the old DOS days, but seeing other people recommend them, maybe it's a thing?

salomon812··on Gitlab Handbook's HN Page
Absolutely. True story: I was at a small startup and our company organically made it to Hacker New's front page. I was so excited. At that point, I was only a reader. I made an account, upvoted it, told our social media manager. Next thing I knew, it fell off the front page and we suspected I or the manager accidentally set off the fake vote detector. We had no idea such a thing even existed. The CEO was so disappointed in us. We learned the hard way.

Edit: to be clear, I wasn't trying to game the system. I was just so excited that the product I'd been working on appeared on a site I often read. Only in retrospect did it occur to me why one would have anti-vote ring detectors. Yes, I was naive.

salomon812··on Show HN: Evil Wordle
No, I'm looping through all possible guess and targets and grouping possible targets by matching scoring. Then I select a guess on which one has the smallest set of possible words afterwards. For example, "SERAI" seems to be a good first word. The reason why is that even if the adversary selects the worst-case scoring of (in this case, it would be no green, no yellow), there's only 168 remaining words it could be.
salomon812··on Adversarial Wordle
Ah, apologizes, I missed your post. This analysis is awesome! I did a single look ahead, so it falls into the -OUCH zone and I have to burn some guesses. Doing the full search across all guesses is key. Well done!
salomon812··on Adversarial Wordle
Your solver is awesome!

I'm really curious what the algorithm is find the 4 move play. Mine only optimizes for a single look-ahead.

salomon812··on Show HN: Evil Wordle
So, there's another evil Wordle thread on Hacker News today (https://news.ycombinator.com/item?id=29862597) and over there, I've been refining my algorith for optimal play. Here's the current approach:

    R A I S E (0 green, 0 yellow, 168 words remain)
    B L U D Y (1 green, 0 yellow, 13 words remain)
    C O U N T (2 green, 1 yellow, 2 words remain)
    V O U C H (4 green, 0 yellow, 1 word remains)
    P O U C H (5 green, 0 yellow, 0 words remain)
But what was interesting was at one point of development, it did this:

    L A R E S (0 green, 0 yellow, 576 words remain)
    T O N I C (1 green, 0 yellow, 50 words remain)
    B O O D Y (4 green, 0 yellow, 5 words remain)
    D E G U M (0 green, 2 yellow, 1 word remains)
    G O O D Y (5 green, 0 yellow, 0 words remain)
See, the "BOODY" has 4 greens, but then it went and guess "DEGUM" to eliminate a lot of possibilities!
salomon812··on Adversarial Wordle
Okay! It's been reworked with all of this new information, so it knows what words are possible. And I also had it output what it would consider to be the worst-case scoring and it matches the adversarial's scoring! Here's what I get now:

    R A I S E (0 green, 0 yellow, 168 words remain)
    B L U D Y (1 green, 0 yellow, 13 words remain)
    C O U N T (2 green, 1 yellow, 2 words remain)
    V O U C H (4 green, 0 yellow, 1 word remains)
    P O U C H (5 green, 0 yellow, 0 words remain)
salomon812··on Adversarial Wordle
So, my algorithm is deterministic because there isn't any random element in it. And then it appears the adversarial doesn't either because the game plays out the same way every time.

So, to generate a single guess, the algorithm will basically try every single word in the dictionary against every possible remaining word. For any given guess, it tracks the count of various possible scorings. The scorings are the positions of greens, and yellows for a total of 243 possible scorings. After looping through all possible remaining words, it finds the max occurrence count within the scoring array. That maximum count becomes that guess's overall utility. It then finds the overall guess that minimizes that utility. (See: https://en.wikipedia.org/wiki/Minimax) After typing this all out, I feel like I didn't do a great job explaining, so let me know what you think.

salomon812··on Adversarial Wordle
Good point! And it's clear to me that this isn't the dictionary I was using. I grabbed a random Scrabble dictionary online and filtered for length of five. I'll rework my code to take all this into account and we'll see what happens (it probably will happen later today.)
salomon812··on Adversarial Wordle
Okay, I ran it again with the squared term in the utility function. Here's what it did:

    L A R E S (0 green, 0 yellow, 576 words remain)
    T O N I C (1 green, 0 yellow, 50 words remain)
    B O O D Y (4 green, 0 yellow, 5 words remain)
    D E G U M (0 green, 2 yellow, 1 word remains)
    G O O D Y (5 green, 0 yellow, 0 words remain)
salomon812··on Adversarial Wordle
It's very possible we don't have the same dictionary! I have 8938 words. I confirmed that NARES, DOILY, and TOUCH are in my dictionary. My analysis shows that SERAI's worst-case is 461 words and NARES would have 578.

I found my code a bit difficult to debug at the end because it's still halfway decent at playing wordle. So, I fully admit I might not be doing it right!

But one thing I also did was allow it to pick a word it knew wasn't possible but could eliminate a lot of possibilities quickly.

salomon812··on Adversarial Wordle
Wow! I really like your analysis!

Yeah, I was trying to determine the utility function that would determine how to select words, but I'm more of a gut-feel, intuitive sort of person. I also tried a squared term like yours, but for some reason, it didn't feel right when I tested it. That version decided the best initial word was `LARES`. I have a sneaky suspicion that we need to account for how common a word was. I think my solver was getting to hung up worrying about BRAXY and CRURA, and giving them similar weight to a word like TRACK.

However, it was very hard to debug because a slightly buggy version was still decent at playing the game! In fact, I'm fairly certain I still have some bugs. I need to comment my code and get it up on Github. It's also super brute force O(n^2)

salomon812··on Adversarial Wordle
This is great! A few days ago, I wrote a Wordle solver in C. It selects a word to minimize the number of words assuming the worst-case green/yellow.

So, it sounds like these two are in direct conflict. My solver is deterministic, and it looks like the adversarial is too, so they always play the same game:

    S E R A I (0 green, 0 yellow, 429 words remain)
    M O L D Y (1 green, 0 yellow, 35 words remain)
    C E N T U (0 greem, 2 yellow, 2 words remain)
    V O U C H (4 green, 0 yellow, 1 word remains)
    P O U C H (5 green, 0 yellow, 0 words remain)
salomon812··on My unorthodox, branchless Git workflow
When I go rock climbing, I don’t use ropes. It saves me time of having to set anchors.

The git advice works for either experts or small projects. If you’re an expert, choose your own workflow. I find in large projects with many users, branches help to recover quickly from mistakes and help define testing history. My primary concern is for novices to go at it without branches because they’re hard to deeply understand without experience and they see experts managing without.

Learn how to use rock climbing equipment before you rely on it. Experts, do whatever works best for you!

salomon812··on Ask HN: Hourly freelancers, what do you do when you can't figure something out?
I have a fair bit of Microchip experience, things to consider:

- You must set the AD1PCFGH or ANSEL bits to enable ADC functionality on a pin.

- There's nothing stopping you from accidentally configuring the pin as a digital output (it might even be helpful for some applications to measure the actual output from a digital output). Check the value of the TRIS register for that pin (and ODC register if it has it)

- Often there is a "Configuring Analog Port" section in the I/O Port section of the chip's datasheet.

Good luck!

salomon812··on Ask HN: What “old” programming languages will you still be using in 2017?
I'll be using QBasic to teach my kids programming. They both got Raspberry Pis for Christmas, which I preloaded with DosBox. This was always Plan A, but this article made me stop looking for a Plan B: http://www.nicolasbize.com/blog/30-years-later-qbasic-is-sti...
← PreviousPage 2 of 2