xianjam

u/xianjam@programming.dev
3 posts · 60 comments

Recent posts

Recent comments

Also didn't watch the video. I don't think the answer is necessarily "no", but more of a "probably not". GrapheneOS is much more difficult to exploit. But 100%, if you install a spyware app on your phone and give it permission to spy, it will spy.

Sure, but DotRush can work well with other editors with LSP support, like NeoVim, Zed, and Sublime as noted here. I'm pretty sure it can work with other editors, too, like emacs, but haven't tried (yet?). It also explicitly supports Godot.

Wow, this would be quite cool. When DS emulators were new, I wanted this to be a thing so bad.

Unrelated (and not what I'm doing this weekend), but I've always been interested in reversed-engineering the DS / DSi firmware drivers that connects to WiFi to attempt to backport the 802.11b driver to WEP-only DS games.

Maybe I am bad at finding communities to subscribe to. For the most part, I'm mostly subscribed to programming-related subreddits (although I was missing. cs_caeer_questions and no_stupid_questions – thanks!)

I don't personally think Lemmy's "tankie community" reputation is that harmful:

  1. It helps explain federation and instance selecting instances to outsiders.
  2. Reputations can change. Over a decade ago, Reddit got a lot of media attention for hosting some nasty subreddits, and before they were banned, were accepted in the name of free speech. Few seem to know or care about that anymore.
  3. Twitter and 4chan are still extremely popular despite their reputations of being preferential to Nazis and pedophiles.

I don't even think Lemmy needs to be overly attractive to outsiders, but it kind of sucks when I search for an equivalent to an active subreddit and find a wasteland (like the fossdroid community. I've also just joined that wasteland). I'd settle for a few quality posts per week for each niche. I think what a lot of communities need are simply signs of life for others to see.

FYI for anyone who depended on old reddit: There are a lot of Redlib instances out there that are being actively updated to the latest instance with fairly high uptime. I use an add-on called LibRedirect which redirects any links from reddit to one of these instances. If Reddit ever hunts down these instances, you can host your own.

Do you have US residency as well? If not, can you go to the US for a month or two and establish yourself somewhere like at a family member's or friend's address?

I hear (haven't searched in a few years) that the job market is tough right now. It will be 10x harder if you have no US residency. I'm actually in Mexico too, right now, but I still reside in the US legally. Companies simply don't want to deal with the legality and taxes of paying someone residing outside of the US.

on Poems, an .ISO puzzle · c/programming · 2 pts · 23d

Cool stuff. I don't know about ISO but I love these kinds of puzzles. Maybe I'll give it a shot, if it's not too hard. Also love that it's hosted on a Wii.

on Help with a complex bug · c/csharp · 3 pts · 36d

Stack doesn't actually allow indexing, and ElementAt is an extension method implemented by accessing Stack's iterator. My honest recommendation is to not use Stack, even if that's what the book was using. Stacks are not really meant to be traversed. They're meant to be pushed to, and popped (or peeked) from. Each ElementAt call requires O(N) time to retrieve. I recommend switching to List and implementing 'push', 'pop', and 'peek' as such:

// Instead of Push
scopes.Add(item);

// Instead of Peek
int peeked = scopes[^1];

// Instead of Pop
int popped = scopes[^1];
scopes.RemoveAt(scopes.Count - 1);

However, I understand that is a bit of a change. If you'd prefer to keep it as a stack, a simple reversal of the for loop can get the job done.

	// Resolve local variable assignment
	private void ResolveLocal(Expr expr, Token name) {
		// Decrement through scopes
		for (int i = 0; i < scopes.Count; i++) {
			// Pass amount of layers since declaration to interpreter
			if (scopes.ElementAt(i).ContainsKey(name.getLexeme())) {
				interpreter.Resolve(expr, i);
				return;
			}
		}
	}

That's enough to get these scripts running.

>for(var i = 0; i < 10; i = i + 1) { print i;} 
0
1
2
3
4
5
6
7
8
9
>var a = 0; var temp; for(var b= 1; a < 10000; b = temp + b) { print a; temp = a; a = b;}
0
1
1
2
3
5
8
13
21
34
55
89
144
233
377
610
987
1597
2584
4181
6765

By the way, I noticed that redefining a global variable will crash as well, but a scoped variable will display an error as intended.

on Help with a complex bug · c/csharp · 5 pts · 36d

Hard bug to spot for sure. It's due to a difference between C# and Java. C#'s Stack.ElementAt() is not the same thing as Java's Stack.elementAt()/Stack.get(). They're actually reversed. Also, ElementAt is a Linq extension method and not a default method like in Java. See the below code/output:

import java.util.Stack;
Stack<Integer> stack = new Stack<Integer>();
stack.push(1);
stack.push(2);
stack.push(3);
System.out.println(stack.elementAt(0));

Output: 1

using System;
using System.Collections.Generic;
using System.Linq;

Stack<int> stack = new();
stack.Push(1);
stack.Push(2);
stack.Push(3);
Console.WriteLine(stack.ElementAt(0));

Output: 3