BehindTheBarrier

joined 2 years ago
[–] BehindTheBarrier@programming.dev 1 points 46 minutes ago

Peguots(car brand) app requires between 8 and 16 characters, no repeating characters, and that it contain 4 of the following: uppercase letter, lowercase letter, number, a special character in this list @$!%*?&_- ;

You'd think that'd be fine, but no. It took me several tries to generate a password that complied, even after limiting to only valid characters and a length of 16. I got the feeling there's an extra rule not shown,maybe lost in translation. In Norwegian it literally says "no repeat or successive characters" making it sound like I can only use a letter once, but thankfully not.

Pure torture. And the app is so shit I get logged out often, and auto fill with my password manager does not work in that app. Pressing login also fails half the time.

[–] BehindTheBarrier@programming.dev 2 points 2 weeks ago (1 children)

I have shitty music taste, and ended up downloading nightcore songs from YouTube. And the videos were usually named "Nightcore - song title". So chances of duplicate songs end up a lot higher when the only unique thing is the title of the song...

[–] BehindTheBarrier@programming.dev 3 points 2 weeks ago (3 children)

They had different names like (1) if they were duplicates. But all my files were named something like "Artist - title.mp3", and the Metadata tag for artist and title were generated based on the filename. I don't know how they would look after being synced over to my phone from Spotify though, but it is probably how Spotify names the files that broke it on my phone.

All the files were in the same folder on my pc too, for reference. So they have unique filenames, but two files could have the exact same artist and song title. I give that's it's an obscure edge case, but really frustrating.

[–] BehindTheBarrier@programming.dev 2 points 2 weeks ago* (last edited 2 weeks ago) (5 children)

Not sure if it fully fits, but one of my old HTC android phones has a bug where it would randomly fail any network request, by just never finishing it. No timeouts either.

It never got fixed. Loading a page in the browser, got stuck, and would need a new refresh. Some apps like Baconreader would get stuck doing the same, any app could have it happen. But sometimes the stars align, Facebooks Messenger had (has? don't see it anymore) the chat bubbles that showed over whatever else on the screen. And i clicked one of those, and they got stuck loading. And there was literally no way to close it. There was no timeouts, so i eventually had to hold the power button and reboot...

Other notable mentions, Spotify on android did not handle duplicated files (since you could add your own music to it) with the same filename or at least artist - title metadata. It would always only play one of them. It was very interesting because Spotify on pc worked, so i could play the second track fine there, but if i told it to continue play through my phone then it would continue form the same timestamp on other track.... Might be related to my phone being stupid, but there was a whole range of infuriating spotify issues. So i just moved to use poweramp and store and sync local music since i had a lot there to begin with .

[–] BehindTheBarrier@programming.dev 4 points 1 month ago (1 children)

I'm going to second the ffmpeg answers, they do the job but won't be completely accurate to timestamps due to cutting at key frames. That's how you persevere original quality though, and it's fastest.

If you need to reencode to fit a target size as well, there exists tools for that too. I made my own for cutting shadowplay recordings by selecting start and stop points in the video and encoding them to fit the discord 8MB limit back in the day. My version is not exactly user friendly to get going though, and not updated for the last 5 years or so. Should still work though.

[–] BehindTheBarrier@programming.dev 3 points 1 month ago* (last edited 1 month ago)

I have had a lot over time : Motherload Idk the name anymore, but something like fighter Z, a space invaders like game were enemies scroll in as you blast things away with a super jet. A space discovery game, was in Norwegian. A mystical signal arrives and you need to research it and eventually send out a space ship.

I was reminded of another i missed, Sinjid: Shadow of the Warrior. A ninja fighter flash game.

Last one I guess I might be missing was a 2d like game where the word was blocks like Minecraft but square board levels, angled like a diamond, I think it's called isometric. sorta like the q*bert games I think. Don't remember much of the goal, but walk around and collect gems I think. I believe most levels were mostly green grass and water/rivers separating areas. Main character might have been a girl.

The implicit return is perhaps the most dubious of them. I don't mind it for simple functions, but they are not so good in anything large and with multiple return sites. Even more so when developers choose to implicitly return 4 chained method calls inside a closure with else cases.

But the rest aren't really sins, they are mostly new or different concepts or ways to do something. And if there is a sin, it's largely because the language itself has a complexity larger than others.

Taking my own examples here, lambdas are just fine, but the move semantics are cumbersome to deal with. But we need to do it some way, to indicate that a value is actually being moved into the closure. Maybe there are better ways and they make into the language in the future.

Conditional values and let statements and such is a good consequence of Rusts design choice with returning Results or Option types. Just because it's different doesn't make it a sin. Just takes time to learn the right way. I think most come from an exception based language, and that has a differnet code flow than what Rust has.

Lifetimes are hard though, and I feel a lot of the introduction is made excessively hard with the simple naming. It's as of every programming tutorial used single letter variable names. Lifetimes isn't something I'm that good with either, mostly because I haven't had to use that complexity yet.

[–] BehindTheBarrier@programming.dev 19 points 1 month ago (5 children)

I can actually see where this is coming from, as I found Rust hard to read when I started out. I do really like Rust for reference, but I do agree Rust is hard to read for someone that has not learned it.

For example:

return statements that are implicit just because the semicolon isn't there. Even better if they occur inside a if block or something like that. Very hard to understanding when you don't know the syntax rules.

Lambda functions, especially when using move semantics too. They are quite simple, but if you don't know the meaning, it's more arcane characters. Especially when this is used inside lots of chained methods, and maybe a multi-line function in the lambda.

A lot for the if let x =... type of stataments are tough the first time around. Same for match statements.

Defining types for use with function::() and such.

Lifetimes, especially when they are all named a, b, c etc. It quickly gets messy, especially when combined with generics or explicitly defined types.

Macros, though not entry level rust to begin with, they are really cumbersome to decode.

None of these are sins of Rust, but for new people they are a hill to climb, and often hard to just "get" based on previous programming experience and reading the code. Rust can be really hard to approach because of these things. This happens in other languages too, but I do feel Rust has a particularly large amount of new concepts or ways to do something. And this is on top of learning lifetimes and borrow semantics.

[–] BehindTheBarrier@programming.dev 17 points 1 month ago (3 children)

Not this one, there is no ambiguity here. Order of operations are all good.

It's the round trips that kill you.

Oracle drivers for .NET are fun. Have a user client application which uses quite a lot of data, but a few thousand rows are fetched some queries. It's way too slow for any larger query, turns out for the batch query kind of work we do, the default FetchSize for Oracle is just a performance killer. Just throw it to 128 MB and it doesn't really hurt at all.

Worst thing i've seen though, apart from the 150 line long dynamic sql stored in our database, was probably a page in our program that loaded about 150 rows from the database. Normally we do create a new connection for each query, but it's fine since Oracle has a connection pool. Whatever millisecond is trumped by the round trip. But imagine a UI so badly written, it did 4 separate database queries for EACH row it loaded into the UI list. Useless things like fetching a new ID for this row in case it is changed, reading some data for the row i think, and more. Thing took a solid minute to load. There was so many bad patterns in that page that even during the PR for improving the speed it was just dealing with a mess because you couldn't just rewrite the entire thing, so they had to make it work within the constraints. Horrible thing to work with.

[–] BehindTheBarrier@programming.dev 7 points 2 months ago (3 children)

Fork it so i have my version, regardless if the original goes away. (Assuming Github doesn't nuke all repos of course like they did with youtube-dl for a while)

We got solid state to come challenge the car market in a few years. Supposedly both safer and bigger capacity. Just remains to be seen when it actually arrives in the average car. It's a tech that hasn't quite managed to get out of laboratories.

view more: next ›