• Breaking News

    Sunday, February 16, 2020

    What have you been working on recently? [February 15, 2020] learn programming

    What have you been working on recently? [February 15, 2020] learn programming


    What have you been working on recently? [February 15, 2020]

    Posted: 15 Feb 2020 08:04 AM PST

    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]

    When are while loops preferable to for loops?

    Posted: 15 Feb 2020 12:24 PM PST

    Generally it is better to dependably setup a loop in advance. No need for an external counter this way also.

    But what cases are a good fit for while loops then? I almost never seem to write them, though others remark to use the right tool for the job. Some example cases of while loops being a better fit would be nice.

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

    How I got my first job offer after 2.5 years of programming

    Posted: 15 Feb 2020 02:32 AM PST

    I started working as a math teacher in 2010. Even if I really enjoy teaching, I also love to learn new things myself. So 2.5 years ago (November 2017) I started to learn how to code. And I have now been working as a developer for 1 month!

    Keep reading to get a mix of my own journey and a guide if you also want to learn how to code.

    It took me 2.5 years of hard work to get from "Never written a single line of code" to get hired. But my background in mathematics has of course help a lot, especially in my computer science and Machine Learning studies.

    My learning has come from five major sources:

    University courses

    I have studied a bunch of different courses. Java, C++, Javascript, Network and alot more

    This is the source that has taught me the least, mostly because Swedish distance courses. I usually learn the material from one of the other four sources and then use the university course for repetition. And It looks good on the CV to have a degree. I will hopefully finish my bachelor degree in june ( I have the bachelor thesis left).

    Code Problem

    I have mostly coded on Leet code, Project Euler, Code Wars and SPOJ.

    This is my favorite way to learn how to code! But not everyone loves it, but give it a try.

    OSSU

    https://github.com/ossu/computer-science

    Some really good courses here when it comes to computer science.

    Machine learningI have created my own curriculum and that is a post on its own. I'm no expert in any way but it is a great way to utilize my programing skills in a different area.

    Youtube/Plural sight/Udemy

    There is so much good content. Just watch some!

    Eriks nine steps to get hired!

    Step 1 Choose your first language

    You need to start somewhere, right? What you choose is not terribly important. In the beginning it is mostly about getting used to reading and writing code.

    My suggestion:

    Start with either Python or HTML/CSS/Javascript.

    With Python you can do anything, but it is quite nice to start building some simple web pages with HTML/CSS/Javascript. Since web pages are visual, you can literally see what changes when you changes color = "blue" to color = "red"

    What I did:

    I did start with Python because I took a Python course.

    Step 2 Physical setup

    You don't need any fancy computer, but two screens is a must.

    My suggestion:

    A dedicated desk with two screens, keyboard and mouse.

    What I did:

    I first coded on a laptop and after a while I bought a portable extra screen. And only when my wrists started to hurt (because coding on a laptop is bad) did I get a dedicated place with a real monitor, keyboard and mouse.

    Step 3 Get a program to write your code in

    You just need somewhere to write your code.

    My suggestion

    The hardest part in every course I have ever taken has been installing the software required.

    So if you can get help setting up an IDE ( I use Anaconda/Spyder for Python) this helps a lot. You need somewhere to write and run your code. When I'm coding Javascript at work and we are using Webstorm, but I think it costs money. VS code is free and should also work.

    What I did

    I wrote in notepad++/notepadqq for HTML/CSS/Javascript which is a really basic text editor, but now I use Webstorm at work. And for Python I use Anaconda/Spyder.

    Step 4 CODE!

    Just code. Code Code Code!!!

    You need to invest 100-200 hours the first month. That is how long it took for me to go from "I don't even know what to google to solve this" to "I know what to google for to solve this".And here I found code problems to be excellent. Many of the problems on these sites are quite small, which is nice in the beginning.

    My suggestion:

    Both Code wars and Leet code are good for beginners. SPOJ and Project Euler don't tell you why your solution is wrong. But hard is also good (not just in the beginning)

    What I did

    I did a lot of Project Euler and took a course in Python. Project Euler is mostly math problems, but since I'm a math teacher so It worked for me.

    Step 5 Learn another language

    I really like to learn new languages. It is also a great way to repeat the fundamentals.

    My suggestion:

    Learn Python, Javascript and Java.

    What I did:

    I learned Python, Javascript, Java and C++. I like C++ but it is not as good for beginners (in my opinion, please don't start a flame war) as Java or Python.

    Step 6 Create a plan

    Are you aiming for a degree? And what do you want your portfolio/github to look like?

    What are you interested in: web design, apps, IOT, machine learning or something else?

    My suggestion:

    It is a good idea to get some type of degree. It shows dedication. And sometimes it can be hard to get access to more advanced courses if you don't follow a program.

    What I did:

    I have had so many plans. And as I learned more and found even more fascinating topics I changed my plans.One part of my plan was the OSSU-courses. Another one was Machine learning. And the third part was to get a bachelor degree in computer science .

    Step 7 Just keep going (but maybe a bit slower)

    Keep taking courses, code problems, and continue with your "specialization". By now you should start to learn things quite fast. You don't get stuck on an error message for hours, but instead you know that to google and what stack overflow answer that is suitable for your problem. And you need to take advantage of this by continuing to learn. You should also feel proud of yourself, because most people don't get past "Hello World". But you have to remember that this is a marathon not a sprint. Your goal is to keep learning for the rest of your life.

    My suggestion:

    Really ask yourself: Can I keep up with my pace? Or do I need to drop some things to be able to focus on a few? Because even if you know a couple of languages and have studied a bunch of topics by now, it is impossible to get into depth in all of them. So go over your plan and make sure that your value quality over quantity. Both when it comes to the number of topics and the hours you put in.

    What I did:

    I am aiming for a bachelor in computer science and also studying machine learning. On top of this I learn Haskell because I am fascinated by functional programming. And my university courses are not that hard which gives the opportunity to focus on machine learning (which I find to be a struggle).

    Step 8 Apply to jobs and go to interviews

    I have only been to a couple of interviews. But everyone has been different. I did white board-coding in one of them. I got a super big home assignment in one. I didn't even need to code once. And I did some coding on a computer with two programmers watching me. My point is that it is almost impossible to know what to expect.

    My suggestion:

    Create a project that you can showcase. Do code problems, because it is quite likely that you need to solve some problems on site.

    What I did:

    I posted one of my machine learning projects on social media together with the question "What should I do to get hired". And a bunch of employees commented with "Send your CV to our company". And that led to interviews which led to me getting hired!

    Step 9 Get hired

    I have been working for a month now! I am working on a Rode/React/redux project. It took me like 2-3 weeks to be productive since I have done almost zero web programming. But I'm really lucky to have 2 excellent senior team members that take their time to teach me.

    Final notes

    I have found coding to be such a joy! Of course I have been extremely frustrated at times. Mostly because I have done everything by myself doing distance learning. I do know some people who can code, but they never really wanted to look through my code to help me.

    Even if this is a success story. I have been spending on average 4-5 hours a day on programming/computer science. I have neglected my other hobbies and friends for two years now. I did work as a teacher, being father of a lovely daughter and trying to learn programming, so it wasn't time for much else. I really love programming/computer science and I don't regret spending all this time. But I am also a nerd in this regard. I love to learn new stuff. So if you are thinking of learning how to code, be prepared to spend some time staring into a screen.

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

    My son wants to program video games

    Posted: 15 Feb 2020 04:25 PM PST

    My son (age 12) loves coding. So far, he's been working with Scratch. He made a game where different colored squares appear on the screen and you need to (depending on the color), hover over them, click on them, or avoid them.

    Having done this, he's said that he wants to learn a more powerful text based language to program video games in. I've never coded a video game before (I do web development) so I'm not sure what would be useful for video games and age appropriate. (I don't want to scare him with an overly complex language.)

    Any suggestions?

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

    Best way to learn C++?

    Posted: 15 Feb 2020 10:39 PM PST

    I've decided to learn C++ for a better approach towards competitive problem-solving. I am quite good at python and know the programming basics. I've learned C++ in high school.

    So now how should I start learning C++?

    I am planning to take a course for C++(including data structures and algorithms) and start practicing in Hackerrank or Code Chef.

    Is this a good way to excel in C++?

    Which course would you recommend me to take? [I can't afford paid courses but if it is worth it kindly suggest I'll try my best, but free courses would be great]

    And would practicing in Hackerrank or Code Chef be enough?

    Thanks in advance.

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

    What would you do if you were 17 again to maximize your success in programming?

    Posted: 15 Feb 2020 10:51 PM PST

    Hello, I am a 17 year old high school student and I would like some more experienced people to share career decisions they are satisfied with and those they harbor regrets about.

    Thus far, I have about 6 months of experience in object-oriented programming with Java (self taught; made 1 big project with everything I learned, coded a website to share it and I got a few hundred downloads :D). I am currently applying to scholarships to minimize my debt and plan to begin self-studying C++ at home soon with the book "Programming Principles and Practice using C++".

    I am looking for advice for what I could do with my free time to help me prepare for a career in computer science and to give me a better chance at success when trying to get jobs through Co-op. Thank you for your time.

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

    Understanding Big Oh Notations in Algorithms

    Posted: 15 Feb 2020 11:02 AM PST

    Hello guys..

    I am learning algorithms and Big Oh Notations & time complexities etc..

    I have a simple confusion.. In Linked List, the time complexity for insertion is O(1) and for search is O(n) as you will have to traverse the whole linked list..

    But in the case of insertion, let's say in the end, you also have to start from start and traverse the whole list and then add the node at the end.. Isn't this O(n) also?

    TLDR; How is time complexity for insertion in Linked Lists is O(1) when you will have to traverse the whole list and add the node..

    Thank You

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

    Is it worthwhile to do anything with the code I've made that can crash Firefox (and sometimes the whole OS)?

    Posted: 15 Feb 2020 09:12 PM PST

    Here's the meme that got me banned from /r/ProgrammerHumor. I've done it multiple times by doing questionable things. Is there any system for sending this to Firefox?

    Is there perhaps even compensation for finding these exploits?

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

    What’s your favorite IDE?

    Posted: 15 Feb 2020 10:43 PM PST

    For me, it's visual studio

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

    Spring Book for self learning

    Posted: 15 Feb 2020 07:00 PM PST

    So I learned about Spring core and little bit if MVC around 3 years ago and forgotten almost all of it. This time want to learn the whole framework in a more detailed format. What would be a good book/video/reference guide?

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

    Trying to Sum up a column in CSV file using python

    Posted: 15 Feb 2020 08:43 PM PST

    Hi there,

    Thanks in advance for any help you may be able to offer, I'm a newbie. I am trying to simply sum up the second column of a csv spreadsheet. Not sure where my code is going wrong, I can't seem to generate the values indicated on the right side in the financial analysis box.

    The spreadsheet is like 100 rows long and has only two columns as you can see in the picture attached.

    Any help with the code would be super appreciated.

    my code

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

    am i a failure as a developing DevOps engineer?

    Posted: 15 Feb 2020 04:40 PM PST

    i couldnt do the bell triangle at De Anza College. it was too complex.. does this mean im not cut out to be a DevOps engineer on salary? i went to the school because i was rejected a lot..needed merit for the meritocracy. but also realized medication issues kept me out of being above the technologies in the work.. if i do a ged including the math would it make me any more able to do the stupid python assignment? i could retake the class.. it is just too hard all my stabs at it failed i cant figure it out.

    are there ways of being a good competent python programmer above stupid logic puzzles like Bell triangle?

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

    [Python] how to find single backslash in python?

    Posted: 15 Feb 2020 06:01 PM PST

    Hi

    tried the double backslash, but got double backslash?

    input: D="\\" input: D output: '\\' 

    how to store a single backslash as a character or string in a variable or how to check a single backslash in a string?

    Help please!

    thanks a ton

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

    Code Review For Short Python Script

    Posted: 15 Feb 2020 07:10 PM PST

    A bit of background, I'm already employed as an entry-level programmer. My family has been playing this silly little word game where you try to come up with words given some combination of letters. I thought it'd be fun to write a little program to solve it, so I did. I was thinking about publishing this to github for my portfolio in case I want to interview for a FAANG later, and I would appreciate it if somebody would look over it.

    In particular, the part where I go through and try to find all of the possible permutations of a sequence of letters. Thanks!

     1 #! /usr/bin/python3 2 import sys; 3 4 def read_dictionary( file_path = "/usr/share/dict/words" ): 5 my_dictionary = set(); 6 with open(file_path, "r") as input_file: 7 my_dictionary = [line.strip() for line in input_file]; 8 return my_dictionary; 9 def permutations ( input_letters ): 10 if (len(input_letters) == 1): 11 return input_letters, set(); 12 my_perms = set(); 13 for letter in input_letters: 14 simple_letters = list(input_letters); 15 simple_letters.remove(letter); 16 simple_perms,all_perms = permutations( simple_letters); 17 starts_with_letter = map( lambda word : letter + word, simple_perms); 18 my_perms.update(starts_with_letter); 19 my_perms.update(simple_perms); 20 all_perms.update(my_perms); 21 return my_perms, all_perms; 22 23 my_dictionary = read_dictionary(); 24 if len(sys.argv) > 1: 25 letters = sys.argv[1]; 26 else: 27 letters = input("Input letters to search for:"); 28 letters = list(letters); 29 junk,answers = permutations(letters); 30 answers.intersection_update(my_dictionary); 31 answers = list(answers); 32 answers.sort(); 33 answers.sort(key = lambda word: len(word)); 34 for word in answers: 35 print(word); 
    submitted by /u/CallMeAnanda
    [link] [comments]

    Tweeters: Have you ever wanted to find and follow developers near you? Meet new friends with the same interests? I whipped up a quick tool to do just that. Link in comments

    Posted: 15 Feb 2020 03:04 PM PST

    Developer Friends is a small tool that uses Twitter's advanced search operators to find tweets at any location within a specific radius you specify. Give it a go here and let me know what you think? -> https://cyris.io/developerfriends/

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

    Is there a CSS Selector to remove the checkered background from an image (clipart)?

    Posted: 15 Feb 2020 04:03 PM PST

    I am trying to add an image to my page, and can't figure out for life of me how to remove the gray and white checkers. I basically want the image of the tree, with no background. Opacity seems to get rid of tree included, so it's not that. I find plenty of these images, but when i load them on page the checkers remain. That said, here are my questions...

    1.) What are these particular images called? How should I refer to them?

    2.) Is there a css selector I can use to nix the checkered area?

    3.) If there is no easy way in CSS, Is there another easy fix that would work for a beginner?

    4.) Happy to send my tree over, if anyone wants to help? LOL.

    Thanks ahead of time. I appreciate your response.

    Cheers

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

    I've started coding in my dreams. Is this good or bad?

    Posted: 16 Feb 2020 12:44 AM PST

    I just started taking classes at hack reactor last week, but i've been learning to program for a few months now. In the last week or so I think I've started to program like a whole boat load more. My git hub went from like 50 commits over 4 months, to 105 in 9 days.

    The first week at hack reactor has been super heavy with orientation and "self care"/don't burn out has been brought up a number of times.

    I can't tell if it's a good or bad thing that i'm coding in my sleep? When you learn a new language you start dreaming in that language so it makes sense I'm coding while I sleep. But also sleep is supposed to be the time when i'm resting and recharging and trying to take my mind OFF coding, because i'm now coding a LOT when i'm awake. Like all day every day.

    So is it bad if i'm also coding when i'm resting/relaxing? I'm really enjoying this journey but I don't want to over do it and burn out.

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

    Need MATLAB help

    Posted: 15 Feb 2020 05:06 PM PST

    I was wondering if anybody would be open to messaging me about this MATLAB question that I am stuck on.

    It says that they're simple functions but my mind has gone blank and the stuff I've done before is coming up with random errors that didn't happen when I was in class

    Would probably be easier messaging in private as there's a fair few problems I'm running into like even just using a tic toc command or asking questions with the script using sprintf and disp.

    I've been able to do the questions before this on my own but for some reason this one just confuses me as if I've forgotten even how to use the software without a teacher's help.

    I'm very new so expect me to ask how to even type in some functions.

    Any help would be appreciated as I'm very stressed and don't know where else to ask.

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

    Spent the last 15 months learning Flutter & Dart. But having no programming experience prior to that, I am now feeling a huge sense of defeat and stupidity when trying to solve issues in other languages

    Posted: 15 Feb 2020 03:48 PM PST

    Basically I've been working on an NBA live scores/ data fetching app. A lot of UI work and some local storing and caching, but no cloud storage. The problem came when I realized if I wanted to release this app, or rather, just to be smart about it, I would need to put all the data fetching on a server before sending it out to users as the live score endpoint updates about every 10 seconds. I started watching videos on JS, node and express. As my understanding is you need SOME understanding of JS to work with node, and node experience for express. (using express because firebase functions use express and I had used firebase on other apps in the past)

    My problem/question is I don't know the first thing about making changes to a database outside of an application. Like I know how to make changes when it's a user doing or requesting it, but how can I learn to manipulate a database outside of the app? I was able to bullshit my way through enough in Node to take some json data from the NBA scores endpoint and puts it on a firebase endpoint, but I really want to learn and I guess I just don't even know where to start.

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

    Coding bootcamps in London? Recommendations on the best ones.

    Posted: 15 Feb 2020 08:37 PM PST

    I'm looking to go to a coding bootcamp in London as I want to learn to code and change my career.

    Can anybody recommend any?

    Thanks

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

    [Python] Converting Nested For-Loop into Recursion

    Posted: 15 Feb 2020 08:09 PM PST

    Hey guys, I'm pretty new to python and I'd like to practice using Recursion in my code to further assist my understandings with the recursive function. From what I am aware of, identifying a base case is required to prevent infinite recursion but I cannot seem to figure out the base case for this scenario.

    Simplified code as shown below:

    for y in range(N): for x in range(M): if origin[x][y] == 1 and CellsMap[x][y] == 0: CellsCounter += 1 DiscoverCells(origin, x, y, CellsCounter) 

    Basically the above code will scan for every (x, y) coordinate in a grid (Implemented by the nested For Loop)

    How do I go about converting this code into recursion, with a call to function of def DiscoverCells()?

    Thanks in advance!!

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

    Time Series with Panda, Python, and Plotly

    Posted: 15 Feb 2020 11:54 PM PST

    Hi! I'm trying to create a data visualization that's essentially a time series chart. But I have to use Panda, Python, and Plotly, and I'm stuck on how to actually label the dates. Right now, the x labels are just integers from 1 to 60, and when you hover over the chart, you get that integer instead of the date.

    I'm pulling values from a Google spreadsheet, and for now, I'd like to avoid parsing csv things.

    I'd really like some help on how to label x as dates! Here's what I have so far:

    import numpy as np

    import pandas as pd

    from matplotlib import pyplot as plt

    import bpr

    %matplotlib inline

    import chart_studio.plotly as pl

    import plotly.express as px

    import plotly.graph_objects as go

    f = open("../credentials.txt")

    u = f.readline()

    plotly_user = str(u[:-1])

    k = f.readline()

    plotly_api_key = str(k)

    pl.sign_in(username = plotly_user, api_key = plotly_api_key)

    rand_x = np.arange(61)

    rand_x = np.flip(rand_x)

    rand_y = np.array([0.91 , 1 , 1.24 , 1.25 , 1.4 , 1.36 , 1.72 , 1.3 , 1.29 , 1.17 , 1.57 , 1.95 , 2.2 , 2.07 , 2.03 , 2.14 , 1.96 , 1.87 , 1.25 , 1.34 , 1.13 , 1.31 , 1.35 , 1.54 , 1.38 , 1.53 , 1.5 , 1.32 , 1.26 , 1.4 , 1.89 , 1.55 , 1.98 , 1.75 , 1.14 , 0.57 , 0.51 , 0.41 , 0.24 , 0.16 , 0.08 , -0.1 , -0.24 , -0.05 , -0.15 , 0.34 , 0.23 , 0.15 , 0.12 , -0.09 , 0.13 , 0.24 , 0.22 , 0.34 , 0.01 , -0.08 , -0.27 , -0.6 , -0.17 , 0.28 , 0.38])

    test_data = pd.DataFrame(columns=['X', 'Y'])

    test_data['X'] = rand_x

    test_data['Y'] = rand_y

    test_data.head()

    def create_line_plot(data, x, y, chart_title="Rate by Date", labels_dict={}, c=["indianred"]):

    fig = px.line(

    data,

    x = x,

    y = y,

    title = chart_title,

    labels = labels_dict,

    color_discrete_sequence = c

    )

    fig.show()

    return fig

    fig = create_line_plot(test_data, 'X', 'Y', labels_dict={'X': 'Date', 'Y': 'Rate (%)'})

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

    I'm a rookie that just got into game coding c++. But I'm stuck, is there a tip or a way for me to learn C++?

    Posted: 15 Feb 2020 11:45 PM PST

    I've created my model and environment in blender but wow im so lost and dont know what to do in unity because im totally new in game programming. I went to youtube but I'm still kinda lost. Is there a way for me to learn C++ at the beginning stage? Or i wanna take notes but how or what should i focus on? How did u guys learn programming by yourself? Pls share it with me.. Thank you

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

    C++ handling cin blank entry

    Posted: 15 Feb 2020 11:42 PM PST

    When the Enter transaction gets called, I set for example C for my command a number for temp,

    which works fine for C if statement, but for E if statement, since I am not using temp, how can I handle my cin for that if all I want is a command returned and not a temp when I press enter?

     while (true) { cout << "Enter a transaction: "; cin >> command >> temp; if (command == 'c' || command == 'C') { balance -= temp; } else if (command == 'e' || command == 'E') { cout << "Processing end of month\n"; break; } } 
    submitted by /u/CEOTRAMMELL
    [link] [comments]

    How much time spend on Pseudocode vs coding

    Posted: 15 Feb 2020 07:55 PM PST

    I was watching a video on programming and they were saying that a mistake beginners do start low level thinking (coding) first before the high level process(step wise refinement and decomposition or just generally breaking down the problem) .

    So it made think is there a ratio of how much time should be spend doing pseudocode and breaking down the program vs actually getting in the editor and actually coding and running the program.

    For example would it be something like 80% psuedocode then 20% coding or the other way around. I would think planning would be higher as a beginner but also it may be an issue were your not testing things out enough and learning from your mistakes that way.

    Cliffs:

    Should you spend more time psesodecode and planning or coding in the editor and testing.

    What percentage of each

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

    No comments:

    Post a Comment