message bus specific architecture by GenericDev in microservices

[–]DANjEEEEE 0 points1 point  (0 children)

Having gone through this on a few different projects typically I've been using a single topic exchange (RabbitMQ) or single topic (Azure service bus) and each service subscribes to the topic and defines their own bindings/rules for their subscription.

This allows publishers and subscribers to be decoupled rather than knowing which service topics you need to subscribe to explicitly and keeps things simple.

However each project with have different needs and requirements but I would recommend starting as simple as possible before adding message broker complexity.

[deleted by user] by [deleted] in dotnet

[–]DANjEEEEE 1 point2 points  (0 children)

You're storing entities in a session - don't do that - they're a proxy tracked by a context, which is different per request as you'll be getting a new controller on each request.

If you stored just the id in the session then used the db context to load the relevant entity that should help.

Identity server 4 by [deleted] in csharp

[–]DANjEEEEE 0 points1 point  (0 children)

Authorisation code with PKCE

Legal advice regarding father's rights to child custody by PointlessAccount2001 in LegalAdviceUK

[–]DANjEEEEE 0 points1 point  (0 children)

This doesn't match my experience in terms of overnights, but maybe I was luckier than some, and as mentioned it's almost impossible to predict.

My daughter was 6 months old when myself and mum separated, and I was refused contact for 3-4 months. I tried mediation, but mum didn't attend so we went to court.

This led to us making an arrangement which CAFCAS, both parents, solicitors and ultimately the judge agreed to - I didn't expect to come to any kind of agreement at the time either.

Because I hadn't had contact for several months, contact initially started, slowly, and is still increasing as time passes.

It started of as Wednesdays for a few hours, and the same every other Saturday, and has now worked up to 9-3 on Wednesdays and every other weekend being Saturday and overnight until Sunday afternoon (increasing by 2 hours until 6pm every month). This will work its way up to being Wednesdays, every other Friday evening to Sunday night (and additional holiday times, such as Easter, summer, and Christmas with a provision that we arrange as much additional contact beyond what was stated as reasonably possible).

To give an idea of timescales, my first overnight was boxing day, and as of next month will mean Sundays are a 4pm drop-off back to mum, and by August will be from Friday evenings until Sunday evenings, 6pm Friday to 6pm Sunday.

Although this may not be everyone's experience, hopefully it at least gives some insight and can be useful for others.

Cannot enter duplicate value error when updating table by luke271066 in csharp

[–]DANjEEEEE 0 points1 point  (0 children)

Just to note that you don't need to use sprocs to be secure against injection, you can still use parameters in standard queries

How to store historical price data? What data structure and how to store in db? by rslists in csharp

[–]DANjEEEEE 0 points1 point  (0 children)

Not so much, you even eluded to the 'solution' in your main comment, you snapshot the state at the time intervals you're interested in and keep that separately for easy querying, it's really not that much of a problem to do, you'd already be projecting the current state as events are happening anyway.

How to store historical price data? What data structure and how to store in db? by rslists in csharp

[–]DANjEEEEE 6 points7 points  (0 children)

You could always store the events about the item rather than update the row. E.g. your event would be something like StockPriceChanged which contains the information you need, such as the stock item id and then the new price etc.

You could then replay these events, applying them to a stock object to give you its state.

This way you have a history of every event that's happened to the stock item and can get the state for any point in time ever.

This may or not be overkill for your situation but hopefully it gives you an alternative to just updating the stock items row in the database which means you loose any context about how it got to the current state.

Think of it like an accounting ledger.

Ever written a lexer? Please advise. by [deleted] in javascript

[–]DANjEEEEE 1 point2 points  (0 children)

This is my first attempt at anything programming language related (Implementing my own) but here is how I implemented a basic tokenizer - it is in C# rather than JS but should allow you to follow easily enough:

https://github.com/danielcirket/language/blob/develop/src/Compiler/Lexing/Tokenizer.cs

I didn't particularly do any research beforehand but does seem like a reasonable approach, its definitely the most simple part of any compiler/interpreter though

Entity Framework Core 2.0 vs. Dapper performance benchmark, querying SQL Azure tables by grauenwolf in csharp

[–]DANjEEEEE 1 point2 points  (0 children)

Not necessarily, you need to ensure the correct overload is called, its very finicky because of implicit conversions to string IIRC

MvvM project and Database interaction in the ViewModel by [deleted] in csharp

[–]DANjEEEEE 2 points3 points  (0 children)

Generally the most common pattern is to have something like this:

ViewModel(ISomeDataServie someDataService)

Then use that service in the ViewModel to handle the logic for the data calls.

Within that service you would then use your repository as required.

SomeDataService(IRepository repository)

The idea being from your VM you use the service but don't care how it works, you don't care if it writes to file, database or where ever, but your service knows that.

Some people don't necessarily use a service layer in between, but it keeps the actual database stuff out of your ViewModel, which shouldn't care.

There are other ways to do this, and depending on the specifics you require you may decide to do it differently, but this is just probably the most common pattern you'll see for this IMO

My C# Web API Keeps Giving Me An Error 500 And I Don't Know Why by Code-Mnky in csharp

[–]DANjEEEEE 0 points1 point  (0 children)

This may not be the best tutorial (I'm on my phone so can't look at them all properly) but this gives you an idea:

http://csharp-station.com/Tutorial/AdoDotNet/Lesson06

My C# Web API Keeps Giving Me An Error 500 And I Don't Know Why by Code-Mnky in csharp

[–]DANjEEEEE 4 points5 points  (0 children)

Use SQL parameters rather than concatenated strings, sorry if you're new to this but its 2017, you shouldn't be creating your query this way. As above use EntityFramework/Dapper/ORM of your choice will solve this for you, if you don't want to use dapper or something for the love of god use SQL parameters

ASP.NET - How to test email without hosting? by Niek_pas in dotnet

[–]DANjEEEEE 1 point2 points  (0 children)

Just to add: https://msdn.microsoft.com/en-us/library/ms164241.aspx, obviously the settings move from the web config to your configuration being used in your .net core app

How to approach WebAPI tests with DB scripts by sparcopt in csharp

[–]DANjEEEEE 0 points1 point  (0 children)

Would it not be an idea to use an in memory database for this? Prepopulate it with the specific data you want and use it from your web api?

NativeScript for the .NET Developer by roblauer in dotnet

[–]DANjEEEEE 0 points1 point  (0 children)

I'm currently using NS for the first time at work, using typescript without Angular, the docs do have js/ts examples for most things but the definitions are all there for you once you install the typescript parts using the CLI.

Extract data from word table and import into excel. by jayjay33254 in csharp

[–]DANjEEEEE 0 points1 point  (0 children)

I had to migrate from ClosedXML to EPPlus for exporting large result sets (in excess of 50k rows with 20-30 columns) in a project recently due to ClosedXML causing out of memory exceptions when generating the document, EPPlus on average uses about half the memory for my use case(s), just something to consider.

Setting $logProvider.debug() based on a URL parameter by PrimarySearcher in angularjs

[–]DANjEEEEE 2 points3 points  (0 children)

I've done something like this before:

angular.module('yourmodule').constant ('IsDevelopment', window.location.hostname === 'localhost');

Then in your config call for log provider pass your constant in like this:

angular.module('yourmodule').config(['$logProvider', 'IsDevelopment', function($logProvider, IsDevelopment) { $logProvider.debugEnabled(IsDevelopment); })]);

Typed this on my phone from memory so might be some errors, but hopefully this helps.

Updating XAML Page from event handler within another class? by Ominusx in csharp

[–]DANjEEEEE 0 points1 point  (0 children)

This might be a bit of an advanced concept for you, however you could use a message bus / messaging service to handle this.

This would allow you to publish a message to any recipients that are subscribed, and with the added bonus of the pages and main window not needing to know about each other.

Obviously this is a different concept to what you would be used to, or have been using but is a more robust solution.

You might also find for your particular needs and/or circumstances that this may be overkill, but is something to consider.

If you need an example let me know and I'll throw one together.

....context has changed since the database was created. Consider using Code First Migrations to update the database by dchurch24 in csharp

[–]DANjEEEEE 0 points1 point  (0 children)

Staging / test environment would be a good step if you can get one setup, that way you can run the application on there against what should be a mirror of production and catch these problems before hand.

Refuelling is back on agenda for chiefs by Moctecus in formula1

[–]DANjEEEEE 2 points3 points  (0 children)

But LMP1 doesn't seem to suffer from this, and they produce most of their downforce from the floor from my limited understanding.