« first day (3320 days earlier)      last day (1632 days later) » 

mr5
4:20 AM
Hi
Does any one here have implement Event Sourcing on an actual application?
 
 
1 hour later…
5:49 AM
!~>()=>{var time = DateTime.Now; return time.Date+new TimeSpan(0,23,59,59,999);}
@nyconing ; expected
@nyconing 11/18/2019 11:59:59 PM
 
 
2 hours later…
7:33 AM
are you kidding me?
Did you really integrate a C# interactive console on your bot?
@nyconing <3
 
Does the StackOverflow chat have bot integration or do you have to screen scrape or whatever
 
Cool. Let's do a PC shutdown command.
 
I wrote a slack bot, but slack has bot integration built into the app
(my bot supports eval)
 
Bots here are just user accounts that listen to the chat
I believe there's an API for listening
 
Last time I checked, there wasn't, and it would surprise me a LOT if SO did anything to improve chat
 
7:39 AM
!~>" Yes, this is C# eval....".Trim()
@nyconing Yes, this is C# eval....
 
!~>"We love you Nyconing"
 
@HéctorÁlvarez We love you Nyconing
 
@HéctorÁlvarez thank you
 
@nyconing You're welcomne
c:
not sure if that looks more like a smiley or a magnet
 
7:41 AM
!~magnet or smiley
@nyconing magnet
yeah, its magnet
 
:(
This weekend I had a pleasant surprise, the headphones worked using the rear panel, so I don't need to buy amps or DACs
that's 200€ that can go towards a new phone
because mine is at that point where I no longer enjoy using it
 
you don't have to pay an arm and a leg for a good smartphone these days
unless of course you're after the latest iphone or samsung phone
 
lots of stuttering, camera takes 8 Mississippis to take the screenshot, with trash quality and usually have to take the shot twice due to focus problems
uh
no thx
I was looking for something better than average, but nothing close to bleeding edge tech
heard the Mi 9t pro 256GB can sometimes be found on sale for about 250€
I will get that
 
it has been said that apple and samsung purposefully updates older phones to slow down
fortunately not all companies do this
what do you use now?
 
I believe Motorola does the same
Google didn't when I owned a Nexus
before the uprising of stupidly overexpensive Google phones
that shady period between the pixel and the 200€ phones
 
7:52 AM
that was invaluable when I picked my phone
it's nice to see how two phones compare to get a good idea
I ended up getting a LG G5 some years ago
 
Yes I checked a few comparisons there
Those 3 to be precise
 
mostly because it had very good camera resolution and screen resolution, both which I appreciate, as well as very good specs compared to the then galaxy 8
 
also checked some oneplus
oh yes, that LG was a very strong pick
 
the fingerprint tech is nice
lets you unblock the phone simply by placing your finger
it is also used for certain banking applications to verify your authentication
 
test ufo down?
 
7:57 AM
I have a Moto G5+ at the moment
I prefer it to have the fingerprint reader on the front
but I guess it's OK at the back
 
meh, doesn't really bother me in the back. It becomes second nature after a while
 
Pretty much all phones suck one way or another nowadays.
A good camera in a 200eu phone is very rare, too.
 
if you want to be scientific about it, then you determine three qualities in a phone which are important to you.. camera, speed, resolution, etc. then you rank each phone from 1 to 10 for each priority
then you can compare on your terms
 
my thoughts exactly
 
but I would only do that between like 2 or 3 phones, because it gets tedious for more than that
 
8:00 AM
however it got simpler than that. Xiaomi has their phones on sale very often
 
and yes, price is definitely one of my priorities :)
 
It happens so often that I'd rather wait for a sale
 
I've never had a Xiaomi phone before though
I used to be big into samsung phones until I got my LG
now I realize how much bloatedware they add on samsung phones by comparison
 
good morning
 
o/
 
8:01 AM
My one and only Xiaomi so far is the one my boss gave me as part of my tools.
 
I like my Xiaomi. Especially for its price point, it's a good phone and it's AndroidOne, so no bloat either.
 
good morning Avner
Right that's another selling point
 
samsung does tactile response really well though
I don't miss samsung phones, but I do miss that
 
MiUI isn't the best customization layer to be honest, all the shortcuts are spread out on the main screen whereas Google's version has one drawer with apps and then the main screen where you place what you like.
Not sure how easy would be to install vanilla Android though
 
@HéctorÁlvarez Haven't actually used any MiUI Xiaomi phones, only the Mi A2, which is vanilla android.
 
8:04 AM
Ah well
Anyway it's not one of my concerns
Snapdragon 855 and 256GB internal RAM for as low as 250€...
48MP camera
4000 mAh battery
 
that's crazy to think about. Just a few years ago 32GB was a lot of ram for a smartphone
I suppose they're fitting in SSD's in phones now
 
lol wait
256GB internal memory
not ram xd
 
ah ok :P
 
got confused because it says RAM in the comparison
 
@HéctorÁlvarez Which model is that?
Mine cost ~250EUR about a year ago, with 128GB.
 
8:07 AM
Xiaomi Mi 9T Pro I assume
 
yeah 64 GB of ram
 
It's up for 350€ at the moment, but it's been on discount several times already
 
I hope that by the time my A2 dies, there'll be a good <6" Android One phone out there.
The A2 is 5.99", and it's ok with a narrow bezel, but even then it's occasionally uncomfortable for one handed use.
 
@HéctorÁlvarez ok but how
 
8:14 AM
Good morning!
 
8
A: Where is the chat API page on the api.stackexchange.com site?

reneThere is no formal Chat API and therefor no page and that hasn't changed since the early days All libraries that exist out there are based on reverse engineering the network traffic and master.js Some bits get documented, for example: How do the Stack Exchange WebSockets work? Because of t...

 
GoOoOoOoOoOoOoOoOoOoOoOd Mornin' pleberinos!
 
@AvnerShahar-Kashtan I thought about the same with my phone, bigger screen? Nooo thanks, I mostly use with one hand. But after trying bigger phones the point is that bigger screen = better experience, and if you want to use with 1 hand you can use the shortcut. Doesn't feel so comfortable to shrink the screen though
 
@HéctorÁlvarez My current 5.99 is a bit too big already. You can't have all interaction areas be on the right side of the screen, not all apps work that way.
 
My friend got one of those samsung note phones. He'd put it to his face to make calls and we all made fun of him for doing so. It looked ridiculously huge by comparison
like putting a tablet to your face
 
8:17 AM
@Neil damn, you almost got me again!
 
@Squirrelintraining almost or did? ;)
 
@Neil Phablets are, well, they're explicitly a different form factor.
 
Though honestly I think the large display would be nice to have
It's still got to fit inside a pocket for me
 
My mode on friday is:
Why isn't this shit working and redirecting me to becci always?!

And today I was like "hey cool 6* on a moving meesage let's see what's up with that.. haaaaang on a second"
 
8:18 AM
How do I check if a returned object is an NSubstitute Mock or a real object?
 
Why would you care killerino?
 
@Squirrelkiller In what scenario would you care?
 
@AvnerShahar-Kashtan No, but there's a shortcut that makes your screen smaller. It is shrunk and placed to the side
 
In the scenario where we have an external library doing our DI, since this codebase came before people know how to DI.
So this OurObjectFactory is used by having static ctors in classes that go myService = OurObjectFactory.Instance.Resolve<IMyService>();
Since I wanna unit test these classes, I need to put a Mock as the ObjectFactory, so it returns what I want it to.
At some point, this OurPbjectFactory is *maybe* instantiated.
So in the method I'm adding the ObjectFactoryMock, in order to find out if I need to replace the instance or use it because its mocked already, I have to know if it'
 
8:26 AM
the user of the service should never care if it is a mocked version or not
If you're in the context of performing a test, then you'd only care in preparation of the test, but the actual test should not take such considerations
 
This OurObjectFactory is actually a DI framework container?
 
OurObjectFactory sounds horrible
 
this.land = your.land;
this.land = my.land.from(California.INSTANCE, NewYorkIsland.INSTANCE);
 
ew singletons
 
8:35 AM
@Squirrelkiller Ah, you should have just said "I need to know if an object is a mock because our DI framework is horribly convoluted"
@misha130 static singletons, at that.
 
you have new york in indonesia too
 
sigh, my reference was lost upon you all
 
I've got it!
it only took me 5 minutes of googling
 
I'm using MongoDB to store data. The data exists of an amount, timestamp and user_id.
I would like to "proof" to the "public" that the data stored has not been altered in any way.
How would you approach this?
 
disable updates
 
8:47 AM
@Wietlol is that a feature in MongoDB?
 
iDunno
if it isnt, I suppose I wont be using MongoDB at all then
 
@user10198470 very carefully
 
I feel like that doesn't really do the job, because I could re-enable updates at any time. Even better would be to make it so that it would not even be possible for me to alter the data..
 
@user10198470 You'll have to define things like "altered" here. You want to show that since creating the record, it hasn't been modified?
 
@AvnerShahar-Kashtan Exactly
 
8:49 AM
Aside from telling them that directly, there's not much more you can do. You can do security auditing and other stuff, but eventually it doesn't matter, because your public has no way to verify what you're saying.
 
I mean you can hash the document save the first hash and the compare the data to the hash
but its a huge overkill
 
Mongo is simply a database. It will store what you tell it to store. What you need to do is calculate a hash for the data when it's created (at the application level, not the database level) and store it separately from the data (possibly at a 3rd party). That way, the auditor can take the hash (which you don't control) and compare it to a hash recalculated from the data.
 
However if it's you who wants to make sure it didn't happen, SQL server has something called Temporal Tables, try to find if Mongo has a similar feature.
 
It really depends on what level of legal and regulatory "proof" you need here.
 
nice original idea avner :^)
 
8:51 AM
If you control the database, you can put whatever you want in it. No "proof" will be convincing.
 
@AvnerShahar-Kashtan I like your idea of storing the hash separately from the data at a third party
 
Yeah, would be nice to be able to add data which expires after a time
otherwise you need a database just to know what items will expire and when
 
@HéctorÁlvarez I'll check that out
 
and no, I don't mean like expire within the hour.. if it was supposed to expire after a week, you couldn't just handle it through memory
 
sounds like redis
 
8:53 AM
redis does this?
 
auto deletes and such
 
sounds like that would be a useful feature to have
 
I don't think it would be hard to set the timestamp and run a job periodically that deletes everything that was created earlier than X
 
redis is a beast in general
 
@AvnerShahar-Kashtan that's true but if you calculate a hash and store the hash somewhere, where you won't be able to change it, I feel like that would create "enough" proof
 
8:54 AM
@Neil CosmosDB can add TTL to documents.
 
@HéctorÁlvarez ok, just like it wouldn't be hard to enforce a constraint in the software rather than creating a constraint in the database
but you generally want the database to handle its own data
 
@Neil This is in preparation for the test. The test just uses it.
 
@AvnerShahar-Kashtan that's a nice feature
 
I've already had to create SPs to delete data, which would then be run either manually or within a job. I mean, it's not expensive at all, unless you want to purge every single table every few minutes or something like that
 
@misha130 It's basically the same as Microsoft's ObjectFactory, but in our own namespace.
 
8:56 AM
@Squirrelkiller oh, well in that case, yeah check all you want :P
 
@AvnerShahar-Kashtan This would make most of my questions here sound the same unfortunately.
Template: "Our DI Framework/Authentication process/Server structure/ticket process is horribly convoluted"
 
why did you decide to add a DI framework?
honest question
 
@Squirrelkiller Why do you need to know if your static member is already a mock? Just replace it with a new mock.
Ah, you want to replace the ObjectFactory, not the mocked service.
*sigh*. Static singletons.
 
\o
 
9:06 AM
The issue you're having is with initialization order of static members of the class?
 
static singletons are fine, as long as they are fully abstracted by an interface
 
Gotta mock two services, potetially several. I have a method that does some reflection action and stuffs a new ObjectFactoryMock in there and puts the ServiceMock in the FactoryMock.
When I want to mock the next service, I can't jsut replace the factory.
 
then the same rule applies for calling constructors of specific implementations: you dont directly reference the static singleton (except from DI setup)
 
Morning Hans o/
So I found a way:
The ObjectFactory instance holds an IObjectFactory. So I go `if(instance is ObjectFactory)` and that tells me if it's real.
Because a mock is no ObjectFactory
 
mr5
Hi guys.
Do you have any time to review my 70 liners source code?

It's my attempt to implement [Event Sourcing](https://martinfowler.com/eaaDev/EventSourcing.html), an original idea of Martin Fowler.

Here's the gist link: https://gist.github.com/mr5z/0249cacfa9e8458d436fc950a315c3e8

I'd love to hear your feedback about this approach and my implementation. Thanks!
damn formatting
 
9:14 AM
We do event sourcing in our current and previous apps. I like the idea. It's good for places where you need clear auditability of your entities at any given point in time.
I wouldn't have the concept of event sourcing exposed to the controller layer. It should be entirely abstracted.
 
mr5
Currently, the events are only stored in memory since I have no idea yet what to do with those if I persist it
 
We store them in a CosmosDB database. Also, we have the concept of an Aggregate, which is an entity computed from a sequence of events.
 
mr5
@AvnerShahar-Kashtan well, I thought it's one way to minimize the logic and dependencies.
 
@mr5 I don't like minimizing logic, I like compartmentalizing logic.
 
I am pretty used to event sourcing
but that is mostly an effect of having everything immutable
 
mr5
9:16 AM
@AvnerShahar-Kashtan what you mean by compartmentalize?
 
is this cqrs lite?
 
not something I particularly chose for to have
 
My PotatoController, for instance, still has GetPotato(int id) and AddPotato(Potato p) methods. And it still goes to the PotatoRepository (or whatever) to get and update the data. The controller doesn't care how data is stored.
 
mr5
@Wietlol how has this something to do with immutability?
 
@mr5 if you want an immutable database, you dont update records
so... you need to insert new records that would overrule the old records
 
9:18 AM
But my PotatoEventRepository is implemented differently. AddPotato won't create a new row in my Potato table, it will create a PotatoCreatedEvent and store it in my events table. Likewise, an edit operation won't modify a row, it will store a PotatoUpdatedEvent.
And, of course, the final PotatoEatenEvent.
 
mr5
@AvnerShahar-Kashtan that's what the service is for. We do all those logic in service. Each service can or cannot have caching service.
 
usually, you do this by some "since" moment to specify which version came after the others
that way, you have the history of all changes
without updates
 
Now, a GetPotato(int id) call in the repository doesn't have a row to read, and it doesn't listen to new events (because they may have occured when it was down). It will simply read all events related to potato X, sequentially, and create a PotatoDTO iteratively, then return that.
 
@AvnerShahar-Kashtan You could 100% do something like mediator.dispatch(new CreatePotato(potato));
 
You can have a listener listening to events as they happen and updating an in-memory entity, but that's an optimization.
 
9:20 AM
and forgot about directly referencing the rep
 
@misha130 What we actually have is a concept of Commands - a CreatePotatoCommand encapsulates the logic (e.g. checking there's no existing potato, validating fields, etc), and then the command handler creates the relevant events.
The events are stored, and they stay there forever. That's an important part of event sourcing. The event store is append-only. You don't update, you don't delete.
 
well your rep sounds more like a mediator
 
@AvnerShahar-Kashtan found something interesting regarding storing that hash on a third party: tierion.com/chainpoint.
 
in KCG, 9 hours ago, by OakBot
If you think nobody cares if you're alive, try missing a couple of car payments. -- Earl Wilson (source)
lol
 
@misha130 In this case, yes. But as far as the controller cares, it's a repository. It can be switched for a classic entity storage repository seamlessly.
 
9:27 AM
hm yes that switch is a good advantage
 
@user10198470 Interestingly enough, this sort of distributed validation is one of the places where "blockchain" might actually be relevant, and not a marketing buzzword.
 
@AvnerShahar-Kashtan that's what I thought too
Another similar one for the EOS blockchain I found also seems interesting: npmjs.com/package/tamperproof
But I don't really understand what's in it for tierion.com (for providing that API)?
Neither for tamperproof
 
what's in it for linux?
 
@user10198470 What do you mean, "what's in it for them?" Tamperproof, at least, is simply a software library that can let you, the data processor, provide your clients with tools to validate that their data, that you hold, hasn't been tampered with.
It's a tool, not a service.
As for Tierion, it looks like simply a standard created by a couple of guys for building similar proof/trust chains. What's in it for them? I'm guessing that their goal is A) pushing the standard they devised as an industry standard, B) possibly licensing it? C) Working as consultants in the financial/data trust/proof industry, D) Profit.
 
@AvnerShahar-Kashtan I see, thanks so much for the help and for pointing me in the right direction
 
9:36 AM
No problem. Just don't forget that I was just shooting off random ideas. You can go on security.stackexchange.com and search there, or ask a question. You'll probably find people there with more expertise and experience in exactly these scenarios.
 
Im doing a terrible today
as cpt squirrel would say
im so sick :(
 
The cooling system broke on Friday and it hasn't been fixed yet. It's feeding cold air, so it was shut down because we're down in temps
Apparently nobody thought about warning anyone
 
oh great
 
Speaking of warning people, I read some reviews about Death Stranding... Mind you I haven't played the game, but the idea I had about it was bad already, it seems like it's a really poor game.
 
ahoy mateys o/
 
9:47 AM
Bad plot, boring gameplay, all you do is move from A to B and leave stuff for other people to pick up, and the goal of the game is try just walk in a straight line
 
Media rating?
 
I've read quite a few reviews and opinions of Death Stranding. Many dislike it. Quite a few love it. Those that hate it, I think, mostly want it to be a different game. Those that like it say they liked it once they realized that they liked it as a zen-like world-exploration game, not a mission-focused action game.
It's certainly a polarizing game, which is not a bad thing. Games shouldn't be afraid to be different, even if it means their appeal is more limited. And in this case, it's a respected veteran designer who can get away with doing something different.
 

« first day (3320 days earlier)      last day (1632 days later) »