

I’m glad you noticed. That was my favorite part too.


I’m glad you noticed. That was my favorite part too.


Yeah, it does look like C now that I think about it. You’re right about the end result too. I believe C# will let you do inline declaration and assignment like that, so maybe that’s what we’re looking at? Been a while, could be wrong


I just tested it in PowerShell. Works fine
$i = 1
$x = -$i
$x
Outputs -1


It’s an incoherent hodgepodge of C#/.NET, PowerShell, and JavaScript, each of which I’ve forgotten more about than I currently know


function myFunction() {
try {
x = new Random().nextInt();
if (x != 10) {
throw "not 10";
}
else {
return (10)
}
catch(err) {
myFunction()
}
}
}
x = myFunction()
Commit notes: Added error handling


function foo() {
x = new Random();
case (x = 10):
return (x);
default:
foo()
}


Shit, you’re right. x is declared inside the loop, so it doesn’t exist until the loop begins execution.
Technically, I suppose you could say the compiler will allocate memory for x without assigning a value before the loop is executed and… I’m understanding what you mean now, I think.


Not in this case. First, i is declared and assigned a value of 0. Next, x is declared and assigned a value of -i or -0. On the first loop iteration, i will decrement to -1, perform the conditional check, then execute the loop body which will assign x to -i or -(-1) or positive 1, and so on.
The only time a variable is created without a value is if you declare one without assigning a value like with
[int]i;


If this is JavaScript, it would have a value of -0, which is actually valid and works the same as normal zero thanks to type coercion. I think the only difference is some methods that detect if a number is negative will return true instead of false, but otherwise, JS treats -0 the same way as 0


Now write a function to unroll the while loop to “optimize it for the compiler”
The glut of US tech workers is due to the excessive number of H1B visas being issued. This year, the number was almost the same, but slightly higher than the total number of US tech graduates. Why hire an expensive American new graduate when you can hire someone from India with 3-5 years of experience at 60% market rate instead?


This happens a lot with old movies.
A film comes out that’s revolutionary, so every film after it copies it. Future eyes lack that context, so they just see something that looks like everything else they’ve seen.
Citizen Kane is a good example. The writing, editing, and cinematography were revolutionary at the time. But, through a modern lens, it appears very ordinary because it’s very similar to every copycat that followed it.


I have the entire lemmy.ml and hexbear.net instances blocked. Nothing of value has been lost and my experience has dramatically improved.


Close. I believe you’re referring to the EPA efficiency mandates passed in the 90s that carved out exceptions for “heavy duty” trucks and SUVs, which lead to the creation of “crossover” vehicles, which started as a way to deliver car-like efficiency and features, while still minimizing development and efficiency costs by still having it classified as a “truck.”


This is the better option. But, if you’re gonna do that, there needs to be some kind of program that allows people to sell their banned vehicle to the government for above market value so they can afford to purchase a comparable, but more suitable vehicle instead. Otherwise, you’re gonna have a bunch of pissed off people with six-figure, three-ton lawn ornaments crying about how they couldn’t have known their vehicle would get banned and it’s now useless.


Close. I believe you’re referring to the EPA efficiency mandates passed in the 90s that carved out exceptions for “heavy duty” trucks and SUVs, which lead to the creation of “crossover” vehicles, which started as a way to deliver car-like efficiency and features, while still minimizing development and efficiency costs by still having it classified as a “truck.”


So, pass a ban that only applies to poor people and let the rich continue to do whatever they want still since they can afford the fine?
Once you subtract suicides, self-defense, justifiable homicides, officer involved shootings, and accidents, what you’re left with is a statistic that indicates 100% of gun violence is caused by less than 1% of gun owners.
Overall, the vast, VAST majority of gun owners in the US are safe and do make good choices.
No, the biggest problem (IMO) is that we enshrine the right to bear arms, but mandate no education about firearms in public school. If we’re going to embrace guns the same way we do cars, we should teach “shooter’s ed” the same way we teach “driver’s ed.”
The second biggest problem is, even though most Americans agree that the root causes of violence need to be addressed (poverty, homelessness, unemployment, mental health, etc.) the sad reality of our political system is that these interests aren’t represented because capitalists have hijacked our government for their own benefit.
Coding on mobile is hard