Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API

From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Feed
All
Post Types
- Rants
- Jokes/Memes
- Questions
- Collabs
- devRant
- Random
- Undefined
Cancel
All
-
Okay, summary of previous episodes:
1. Worked out a simple syntax to convert markdown into hashes/dictionaries, which is useful for say writing the data in a readable format and then generating a structured representation from it, like say JSON.
2. Added a preprocessor so I could declare and insert variables in the text, and soon enough realized that this was kinda useful for writing code, not just data. I went a little crazy on it and wound up assembling a simple app from this, just a bunch of stuff I wanted to share with friends, all packed into a single output html file so they could just run it from the browser with no setup.
3. I figured I might as well go all the way and turn this into a full-blown RPG for shits and giggles. First step was testing if I could do some simple sprites with SVG to see how far I could realistically get in the graphics department.
Now, the big problem with the last point is that using Inkscape to convert spritesheets into SVG was bit of a trouble, mostly because I am not very good at Inkscape. But I'm just doing very basic pixel art, so my thought process was maybe I can do this myself -- have a small tool handle the spritesheet to SVG conversion. And well... I did just that ;>
# pixel-to-svg:
- Input path-to-image, size.
- grep non-transparent pixels.
- Group pixels into 'islands' when they are horizontally or vertically adjacent.
- For each island, convert each pixel into *four* points because blocks:
· * (px*2+0, py*2+0), (px*2+1, py*2+0), (px*2+1, py*2+1), (px*2+0, py*2+1).
· * Each of the four generated coordinates gets saved to a hash unique to that island, where {coord: index}.
- Now walk that quad-ified output, and for each point, determine whether they are a corner. This is very wordy, but actually quite simple:
· * If a point immediately above (px, py-1) or below (px, py+1) this point doesn't exist in the coord hash, then you know it's either top or bottom side. You can determine whether they are right (px+1, py) or left (px-1, py) the same way.
· * A point is an outer corner if (top || bottom) && (left || right).
· * A point is an inner corner if ! ((top || bottom) && (left || right)) AND there is at least _one_ empty diagonal (TR, TL, BR, BL) adjacent to it, eg: (px+1, py+1) is not in the coord hash.
· * We take note of which direction (top, left, bottom, right) every outer or inner corner has, and every other point is discarded. Yes.
Finally, we connect the corners of each island to make a series of SVG paths:
- Get starting point, remember starting position. Keep the point in the coord hash, we want to check against it.
- Convert (px, py) back to non-quadriplied coords. Remember how I made four points from each pixel?
. * {px = px*0.5 + (px & 1)*0.5} will transform the coords from quadriple back to actual pixel space.
· * We do this for all coordinates we emit to the SVG path.
- We're on the first point of a shape, so emit "M${px} ${py}" or "m${dx} ${dy}", depending on whether absolute or relative positioning would take up less characters.
· * Delta (dx, dy) is just (last_position - point).
- We walk from the starting point towards the next:
· * Each corner has only two possible directions because corners.
· * We always begin with clockwise direction, and invert it if it would make us go backwards.
· * Iter in given direction until you find next corner.
· * Get new point, delete it from the coord hash, then get delta (last_position - new_point).
· * Emit "v${dy}" OR "h${dx}", depending on which direction we moved in.
· * Repeat until we arrive back at the start, at which point you just emit 'Z' to close the shape.
· * If there are still points in the coord hash, then just get the first one and keep going in the __inverse__ direction, else stop.
I'm simplifying here and there for the sake of """brevity""", but hopefully you get the picture: this fills out the `d` (for 'definition') of a <path/>. Been testing this a bit, likely I've missed certain edge cases but it seems to be working alright for the spritesheets I had, so me is happiee.
Elephant: this only works with bitmaps -- my entire idea was just adding cute little icons and calling it a day, but now... well, now I'm actually invested. I can _probably_ support full color, I'm just not sure what would be a somewhat efficient way to go about it... but it *is* possible.
Anyway, here's first output for retoori maybe uuuh mystery svg tag what could it be?? <svg viewBox="0 0 8 8" height="16" width="16"><path d="M0 2h1v-1h2v1h2v-1h2v1h1v3h-1v1h-1v1h-1v1h-2v-1h-1v-1h-1v-1h-1Z" fill="#B01030" stroke="#101010" stroke-width="0.2" paint-order="stroke"/></svg>6 -
What have I done today?
Nothing. Stayed naked all day and smoked weed.
Well I did my budget for the month and send my bills.
Tomorrow I'm paid.
Can't wait to receive my 8 strings guitar omg10 -
The nightmare of all AI users is when this shows up: https://devrant.molodetz.nl/Screens...
The content what it said was even worse. Of course, it doesn't have the ability to do it. But imagine if it had, it was a false positive.5 -
Modern smartphones: "Powerful", "marvelous", but corporate overlords dictate what you actually get to do with it.
They lock your bootloader and prevent you from installing third-party operating systems.[1] Now they are starting to block third-party app installation only in certain situations, but this will sure as hell escalate.[2]
They block you from using the MicroSD card properly or take away the memory card slot entirely, decide what you are allowed to screenshot[3], and they lock your user data (like browsing history and saved pages) away from yourself to "protect you" from imagined evils. But this "protection" is actually the curse.
They also refuse to implement features people ask for like always starting with the rear camera regardless of the last used camera[4] and let the user backed up saved pages[5]. Something as simple as turning the flashlight on and off while recording a video took over a decade for Samsung to implement when shouldn't have taken a single afternoon.
----
Sources:
[1] Xiaomi prevents unlocking the bootloader but graciously allows it seven days after purchase. I believe that as the buyer, you should be able to install any operating system you like.
[2] (added through edit, hence last) Since Android 16, Google blocks APK installations during phone calls, supposedly to protect against scammers. But if history teaches us anything, it means this will quickly escalate and end with APKs being blocked completely or only installable through ADB, which requires an external computer and a USB cable.
[3] Google and Apple let app developers block users from taking screenshots. This is, for example, used by WhatsApp to prevent screenshots of profile pictures, even though everyone knows one should not put something in a visible spot on the Internet that one does not wish to be preserved. I believe people should have the freedom to screenshot anything that appears on their screen, like desktop operating systems (Windows and Linux) do. The buyer deserves to have the final say on a device they paid for.
[4] https://r1.community.samsung.com/t5...
[5] https://forum.developer.samsung.com/...34 -
I don't like how tech companies are advertising they will sell you "peace of mind"
better question is why did you take it away in the first place, eh? so if you took it away in the first place why would I trust you to fix the issue you caused? talk about insanity, doing the same thing over and over again expecting different results1 -
Working on some linux shell/terminal stuff and chatgpt really is both a saint and a curse
It's super helpful but like half the stuff it tells me is just flat out wrong
Never forget to double check guys!1 -
Cool, Snek has a new few members with new input to work on for now. It's still not released guys, it takes some tweaking. But i'm happy, earlier this day I went to beach, and when i came back, in the general chat there were 1200+ new messages. Holy fuck. I keep on preparing it for when it's needed. But I do hope to say within a month or so that it's <stable>. Finished, will never be the case! So many ideas to implement. One of the priorities is now, what you can do with the Snek app, because it's a lot, it has some sick features. Live typing was not appreciated by everyone but it's possible to disable it with /live.
Meh, stay tuned, will spam next month or so again. Happy that the cert is renewed and we can continue talk here.12 -
I've just learned that some unicode codepoints (like 𘀀) are wider than 1 cell in a normal monospace terminal
Yay, i hecking love unicode
(i want to die)2 -
guys, remember, don't think
the establishment and authority, your peers, your boss, your company, the whole corporate, economic structure as approved by government... if you try to think instead of nodding. you're the problem
don't think, man
no thinky1 -
apparently there's benevolent lizards and they actually have decent "reprogramming self" advice. like immunity to being eaten by the malevolent lizards which feed off fear and apparently anger (though they never fed on my anger... so I took why my anger can never be fed on and added it to the fear and now I can feel fear without getting pulled)
but really I don't know what's wrong with me. there's something in there that's just violently lashing out at everything like a cornered animal. and I don't even know why it's triggering. I don't think I existed with this before I had gotten sick. it's like sharp claws in a fuzzy ball like how one would imagine cats being just rapid razorblades. so fast and vicious
and even past that it's like. how do you even trust random aliens in the universe. humans are so shitty so why would they be any better? do they all parrot repeatedly what their authority figures tell them, also? do they manipulate each other? my dogma or eat shit kind of attitude? you do what they want or they try to outsmart you, domineer you?
I talked to the angels and they felt authoritarian. I don't know if that was something telling me that or they really are that way. and the demons trick you. at least I can respect that. maybe I'm just traveling on the wrong stream
met a guy irl and he was like, "nooo, my brother comes to visit us to see us?!". I was so confused. he doesn't use you? he just likes you? and here my last HR from a company, when my boss was abusing me and I conceptualized it as her not liking me, went at me for mentioning that I conceptualized it as her not liking me as if if anybody wants to be liked it should be shameful (I wasn't even saying that I wanted it... it was just fact to me, it was the literal diagnostic problem). she told me it's not about being liked. like it's somehow shameful to want to have a good atmosphere, to have a reason to have a cooperative atmosphere... and I don't actually know if everyone prior to this incident was using me the whole time and I just didn't notice it. since all those relations did eventually fall through for one reason or another -- either I left cuz they wanted to force something too hard, or they left because I refused to do what they wanted or wasn't "as they already wanted"
sigh5 -
Am I in a toxic work environment or not?
1. I suggested implementing some code guidelines for our team so we can all work the same way. Lead architect sends me a DM telling me to stop talking about it until after projectX is done because it might stress out other devs. Friday he talks about how important it is to use standardised tools and ways of doing things.
2. Spent a week working on a bug fix and they said solution is good, but then invalidated all of my work by DM-ing me saying it's unusable because i worked on wrong branch and he quickly fixed it over the weekend and I should just copy his (inefficient) code.
3. I ask him a basic question of what version the backend software is using and he doesn't even respond. I ask another team member who quickly helps me check. it would have taken 1 fucking integer to answer that question. i wanted to learn the backend stack, but not so much anymore.
4. Lead doesn't respond to project management software ticket mentions.
5. Lead randomly makes hotfixes to the QA server without prior notice so the backend randomly goes down at times during work hours and then my local copy of the front end stops working for no reason at all when I am trying to focus on bug fixes
6. UX/UI designer's screen designs look completely different than the actual app, so I spent weeks implementing a feature looking like his nice designs, then having to change it again, taking another week.
7. Generally poor comms
8. Leadership mentioned jobs are safe, then 2 months later retrenched a bunch of people.
9. People getting sick all of the time.
10. Nobody gives a shit about technical debt22 -
- went to the store
- get shot
- call 911
- cops arrive before er
- they're suspicious bc you're black
- ask for your license and registration
- you reach for your pocket to get your driver's license
- "he's reaching!", they say as they mag dump into you
- you die
- your family can't afford funeral while m$ valuation goes from 3 trillion dollars to 4 trillion dollars
- murica!10 -
Yes, send me a screenshot of the logs. Beacause I love having to re-type the error you just got. If only there was a way to copy paste text in Slack!
I did not know I was working with my grandma...11 -
It's so not in the sun here, that my headphones stopped working. I guess I'll just go home again. Also, since I work with li-on batteries at the community service I'm a bit scared for my phone getting hot and stuff. We throw these batteries at eachother for a reason.10
-
Devrant not loading again... hit refresh... still nothing... is today the day it finally snuffs it?
Sigh with relief as the UI starts to load...
And there it is: a lengthy ode to the best pest control service in Hockaloogie, Alabama.
The natural balance of the universe has been restored.2 -
I hate deprecations! Adopted a web project that was actively maintained until 2023, how can it already be so "legacy" that none of its npm scripts work anymore?7
-
Static Types work great with my wife !!!
I ask: "how much it costs?"
She sits down, and starts "well, it depends.."
me: "number"
she: 500.
Amazing! I'll try object/enum style next, see if she can answer 'return {cost: 500, cur: "GBP"}'.
Then I'll try Rust strings for shorter tales of her co-workers :)5 -
Guys what if the temperature never goes down and this is the beginning of the boogaloo?
I will be your king.24 -
Yeah turns out writing a shell is a whole lot more work than I thought
Fuck man, why can't I just find a cool project that is actually doable in a normal lifetime6