Jump to content

vorticalbox

Member
  • Posts

    6,237
  • Joined

  • Last visited

Reputation Activity

  1. Funny
    vorticalbox reacted to kelvinhall05 in Brain Fuck   
    You might be thinking of Java.
  2. Agree
    vorticalbox reacted to Eigenvektor in Simplify scoring for a database where there can be two users   
    Some of the terms in your question aren't clear to me and the use of arrays rather than objects with properties makes your code hard to follow. For example:
    Who does "original author" refer to? The person answering the question (i.e "the user") or the person asking the question? Is losing points a good thing or a bad thing? E.g. does this mean: "If a user answers a question, but the answer was not given within the timeframe, that user loses two points"?
     
    How do emojis work in this context?
     
    Who does "stealer" refer to in this context? I assume people have the ability to react to answers (marking them as correct/incorrect) and if their reaction is right/wrong they can steal points from the person posting the answer?
     
    You're using terms in your question without explaining what they mean/who they refer to which makes it hard to follow what is being asked. In the code itself you're using arrays to refer to different user properties e.g.
    orgUser[2] -= 2 orgUser[4] += 2 This makes it hard to infer what is gaining points or losing them. Using objects with properties rather than arrays would make it easier to follow your code. If you could clarify the terms and use more descriptive names for your variables it might help get some answers.
     
    The first step to cleaning up the code would be to separate the game logic from the database code. Move that into separate methods. One method to get the user (and create it if needed) and one method to award points. The second step would be to use more descriptive names. The more you have to think about "what was user[3] again?" the less time you have to think about the logic and how to improve it.
  3. Informative
    vorticalbox reacted to badlou101 in What License do I want to use?   
    This should help you. https://choosealicense.com/
     
  4. Like
    vorticalbox got a reaction from Ithanul in TV-Style ads coming to console gaming before the end of 2021   
    This has always been a  thing.
     
    Remember DVDs?
     
    I used to always think "Why am I watching an ad when i paid for the thing"
  5. Agree
    vorticalbox reacted to Forbidden Wafer in TV-Style ads coming to console gaming before the end of 2021   
    Can someone please ban ads, especially within paid services/products?
  6. Funny
    vorticalbox reacted to flibberdipper in Microsoft provides clarifications on Win11 specs, says it is evaluating in adding 7th gen CPUs and Ryzen 1 series CPUs   
    Breaking the Law by Juadas Priest playing loudly in the background

  7. Informative
    vorticalbox reacted to straight_stewie in C language, I created this code but I want to make it more efficient(reduce the runtime)   
    If I'm following this correctly, that just prints all numbers b <= n <= a where n % b = 0. In plain English, you are looking to find all multiples of b between b and a inclusive.
     
    What you should do is find the largest multiple of b less than a. We can do this by writing:
    int largestMultiple = div(a, b) * b; Then you would just continually subtract b from largestMultiple until you are equal to or less than b, printing as you go along.

    This is about as efficient as it gets, because it only requires as many iterations as there are multiples of b such that  b <= multiple <= a.
  8. Agree
    vorticalbox got a reaction from Franck in Write a function that receives 2 strings, that are split with spaces into words, and retruns the count of the words that are contained in both strings   
    Could you show some evidence that this is actually the case?
     
    There is nothing wrong with asking for help even if it is to do with homework.
     
    The issue is when people ask for their homework to be done for them, which as far as i am aware is not actually against any rules but it a rather rubbish way to learn.
  9. Funny
    vorticalbox reacted to ramava in F@H on discreet GPU.   
    I think that's bus 1 and slot 0, but honestly, I'm kinda guessing based on what I know from Windows.
  10. Funny
    vorticalbox reacted to badreg in Write a function that receives 2 strings, that are split with spaces into words, and retruns the count of the words that are contained in both strings   
    int StringSplit(char* str1, char* str2) { printf("Stop trying to cheat on your exams."); return -1; }  
  11. Agree
    vorticalbox reacted to WereCatf in Python or c++?   
    I'd definitely start with Python. With C++, you'll have to do a ton of boring tasks yourself, but which don't really advance your programming-skills that much, like e.g. manually having to handle all memory-allocations and such. With Python, you get to focus more on the actual logic you are doing and practicing the concepts, so I'd say it's the way to go in the beginning.
  12. Informative
    vorticalbox reacted to AnotherMax in (Python) why does this not work?   
    You can do that sort of behaviour with sets:
     
    fruits = {"apple", "banana", "cherry"} print(fruits - {"apple"}) # or to actually remove it. fruits -= {"apple"} print(fruits)  
  13. Agree
    vorticalbox got a reaction from igormp in Is GitIgnore OK (API keys)?   
    normally you would save these in a .env file then load them into your environment before starting your application.
     
    for node i use env-cmd, for python i use python-dotenv. You didn't say what language you are using but this is a common pattern and there should be some module to help you out
     
    https://www.npmjs.com/package/env-cmd
    https://pypi.org/project/python-dotenv/
  14. Agree
    vorticalbox reacted to FlappyBoobs in (javascript) How can I store data from an API as json   
    Response is not defined outside of the function which is why you get that error when you reference it.
  15. Like
    vorticalbox reacted to pythonmegapixel in Best software to use for coding that requires no download and is free   
    Repl.it or CodingGround are two good online ones.
  16. Informative
    vorticalbox reacted to Eigenvektor in read DNS server python   
    When you do a normal DNS query, you send a host name and the DNS server returns you the associated IP address (A record)
    When you do a reserve DNS query, you send an IP address and the DNS server returns the associated host name (PTR record)
     
    There is typically only a single PTR record associated with an IP address, even though there may be multiple A records pointing to that IP. This means you cannot realistically use this to compile a list of all known domain names.
     
    ~edit: There's another issue:
    If you were to do a reverse DNS lookup of every possible IPv4 address, you'd be querying upwards of 4.2 billion IP addresses. The DNS server is most likely going to blacklist you in short order. To avoid this you could try to slow down and/or spread the queries to other DNS servers. But keep in mind how long this would take.
     
    Even if you were able to do one request every 10 milliseconds it would take you more than 1.33 years to query all of them. The faster you go, the more likely you'll end up blocked. But if you slow down to one request every 100 ms, we're already talking about 13.3+ years to test every possible IP address.
  17. Agree
    vorticalbox reacted to Sauron in Python3, Why does this bypass GIL?   
    You've run it and... what? If it was faster than just doing sleep x times that's because sleep doesn't actually do anything and other threads can be run while it's waiting.
  18. Funny
    vorticalbox reacted to WereCatf in Intel caught fudging benchmarks in M1 vs Core i7 11th Gen comparison   
    Me checking Intel's latest "benchmarks" out:

  19. Like
    vorticalbox reacted to WereCatf in Huawei makes new OS, basically Android 10.   
    Huawei != China.
  20. Informative
    vorticalbox reacted to manikyath in Manjaro Architect edition Anyone?   
    manjaro is basicly arch with an actual installer.
     
    but i do say it's very refreshing to see that they made it a very barebones installer, gonna give it a spin in a VM and see if they managed to reach the refinement some of the big boys (debian / *buntu / fedora) are good at.
     
    EDIT: nope, it's shyte.. 9 years of development and they still cant get keyboard layouts besides US QWERTY to work properly. selecting additional packages is essentially just a dump of the repo, and currently my screen is just a waterfall of errors because it cant resolve some mirror's hostname.
     
    also, for having not selected any additional packages, i really wonder why i'm seeing SO MUCH FREAKING SOFTWARE fly past on my screen..
     
    installation done, here's the pain points:
    - had to set language and keyboard layout 3 times, still had to do one login with a wrong keyboard layout
    - virtualbox drivers are broken
    - i enabled auto logon, it doesnt auto logon
    - i installed the 'latest' kernel.... but there's a kernel update?
    - i didnt install any additional software, and went for an xfce installation, the layout they squeezed xfce into is HORRID...
    - while having not installed any additional software, here's the damage report: gColor2, GIMP, Gparted, GtkHash, HexChat, HP device manager (WHAT?!!), pidgin, thunderbird, timeshift, VLC, and a bunch of system utilities installed 'double' like xfce's task manager and htop.
     
    all in all.. it's a pretty poor experience compared to going for a *buntu, and for all the work they seem to be doing on making things more refined.. it's making things more messy. i havent had problems with virtualbox drivers since like.. 2015? but manjaro never fails to surprise.
  21. Agree
    vorticalbox reacted to cm992 in Python 3, I have made a program that uses a lot of ram, in short I want to reduce how much it uses.   
    Can't really help without knowing more about the program
  22. Funny
    vorticalbox reacted to straight_stewie in Webscraper to check stock availability   
    Damn. Thought there was another hobby developer here interested in automated market analysis.
  23. Agree
    vorticalbox reacted to WhitetailAni in Who here Programs with TCL Still?   
    This is rare(ish). Sometimes it seems everyone goes to sleep.
  24. Funny
    vorticalbox reacted to ARikozuM in Browser extension to automatically skip segways   
    Running away from mall cops?
  25. Funny
    vorticalbox reacted to Kilrah in Python Noob Questions (don't get mad I'm new)   
    As many as you want (aka until the whole thing is unreadable...)
×