Skip Navigation

InitialsDiceBearhttps://github.com/dicebear/dicebearhttps://creativecommons.org/publicdomain/zero/1.0/„Initials” (https://github.com/dicebear/dicebear) by „DiceBear”, licensed under „CC0 1.0” (https://creativecommons.org/publicdomain/zero/1.0/)V
Posts
8
Comments
514
Joined
3 yr. ago

  • For a small amount of time in a lot of cases. It would likely run out of memory and crash the system.

  • General computing tip: if that happens you can press ctrl and c and it will stop the current program(assuming windows). Useful when making console apps especially when you are learning and are likely to make mistakes and infinite loops.

  • Also look up the modulo operator. It's similar to integer division but ONLY returns the remainder. It's useful if you want to have something with multiple division steps for example.

    38 hours is how many days? 38 / 24 = 1 with your current setup

    38 / 24 = 1.583333333 if you use floats

    38 % 24 = 14.... % is the modulo operator

    Combine your setup and the modulo you could output something like "there is 1 day and 14 hours over course of 38 hours" which is much more human usable since most people don't know how long 0.583333333 is but know 14 hours.

    Or doing money... I'll leave this up to you as a mental exercise for you but say you want to give someone $46.28 in cash. How many and what type of bills and coins would you give? Hint while 4628 pennies would be true it's not the answer you want.

  • Just warning you, the rpn suggestion is pretty complex and would be a complete rewrite. You are on chapter 2, rpn would probably be covered in the second book.

  • That's when you make really cold or really hot..

  • I can't tell from the photo but if your sink turns on by lifting the handle, use a broom and then RUN!

    Can be done if they twist open but is harder...

  • But it would be funny to watch them trying to use a pencil sharpener

  • All the other tips are great. I would also recommend checking out a switch statement, for example https://www.geeksforgeeks.org/c/c-switch-statement/

    This will clean up alot of the else if statements. Also I would work on code to organization. For example you test if the choice is greater than or equal to 6 or less than 1, then if it is equal to 5 then check again if it's less than 5 and greater than 0. You already did that third check.

    If you want to go slightly more advanced I would put the steps to ask for and save the input numbers into a function then just call that function on each of the following choices. Would add a functional call but would remove another if statement. If you name it well it would also help on code readability.

    Also if you want to take this farther like taking more than 2 numbers or more than 1 operation (for example 2 + 3 * 4) look into reverse polish notation. Basically it's how to store the equation to make executing them correctly easier. That might be a little advanced for you at this stage though.

  • Yeah, he had a bunch of really weird ideas especially about sex and masturbating.

  • Some of it was probably due to being in a low volume high profit market. We had close to a 10x cost to profit ratio, and the profit per unit was 10s of thousands. Although alot of that went into R&D and quality etc.

    There are tons of ways to cut cost often. Another example is one time I bought a device to detect air/gas leaks. It was 1000 dollars. I walked through our production measured the leaks, fixed them(most were push on connectors so pull off, cut tip, reinsert, typically leak was done), took about an hour. Per the sensors software saved about 175k. Also prevented my company from having to buy a new compressor for about 750k as our current one was close to the limit of what it could support.

  • Fun fact corn flakes were initially released in the thought of them being so bland they would remove your desire to masturbate.

    Basically like "I really want to cum but instead I'll just eat this bowl of cereal".

  • Deleted

    Permanently Deleted

    Jump
  • True, maybe didn't create the concept but definitely expanded it

  • Deleted

    Permanently Deleted

    Jump
  • Fun fact a lot of people, including myself, believe the invention of reality TV was actually the writer strike in early 2000s. Basically TV writers went to the producers and said "you make all these millions and only pay us this small amount when we are the reason people watch these shows". The producers basically said "fuck you we will make TV shows without writers"

    That created reality TV in America and panel shows in the UK.

  • I used to be on the gross margin improvement team. Basically our job was to implement projects which reduced cost.

    I don't think a single person's job was eliminated because of my work. I remember creating about 35 jobs. For example I had a project where I identified about $900k in potential savings per year. We had to spend $50k one time and hire an employee for about $60k per year but still saved about $900k.

    Employees are cheap(even expensive ones). Simple things like hire an employee to check something at step 3 so you are not paying people to do steps 4-20 will easily pay for itself if that issue at step 3 happens enough. Like for example that's the whole point of unit testing software. Pay someone to write tests all day everyday even at an high salary, say $150k reduces costs of tech support, reduces cost of later testing, improves value of product, increases sales etc. If you want to be negative this is value stolen from the worker. But if an employee doesn't make you a profit, why are they a employee? Like if you pay $70k for an employee who causes $50k in revenue... Fire them and make yourself a 20k raise. Now if you pay someone $70k and they make you $700k that's immoral...

  • Actually the typically recognized person as the pope is not in the Vatican city. Which means the number of pope's in Vatican city is 0. https://youtu.be/RMf4OtC7SXY

  • The correct way to deal with cookies : eat them!

    I may have diabetes...

  • Deleted

    Permanently Deleted

    Jump
  • If its a blind date... Does it matter what you wear?

  • Hey it you throw all the waste in the river it just goes d I wn the river... Take that Information as you want

  • Look, I have a job opportunity, room and board provided nearish to a large river yes it's I will Egypt but...