HNHacker News
TopNewBestAskShowJobs

maldev

299 karma · joined July 9, 2022

submissionscomments
maldev··on Amazon to lay off 9,000 more workers after earlier cuts
Bro, it's literally printing out "fizz" if a number is divisible by 3, and "buzz" if it's divisible by 5, on a for loop from 1 to 100. You really need a python module for a 3 line for loop??
maldev··on Amazon to lay off 9,000 more workers after earlier cuts
Exactly, I started doing it since I know if they can do literally 5 lines of super basic code. It should take 30 seconds. Why would I ask someone to write kernel code or other domain topics if they can't write fizzbuzz??? The replies to your comment are exactly what I meant lol.
maldev··on Amazon to lay off 9,000 more workers after earlier cuts
It honestly shows that alot of people havn't done interviews with the comments. You're 100% right with the 1:100 people knowing how a computer works. I legit have to ask FizzBuzz and I would like 4 out of 5 people can't do it. Like maybe we'll see the industry require the bare minimum of actually knowing how to write a basic program for a 6 figures job, but we arn't gonna go anywhere as a profession.
maldev··on Gitlab loses one-third of its value after company issues weak forecast
I think Github knows that and that's why it's turned into more of a "Social Media" site. Jr Dev's grind it and view it as a gateway to a job. Constant memes about "Green boxes". "Only want my Sr Dev's to have full green!111!!". In reality nobody cares, but you can tell that's how the marketing is going. And it's to the point that if I have a public product, I might as well put it on github and get that stuff for free. Even though I do run gitea in a docker container for 99% of my projects offline.
maldev··on Facebook confirms it will drop news sharing in Canada under bill C-18
Apple news does this. And it has the backing of a big company that keeps gaining outlets rather than losing it like the other option linked. I can't find a single one that I read that isn't on it. https://www.apple.com/apple-news/publications/
maldev··on Microsoft lays off one of its responsible AI teams
You're on the nose. I've been calling these types of positions a low interest rate phenomena.
maldev··on US court rules Uber and Lyft workers are contractors
You can see this actually doesn't have that big an effect. See https://ballotpedia.org/California_Proposition_16,_Repeal_Pr...

To summarize, the law is extremely simple. Remove the line "the government and public institutions cannot discriminate against or grant preferential treatment to persons on the basis of race, sex, color, ethnicity, or national origin in public employment, public education, and public contracting." from the California constitution.

It was a No vote with 57.23 % and yes with 42.77. Now, that's not to interesting. Until you look at who supported the bill! It's to many to list! But you have Pelosi, Sanfrancisco, LA, San Jose, Oakland, Stockton Mayors. Pretty much every D reprsentative, Pete Buttigieg, former state senators, the CA Democratic Party, multiple government entities. AirBnb, Blue Shield of California, Facebook, Instacard, Kaiser Permanente, PG&E(Local Power company), Uber, Twitter, 49er's, Giants, Reddit, United Airlines, Oakland A's, Multiple unions, daughter of MLK. And there list goes on for people who supported it.

Now, here's who opposed it. Two republican State Senators, 3 former representatives, the Republican Party of California, Ward Connerly(Who got the anti discrimination line added in 1996, and 5 organizations you've never heard of. Financing was 25.13 million for Yes, and 1.7 million for no. With only a asingle donor on the No above 50,000, while the Yes vote had Kaiser donating 1.5 million, ACLU with 1.331 million, California Teachers assocation with 3.5 million. And multiple others above a million.

So with over 20 million more in funding, or almost 200%, a long list of who's who fortune 500 and politicians, it still got struck down. I think we can have more faith in the voter and stuff like this shows it.

maldev··on Dropping support for old C++ standards
So I mainly do Kernel or super low level systems code. And i've never had an issue targeting the latest C++ standard. Given I don't use the C++ STL and only use the language features. The backwards compatability is amazing and i've never had a single issue in my career with swapping forward. So good on them. I also do Windows work though, so maybe it's different on Linux.
maldev··on GOTOphobia considered harmful in C
I don't see how the number of goto's is relevant. You're still having alot of goto's in each function in the codebase with SESE and only using one goto location, solely for cleanup and exit.
maldev··on GOTOphobia considered harmful in C
I'm not saying not to use goto. The above example works on any C language, with some tweaks needed to K&R. I've done substantial Kernel work and can tell you that there's no reason to ever break my example and put multiple goto stubs. Can you provide a single situation where it is needed and there's no other alternative? I can't prove the negative you want me to.
maldev··on GOTOphobia considered harmful in C
Yes. There's a reason pretty much every secure C coding standard dictates exact what I said, like CERT C etc. There's a reason they have weird bugs. Just because it's an impressive piece of software, doesn't mean it can't have horrible design pattern written by substandard coders. And in an open source project with as many contributors as Linux, I would say it's not hard to fathom that there's a significant number of substandard people writing code on that codebase. Even MISRA quoted in the article I believe intends that you only have one goto location.

For a big example of substandard coding, see this thread for an egregious wireguard module in BSD. Countless other examples. https://news.ycombinator.com/item?id=33381949

maldev··on GOTOphobia considered harmful in C
This blogpost is horrible! The title is good, you can tell if someone actually uses C at a decent level based off of if they describe SESE(single exit single entry) and how you use goto's to achieve that.

BUT, the fact they have multiple goto locations in one function violates this! Only one goto locations ! That goto is goto cleanup, or goto exit. What you do is then check state of each variable you cleanup. Every function should be some variable of this. If anyone writes C in any other style than SESE, you can consider them a subpar C programmer. There's variations like using BOOL and in and out variables. I like them, but there are different styles. But anyone not using a single AND ONLY A SINGLE goto in every function is 100% a subpar C programmer who you should not trust.

    BOOL foo()
    {
       int *allocation;
       char *allocation2;
       BOOL bRet = FALSE;
       const int BUFFSIZE = 10; //NO MAGIC NUMBERS
       allocation = resourceallocation(BUFFSIZE); // Malloc, file.open, network open, etc
       if(!allocation)
       {
          DEBUGPRINT("ALLOCAITON FAILED");
          bRet = FALSE; //Redundent, but protect against intern
          goto cleanup;
       }

       allocation2 = resourceallocation2(BUFFSIZE); // Malloc, file.open, network open, etc
       if(!allocation2)
       {
          DEBUGPRINT("ALLOCAITON FAILED");
          bRet = FALSE; //Redundent, but protect against intern
          goto cleanup;
       }
    
       ...
       bRet = TRUE;
    cleanup:
       //Add error handling if allocation fails
       if(allocation)
         resourcefree(allocation);
       if(allocation2)
         resourcefree(allocation2);

    
       return bRet;
    }
maldev··on Mercedes-Benz previews its operating system MB.OS
No, I'm just trying to build a point that the high end car manufacturers are able to get some wild integrations going on that differentiate them from regular manufacturers due to their software. Especially Mercedes, who regularly has the best tech in their vehicles, years ahead of the other manufacturer, and usually a year before BMW or other high end ones. This makes a very nice product. Since otherwise you run into an issue of "Why would I buy this", when the reason people get these cars is how integrated they are and the attention to details.
maldev··on Mercedes-Benz previews its operating system MB.OS
It has a few things like this. https://youtu.be/mG3Uo0a8k5Q . It basically opens up the valves/exhaust a bit more for more noise. It's 100 % from the engine and not from speakers.
maldev··on Pentagon warns poppy seeds might cause troops to fail drug tests
Welcome to government, where comp isn't based on skills and is based on years of experience. And money is based on hours billed rather than shipping a product like private sector :)
maldev··on Mercedes-Benz previews its operating system MB.OS
The infotainment and lighting + other controls really sells it…

I more meant that even from a style standpoint, I never had that happen when I drove a Honda. There’s also features like making the engine “purr” which works really well on dates. There’s just a lot of integrated features they can control, to the point that not only is it useable and I like it better than CarPlay. It also has tangible benefits and genuinely helps me score. With features that wouldn’t be possible with a CarPlay based os and not having everything super integrated.

maldev··on Pentagon warns poppy seeds might cause troops to fail drug tests
Defense contractors.
maldev··on Pentagon warns poppy seeds might cause troops to fail drug tests
My field of tech is strict no drug. The level of job security and salaries this provides is insane. FAANG salaries, and a tenth of the work(if that) compared to private sector. Along with being near impossible to get fired or laid off and all I have to do is not smoke a doobie.
maldev··on Mercedes-Benz previews its operating system MB.OS
Everyones talking about alot of negatives. But I have a E53 AMG 4matic+ coup. It looks amazing, like constant compliments, i've even had people compliment it and give me their number in a wendy's drive through.

But the OS(MBUX 2) is actually really good, at first I was a bit negative on it. But the way they have everything integrated that isn't really possible with apple play is nice. The dash is customizable, I have my setup with speed, an array right in the center on when to turn, and the right is a mini map so I can see the road. On top of that the screen in the center is amazing and has a few views.

The voice assistant is really nice, does everything I want, they have it baked in so each seat can activate it and it knows based off a mic. Can't do that with apple play. So when a girl in my car says "Turn on the massage" or "Turn the temperature to 70", it only does for their side. And honestly, besides the map not having police checkpoints, it's a bit better than apple maps or google maps. And on top of that, I can lookup the location on apple maps on my phone, then send it to the car.

And according to my dealer, most people forgo using carplay for anything other than music in alot of the benzes.

maldev··on Ask HN: I just want to have fun programming again
C# with maui can natively compile (on most things), otherwise you can just ship the .net runtime with your app, you can target a webview on "any" platform with the same codebase and same tools using Blazor. Blazor has it's own syntax that works similar to Angular, but ALOT different. And you can pretty much do straight up C# in it. You also have super easy multithreading. And since all the frontend code is baked into your backend, it's super easy. You can also build webapps which function pretty much alone with no backend. Or have a backend linked into it. It also works in the browser and can target WASM, with the exact same codebase and UI as Linux, Windows, Iphone, ANdroid, etc(Assuming you use the webview with blazor)
maldev··on Cloudflare is destroying the open internet
I don't condone that stuff at all. The big risk comes from 5 or 6 digit member enterprises where you can't properly vet your partners, employees, or contractors. What if a situation like Yandex happens and you find out your code has obscene comments on the backend? What if you have a sponsor that wasn't properly vetted. What if you wind up in a catastrophic PR situation, say BP oil spill. Or, what if someone goes onto a public comment form and posts that obscene stuff and you don't realize it?

Enterprises are massive machines that move EXTREMELY slow. And the risk of not being able to catch something in time is there, and since Cloudflare has now done it once, that means they could be pressured into it in the future. And would the media or Twitter be defending a poor Oil and Gas company if their source code had obscene things in it from a malicious developer, or would they push for Cloudflare to remove them?

Even if the odds of this are so low. I would be doing a disservice to my clients and enterprises if I didn't advise them of this possible risk that could cripple a company. Anything that can be easily stopped by using another vendor, so essentially free, when compared to a risk of something that could result in a company losing hundreds of millions or billions of dollars is an easy choice to make.

Corporations are risk averse, and this plays into both sides. Activists abuse this to pull advertisers of people they don't like. But they also have to understand that services which can cause risk are avoided like the plague.

maldev··on Cloudflare is destroying the open internet
I personally don't trust any of my businesses to run on it after this, and have been advising business partners and people I advise to steer clear of it. I know it's not much, but it's been mid to high 6 figures in revenue i've had shifted elsewhere. Having a business possibly be crippled won't pass any sort of risk management, and clearly shows they don't rank highly on any sort of organizational maturity scale.
maldev··on It is becoming difficult for me to be productive in Python
You're 100% right, the new type annotations are really nice to. You can still be really pythonic and leverage some cool reflection capabilities with types. And on your point of forcing people to use types. I can't imagine many situations where you don't have a type in mind and can't use a higher order function to solve the problem. Which python does internally with __add__ __str__ and all the other functions included with classes.

As an example of stuff you can do with types. I was trying to teach a buddy how to program from a non CS background and I explored it a bit to make it as modular as possible so he could literally just change the structure and types and the code would all work for him. And it's really easy using some reflection

For example, to mimic a struct, you can use.

    @dataclass
    class CSVStruct:
    x: int = 0
    y: int = 0
    foo: int = 0
    bar: int = 0
Then you can typecast dynamically and generate random data(assuming you can go from int -> datatype) to fille in the data.

    arg_list = []
    # Generating argument list dynamically
    for field in dataclasses.fields(self.CSVStruct):
       arg_list.append(field.type(randint(0, 100)))
Or to get all the names of a struct (In this case to print out any structure with headers into a CSV file. Can also be done with their values)

     # Getting column names
     row_names = {field.name: field.type for field in dataclasses.fields(self.CSVStruct)}
maldev··on Tell HN: DEI initiatives undermine the self esteem of PoC within a company
The curse of low expectations is real. I recently moved out of Baltimore because of the long term implications of DEI in education. There's schools where a gpa of 0.13 puts you in the top half of your class (https://foxbaltimore.com/news/project-baltimore/calls-to-shu...). You also have 77 % of seniors being illiterate (https://www.washingtonexaminer.com/policy/77-of-students-at-...). I also dated a teacher for a bit, they can't even teach, it's daycare and the bar for a highschool senior to pass is literally being able to write their name. Teachers can't fail or require more.

This is going to lead to decades of crime, most major cities in America are like this. And it's going to get worse and worse. The future is scary, and I wonder what the outcome will be. These are also largely black schools, what happens when these communities can't read and stay illiterate due to DEI in the school system?

maldev··on The unequal treatment of demographic groups by ChatGPT/OpenAI content moderation
For anything like this, you're unironically better off using a non US based search engine. There's alot of US cultural biases. If you search something like that on say Yandex, you will get far more accurate results. But also keep in mind it has "Russian" biases, so if you search something like "Ukraine War" it will return Russian biased responses.
maldev··on Ask HN: Reject/ghost on all job applications with 8 YoE, what am I doing wrong?
I have a third person intro at the top of my resume. I feel it helps alot, and makes me stand out. It's only a ~4 sentences, but it says what I like to work on, how I'm passionate about it, and what unique things I can bring.

Think of it like a resume pitch on a resume.

maldev··on Release engineering is exhausting so here's cargo-dist
This is actually pretty similar. The OS has an alternative data stream(An idea they stole from Mac), and they list what site a exe was downloaded on, or if it came from somewhere else. Others incorrectly called it a flag, when it works by having two different file data streams for a single file, one is the default one.

So for example, a single file can actually contain two different "files"(File data).

So, foo.exe, actually will effectively open the file foo.exe:DEFAULT. You could also add a piece of malware to the foo file in place of a datastream. So foo.exe is legit, but if you open foo.exe:MALWARE , it will open up the malware datastream.

So tldr, how Windows does this, it when you get a file from a third party source(Internet, USB Drive, etc), it adds a new datastream in the form of a textfile. And the textfile contains info about the source. Namely, a number for location it came from(3? for web), and then some more info.

maldev··on Swift Achieved Dynamic Linking Where Rust Couldn't (2019)
Wow, you're right. I stand corrected. I've been leveraging it for Windows and Macos, and incorrectly assumed it would work on Linux as well. And when I did target linux it was using the Blazor(Webview stuff). Thanks for the correction, such a weird decision for Microsoft to market it as cross platform so heavily and omit Linux. I would definitely put it on Lie tier. Even more strange since some other features have first class linux support like compiling to native code, but others like Blazor apparently omit only linux.
maldev··on Swift Achieved Dynamic Linking Where Rust Couldn't (2019)
With Maui, you can now have first class Linux gui support, same with Blazor. You can also even do some of the more cutting edge stuff on linux like compiling straight to ASM.
maldev··on Hackers demand $10M from Riot Games to stop leak of ‘League of Legends’ code
In games obscurity isn't really a thing. They are prime targets for memory scanning and getting extremely accurate results.

Here's how to build a simple "bot" for any game in about 30 seconds.

Step 1, Scan memory for Hp using a tool like cheat engine. Step 2. Since you know simple C programming, you know HP is kept in a structure, most likely the player structure. Look at surrounding memory and you'll have something like this.

struct LocalPlayer { INT32 CurHP; INT32 MaxHp; INT32 CurMana; INT32 MaxMana; Position Pos; }

Step 3. Now you have a basic structure, how do you find what uses it? Well, you know what a getter setter is from your CS 101 class. So you set a HW breakpoint on Read for the hp, and a HW Breakpoint on Write for the hp. Now you have GetHp(); And SetHp();

Step 4. You also remember how linkers work from your Compilers class, so knowing this, just like the structure has similar variables in memory, the binary will also have similar functions next to eachother(Or you can use class/variable passing from your struct.). So Right below GetHp, is 99 % of the time going to be GetMana.

Step 5. Now you have your structures, and know what functions use it, so find the global variable or scrape how these functions get the address to update.

Step 6. Repeat for other players using exact same steps, congrats, you now have all you need for a wallhack, bot, or whatever you want.

So as we can see, no code is needed, no big brain hacks are needed. A cs 101 student can do this(And alot do, this is why cheats are filled with skids). And it's all done through super simple dynamic analysis. Games are different, since in a regular application, you won't be able to memory scan as easily.

← PreviousPage 4 of 7Next →