Details
-
AboutI write code and a science-friction story about code, where magic is programmable and upholds the rules of thermodynamics in a fantasy universe.
-
SkillsC++, JavaScript, TypeScript, and I refuse to add PHP to this list.
-
LocationAlexandria, Egypt
-
Website
-
Github
Joined devRant on 9/14/2018
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
-
@dUcKtYpEd it gets worse when you know that this project has geospatial queries. ORMs won’t make much of a difference in this case. I’m not aware of many ORMs that play nice with geospatial data/queries/types without 3rd party/black magic tinkering.
-
@HollowKitty don’t try to make sense of it. It really makes absolutely no sense from a developer’s standpoint. 🤷♂️
-
@Stuxnet Nah, I use SO all the time myself. Not all problems are obvious, and it saves a lot of time when fixing obscure bugs, and I can see the value in that.
The only thing I really dislike is when someone copies some code from SO into their project blindly out of laziness then starts complaining about it. I mean, how hard is it to write some JS to split strings in a specific way? (surprisingly common case) -
@Stuxnet Friends and co-workers teasing one another?
-
@illegaldisease *With* all due respect, sir. I demand a lawyer.
-
Sometimes, the simplest low-tech solution to a tech-related problem is the best choice.
I remember a story some guy told me about his server room. He toiled for 3 days on end looking through networking code while trying to figure out the source of packet loss in his network. Only for a janitor to come along, notice the real issue, and solve the problem by socketing a CAT5 cable that was slightly out of position.
Most tech-minded people look for the technical solution to a problem, whilst in truth, a more direct mechanical/physical approach could be more efficient at solving the problem.
Glad you managed to help her in the end. -
@DLMousey thanks man!
Recruiters run algorithms on github profiles that rank and select the best from their target demographic. Then they research those candidates before reaching out to them with emails.
It’s not a %100 automated process in most cases, and I’m speaking from experience obtained through a correspondence with one. -
@amahlaka well, yeah. I couldn’t enter my password and login from desktop or mobile at the time anymore, then I remembered I had logged in via mobile chrome on iOS in the past, and luckily I was still signed in.
Looks like they don’t flush out your old sessions after locking you out like this.
It’s not even a normal ban, I believe. Whenever I try to login it says my password is incorrect and lets me reset it, but then when I try the newly set password it gives the same message all over again.
It was kinda vexing when they acquired Souq.com (our equivalent of Amazon in the Middle East), because they migrated it to their authentication system, and I can no longer use that site too. -
@vane That would have been epic justice.
-
@vane I didn’t think it would be worth it at the time. I was looking for an alternative cloud hosting solution for the startup I was co-founding because amazon locked my account. 😂
-
Now add a desk fan to this setup to complete the ensemble!
-
@RememberMe Nah, typescript is pretty good with type inference, the problem is that decorators can't provide any contextual type information. So to use such a decorator you have to declare the method/lambda signature to the fullest (even unused arguments)
I prefer TypeScript for prototyping ideas, but my main language for development is C++. So I completely understand where you're coming from.
TS generics are somewhat similar to templates in C++, although the syntax is not as flexible as modern C++17.
Sigh, Microsoft needs to fix this soon. Sadly I can't complain because decorators are an "experimental" right now, despite wide use in production code. -
@xewl Very odd. It sometimes works and sometimes doesn't?
The only possible explanation is if they're using a service like CouldFlare and the service is buggy.
I got no response on Twitter from either GitHub or Microsoft either, and that silence makes me question what's going on... -
@muliyul there are some basic recombination tests in this file: https://github.com/voodooattack/...
I’m going to go to bed now but I‘ll try to implement something more practical with recombination in the morning when I wake up.
I’ll mention you here when it’s done. -
@gitpush As requested, here's the fully working implementation's repo: https://github.com/voodooattack/...
It's on NPM and GitHub. -
@C0D4 Looks like it's only happening on the www subdomain!
Edit: they just fixed it I think. -
@muliyul @gitpush Here's a working practical example of moderate complexity: https://gist.github.com/voodooattac...
I'm all done with the first alpha reference implementation. I'm writing a godly amount of docs and examples right now. I'll upload it soon! -
@muliyul This can be used to implement anything that can be implemented by using a state machine.
It makes writing state machines *simpler*, which is very good news to any agent-based system that makes use of abstract logic trees for decision making. I'm just considering how to add activation inhibitors (like a way to turn off certain behaviours in some cases or make them mutually exclusive to better represent how real DNA works)
Edit: I have the reference implementation fully working with full test coverage. I might just publish what I already have as an alpha for people to look at in the meantime. -
@Fenix Not exactly, from what I understood. Event sourcing is a way to store events describing an object's state in a database and evaluate the final state of said object by going through those records when it's need. Which I find very cool!
But this is more like memory mapped-I/O, where your program has to keep polling a specific address in memory inside a tight loop to get the most recent mouse coordinates and button states, and react based on that new information:
when(state => state.mouse.coordintates.withinBoundingBox(state.ui.button) && state.mouse.buttons.left) { ... mouse is hovering and is the button is pressed ... }
Let's say this pattern would make low-level programming much easier. (but won't be fully discrete if used in such a manner) -
@muliyul It's radically different from Redux in that states are constantly mutated from one tick to the next, and not by dispatching actions through action creators!
There's also a discrete time system and a state history that's easy to access and rewind through.
This is pattern is more suitable for real-time applications that run a fast/tight loop and state machines that you can interleave and step through one tick every cycle.
The recombination feature would also make it good for developing AI agents that can acquire new behaviour dynamically. Because it's completely feasible to add the capability of self-modification during run-time and allowing the code to add and delete actions or to replace the conditions on them. -
@aritzh That's a good point. There's also 'event-driven programming' as an existing concept which I think might be confusing.
How about a new name then? How does 'recombinant logic programming' sound to you?
I'd like any suggestions on this before I publish the reference implementation. (almost at 100% coverage now, still writing more tests) -
@gitpush I'm already working on an npm package, this is just a copy for the curious.
I will publish it as soon as I have enough features and the documentation/test coverage is good enough.
Edit: Just so you know my reasoning for publishing early, I was so excited I couldn't stay silent about it. :D -
@gitpush Indeed!! I'm feeling super excited right now.
Btw, I just implemented the "side-effect" mechanism here https://gist.github.com/voodooattac...
This now rewinds and mutates the past state at the same time:
```
@when(state => state.value >= 5) // this will only execute when `value` is >= 5
exitWhenDone(s: State, m: TestMachine) {
console.log(`finished on tick #${m.history.tick}, exiting`, s);
if (m.history.tick === 5 && s.cycle < 10) { // rewind the program 10 times
m.history.rewind(5, { cycle: s.cycle + 1 } ); // rewind the state machine with a side-effect
}
if (s.cycle >= 10)
m.exit(); // exit the state machine
}
```
PS: I wish this site had markdown support. :( -
@gitpush Every time you return an object from an action you return a partial state that mutates the current state. So you only need to update what you require.
Once you rewind, your program will naturally reach a new, but potentially different "present" again, but I can see some crazy applications for an inline evaluation technique (look ahead) like you're describing! You give a state and request the nested evaluation of the output while inside the "past" state. I can see how that would work.
Especially because `EventMachine.exit(...)` accepts a final state object (optional) that can be returned in that case. -
@gitpush Rewinding is for scenarios where you wish to restore an earlier state of the state machine. Here are some possible applications of rewinding:
1. Your machine has entered a bad state: you can gracefully recover from such a situation by rewinding to a previous good state. (I'm considering adding a mechanism to pass along information from future states to past ones about what happened)
2. Your program is traversing a tree: you rewind to the last branch once you reach a leaf node (but that'd also require the rewinding mechanism proposed in #1)
3. Graph traversal in general, etc.
I can't think of anything else right now, but someone can probably think of some other interesting applications they give it some thought! -
@gitpush If your state can be serialised to JSON (no class instances for example) then yes. You can pass the saved JSON state to the EventMachine constructor.
-
@gitpush You're welcome. And yes, history is an array that keeps track of the state with every tick.
The spec allows your program to rewind in time, and you can set a limit on the number of states to keep. (and discard older states in the process)
You can also disable history tracking and this rewinding feature completely by passing 0 to `history.limit`. -
Seems the screenshot was not attached. Here it is!
-
@vane Oh no, we're too late.
-
@7400 Interesting. I don't keep up with new languages as I should. Maybe I should look beyond my comfort zone of C++/TS every once in a while.
Are any of them being widely used though?