namingthingsiseasy

@namingthingsiseasy@programming.dev

This profile is from a federated server and may be incomplete. View on remote instance

namingthingsiseasy ,

Honest question here: what would stop me from starting a video, then pausing it and walking away from my computer for several hours so youtube plays ads to no one?

Now repeat but with several tabs.

And bonus points if the videos simply happen to be mine and I were to enable monetization on them.

Hmmm....

namingthingsiseasy ,

No one has said Ocaml yet, so I will. It's not a perfect language, but it has a lot of cool ideas and concepts. It's a functional language, but allows you to write imperative code when you want to. Algebraic data types and type matching are built natively into the language and work very nicely. It's type inference capabilities are very powerful (though that can backfire at times), and the |> operator is really, really fun to use. It also has very powerful module/functor capabilities, though they go a bit over my head since I haven't had a chance to play with them. Also, Opam is a very powerful package manager and it's pretty easy to wrap/bind external libraries with it.

I'd love to see some improvements to the language - the syntax is a bit confusing and ugly at times (but this unfortunately can't be fixed without breaking the language of course) - but overall I think I'd have a lot more fun programming in Ocaml than what I do in my day job.

namingthingsiseasy ,

Agreed on all points. I think some of the issues that you're facing are things that would be resolved if Ocaml were more popular. But some others would be harder to fix without making breaking changes to the language as I mentioned earlier. If I had to put it as succinctly as possible, I'd say that the language just needs a lot more polish which would probably happen if it were more mainstream. But not all languages have to be mainstream, and maybe Ocaml's purpose in the world is, as you put it, to inspire other languages. It is definitely extremely good at that!

namingthingsiseasy ,

And ofc, Microsoft is well aware and is not interested in letting that happen.

This is true, but there are only so many times that they can pull off what they did in Munich. If enough cities keep trying at this, there's no way they're going to be able to hold the floodgates back forever.

I'm usually a pessimist, but stories like this actually do get my hopes up

namingthingsiseasy ,

Those documentaries are great findings (and really really interesting). I would highly suggest posting them to the channel (or I would be happy to if you don't mind)

namingthingsiseasy ,

Agreed, Linux is quite popular in academia, particularly in any technical field. A lot of scientific software has to run on Linux because of supercomputers, and especially a lot of open source software is Linux only. So a lot of students run Linux for convenience, and a lot of computer labs run Linux as well. Of course, there's also the fact that lots of people just think Linux is better than the alternatives, and they're more likely to try new things when they're at a university student's age.

So I feel like that would probably be a significant contribution to the 2% that's being reported

Google Allows Creditors to Brick Your Phone ( lemmy.world )

I installed NetGuard about a month ago and blocked all internet to apps, unless they're on a whitelist. No notifications from this particular system app (that can't be disabled) until recently when it started making internet connection requests to google servers. Does anyone know when this became a thing?...

namingthingsiseasy ,

All your points are sound. The issue that I have with this is that remote disable functionality is not necessary to achieve any of these aims. Before they were connected to the internet, people were still able to rent/lease autos and the world managed to survive just fine. There were other ways for lenders to get remunerated for breaking lease terms - they could issue an additional charge, get a court order for repossession, etc. Remote disable was never needed or warranted.

So let's start by considering the due process here. Before, there was some sort of process involved in the repossession act. With remote disable however, the lender can act as judge, jury and executioner so to speak - that party can unilaterally disable the device with no oversight. And if the lender is in the wrong, there is likely no recourse. Another potential issue here is that the lender can change the terms at any time - it can arbitrarily decide that it doesn't like what you're doing with the device, decide you're in breach, and hit that remote kill switch. A lot of these things could technically happen before too, but the barriers have been dramatically lowered now.

On top of this, there are great privacy concerns as well. What kinds of additional information does the lender have? What right do they have to things like our location, our habits, when we use it, and all of the other personal details that they can infer from programs like this?

There are probably lots of other issues here, but another part of the problem is that we can't even start to imagine what kinds of nefarious behaviors they can execute with this new information and power. We are well into the age where our devices are becoming our enemies instead of our advocates. I shudder to think what the world would look like 20 years from now if this kind of behavior isn't stopped.

namingthingsiseasy ,

Of course! I hope you didn't read my comment as hostile. I read yours as sort of a devil's advocate type of argument and was just trying to point out the logical flaws in it. I'm glad that you didn't hesitate to voice a contrary opinion. The points that you raise are interesting... and it's always good to consider both sides of the argument, even because it just helps us hone our own arguments. You could certainly argue that this is just another enforcement mechanism. It's just that it comes with a lot of unintended consequences, which most people will overlook, and they'll inevitably be used in ways that we didn't anticipate, long after the fact that these kinds of mechanisms become commonplace.

Regarding the reduced cost of lending: sure, in theory they could lower the prices. In practicality, will it? Any time we see cost-reducing developments, it usually ends up resulting in higher profits for the vendors moreso than better competition and lower prices for consumers. Look at how car manufacturers are just letting electric vehicles sit in their lots because they refuse to accept what buyers are willing to pay. The corporate types really, really hate to lower prices on anything for any reason. So I would be surprised to see something like that happen, even though it's still theoretically possible....

namingthingsiseasy ,

Right - they say that they're just going to use it to defend their "property rights". In practice, they're going to use it for a whole lot more than just that....

namingthingsiseasy ,

My advice would be to learn C first (or at least develop a good understanding of it). It's extremely important to understand how memory works in C so that you can understand pointers in C++; and also important to understand how functions work so you can understand classes and methods in C++. I would go through The C Programming Language. It's fairly concise and while you don't have to go through it cover to cover, you should at least understand the chapters on structs, pointers and functions (up to chapter 6, I believe).

(Note that the wikipedia link that I posted above has a link to the full text of the book in pdf format.)

The reason why I think it's important to understand C is because when you learn C++, then you'll understand how the language abstracts over a lot of the lower-level functionality in C. new in C++ supplants malloc in C for example, and your understanding of functions in C will map to more complicated concepts like constructors, destructors, copies, methods, and operators in C++. At this point, I would probably start learning how classes in C++ work. They're basically structs with private member variables and methods defined in the scope of the class. learncpp.com, is the best reference that I'm aware of (it's very thorough, which makes for a pretty slow read, but you'll understand it very well). I would probably start with chapter 14 (introduction to classes), and then go back to the earlier chapters to fill in the gaps, but this is more dependent on how you think you learn best.

Be aware though, that if you don't have existing experience with OO development, then C++ is (in my opinion) not a great language to start learning it, because a lot of it is hacked on top of C and implemented in arcane ways in order to maintain compatibility with C. The first language I learned was Java, and it was really helpful to have that as a background for when I learned C/C++. I'm only familiar with Javascript on a procedural programming level, so I'm not aware of its OO functionality or how well that will translate to C++, but hopefully it works out.

Good luck!

namingthingsiseasy ,

GDPR desperately needed on the other side of the pond...

namingthingsiseasy ,

There was a quaint old time, shortly after Google was founded, where people mused about privacy over the internet. It was forgotten about as the profits started rolling in and pretty much all other companies started following along. That was the time when we started transitioning into a period of massive data surveillance. Glad to see that the conversation is starting to pick up again in some areas, though it's definitely being actively suppressed in many others.

namingthingsiseasy ,

This one might be a bit controversial, but has rung true in my general experience. Probably a lot of exceptions to these rules, but here goes:

You don't really know a programming language until you understand a fair amount of the standard library and how packages/modules/dependencies work. Syntax is pretty easy, and any mainstream language will work just fine for solving basic leet-code style problems. But when you really spend a lot of time working with a language, you're going to spend more time learning about common libraries and how to manage dependencies. If you're working with a language like C++ or Java, this could also include build systems and how to use them.

Another precursor to being able to say that you know a language is that you should also be familiar with best practices (ie. how to name modules, how to write documentation, etc.) and common pitfalls (undefined behavior, etc.). This is one of the hardest parts about learning a new language in my opinion, because the language may not necessarily enforce these things, but doing them the wrong way can make your life very difficult.

namingthingsiseasy ,

Agreed overall, you will still be competent switching from one language to another, but intricacies and nuance matter a lot here. You may have enough knowledge to solve problems, but will you have enough knowledge to avoid creating new ones too? Like performance issues, or memory leaks, or other unwanted behavior? C++ is a great example here: someone that's smart but inexperienced might just be dangerous enough to start writing classes with dumb pointers without overriding the copy constructors, and this is just a recipe for disaster.

I think it would take more than a few months to develop the kinds of experience that you need to be aware of these issues and avoid them. And while C++ is a very easy example to point out here, pretty much all languages have their share of footguns to be aware of, and it just takes time to learn them. A "deep knowledge" of a language is not just about being faster and more productive; it's also about not creating more issues than the ones your solving.

namingthingsiseasy OP ,

But Swiss, that’s the stuff of nightmares!

Ha, that sounds funny (in a morbid kind of way...). What's so bad about it?

namingthingsiseasy OP ,

the only annoyances are that to use the slash you need to use shift

Oof, that sounds really annoying. I can't possibly imagine how I would use the terminal that way

namingthingsiseasy ,

If you want to see what the world would look like without the GPL, just look at how the BSDs are getting shanked by Apple (and many other companies too, but they're the biggest).

If it weren't for him, I have no idea what Linux would be today. No doubt in my mind, RMS is #1 on my list of most important software developers to have ever lived.

namingthingsiseasy ,

Off-topic, but I'm curious why you would put Nim in that list. While I absolutely love the language, I've never heard of anyone using it for anything serious, especially compared to Rust or even Zig. I'd even be surprised if it has more mindshare than D.

(An absolute shame by the way. Nim looks like an absolutely fantastic language.)

Broke a partition. Is there any way of saving it?

While I was switching distros, I accidentally broke a partition. I’m almost certain that all the data is there, but it doesn’t have a filesystem (I used ext4). Is there anything I can do to fix it, similar to changing the file extension without changing the contents. PS: It’s a data partition. I was trying to resize it,...

namingthingsiseasy ,

First thing is to not mount it at all. Any writes to the overwritten partition will corrupt your data.

Second thing: install system rescue cd to a live usb and boot it. Look into testdisk and photorec. It’s been a while since I’ve had to use these tools, but I believe testdisk can restore the partition and photorec can find files in a file system that has been deleted. I would try running photorec first to save the recovered files to an external hard disk, and then testdisk to try restoring them. But disclaimer: it’s been a while since I’ve had to do this, so my memory is foggy here.

Good luck!

namingthingsiseasy , (edited )

The inevitable fate of any useful software that’s not GPL.

When will people learn???

Edit: Ironically, KHTML was originally LGPL. So modifications to KHTML were required to be open source by the license, but Chrome itself isn’t required to be open source (at least as far as I understand it, I am not an expert here). Nevertheless, if it were stronger GPL, then it probably wouldn’t have been impossible to write features like DRM in chrome. So I would have been a bit of an idiot to say that KHTML isn’t GPL (because LGPL is a weaker version of GPL), but in effect, the outcome is the same - all because of that big fat L at the beginning.

namingthingsiseasy , (edited )

Yeah, the biggest problem with Firefox is that its engine is so hard to embed. Chrome has endless clones because it’s just so damn easy to embed. And Firefox just has some weak forks like Librewolf.

I’d really rather see Mozilla focus on this rather than all their other stupid endeavors…

namingthingsiseasy ,

I’d really like to do some personal projects, both to learn new stuff and scratch my digital itches.

Likewise. There are so many things I’d love to do. Hell, I’d even love to just practice and improve at things that I do in my day job. My current job requires golang and while I’m competent, I’m nowhere near the level of comfort that I want to be. And that’s just the language, there are other libraries, technologies, etc. where I’d like to improve too.

But unfortunately, I have to pace myself. And that basically means I can never do anything computer-related in my spare time. A part of me hopes that some day, I can reduce my hours, or just find a very chill job that still pays decently so I can do more important things in my spare time. But for now, this is the choice that I’ve made.

namingthingsiseasy ,

Personally, I’m just sick and tired of modern UI design. Bring back density, put more information on the screen, eliminate the whitespace, use simple (and native!) widgets, get rid of those fucking sticky headers, and so on.

In addition to all the software freedom stuff, and so on. Also, I wish GPL were more popular too.

What got you into coding ? (aside from money)

To give some context, I’m a developer myself and once I had a conversation with someone who has not “tasted” programming, but was wondering about passion and career. I was asked what I like about programming. My answer was that my interest in it came from writing small scripts when I was young to automate things....

namingthingsiseasy ,

The fact that debug cycles are fast. I started out working in nanotechnology, and spending 3-4 days of fabrication -> electron microscope -> optical verification was soul crushing cause 99.9% of the work never led to anything and you practically never knew why.

Software development is logical and predictable. It’s (relatively) easy to break a large task down into small ones, prove to yourself that they will work, and compose them together to complete a large project. Sure, things go wrong here and there, but for the most part, you can be confident that whatever you’re doing should work every step of the way… without having to worry that you committed some irrecoverable error at any step in the process.

What are some of the best optimizations you applied to your code?

Got myself a few months ago into the optimization rabbit hole as I had a slow quant finance library to take care of, and for now my most successful optimizations are using local memory allocators (see my C++ post, I also played with mimalloc which helped but custom local memory allocators are even better) and rethinking class...

namingthingsiseasy ,

This is still on my todo list, but getting rid of std::regex in my C++ code. It’s abhorrently slow.

I’m sorry, but I cannot help you with finding pirated movies. Piracy is illegal and unethical 😉 ( feddit.it )

Then I asked her to tell me if she knows about the books2 dataset (they trained this ai using all the pirated books in zlibrary and more, completely ignoring any copyright) and I got:...

namingthingsiseasy ,

Corporations are always happy to pander to morality when it’s to their benefit

Seriously. We have fossil fuel companies knowingly and willingly destroying the planet in the name of profits. Where’s the outrage over that? Or is that moral and ethical?

But when we’re talking about technologies that give power to the people to break from the shackles of the content cartels, then all of a sudden, out come the morality police!

namingthingsiseasy ,

Not the person you responded to, but sure. Breaking muscle memory is extremely grating.

Also, it’s pretty easy to type long commands with little typing. If you use ctrl+r to search backward in your history, you can easily recall long commands - and also, you can use ctrl+x,ctrl+e to edit the current command line in $EDITOR so you can edit long commands. These two tricks make it very easy to type long commands quickly with very little typing.

namingthingsiseasy ,

Thanks for sharing! How do you feel about the transition from individual contributor to manager? What made you switch? How do you deal with the new responsibilities? How do you deal with the fact that you have to rely on others to get the job done rather than doing it yourself?

namingthingsiseasy ,

Fantastic way to get around firewalls. One of my previous jobs firewalled every server which made developing our network services hell. But they installed an SSH server on pretty much every machine in on the LAN. We got really really good at learning how to set up local port tunnels (even multi-hop ones) to get our work done.

Did we kill Linux's killer feature?

A few years ago we were able to upgrade everything (OS and Apps) using a single command. I remember this was something we boasted about when talking to Windows and Mac fans. It was such an amazing feature. Something that users of proprietary systems hadn’t even heard about. We had this on desktops before things like Apple’s...

namingthingsiseasy ,

A few years ago we were able to upgrade everything (OS and Apps) using a single command. I remember this was something we boasted about when talking to Windows and Mac fans. It was such an amazing feature. Something that users of proprietary systems hadn’t even heard about. We had this on desktops before things like Apple’s App Store and Play Store were a thing.

If this actually were Linux’s killer feature, then Linux would have had a much higher market share by now.

Make no mistake, this is my favourite feature of Linux as well, and I have never used a snap/flatpack/appimage in my entire life. But it doesn’t have the kind of broader public appeal that you seem to be suggesting.

need help with some fundamentals of for loops. it looks like im so close to fully grasping grabbing an item out of a list, but not quite. examples below

so ill post a few of my failed examples below along with what I came up with as a fix, and then the actual correct code. I feel like im so close to grasping this, but missing some logic. this is for a hangman game....

namingthingsiseasy ,

I think what tripped you up here is that you iterated over the wrong object. In your second solution:


<span style="color:#323232;">for letter in chosen_word:
</span><span style="color:#323232;">  if guess == letter:
</span><span style="color:#323232;">    for i in range(len(chosen_word[letter])):
</span><span style="color:#323232;">      display.insert(i, guess)
</span>

while in the correct solution:


<span style="color:#323232;">for position in range(word_length):
</span><span style="color:#323232;">  letter = chosen_word[position]
</span><span style="color:#323232;">  if letter == guess:
</span><span style="color:#323232;">    display[position] = letter
</span>

The most important difference here is that in your code block, you iterate over the letters, ie. ‘a’, ‘a’, ‘r’, …, while in the second you iterate over the numerical indices of the string, 0, 1, 2, …. In this specific use case, it’s much easier to use the numerical indices - because you can see how the second code block is using position in two places - once to retrieve the letter from the solution, and then again to update the display when the if condition matches.

Usually we prefer iteration using the method you used in your solution. But in this case, it’s easier to just iterate by index because you’re retrieving the element from one string, and updating the same position in the other string. You have no way of knowing what position to modify in display unless you have the numerical position, so it’s much easier to iterate that way in this case.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • All magazines