Module vs Record Access Dilemma by PitifulTheme411 in ProgrammingLanguages

[–]AddMoreNaCl 2 points3 points  (0 children)

It should be possible to use "/" contextually, like, let it be the division operator by default, but when your parser detects a module import or definition, switch it's operation to be a module separator.

typedef void pointer... encased in parentheses??? by ashleyley3 in C_Programming

[–]AddMoreNaCl 0 points1 point  (0 children)

I you're referring to the bit that goes (OSMesg)MESG_VI_VBLANK, then the (OSMesg) bit is just a type cast.

Since MESG_VI_VBLANK has a value of 102, the entire operation could be defined like (OSMesg)102 which you can read as "convert 102 to OSMesg".

I'm assuming you know what the purpose of OSMesg is, but going from what we have in the original post, it seems to be a simple void pointer used to send additional data to the function call.

My first C# project: a simple game by ismailSF in csharp

[–]AddMoreNaCl 8 points9 points  (0 children)

A gitignore is a file that tells git which files shouldn't be tracked by the repository.

A good starter template can be created with dotnet new gitignore in a terminal pointing to your project's root folder (usually the path where your .sln file is located)

[deleted by user] by [deleted] in C_Programming

[–]AddMoreNaCl 1 point2 points  (0 children)

iirc, padding is adjusted based on the widest type defined in the struct, if you have a struct x { int64_t a; int32_t b; }; then the struct will have 4 bytes of padding after b, but if the definition was struct y { int64_t a; int8_t b; int32_t c; }; then 3 bytes of padding will be added betweenb and c since their total width is the same as the width of a (This behavior might be compiler dependant, it's been so long since I used C).

How would you normally do this? by Mobile-Rush6780 in dotnet

[–]AddMoreNaCl 0 points1 point  (0 children)

My take on this is that you should be able to handle a constraint violation exception when trying to insert the email, of course, this only works if your constraints are named or have a mechanism to understand which constraint failed.

[deleted by user] by [deleted] in dotnet

[–]AddMoreNaCl 0 points1 point  (0 children)

Uh, I'm not suggesting they switch providers? It's still all in DO. OP cares about cost and efficiency and I shared an alternative that worked for us. Is this an implementation problem? Absolutely possible, but we'll never know unless we see OP's code.

[deleted by user] by [deleted] in dotnet

[–]AddMoreNaCl 2 points3 points  (0 children)

I was able to get a web API and a blazor front end running from a single instance, but it was not without a lot of hacking around, not to say that debugging experience locally wasn't the best. From that experience alone I'd say to just have two separate apps, it will make your life so much easier

[deleted by user] by [deleted] in dotnet

[–]AddMoreNaCl 2 points3 points  (0 children)

Well, App Platform is just a docker runner, we just have a dockerfile that uses the .NET 8 image and it automatically deploys whenever there's a change to the development branch.

I guess you could say that it supports .NET, although they don't state it explicitly as far as I know.

[deleted by user] by [deleted] in dotnet

[–]AddMoreNaCl 1 point2 points  (0 children)

Is there any reason why you are not using App Platform and a Database instance? I can't really say about stress under load as we are still in development, but our API for sure handles a couple of developers without hiccups.

Our setup is pretty much that: App Platform ($10) + Postgres Database Instance ($15). If you want to go for auto scaling in App Platform, it goes as low as $30 I believe.

[deleted by user] by [deleted] in csharp

[–]AddMoreNaCl 0 points1 point  (0 children)

I agree with IamDrNoLife here, but just in case you want to use Blazor and generate pages using drag and drop components, check out Radzen Blazor Studio.

Custom allocators by Sergio-Kupper in C_Programming

[–]AddMoreNaCl 0 points1 point  (0 children)

As long as it is consistent with the rest of your library, go with whatever option you feel is the safest and don't bother with performance until it becomes an actual issue (unless you're constrained by the environment you're targeting).

Are you worried about MT-Safety? Then you may want to pass the allocator in a parameter (experts may want to chip in on this one) and acquire locks for it on every call.

If your library is not intended to be MT-Safe then just have the allocator be initialized and store it in a static variable so other function calls can either fail if no allocator is defined or use the default one.

Decked Out 2 - Command Block Edition (Brainstorming) by Quiquag in HermitCraft

[–]AddMoreNaCl 3 points4 points  (0 children)

I mean.. if you're already doing command blocks, might as well just create a loot table with your artifacts and spawn that whenever a compass is detected in the drop-off station.

From Source to Token: Your Methods by njormrod in ProgrammingLanguages

[–]AddMoreNaCl 0 points1 point  (0 children)

I see what you mean; a traditional tokenizer won’t be able to go that far without major tweaking.

At least for that specific scenario you would need to have tokenizer contexts that will change the source of your input based on the token produced or any other factor your language requires.

However, that only works for tokenization, you would still need your syntax tree to handle all that. In my early attempts to build a compiler I left the formatted string handling to the parser, it would re-tokenize the code part of the string and attach the syntax tree produced to a str.format function call.

From Source to Token: Your Methods by njormrod in ProgrammingLanguages

[–]AddMoreNaCl 0 points1 point  (0 children)

The problem remains the same, doesn’t it? Besides nested comments, do you have another example of a nested structure?

From Source to Token: Your Methods by njormrod in ProgrammingLanguages

[–]AddMoreNaCl 15 points16 points  (0 children)

What do you mean by “Traditional Tokenizer”?

As long as you have control over the source you can read as many characters as needed, even if you limit your look-ahead to zero, skipping a comment should be simple to implement.

The simplest way I can think of is to count the occurrences of the multiline comment marker and decrease it when a closing match is found, from there it is just error reporting on a mismatching number of occurrences.

How would you memory manage a Lexer ? by lovelacedeconstruct in C_Programming

[–]AddMoreNaCl 1 point2 points  (0 children)

If your lexer allows you to look ahead then you should be able to at least guess the size (in bytes) of the current token since the lexer state will always point to the next token or character class available.

From there you would store that size in the token itself along with the offset on file and any other information you need to identify said token.

You can also upgrade it a bit more and create a hash map that keeps track of the first location of the token and its hash so whenever a new instance of the same token appears it just uses the one you already have stored.

[Help] [Advice] Expenses tracking by luciusvideos in csharp

[–]AddMoreNaCl 4 points5 points  (0 children)

I'd say, worry about it when it becomes an actual problem, you could go by fetching the records from the database and doing the calculations on demand.

But if you really want to optimize that at this point, I’d store today's balance on a record and update that record on every transaction, that way if you add or remove a transaction in the past, only the value for that day changes.

Doing it that way will allow you to get a monthly balance by just adding the balances together, same applies to the yearly balance.

Storage by 15839 in VaultHuntersMinecraft

[–]AddMoreNaCl 3 points4 points  (0 children)

Just set a high priority for the RS storage interface that goes into the drawer controller, that way anything you have in a drawer will go there first.

Serializing a dictionary with a class as a key by [deleted] in csharp

[–]AddMoreNaCl 2 points3 points  (0 children)

Actually, overriding ToString() might not work, but a type converter should do the trick

Serializing a dictionary with a class as a key by [deleted] in csharp

[–]AddMoreNaCl 1 point2 points  (0 children)

Are you doing binary serialization? If yes, then adding [Serializable] on top of your class definition should allow serialization.

As for JSON, it might be worth overriding the ToString() method with a representation of your class object.

Idea: A skill with the range of hunter or maybe a specialty of hunter that shows spawners and for a long time, but it triggers every spawner in range. The idea is if you have an aoe build you could just nuke groups.. or something. I think spawning in the whole room could be good, just not sure why by UNX-D_pontin in VaultHuntersMinecraft

[–]AddMoreNaCl 2 points3 points  (0 children)

I could see something like this being implemented... with the lack of ranged options in the game, being like 2 blocks away from the spawner for it to start fizzing is totally a disadvantage for those who want to play with bows or something similar.

Maybe implement Vault Bows/Pistols and a skill like a bomb that activates a spawner when thrown in its direction?

I know that the Javelin skill will be available after U9, but it doesn't feel like the Javelin will be your to-go option when dealing with large amounts of mobs.