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
Search - "readonly"
-
<This is my first rant, though I've been spectating in readonly mode (ie, without an account) for a while now./>
*Programs all day Saturday adding innumerable lines of code to a new project*
*Builds and runs project*
*Everything not only compiles, but the app works flawlessly*
*Faints*5 -
Didn't sleep well.. now i'm constantly phasing out in front of my editor.
I just looked 5 mins straight at the word "readonly" until I came back to life and completely lost track of what I was doing.
Going to sleep a bit now..:D -
Staring at computer trying to figure out why I can't read a float from modbus. I swapped the bytes correctly for my platform. I also ensured the endianess of the words matched my platform (byte endianess is not the sames as word endianess, fml). Was driving home thinking about what could be wrong. My mind saw this code:
uint32_t newint;
for(int count=0; count<2; count++){
newint |= words[count] << count;
}
Then I am fuck! It should be:
newint |= words[count] << (count*16);
This was later turned into float. I kept getting values in the 1e-40 or some shit. Now it makes sense. The upper word was not set.
This is such newb shit. Fuck you newb shit I should just know!
Reading more I realized that the endianess of words can vary between devices even though the spec calls for big endian words. Fuck you non-compliant vendors! So I gotta add a flag for fucked up devices. Fine. The pay off is a generic way to add modbus to our opcua server. I want this easily editable in the field. For now it is readonly. So that makes it nicer.
Just a little torqued that I solved this driving home instead of at work. Too close to the code. I think tomorrow I will have my boss review it to tell me of other logical crap I missed.3 -
Soooo.... I'm back after 8 years 😅 Is DevRant still alive? I tried to log in, but I had some problems and I thought "now it's in readonly mode", but finally I'm logged in... and this is my first (1) rant!2
-
Completely fucked up replication of MySQL servers.
Remote: 2 different database Servers
--> made sense.
Except the misconfiguration. Or better: No configuration at all.
So how to solve the massiv delays and make everything even more crazy?
2 remote servers - 2 readonly slaves for reading data remote (master - slave)
2 local (internal) servers.
Remote - Local Master Master.
Unfucking this cluster fuck was a real nightmare.
It had to be done at night, cause everything needed to be ripped apart.
And the servers were the backend of a warehouse with supply chain and multiple selling channels (Amazon, eBay etcetera).
So. It had to run the next day at 05.00 clock so the incoming orders could be packaged / prepared for shipping.
That was fun. Not.
And the clusterfuck died spectaculously on my first work day - the old DBA was gone (fired....)
:) -
Docker compose switches users but doesn't update the home directory. Both switching users and not touching envvars are very sensible default behavior, but the result is that the running service has no write access to $HOME - and many programs don't provide sensible error messages for this rather unlikely scenario.2
-
Immutability is nice and all, but there are languages and tasks where it really doesn't work as well as it should.
-
@retoor I did it I FUCKING DID IT. I CRACKED THE COWDZ.
HAVEN'T SLEPT IN ALMOST THREE DAYS.
BUT I FED THIS TO A LOBOTOMIZED BOTII.
IT WAS ABLE TO RUN MY RULESET.
WELL, A VERY LIMITED VERSION.
BUT STILL.
PRO VIBES-ORIENTED PROGRAMMING.
IN MARKDOWN.
PSEUDOMARKDOWN.
what?
WHAT??!!!!
OH YEAH.
BEHOOOOOLLLD THE POWER OF CRACK:
```
# Definition of Basic Terms:
- Actor;
· * "An Actor is a character or entity actively or passively participating in the game";
- Action:
· * "An Action is whatever an Actor does during their turn";
· * **IMPORTANT: "In addition to taking an Action during their own turn, an Actor can opt to prepare a Re-Action to activate during another Actor's turn, *if* they have enough SP/MP to do so"**;
- Signa:
· * "A Signa is an in-game effect that describes an Actor's Actions and Re-Actions";
· * "In-game effects can only alter values within the Actor->Status dict";
· * Signa->Caster = the Actor that activated the Signa;
· * Signa->Target = the Actor that is affected by the Signa;
· * **IMPORTANT: "A Signa can be cast 'OnSelf', that is, the Caster can choose to cause the effect on themselves"**;
---
# Actor Attributes:
- Actor->ReadOnly:
· * **IMPORTANT: "ReadOnly attributes represent an Actor's natural advantages and cannot be changed through in-game effects"**;
· * **IMPORTANT: "The purpose of these immutable attributes is determining the base values for game formulas"**;
· * "Actor->ReadOnly is a (key=>value) dict that stores the Actor's innate and immutable attributes";
· * **IMPORTANT: "These bonuses are fixed and cannot be altered by in-game effects"**;
· * "Each key corresponds to a specific game formula";
· * "Each value is a constant signed integer that represents a modifier for the associated formula";
- Actor->Grit:
· * Actor->ReadOnly->{"HP->Max"} = 8+(Actor->Grit*2);
· * "Actor->HP->Regen is not affected by Grit";
· * Actor->ReadOnly->{"Strength"} = Actor->Grit*1;
· * Actor->ReadOnly->{"Resist"} = Actor->Grit*1;
- Actor->Wit:
· * Actor->ReadOnly->{"MP->Max"} = 4+(Actor->Wit*2);
· * "Actor->MP->Regen is not affected by Wit";
· * Actor->ReadOnly->{"Intelligence"} = Actor->Wit*1;
· * Actor->ReadOnly->{"Dexterity"} = Actor->Wit*1;
- Actor->Charm:
· * Actor->ReadOnly->{"SP->Max"} = 1+(Actor->Charm*1);
· * Actor->ReadOnly->{"Perception"} = Actor->Charm*2;
· * Actor->ReadOnly->{"Charisma"} = Actor->Charm*2;
- Actor->Spirit:
· * Actor->ReadOnly->{"Arcana"} = Actor->Spirit*2;
- Actor->Faith:
· * Actor->ReadOnly->{"Defend"} = Actor->Faith*1;
· * Actor->ReadOnly->{"Heal"} = Actor->Faith*1;
· * Actor->ReadOnly->{"Bless"} = Actor->Faith*1;
- Actor->Hatred:
· * Actor->ReadOnly->{"Damage"} = Actor->Hatred*1;
· * Actor->ReadOnly->{"Curse"} = Actor->Hatred*1;
---
# Diceroll Definition:
- rand:
· * "A pseudo-random number between 0 and 0.99";
- roll->dX:
· * roll->dX = truncate (rand*X);
---
# Basic Formulas:
- Actor->Status:
· * "Actor->Status is a (key=>value) dict that stores the Actor's current status effects";
· * "These bonuses are temporary and can be altered by in-game effects";
· * "Each key corresponds to a specific game formula";
· * "Each value is a signed integer that represents a modifier for the associated formula";
- Actor->Damage:
· * let base = roll->d4;
· * let X = Actor->ReadOnly->{"Damage"};
· * let Y = Actor->Status->{"Damage"};
· * Actor->Damage = base+(X+Y);
· * "Result can be negative if (X+Y) is less than -base";
---
# Regeneration Rates:
- Actor->HP->Regen:
· * const base = 0;
· * let X = Actor->Status->{"HP->Regen"};
· * Actor->HP->Regen = base+X;
· * "Result can be negative if X is less than 0";
- Actor->MP->Regen:
· * const base = 1;
· * let X = Actor->Status->{"MP->Regen"};
· * Actor->MP->Regen = base+X;
· * "Result can be negative if X is less than -1";
- Actor->SP->Regen:
· * let base = Actor->Status->{"SP->Max"};
· * let X = Actor->Status->{"SP->Regen"};
· * Actor->SP->Regen = base+X;
· * "Result can be negative if X is less than -base";
---
# Default Signas:
- Movement (Signa):
· * Movement->Cost->SP = 1;
· * Movement->Cost->MP = 0;
· * Movement->Duration = 1 turn;
· * Movement->AreaOfEffect = 4 tiles;
· * "Allows the Caster to move the target up to 4 tiles distance";
· * **IMPORTANT: "This Signa does not allow the Caster to avoid obstacles"**;
- Attack (Signa):
· * Attack->Cost->SP = 1;
· * Attack->Cost->MP = 0;
· * Attack->Duration = 1 turn;
· * Attack->AreaOfEffect = 1 tile;
· * let dst = Attack->Target;
· * let src = Attack->Caster;
· * dst->HP->Current -= src->Damage;
· * **IMPORTANT: "This Signa never misses"**;
```14 -
I have a readonly object property foo on a typescript class. When I create an instance bar by calling the constructor, bar.foo doesn't compare equal to this.foo as seen from within bar several async calls later. What could I have possibly fucked up?4
-
Wasted over two hours today on a stupid bug: for some reason, every event was handled two times on my local machine.
Why? Because although all services are readonly after instantiation, the EventDispatcher isn't: it is modified when registering event handlers. Meaning the very same instance of the actual EventSubscriber was reused for the async- and sync event dispatcher. Which are just simple wrappers for primary and secondary use cases, but use the _same_ instance of the actual EventSubscriber in my dev-environment as I now know.
Thankfully a shallow clone did the trick. Of course it would be possible to simply create a new instance, but this is one of the few services which are autoconfigured by the framework.
Don't know what to make of this to be honest. "Play stupid games, win stupid prizes!" I guess...