• Breaking News

    Sunday, September 20, 2020

    What have you been working on recently? [September 19, 2020] learn programming

    What have you been working on recently? [September 19, 2020] learn programming


    What have you been working on recently? [September 19, 2020]

    Posted: 19 Sep 2020 09:04 AM PDT

    What have you been working on recently? Feel free to share updates on projects you're working on, brag about any major milestones you've hit, grouse about a challenge you've ran into recently... Any sort of "progress report" is fair game!

    A few requests:

    1. If possible, include a link to your source code when sharing a project update. That way, others can learn from your work!

    2. If you've shared something, try commenting on at least one other update -- ask a question, give feedback, compliment something cool... We encourage discussion!

    3. If you don't consider yourself to be a beginner, include about how many years of experience you have.

    This thread will remained stickied over the weekend. Link to past threads here.

    submitted by /u/AutoModerator
    [link] [comments]

    A How-To Guide go from Zero to Finding a Job at a FAANG Company as a Bootcamp Grad

    Posted: 19 Sep 2020 04:07 PM PDT

    If you have a CS degree, you can skip all the bootcamp related stuff. I'll be as transparent as possible about my background (willing to verify with mods). Essentially I took a bootcamp about 3 years ago, coming out of a top UC school with a biology degree. I found out like 2 weeks after graduation that I enjoyed coding, so I embarked on the journey to becoming a software engineer. I enrolled in a top coding bootcamp in SF and haven't turned back. I've currently work at a FAANG company, I've developed my own app that hit the iOS store, and before that a top tech company before leaving.

    The key in my opinion is setting small goals and benchmarks. DO NOT THINK ABOUT THE BIGGER PICTURE TOO OFTEN. It'll confuse your priorities. You need to focus what is immediately in front of you and accomplish that. Yard-by-Yard.

    Here is my learnings:

    1. Pre-Pre-Bootcamp: Pre-bootcamp concerns should just be learning the basics. Do the pre-bootcamp programs that a lot of these top bootcamps have. It's a great way to see if you enjoy coding. Don't get bogged down with any "Hello World" tutorials in XYZ language. Forget about any language or concept that is not Javascript . Don't even think about it. All bootcamps take Javascript (even the ones written in Ruby) , so really it makes no sense to learn anything that is not related to the bootcamp languages. The primary goal here is to gain knowledge of the fundamentals of javascript.
    2. Pre-Bootcamp: Now you can start doing things like easy level problems on sites like codefights, codewars, leetcode. Don't even attempt anything else. Don't even venture into data structures, or conceptual understandings of algorithms. The primary goal at this stage is to learn how to use if-statements and for-loops to solve basic problems. That's it. When it comes to data structures, just learn the built-in javascript ones: arrays and objects. Don't mess around with Maps, Sets, or any of that stuff just yet. Just focus on the extreme basics. Don't venture into async, any of that stuff. Do tutorials up to the point of learning for-loops, if-statements, objects, and arrays. After you feel comfortable apply to a bootcamp and take the top one you get into.
    3. During Bootcamp: I did a full time program and I'm not gonna bullshit you here. I lived and breathed code for that 3 months. I worked 14 hours a day. If you're not willing to do this, you are going to be at a massive disadvantage. YOU HAVE TO FIND A WAY to dedicate this much time. AT LEAST 8 hours a day at minimum. Do the advanced sections of all the projects, stay late, start extracurricular study hours. Your primary goal at this stage is not to graduate but to learn as much as humanly possible. If you have a wife and kids, you're going to have to talk to them and come to an agreement about how these next three months is going to be. It's not going to be easy from a time perspective, but learning at a pace of 2-4 hours a day is not worth it. Might as well, stick at your old job to be honest.
    4. Towards the End of Bootcamp/Post-Bootcamp: Start applying, Don't wait until the bootcamp ends! And because you have no CS degree, no one is gonna give a hoot about you. You WILL be filtered out by algorithms, you WILL be ignored, so you NEED to be efficient. This is going to be a lot easier too if you are in the bay area. A little basic sales will go a long way here:
      1. Use an email scraper + LinkedIn Premium to find emails of hiring managers , and recruiters at companies you'd love to work for. Collect these for reference in an excel file/CSV and group them by company
      2. Go one-by-one, and personalize a cold email for each particular person, ask for a way to be connected with a recruiter or if their team is currently hiring. Talk about who you are, what your skills are, but keep it short and sweet. A lot of my friends had success by scheduling a quick phone chat to learn more about being a software engineer at XYZ company.
    5. During Job Search: Leetcode, Leetcode, then more Leetcode. Your time is going to be divided between doing an aggressive personalized cold email campaign + Leetcode. 4 hours each ideally. It would be worth it if you set a "chop wood, carry water" goal of sending 100 emails a day and doing 10 high-frequency problems a day.
    6. With Recruiters: Emphasize the technologies that you know. Do not lie about this, but recruiters will be on your side (they want commission). So stick to the things you learned during the bootcamp, and talk extensively about those skills. I recommend building a basic React app on the side so you can talk about this during your interviews.
    7. With Technical Interviews: Definitely you need a personal project that you created during the bootcamp or on your free time to talk about when it comes to technical challenges. Most the problems will be using skills you pick up in your Leetcode studying.
    8. After your Final Interviews: Interviewing does not stop until you step foot in the door of your first job ( or in our case, have your onboarding skype call) . Don't set expectations too high (you can always join FAANG much easier after a year or two somewhere more mid-tier) but also don't settle for somewhere that's giving you a bad vibe. After all, SWE is a job, so if you join with a shit boss you might end up blaming the job rather than the situation.

    I hope this helps a few people looking to learn coding for the sake of getting a job. It's a long but rewarding journey and I wish there was more content like this when I was going through the process.

    Feel free to message me with any questions, I'd love to answer them.

    submitted by /u/BlueCigarIO
    [link] [comments]

    regex tutorial

    Posted: 19 Sep 2020 11:59 AM PDT

    was looking for a comprehensive guide for regex because all what i found seem introductory level tutorials and the python documentation is really bad. "sites, courses are all fine"

    submitted by /u/Majestic-Assistant-6
    [link] [comments]

    You do not need to be good at math to learn programming.

    Posted: 19 Sep 2020 09:33 PM PDT

    It is a question often asked by people considering to learn a programming language. "Do I need to be good at math to learn Javascript, or C, Java, or any other language?" The reason they are most likely asking this question is because they're either really good or bad at math so they want to know if this instantly disqualifies them or gives them an advantage. As a programmer with over 20 years experience, I've seen this asked and been personally asked this very question countless times and I'd love to say that my answer has been consistent but it hasn't.

    Programming is very hard, I don't want it to sound easy, so when asked a question like this I have the urge to just say yes, to make it sound hard and make myself sound smart. If I were to say no, then I might be trivializing how hard my job is. I'm not alone on this, this question is asked constantly online and the answer almost always is "you should at least be able to calculate X times Y to be able to be a programmer", or worse, "you should know this formula or that algorithm".

    The fact is that programming is not math, it's a science. Anyone who says you need to be good at math is gatekeeping. Knowing how to multiply has nothing to do with programming. Though programming is not math, it does contain math sometimes. It's clear that sometimes people who struggle in programming are really good at general math, and sometimes people who are good at programming are really bad at general math. Every combination of skillset exists in the field and they are perfectly capable of developing different types of software.

    With that said, some types of software development do require a lot of math such as some types of 3d game design, graphics, simulators, etc. Also sometimes it can help you to write better code when you know a math formula that can be applied to save on data storage and performance. This is an issue I see from time to time with programmers who are senior level, they will use database tables and do all sorts of manual processing to achieve something that could have been solved by a simple algorithm. But the bottom line is they still managed to become senior programmers without being great at math because they get the job done, which is what matters most.

    So the answer is no, you don't need to be good at math to start learning to program. Knowing some math formulas can help you down the road to write better code or might be required to be able to do a task but you can learn that on the spot when you need it. Obviously, it's more ideal to know math, you will have an advantage but in no way is it a limiting factor. It might even make you appreciate math more and want to be better at it, so please don't see it as a limitation any more.

    Medium article: https://medium.com/@andyware/do-you-need-to-be-good-at-math-to-learn-programming-c0b69caad853?source=friends_link&sk=7cf606abc6624463faf6dfb7fa6e7a1b

    submitted by /u/TheThingCreator
    [link] [comments]

    Just began Colte Steele’s “Web Developer Bootcamp” Udemy course - wish me luck!

    Posted: 19 Sep 2020 05:29 AM PDT

    As the title states... here we go! If anyone's taken the course if you have some advice or any other comments I'd be happy to hear what you have to say! I'm starting from basically zero so this will be quite the interesting experience. My goal is to know HTML, CSS and JavaScript somewhat decently by mid-November! Had to write it down and put it out there to make myself get determined.

    submitted by /u/PlaystationGO
    [link] [comments]

    I Created A Path For You To Learn Design Patterns

    Posted: 19 Sep 2020 05:33 AM PDT

    TLDR: 1. Learn design patterns. Read a book. Go trough a resource. 2. Implement the design patterns. No matter how contrived your scenarios just implement them. 3. Start a project. Use your new found knowledge in your project. The key to knowing how to use patterns is to practice using them. Not to read about them and never use them.

    Design Patterns

    In software engineering, a software design pattern is a general, reusable solution to a commonly occurring problem within a given context in software design. It is not a finished design that can be transformed directly into source or machine code. Rather, it is a description or template for how to solve a problem that can be used in many different situations. Design patterns are formalized best practices that the programmer can use to solve common problems when designing an application or system. - Wikipedia Software Design patterns

    What matters

    What really matters with these patterns? Understanding why and when a specific design pattern should be applied is what counts. Sounds easy right? Often times it proves to be quite challenging in the real world. Having experience with patterns is what helps you understand when to apply them. How do you get experience? You get experience from applying them in real applications. Reading about them in a book helps, but isn't going to be enough to know when you should apply them.

    Paid

    Design Patterns: Elements of Reusable Object-Oriented Software Is commonly referred to as the GoF (Gang of Four) it's considered a huge influence in object oriented design. Typically when people think of design patterns they're actually thinking of the patterns presented in this book. The book motivates the need for patterns, and presents 23 of them. Most resources today borrow ideas from this book or re-hash the patterns in it. New patterns have obviously emerged as time has gone by, but if you want the ideas of modern day design patterns right from the source this is where you'll want to go.

    Free

    Refactoring.guru Is a comprehensive resource on the typical 23 GoF design patterns. On top of it's analysis it also provides important context other resources fail to mention like history, criticisms, and when not to use patterns. Each pattern is presented with a problem motivating it, a solution to the problem, UML diagrams, code, and more. Refactoring.guru contains all the information and more in it to learn about design patterns.

    Do Factory Is a simple resource on design patterns. I'd describe it as a reference with only essential information. They cover all of the GoF patterns, provide UML diagrams & code examples in C# for each one. It doesn't attempt to do anything past this. If you don't understand UML the class diagrams won't make that much sense, but you can pick up most of it just from the code they present.

    Design Patterns For Humans Attempts to describe design patterns in simple terms. The great part of this is no UML diagrams. It's just code and words. It doesn't try to be overly sophisticated. It just tries to get the points across. It covers all of the essential design patterns, motivates each pattern with a real world example, and tells you when you should use it.

    Wikipedia's Software design patterns is another comprehensive resource for learning patterns. I've found that wikipedia isn't always a great resource for learning, but in this case it is. Wikipedia provides great context around patterns to help frame your learning. It does so more than most other resources here. It has pages on all the typical design patterns and others as well. Most pages on specific patterns include UML diagrams, code, and a pros and cons section.

    Extras

    It helps to know UML for some of the resources so I'm going to link to where you can learn about UML.

    Wikipeida Class Diagrams - This covers everything you'd need to know about UML for the above resources.

    Mosh Design Patterns - This is part of a video course on design patterns that didn't make the cut for me, but there is an excellent section on UML about 36 minutes in. It explains most of what you need to know about UML for design patterns.

    Learning Path

    You now have a handful of resources you could use to learn design patterns. Where do you start? To answer that question you should know where you want to end up. I provide two learning paths below. One is for functional use i.e. being able to understand and to identify where you can use patterns. The other is going past functional use i.e. becoming advanced. Be warned design patterns don't always lead to the best design, and can even lead to over engineering your application if you use them improperly.

    Shooting for functional use

    In order to be functional with design patterns you have to understand them on a fundamental level. What does this mean exactly? It's knowing what each design pattern is good for and where it can be used. To do this you really need to understand how to use patterns. Often reading about patterns isn't enough. Just reading about the pattern makes it make sense in the moment, but when you encounter them in the wild you'll be baffled. It's not enough to just read about patterns. You must implement them. Once you actually implement the patterns and use them, you'll become much more familiar with them and their use cases. To sum it up

    1. Understand the pattern and what problem it solves
    2. Understand where the pattern can be used
    3. Implement the design patterns to understand them on a deeper level

    Shooting for anything past functional use

    In order to get to a more advanced level you'll need real engineering experience with patterns. Obviously to do this you need to apply them in real applications. Only through reaping the benefits and suffering through the mistakes can you gain real experience. Realistically this means try to use design patterns as much as possible where applicable. That's not an easy thing to do depending on what kind of application you might be working on. Frameworks already have there own patterns they try to get you to conform to, but there is no reason that an application can't be composed of multiple design patterns. Having this experience will allow you to understand future scenarios and how patterns can help or hinder you application.

    That's all I got for design patterns! Hopefully you learn something from these resources!

    If you enjoyed this post there are more writings like it at the Learning Computations Archive!

    submitted by /u/sasacocic
    [link] [comments]

    List of 50k words and I need to do string comparisons. What's the best way to store the list? (DB? CSV? python variable?)

    Posted: 19 Sep 2020 01:15 PM PDT

    I have a list of 50,000 names.

    Given a string (ex. "Ruth Bader Ginsburg"), I need to compare each word in the string against this list of names. Eg.

    • Is "Ruth" in the list?
    • Is "Bader" in the list?
    • Is "Ginsburg" in the list?

    I'm wondering what the best way to store this list of names is.

    I would assume the MySQL database would be the fastest, but is this abusing the DB?

    I could put it in a flat file (.csv).

    Or I could just have it as an inline python variable.

    What is best to do in this situation?

    submitted by /u/kristianwindsor
    [link] [comments]

    Day 1 over with Colt Steele’s web dev Udemy course - Just a quick account of my personal experience.

    Posted: 19 Sep 2020 09:48 PM PDT

    So for starters I would describe myself as a beginner. I touched code for the first time yeaaaars ago and had no clue what I was doing, but thought it looked cool, and then afterwards never touched code ever. The only thing I knew today was that using Chrome's inspect element you could view code - that's all my knowledge related to coding. Also, I'm pretty slow at learning complicated things. I'm always struggling with complicated concepts initially and it takes me much longer than the normal person to get some things. I dunno it's just always been like that. So I wasn't really sure how I'd do when I started the course or whether I'd be able to understand anything.

    Experience

    So I started this morning and Colt starts off by teaching you html and how to use the html boilerplate and what program you can write code in. We covered some basic html which I sort of felt like I got the hang of. He does say throughout the program coding is something that you just memorize more as you go on and there's nothing wrong with looking stuff up as you code, in fact he encourages us to look things up a few times for some exercises. Which makes a beginner feel very reassured and it takes the pressure off! It reminded me of when I started learning Japanese and would have to use the dictionary a lot whenever I had to look back at my notes or search something!

    Once we got to CSS it started to get really fun actually. But it's also where it was starting to get a bit intimidating to me as a beginner! I knew looking things up would work out for me but the class and id selectors, along with the various ways to format text to look a certain way and so forth was a little scary lol. But at the end of the CSS section there's an exercise where we get to create a little blog-looking page and it made me relax a little more since I realized you don't have to use a lot to make something very basic and decent-looking right now. In addition to that,

    And then we got to Bootstrap! I'm like halfway through the introduction to Bootstrap module and I already love it! I'm not sure how common the use of Boostrap is but having a huge selection of pre-built buttons, forms, and other neat tools at my disposal to play around with has been incredible so far. It made me wonder if sometimes coding can be as easy as just searching on GitHub or Google and then identifying where the certain line of code needs to go and then just copy and pasting it lol. Bootstrap initially is a bunch of code in front of your face, but the html and css sections have made me more comfortable seeing so much code!

    Thoughts

    So Day 1 I spent most of the day going all the way up to boostrap. It was a very fulfilling day and the course has been easy-to-understand and you can digest the info easily as a beginner. Do I feel like my foundations for basic coding are getting built well? I think so, but I know that due to it being outdated I'll have to familiarize myself with the up to date things as soon as I can. I posted this to hopefully give a rough idea of what your day 1 will be like if you haven't taken this course yet, and also to invite you to ask any questions or give advice if you had some.

    submitted by /u/PlaystationGO
    [link] [comments]

    How to learn programming without the internet of distractions?

    Posted: 19 Sep 2020 11:55 PM PDT

    I've found programming and learning about the inner workings of computers an exciting and fulfilling interest for the past year now. The problem is that it's much easier to talk about programming, than actually doing the programming.

    I've been stuck in this loophole for a few months now, where I pick up books, read the first 200 pages, and drop them because I lost the motivation to continue. Another thing I've noticed is that I keep jumping from subject to subject, language to language but get nothing done in the end.

    In the end I know that most of my time still goes down the drain playing videogames, watching YouTube and chatting with others.

    How do you guys stick to your goals?

    submitted by /u/AmbitiousResister
    [link] [comments]

    tokens vs cookies: What is the difference between data and the thing it is stored inside

    Posted: 19 Sep 2020 07:44 AM PDT

    Recently I've realized I don't have a firm understanding of how to describe the difference between session or jwt data, and cookies, local storage, and caches.

    I get that the later group is the storage medium and the former group is the actual data. Is that also there is to it or does it go any deeper?

    submitted by /u/embar5
    [link] [comments]

    ok...so c++ with vim huh..

    Posted: 19 Sep 2020 08:49 PM PDT

    I know this its a hot debated subject..unless im slow and there's been a consensus by now..But while learning c++ and reading these forums i always see "use vim" whispered in the background followed by "dont do it,just use a ide"

    anyways i wanted to give it a try...and o-m-g

    first of all...is there any good sources that walk you through setting up vim..hell even setting up plugins and a plugin manager for it. I ended up watching one of those stereotypical very old Indian narrated walk through which helped a good bit...but jesus everything was so vague or obscure...it was driving me mad.

    After about 2 hours i guess i stumbled my way through and figured out how to get vim-plug working and finding plugins from vimAwsome....but by then i was already on the edge with this whole obscure vim set up shinanigans...

    then to get plugins working decently it felt like i iwas just trying to solve a puzzle, but every piece of the puzzle was another puzzle that i needed to decipher how to configure before attempting to even put something together....

    so i guess im asking did i miss some totally awesome website or tutorial that explains everything and shines a light on this whole process? Because honestly i just said fuk it and used timeshift to go back before i even started tinkering with it and i ask my self....why...why not just use qtcreator it does everything your pulling your hair out hoping to get vim to do..

    submitted by /u/cplusplusisgod
    [link] [comments]

    Best resources to study for a coding interview?

    Posted: 19 Sep 2020 08:44 PM PDT

    Hello fellow programmers, I would like to start studying for coding interviews now and I would like to know what are some good resources to study for coding interviews. Also I have heard some very good resources but you have to pay for them, is it worth the money?

    submitted by /u/bourbanx1
    [link] [comments]

    Web Automation Google Apps Script or Python w/ selenium?

    Posted: 19 Sep 2020 10:26 AM PDT

    Can anyone give me any pointers or direction with this idea. I want to automate a task I have to do on a website but I don't want it to consume many resources on my computer by introducing more programs. I was wondering if it was possible to use google apps script to have it interact with a website but I am not sure how to implement this. At the same time I know it is possible with python and selenium but this performs a process on my desktop which sometimes interferes with my work.

    Any input is appreciated!

    Edit:

    I also want to be able to set a daily schedule to have it repeat weekly.

    submitted by /u/007prometheus
    [link] [comments]

    I finally solved my first leetcode easy problem all by myself

    Posted: 19 Sep 2020 06:34 PM PDT

    Hey guys so I started leetcoding after doing 2 certification in java from Coursera. At first I understood nothing when I did 2 easy problems one of them is two sum. Then I did a problem on leetcode today called palindrome number. I did it within 10 mins and I feel so happy. Do Amazon or other companies really ask these easy questions in interviews? I am just curious.

    submitted by /u/Goku560
    [link] [comments]

    Career progression tips - M(22)

    Posted: 19 Sep 2020 11:57 PM PDT

    Hey Guys, i am an tech savvy student who has completed his bachelors in commerce. I have studied computer applications and fundamentals of computers in my undergrad. And i have also worked 2 years as a full time system admin. This is my next step - do a masters in computer science ( conversion course ) in the UK

    What do you guys think of this? Any feedback would be excellent.

    submitted by /u/therealultranoob
    [link] [comments]

    Best practice for creating an embedable feature.

    Posted: 19 Sep 2020 11:54 PM PDT

    I have a cool backtracking visualization project I was working on and was wondering what is the best way to make easy for other people to use my work in their own website. Should I just open source the code and have people integrate it into their own projects? Many big sites use iframes to do this, is it the best practice and if so how to approach it.

    Some details:

    • No backend
    • No framework
    submitted by /u/username-must-be-bet
    [link] [comments]

    What is i in a for loop when iterating through a string? [JAVA]

    Posted: 19 Sep 2020 11:44 PM PDT

    public void operatorFromString(String input) {
    for(int i = 0; i<input.length(); i++)
    {
    System.out.print(i);
    }

    This prints out "012". I wonder why it does that?

    submitted by /u/thecarrot95
    [link] [comments]

    I need help with an Angular app.

    Posted: 19 Sep 2020 11:39 PM PDT

    I was making a remake of my Clicker game with Angular. I think the problem isn't actually in Angular. I think I'm doing something wrong with the object in TypeScript. Can anyone tell me what I'm doing wrong?

    <!-- HTML -->

    <html lang="en">

    <head>

    <meta charset="UTF-8">

    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>Clicker Game</title>

    </head>

    <body>

    <h1>Welcome to Clicker Game!</h1><br>

    <p>Welcome to my clicker game. You have a bussines where you sell space food. Your goal is to build a rocket and launch it into space. You may be asking how to do that... well you can get money by clicking a button. The money that you get you can use to upgrade or to build parts of the rocket. Good luck, have fun.</p>

    <div id="div2">

    <h2>Your money: {{money}} $</h2>

    <p>Money per click: {{shop.ClickUpgrade.num}} $</p>

    <p>Money per second: {{MPS}} $</p>

    <button (click)="add()" id="moneyButton">Click for money!</button>

    </div>

    <div id="div3">

    <p>Workers give you 5 $ per second. They cost {{shop.Worker.cost}} $. You currently have {{shop.Worker.num}} workers.</p>

    <p>Click upgrades give you more money per click. They cost {{shop.ClickUpgrade.cost}} $. You currently have {{shop.ClickUpgrade.num}} click upgrades.</p>

    <p>Shops give you 50 $ per second. They cost {{shop.Shop.cost}} $. You currently have {{shop.Shop.num}} shops.</p>

    <p>Laboratories give you 150 $ per second. They cost {{shop.Laboratory.cost}} $. You currently have {{shop.Laboratory.num}} laboratories.</p>

    <p>Warehouses give you 500 $ per second. They cost {{shop.Warehouse.cost}} $. You currently have {{shop.Warehouse.num}} warehouses.</p>

    <p>Factories give you 1250 $ per second. They cost {{shop.Factory.cost}} $. You currently have {{shop.Factory.num}} factories.</p>

    </div>

    <div id="buyMenu">

    <form>

    <input type="radio" \[(ngModel)\]="buyWhat" value="Worker" name="buy">Worker<br>

    <input type="radio" \[(ngModel)\]="buyWhat" value="ClickUpgrade" name="buy">Click upgrade<br>

    <input type="radio" \[(ngModel)\]="buyWhat" value="Shop" name="buy">Shop<br>

    <input type="radio" \[(ngModel)\]="buyWhat" value="Laboratory" name="buy">Laboratory<br>

    <input type="radio" \[(ngModel)\]="buyWhat" value="Warehouse" name="buy">Warehouse<br>

    <input type="radio" \[(ngModel)\]="buyWhat" value="Factory" name="buy">Factory<br>

    <button (click)="buy(this.buyWhat)">Buy</button>

    </form>

    </div>

    <p>To build you rocket you will need to buy parts for it. Here you can get them by paying with the money you have.

    You will need rocket fuel, fuel canisters, rocket engines, cockpit, platform for the rocket and control room on land.</p>

    <div id="div1">

    <label>Price: 70 000 $ </label><button (click)="buyPart('PlatformForRocket', 70000)" id="PlatformForRocket">Buy platform for the rocket</button><br>

    <label>Price: 50 000 $ </label><button (click)="buyPart('RocketFuel', 50000)" id="RocketFuel">Buy rocket fuel</button><br>

    <label>Price: 25 000 $ </label><button (click)="this.buyPart('FuelCanisters', 25000)" id="FuelCanisters">Buy fuel canisters</button><br>

    <label>Price: 125 000 $ </label><button (click)="this.buyPart('RocketEngines', 125000)" id="RocketEngines">Buy rocket engines</button><br>

    <label>Price: 75 000 $ </label><button (click)="this.buyPart('Cockpit', 75000)" id="Cockpit">Buy cockpit</button><br>

    <label>Price: 65 000 $ </label><button (click)="this.buyPart('ControlRoom', 65000)" id="ControlRoom">Buy control room</button><br>

    </div>

    <button (click)="launch()" id="launchButton">!!!LAUNCH!!!</button><br>

    <br>

    <h1 id="launchCountdown" style="display: none; margin: auto; text-align: center;">{{count}}</h1>

    <script>

    setInterval({addShop}, 1000);

    </script>

    </body>

    </html>

    <!-- At one point everything was working but now it broke again -->

    //TypeScript !!!Also you should note I did import the [(ngModel)] thingie

    import { Component } from '@angular/core';

    @ component({

    //Here I left a space cuz else reddit thinks I'm mentioning someone

    selector: 'app-root',

    templateUrl: './app.component.html',

    styleUrls: ['./app.component.css']

    })

    export class AppComponent {

    title = 'ClickerGame';

    money: number = 10000000000;

    buyWhat: string = "";

    clicked: boolean = false;

    count: number = 10;

    shop = {

    Worker: {

    num: 0,

    cost: 100,

    moneyUp: 50

    },

    ClickUpgrade: {

    num: 1,

    cost: 150,

    moneyUp: 100

    },

    Shop: {

    num: 0,

    cost: 2000,

    moneyUp: 500

    },

    Laboratory: {

    num: 0,

    cost: 7000,

    moneyUp: 1500

    },

    Warehouse: {

    num: 0,

    cost: 10000,

    moneyUp: 3500

    },

    Factory: {

    num: 0,

    cost: 50000,

    moneyUp: 7000

    }

    };

    rocketParts = {

    "RocketFuel": false,

    "FuelCanisters": false,

    "RocketEngines": false,

    "Cockpit": false,

    "PlatformForRocket": false,

    "ControlRoom": false

    };

    MPS: number = this.shop.Worker.num * 5 + this.shop.Shop.num * 50 + this.shop.Laboratory.num * 150 + this.shop.Warehouse.num * 500 + this.shop.Factory.num * 1250;

    buy() {

    const cost = this.shop[this.buyWhat].cost;

    if (this.money >= cost) {

    const item = this.shop[this.buyWhat];

    this.money -= item.cost;

    item.cost += item.moneyUp;

    item.num += 1;

    this.MPS = this.shop.Worker.num * 5 + this.shop.Shop.num * 50 + this.shop.Laboratory.num * 150 + this.shop.Warehouse.num * 500 + this.shop.Factory.num * 1250;

    } else {

    alert("You don't have enough money");

    }

    }

    add() {

    this.money += this.shop.ClickUpgrade.num;

    }

    moneyAddShop() {

    const res = this.money += this.MPS;

    return res;

    }

    buyPart(tag: string, price: number) {

    if (this.money >= price && this.rocketParts[tag] !== true){

    if(tag == "PlatformForRocket" || this.rocketParts["PlatformForRocket"]){

    this.money -= price;

    this.rocketParts[tag] = true;

    document.getElementById(tag).className = "built";

    }else{

    alert("You must build the platform for the rocket first!");

    }

    }else if(this.rocketParts[tag]){

    alert("This has already been bought");

    }else{

    alert("You don't have enough money");

    }

    }

    launch(){

    if (this.rocketParts["RocketFuel"] && this.rocketParts["FuelCanisters"]

    && this.rocketParts["RocketEngines"] && this.rocketParts["Cockpit"]

    && this.rocketParts["PlatformForRocket"] && this.rocketParts["ControlRoom"]

    && this.clicked !== true) {

    let launchCountdown = document.getElementById("launchCountdown");

    launchCountdown.style.display = "grid";

    this.clicked = true;

    let Int1 = setInterval(() => { launchCountdown.scrollIntoView(); }, 1)

    let Int2 = setInterval(() => {

    if (this.count > 0) {

    this.count--;

    } else if (this.count <= 0) {

    launchCountdown.innerHTML = "ROCKET LAUNCHED! CONGRATILATIONS! YOU WIN!";

    clearInterval(Int1);

    clearInterval(Int2);

    }

    }, 1000);

    }else if(this.clicked){

    alert("You already started the launch!");

    }else{

    alert("You aren't ready to launch!");

    }

    }

    Int3 = setInterval(() => { this.money = this.moneyAddShop() }, 1000);

    Int4 = setInterval(() => {

    if (this.rocketParts["RocketFuel"] && this.rocketParts["FuelCanisters"]

    && this.rocketParts["RocketEngines"] && this.rocketParts["Cockpit"]

    && this.rocketParts["PlatformForRocket"] && this.rocketParts["ControlRoom"]

    && this.clicked !== true) {

    document.getElementById("launchButton").style.display = "grid";

    clearInterval(this.Int4);

    }

    }, 1)

    }

    /* I'd love if you guys test it and it would help a lot if you can find where the problem is. I last saw problems in the buy() function. Thanks in advance */

    submitted by /u/ProGamer2711
    [link] [comments]

    May have gotten in too deep in a comp sci class, need advice/resources on how to stay afloat

    Posted: 19 Sep 2020 12:16 PM PDT

    Hey all. As the title states, I am studying computer science right now, and I think that I may have bitten off more then I can chew. I started at one school where my class was in Python, and I did really well, but with COVID I ended up transferring to a different school, and took the next course in the sequence. Unfortunately for me, this class is in Java. I didn't think it would be a big deal at the time since I briefly learned Java in high school, but this was a massive jump and I don't really know what to do. Are there any sites/books/videos you guys recommend looking at when it comes to learning Java? Because I have to learn it, and do it well enough to do well in class. Thanks!

    submitted by /u/throwaway-128373737
    [link] [comments]

    How to learn from the code found in the internet?

    Posted: 19 Sep 2020 07:20 PM PDT

    Whenever I want to do something I have no knowledge of, I search in the internet about it but most of the time I just get the whole program itself. So my question is how do I learn from that big chunk of code, should I read the entire code and then search for each function used and then implement later by myself. This surely looks like a tedious job or is there any other way?

    submitted by /u/Frexpe
    [link] [comments]

    Developers who are shit at design: how did you make projects for your portfolios that looked half way decent?

    Posted: 19 Sep 2020 05:02 PM PDT

    Basically what the title says.

    I'm a terrible designer, and it's not really something that I have a whole lot of time to learn. I'm trained on HTML, CSS, JavaScript, and React, but I struggle with getting projects for my portfolio off the ground because I don't know where to start with the design process. It's paralyzing in a way, and it's seriously stunting my growth as a developer.. not to mention my job search.

    Did you pay someone to make designs for you? Were you "inspired" by other people's projects?? Help!!

    submitted by /u/CuttyAllgood
    [link] [comments]

    Complete noob at coding, and im tryna start off by building an offline website. I tried putting a video, and the vid showed but i cant change the size.

    Posted: 19 Sep 2020 07:13 PM PDT

    <video controls> <source src="osuvideo.mp4" type="video/mp4" > </video>

    this is the code. i tried doing this

    <video controls> <source src="osuvideo.mp4" type="video/mp4" height="340" width="240"> </video>

    wont work the size stays the same. help?

    html5 btw

    edit: i fixed it just add this

    <video width="500" height="500" controls>

    submitted by /u/SolerFlereTEE
    [link] [comments]

    I am entering college soon and i want to pursue CS. My interests lie in Web design and Game Development. But after thinking alot I have chosen Web designing. So can anyone please guide me on how I should begin?

    Posted: 19 Sep 2020 10:31 PM PDT

    I want to know the proper phase to start learning web design. Please anyone guide me through the proper process of it. I mean which all softwares (Languages) I need to learn, which one to learn first, which will be the next one and all other extra advices that I would need to become a good Web Designer.

    Try to explain the process in a simple way.

    Thank you

    submitted by /u/LordSparos
    [link] [comments]

    Is it normal for versions of software to disappear from an artifactory?

    Posted: 19 Sep 2020 10:20 PM PDT

    I have been building an app that depends on a library. It's open source and free, but it is maintained by a for-profit org that charges for support/training service (Akka HTTP is the library, Lightbend is the company).

    They recently went through a minor version upgrade (10.1.x -> 10.2) that introduced pretty significant breaking changes. That in itself I would think is fine, butt the version of the software I was using before which was only released in June 2018 has disappeared from the online artifactory/repository completely. So I am forced to migrate.

    This is my first time managing my own product, so I don't know if forced migrations like this are common. Is this pain something I should expect? Now I have to spend time migrating and learning the new ways of this library instead of building features!

    submitted by /u/crpleasethanks
    [link] [comments]

    No comments:

    Post a Comment