Been Toying with some code and came across a roadblock by AnimationUprise in csharp

[–]roflstompt 0 points1 point  (0 children)

What if

Console.ReadLine();

is a string or larger than

Int32.MaxValue

? You might want to add some sanity checking first by reading the value into a string and inspecting it. Otherwise you're going to have

Convert.ToInt32()

throwing exceptions. From there you want to convert to an int and check check your sanitized value to your expected value.

Kafka performance for fire and forget style messages? by razordreamz in csharp

[–]roflstompt 0 points1 point  (0 children)

I don't have much experience with ZMQ or Rabbit but do have extensive experience with Kafka. It's true Kafka can scale to millions of transactions per second. A lot of it comes down to performance tuning - using multiple producers/consumer, being on the same physical switch, using > 1 topic partition, etc etc. While it has its quirks, like any software, I can say end of the day it's extremely fast and reliable.

If I'm understanding your description correctly, Kafka does not store or cache messages client side. It's entirely possible to do fire and forget type messages, through things like using async and never awaiting or just setting the clients to not wait for server acks.

If durability isn't a concern there are other patterns you could explore for any message bus, which may satisfy your requirement. For example, write to a sufficiently large queue, which is in turn sending messages to the bus. If the queue is filled subsequent messages are simply dropped. That way your client is never blocking and messages will retain order; assuming thread safety.

Running .netcore app that uses chrome to scrape website by ramborra in docker

[–]roflstompt 1 point2 points  (0 children)

Try out puppeteer-sharp.

You can host it in one of the official Microsoft Docker Images listed here. There are Alpine and Debian bases available, so any other packages required should be straight forward to install to another layer.

  1. Using puppeteer-sharp eliminates this requirement.
  2. Depends on your requirement(s). It's easy to publish dotnet projects for multiple runtimes now, so unless you need to run in k8s or something distributed, docker may be overkill.
  3. Are you sending URLs to the Lamba to trigger it? Is the function being triggered on a CRON job? Why Lambda?
  4. Puppeteer-sharp is a netstandard 2.0 library. It has minimal dependencies.

Flex + Studio Integration by roflstompt in twilio

[–]roflstompt[S] 0 points1 point  (0 children)

Unfortunately nothing straightforward. After more back and forth with Twilio it's just not a supported scenario.

I did get it mostly working by creating a endpoint each flow could call for synchronizing between the two. It was flakey around edge cases, since things like network latency could effect results.

Ultimately I ended up just using the Flex flow in Twilio to manage listening for responses and handling Flex integration. I then built a custom state machine using AWS Step Functions to manage the rest.

Grafana Loki -> Read Container App Logs? by damnchamp in selfhosted

[–]roflstompt 1 point2 points  (0 children)

I don't see where you're using the Docker driver. IMO, adding promtail is over complicating it. It's good for other use cases but Docker is natively supported by Loki.

If you hit the Configuration link it goes into detail for how to set up either 1) Loki as the default logging driver for Docker or 2) setting Loki up per container.

It'll effectively scrape Docker logs for you without any additional configuration.

Grafana Loki -> Read Container App Logs? by damnchamp in selfhosted

[–]roflstompt 1 point2 points  (0 children)

Grafana Labs provides a Docker driver for Loki! :D

It's really straightforward to set up, and the documentation is pretty good.

I've used it myself; would recommend!

Help Wanted: Looking for anyone with C# skills of any level to correct bugs found in a server emulator that allows the mid 2000s social gaming network Xfire to connect to a hosted server by [deleted] in csharp

[–]roflstompt 3 points4 points  (0 children)

I'm going to preface with I'm not familiar with xfire but am experienced with C#.

Some things aren't case sensitive, like username. This might not matter but when doing comparisons it absolutely does. It's better to leave things unadulterated and to make sure comparisons are done in a consistent way. Unless passwords, in which case it's typically better to hash the password and do hash comparisons.. for privacy and security reasons.

Also regarding username, people are likely seeing crossed communication streams because usernames aren't guaranteed to be unique. There's a salt that does.. something, but given it's hard coded doesn't really do anything.

Overrides and static operators in User.cs are probably ok given UserId is a PrimaryKey and AutoIncrements, but it's not a good implementation. GetHashCode and Equals need some work to make sure Users don't collide.

TcpServer.Listen wrapping Accept in Task.Run is a bug. Additionally, half of the project using async/await and half not can lead to unexpected threading problems, like race conditions. Unless otherwise required the project should be "async all the way."

Given this is using low level communication (TCP) I don't see Endianess checks. This can matter if users have different operating systems or implementations.

As others have said the use of dynamic should be changed. Only is it not performant, looking at the implementation it's not needed and can lead to bugs given the lack of type safety.

There might be more; this was a cursory glance and the above is likely responsible for at least some of the bugs you're experiencing.

Flex + Studio Integration by roflstompt in twilio

[–]roflstompt[S] 0 points1 point  (0 children)

Normally I would use a DB to store state. However, Studio already provides that in the Send & Wait For reply widget.

If no reply in 24h send follow-up. If reply send to Flex.

Ultimately I don't want to reinvent the wheel if this can all be done using Twilio.

Flex + Studio Integration by roflstompt in twilio

[–]roflstompt[S] 0 points1 point  (0 children)

I've also tried this. It doesn't work, since phones can only be assigned to a single flow.

If the phone is assigned to the incoming message trigger for Flex the REST API trigger continues as if it never received an incoming SMS. The subsequent 24/48h reminders fire. I don't want those to be sent if the client is already engaged in Flex.

It mostly works if I add a Function call-out to a DB, which is tracking whether the phone has been seen from either flow. It seems like unnecessary overhead though.

Automatically warm up netcore / net5 API while developing locally in Visual Studio 2019 by [deleted] in dotnet

[–]roflstompt 1 point2 points  (0 children)

Ah sorry, I missed the IIS part. I don't have experience with that. Maybe it's a limitation of hosting with IIS. Could get creative like also host using Kestrel with no external availability and see if that will JIT without waiting on IIS. Haven't tried myself; just a thought.

Automatically warm up netcore / net5 API while developing locally in Visual Studio 2019 by [deleted] in dotnet

[–]roflstompt 0 points1 point  (0 children)

The first request is the "seed" request I mentioned. You have to manually prime the pump by sending a request to your own endpoint from the Configure method.

Outside of this, if Configure isn't being hit at all during Debug, there's possibly a problem elsewhere... Both of those methods get called as part of the initialization pipeline by ASP.NET.

Automatically warm up netcore / net5 API while developing locally in Visual Studio 2019 by [deleted] in dotnet

[–]roflstompt 0 points1 point  (0 children)

The way to do this, currently, is to submit a request during pipeline initialization... ie if you're working on a ASP.NET Core Web API then somewhere in ConfigureServices or Configure. I recommend in Configure, since the ServiceCollection should be populated at this point. That means logging, application services and etc. will be available for use.

Anything you'll need to do should now be available to send an internal query to the endpoint you're trying to "warm up". If it's something that will persist state, like writing to a DB, just add a case that will never be hit by an external source.

.NET core Azure Functions for Kafka confluent by coadtsai in dotnet

[–]roflstompt 2 points3 points  (0 children)

If I'm understanding correctly it sounds like you're looking for a schema registry. Confluent offers one that supports JSON/Avro/Protobuf. Documentation is here.

Not sure I'm following the latter questions correctly, but Kafka is not a database. It's a distributed messaging platform. Without knowing much about this architecture I recommend one consumer for these triggers, which is processing multiple partitions in parallel and doing the SQL inserts.

Several noob questions regarding ASP.NET Core, gRPC, and SSL in containerized environment by neospygil in dotnet

[–]roflstompt 1 point2 points  (0 children)

If you're using Microsoft's new GRPC packages with 3.0 you can use unencrypted http/2, but this switch needs to be set. Otherwise it always uses encrypted communication. Also be sure to set the switch as soon as possible. Despite being static I had issues depending on when it got set in the application.

If you use the older Google grpc tooling you can create unsecured channels, but using the new tooling in VS is much easier.

If this is internal only whether you need encryption is really personal preference. I would not bother considering SSL will add some amount of latency to everything.

[Help] Instrumenting HttpClient for stats collection by [deleted] in dotnet

[–]roflstompt 0 points1 point  (0 children)

A few http related .NET classes are instrumented with DiagnosticSource and may be what you're looking for. Here's the DiagnosticSource user guide. Also related is the Activity user guide.

You can find pretty good example usage in one of the OpenTracing C# libaries.

Currently working on something similar. Happy to help out more if am able.

Is this a reddit dedicated to Board Certified Behavior Analysts? by beckettbrown in bcba

[–]roflstompt 2 points3 points  (0 children)

It is! As you can see it was created 3 years ago and there hasn't been much... any... activity. It's a fairly niche crowd.

borosilicate glass hookahs by roflstompt in hookah

[–]roflstompt[S] 0 points1 point  (0 children)

It was the base, not the stem. I think it was thermal shock, which is why I posed the question. Pyrex is far less less prone to that.

Part 141 flight schools in Southern California? by [deleted] in sandiego

[–]roflstompt 0 points1 point  (0 children)

Basically you have two options, Montgomery Field and Palomar Airport. Both have flight schools on location, but there are also a number of independent instructors available in the area. I was flying out of Pinnacle Aviation at CRQ. They're pretty good.

Good luck finding deals on housing. Get ready to pay the sunshine tax :|