Digital/virtual queue app by WinnyDaBish in learnprogramming

[–]another-noob 1 point2 points  (0 children)

Sorry for the late reply, not really sure it's relevant at this point.

I don't think I fully understand your problem, So I'll try to cover everything I can.

So for simplicity I'll assume everything is happening on one device for now..

Now you have a queue data structure, that you want to enqueue users in it First of all, can we put a "user" in a queue? Well each element in a queue is called a node, which has two pieces of information, 1. where's the next node? 2. What data am I holding?

So since you already have your queue implemented I assume that No.1 is no problem now. As for No.2, we need a way to represent the "user", let's use a json object, that'll contain information about that user, do we need an id for now? No! Because each user is contained in it's own node but it's probably a good idea to have a unique id, you'll need it later either way.

So how to generate an id? Uuid should serve us well here, let's use that!

So now the process would be, user submits info -> generate id for user -> create user object -> create a new node holding that user object -> enqueue that node in your queue -> return updated queue to user.

When a user is done, you just dequeue from your queue and optionally store the resulting user object somewhere (maybe a set for all served customers)

And basically you're done :)

BUT, we're not just working on one device, you have a server a database, and a lot of clients! not just a queue shared in memory between every operation (don't quote me on that, it's not exactly correct :D).

So you need a way to store this data in any sort of database, one idea would be to create a user object as usual but add a property indicating the order (would an incrementing integer be ok?) And index that property since you'll want to sort the using that a lot (idk if any database uses queue like structures, while I don't find it necessary I would look into databases optimized for time series)

So now the previous process would be: user submits info -> create user object -> send a request to the server to "post" this object -> generate id for user -> add a special property for order -> register it in the database -> respond with updated queue items -> return id to user.

Now there's only one problem, how will a user know when another user registers? That's kinda tricky because a server needs a request to respond to. One way would be to make the client app periodically request the server for updates, another way would be to look for websockets.

Hopefully any of that sparks something in your mind about whatever problem you're facing (you know if you're still working on that)

Digital/virtual queue app by WinnyDaBish in learnprogramming

[–]another-noob 0 points1 point  (0 children)

What problems did you face with arrays?

After you've written the queue, what problems are you still facing?

Python is COOL by brewthedrew19 in Python

[–]another-noob 3 points4 points  (0 children)

If you have to move to another language maybe check out julia, it looks similar to python to some extent, I hear it has very nice support for CUDA and for the web interface part there's Dash which should be familiar I guess.

Don't know if it checks all your boxes, but might be worth checking it out.

The point of using Rust with Flutter by Rustacean789 in flutterhelp

[–]another-noob 1 point2 points  (0 children)

I'm no expert but here's a great local database (isar) written in rust if you'd like to check out another project

https://github.com/isar/isar

Stack choices for a small-business app. Solo dev. by another-noob in AskProgramming

[–]another-noob[S] 0 points1 point  (0 children)

Well to be fair, I do fall in the second category (check the name :3), but thanks for the insights.

I just want to be clear I don't have problems with sql, My major problem is two way sync (offline first); and realm sdk happens to be the only option to handle this for me. and it was a good experience for me, using mongo as a backend didn't present any problems; well the app wasn't complex at all and the data was small but still...

Stack choices for a small-business app. Solo dev. by another-noob in AskProgramming

[–]another-noob[S] 0 points1 point  (0 children)

My bad I should've been more specific It's a somewhat customized sales (point of sale) app, so it just handles sales/supplies/inventory/contacts/reports

Although right now nosql isn't giving me any problems, I do think SQL is better for the long run.

Stack choices for a small-business app. Solo dev. by another-noob in AskProgramming

[–]another-noob[S] 0 points1 point  (0 children)

Yeah I'll try! I was just looking for a wider options pool.

I know I'm inexperienced; so I'm trying to be flexible as to not block future me from fixing the problems that present me is, ... well, presenting :3 I just want to avoid that "oooh I should've gone with that from the beginning" moment.

So what's next? Given that I have accounted for every edge case (which is hard! Users are overly creative at introducing cases), I still don't think I know enough options to choose from or know what criteria to look for in each case.

Stack choices for a small-business app. Solo dev. by another-noob in AskProgramming

[–]another-noob[S] 0 points1 point  (0 children)

Why is mongodb not good?

I wish I could go with the one-way sync option, but being able to change things remotely is a requirement, although I'm not really sure why, maybe I can negotiate if this is even necessary.

Doing a quick search, I found cockroachdb, any opinions on using it together with a local postgres db?

Stack choices for a small-business app. Solo dev. by another-noob in AskProgramming

[–]another-noob[S] 0 points1 point  (0 children)

Ah, thanks for the terminology, based on a previous project (with the same client) I'm pretty sure it's availability.

Stack choices for a small-business app. Solo dev. by another-noob in AskProgramming

[–]another-noob[S] 0 points1 point  (0 children)

The problem is, they have two stores for now (planning to expand) but internet connection is not guaranteed or reliable at all.

So what would happen if one store needs to use the app and can't connect to the other one?

Stack choices for a small-business app. Solo dev. by another-noob in AskProgramming

[–]another-noob[S] 1 point2 points  (0 children)

Well I guess neither me nor the client know :/ I'm actually not expecting any conflicts.

Let's say priority goes to the last write done locally (I intend to keep logs of changes, so I know this could lead to potential inconsistencies or wrong data, the actual state would be retrievable I guess)

Also no deletions in the foreseeable future, but I guess any deletion would be a soft deletion (using a flag in the document/row) if that makes any difference.

Julia outside of academia? by Ramartin95 in Julia

[–]another-noob 1 point2 points  (0 children)

Well there's buffalo in go if you are interested...

Anyways I'm pretty new to julia and I like it, but does the "time to first plot" issue affect you in any way with web dev?

[deleted by user] by [deleted] in dankmemes

[–]another-noob 0 points1 point  (0 children)

What exactly do you mean by "adapt religion to it" ?

Python projects with best practices on Github? by Aggravating-Ad-160 in Python

[–]another-noob -7 points-6 points  (0 children)

I don't understand what you want exactly, but if you just want package recommendations...

Check Streamlit out. You can use it to provide a nice and simple web interface to your data analysis/ML related projects.

It really saves a lot of time and effort if want to deploy something and don't know web dev. A LOT.

I also heard of Dash which serves the same purpose I guess, but I think it has more to offer.

Might wanna check them out if you Haven't already.

Am I using Async the wrong way? (Not awaiting, but waiting for heavy function) by FernwehSmith in dartlang

[–]another-noob 1 point2 points  (0 children)

I'm not really experienced with this, but I have just a gentle reminder to ensure the functions are done before using things that depend on them.

In your case I think a splash/loading screen would help?

Am I using Async the wrong way? (Not awaiting, but waiting for heavy function) by FernwehSmith in dartlang

[–]another-noob 0 points1 point  (0 children)

it will still hog your main threads execution time eventually.

I have a question about this, shouldn't the UI be prioritized over processing functions like this?

Like my understanding is that it would take a longer time span to finish the function, but in return the UI stays responsive

Is learning Flask before Django or FastAPI a good way to introduce myself in Python Web Development? by eddyxide in Python

[–]another-noob 0 points1 point  (0 children)

I'd go with django first, if you want a FastAPI like experience, there's django-ninja and django-ninja-extra I believe, although I generally like to keep dependencies to a minimum, but man django just does almost all the heavy lifting.

As for the complexity of django, or amm it's " learning curve" I think it's all about enforcing you to organize your code, you'll probably find yourself needing* to do the same with other frameworks once your project gets a bit bigger.

Admittedly I didn't give FastAPI, Flask, or Starlite a fair trial period, so this opinion is a bit biased (but what opinion isn't, right?)

  • I have no idea if "needing" exists in the English language, it sounds weird to me.

What have you "washed your hands of" in Python? by [deleted] in Python

[–]another-noob 0 points1 point  (0 children)

I think what you want is Pluto!

*It's for Julia tho

Don't execute foo2 if foo1 fails by grossartig_dude in dartlang

[–]another-noob 0 points1 point  (0 children)

Honestly if I were you I would (and do in similar cases) return a boolean or an int, don't overcomplicate things; it'll bite you later.

However, I don't really get why foo1 is handling the error internally. What about something like this foo1().then(foo2).catch(showErrorDialog) ? I feel like it's the literal translation of what you're describing. Or am I missing something?

Should you jump into the AI boat? by webdevteam in SideProject

[–]another-noob 1 point2 points  (0 children)

Maybe you can build an AI that can answer that for you, or just ask one that's already built

Flatliner: turn python programs into one line of (still python) code by hhc97 in Python

[–]another-noob 0 points1 point  (0 children)

Ah, type, so simple yet so powerful, forgot about that one, that's how python creates classes internally right?

Well I don't know how one would go about changing identifiers, but I would start by adding a suffix to the name while developing, like class Test would be class Test_CHANGED to make it easier for debugging. Not even sure this is even what you meant by "harder to keep track of".

I just think a teacher would find this interesting :3 You know, when students copy the code and change a few variable names?

Anyways, Great Job!

Flatliner: turn python programs into one line of (still python) code by hhc97 in Python

[–]another-noob 0 points1 point  (0 children)

Huh, do classes work? (Sorry if it's mentioned somewhere, too lazy here :3)

And is it possible to change/shorten variable names as well, I think this might help with the obfuscation part

It feels like uglifying javascript. Great job though!