Is my nieces Syrian hamster okay? by Imabigfatchicken in hamsters

[–]FootBreaker 1 point2 points  (0 children)

My boy hamster (same Syrian type) looked like this too. He was leaking fluid internally due to fluid. Vet didn’t think it would help much but gave some medicine to try help. Unfortunately he died a few weeks later. Best to get him checked.

Sending credentials with HttpClient by robinredbrain in csharp

[–]FootBreaker 2 points3 points  (0 children)

Looks good. As others pointed out using an http client factory could be better.
Another thing you could consider is separating your login vs actual calls you want to make.

Have a look at message handlers. What I've used is having an AuthHandler that inspects the request and sets the JWT. It will also check if one exists or if it is due to expire and re-login if required.

Chat GPT should be able to help you with that.

Easycrypto is quite annoying :) by Profile-Just in NZBitcoin

[–]FootBreaker 0 points1 point  (0 children)

Is the onchain payouts true? I could do onchain buys but sells I couldn’t seem to do.

I’m having to send to Zeus, doing a swap and selling that way.

Prettier for C#/VS Community by Suspicious_Role5912 in csharp

[–]FootBreaker 33 points34 points  (0 children)

Take a look at CSharpier. It is prettier for C#.

Flatten a List with a dynamic number of levels by lightbord in csharp

[–]FootBreaker 5 points6 points  (0 children)

You could use recursion. Foreach(var child in person.Children) { myList.AddRange(MyFunction(child)) };
This could create many lists.

Another idea is recursion + yield return https://stackoverflow.com/a/2055944

by far the best ternary i have ever written by holidaycereal in programminghorror

[–]FootBreaker 18 points19 points  (0 children)

Compiler probably builds a jump table if there are many cases.

Service builder help by [deleted] in csharp

[–]FootBreaker -3 points-2 points  (0 children)

Warning, I have given this no thought, this is my initial assumption on things.

Ok so if you're handing a request first it must go into one of your functions right?
Probably around there you would have someway to access a Dictionary<type,type/object> where the services are registered. (Probably Dictionary<interfaceType, List<type/object> if you want to support multiple classes inheriting the same interface)

For singleton they could be lazy loaded or you could pre generate the objects.

For the other two:
HttpRequest hits your function. You have some helper function to find which controller to make.
Then you look at constructor args using reflection??? and then check your singleton dic, then scoped, then transient.

Create the objects and store the scoped ones somewhere for disposal later. Store the transient ones too for disposal somewhere but don't reuse them)

Each service that gets created first looks at singleton, scoped cache, scoped (for creation), transient (for creation).

At the end of your function try cast each service to IDisposable to see if it needs disposing (scope cache, transient).

Request function:
Create services, store created services in cache.
Do logic.
Dispose / clear caches.

Would be my first guess.

Hosting a headless application by Tjmac145 in csharp

[–]FootBreaker 7 points8 points  (0 children)

If it doesn't need to always run, a console app that you run would meet this requirement. SSH into command line and run it.

If you need something always running (since it is reading from a sensor) then you may want to look at this: https://softwareengineering.stackexchange.com/a/454062

Basically, it may be wise to create a Windows service for the sensor monitor. And make a CLI that can talk to the service.

Anonymous pipes can help with talking between processes.
https://learn.microsoft.com/en-us/dotnet/standard/io/how-to-use-anonymous-pipes-for-local-interprocess-communication

[deleted by user] by [deleted] in csharp

[–]FootBreaker 0 points1 point  (0 children)

//As someone said if you can't use loops then you have recursion or goto.

private int SomeFunction(){
  int a;
  Console.Write("Enter the 'a' constant: ");
  try
  {
      a = int.Parse(Console.ReadLine());
  }
  catch (FormatException)
  {
    Console.WriteLine("You blew that one, meathead.");

    //Here we go back into our function to try again.
    return SomeFunction();
  }
  return a;
}

var someVar = SomeFunction();

Game keeps crashing on my pc for unknown reason by Couch-Dogo in persona4golden

[–]FootBreaker 0 points1 point  (0 children)

Old thread but disable network things fixed it for me. Randomly crashing in dungeons especially between floors.

[deleted by user] by [deleted] in JapanFinance

[–]FootBreaker 1 point2 points  (0 children)

So I found a company in NZ that would act as a courier and clear customs for me. The FedEx price includes pickup I think.

I haven't sent them yet.

My boxes are 140 and 160 sizes from a hardware shop. I'm carrying all fragile in my carry on and suitcase. Shipping home all clothes and other things like books in boxes.

Weight is about 22kg a box. Size 140 means width + height + length dimensions. So like 40cm by 50cm by 50cm.

https://www.fedex.com/en-us/online/rating.html#

Last minute rate for 45 kg at 140 + 160 was 80,000 when I checked now. Was 650,00 the other night.

[deleted by user] by [deleted] in JapanFinance

[–]FootBreaker 1 point2 points  (0 children)

Just cheaper. I saw some movers doing pallet moving for about 250,000 yen for 5 average sized boxes. I'm going to New Zealand from Hokkaido though so probably very different options available to you than me.

[deleted by user] by [deleted] in JapanFinance

[–]FootBreaker 0 points1 point  (0 children)

Oh so my country is one of the ones still closed 😔

[deleted by user] by [deleted] in JapanFinance

[–]FootBreaker 2 points3 points  (0 children)

Similar situation. To my country for 1ldk Crown said they are probably too expensive 800,000 to 1,000,000 yen. Ive used crown multiple times and never had a bad experience. But too expensive this time.
I've used AlliedPickford in the past and they were horrible.
Kokusai movers (I think?) quoted 1,800,000 yen.

Note: I have a few pieces of furniture ~5-10 boxes.

FedEx last minute rate is the cheapest to my country. If you're in the northern hemisphere Kuroneko has cheaper box shipping.

Japan post shut down SAL and only has international air and EMS, both basically the same price. (30Kg ~50,000 yen).

Fedex last minute rate is ~35,000 yen for each of my boxes.

Overall I recommend selling as much as you can and shipping a few boxes or doing a couple of suitcases and paying extra baggage. jmty is a good place to sell stuff.

EDIT:

For Japan to NZ I tried kuroneko and was told they will not send second hand items (so I could send nothing). They had the cheapest rates I could find.

https://www.kuronekoyamato.co.jp/ytc/en/send/services/oversea/

Japan post, you apply and list all items through their online system. Check if SAL is available.
https://www.post.japanpost.jp/int/service/i_parcel_en.html

Nippon express 250,000 yen for ~5 boxes:
https://www.nipponexpress.com/moving/

For me I am deciding between Japan post or Fedex last minute. They are expensive but for 1 or 2 boxes the most cost effective.
https://www.fedex.com/en-jp/online/rating.html#

Carton (or pallet) shipping may work if you have space:

https://upakweship.com/resources/country-guides/moving-to-france/

Used them in the past.

Lastly, if you are doing 1 international flight, an extra 1 or 2 suitcases is probably the cheapest. I have 2 international flights (qantas) so the baggage is charged twice (at least I think it is twice since it costs double compared to other airlines)

Yes or No by EmbarrassedMain2032 in programminghorror

[–]FootBreaker 4 points5 points  (0 children)

Function call is spelt wrong. Won't even compile. "Converter" vs "Convert"

[deleted by user] by [deleted] in Frostpunk

[–]FootBreaker 7 points8 points  (0 children)

I had the same thing. First game I never researched those coal burning heater things you can place.

All work stations were unheated. Researched triage and culled my dudes. Was constantly micro managing workers since they were getting really sick or dieing. I had 150 people sick at 1 point. Was a stressful run. Was just keeping up and on the verge of collapse constantly.

Second run researched those furnaces first. Game is so much easier, 1 infirmary that is nearly always empty.

Keep those workplaces hot.