• Breaking News

    Saturday, April 20, 2019

    What have you been working on recently? [April 20, 2019] learn programming

    What have you been working on recently? [April 20, 2019] learn programming


    What have you been working on recently? [April 20, 2019]

    Posted: 20 Apr 2019 09:12 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]

    I'm a self-taught developer with nearly a decade of industry experience. I went from years spent trying to make game engines with no luck to having > $100k annual salary. Here's my advice.

    Posted: 20 Apr 2019 10:43 AM PDT

    BACKGROUND:

    During my teens, I spent years trying to write game engines as a self-taught programmer with no luck.

    I'm currently a professional business applications developer earning over $100k / yr. Here's a few realizations I had:

    Focus on the PROBLEM SPACE you want a solution to

    Step away from the SOLUTION SPACE until you fully understand the problem you want to solve or task you want to accomplish.

    Solution-oriented items, such as pseudocode, technical design, programming, etc. should come AFTER you've acquired a grasp of what it is you actually want to do.

    This is not a strict rule, but I would step back and think about what it is you are actually trying to do if you find yourself spending more than 45 minutes without making any measurable progress.

    WHY: To avoid coding yourself into a hole. You may be able to solve problems by coding yourself around them, but why take that chance?

    Project progress should be measured by PROBLEMS SOLVED, not CODE WRITTEN

    Or perhaps even problems understood, as noted above, since a deep understanding of problems will often make crafting solutions easier.

    This tip is a bit of a throwback to my game engine days. It's easy to write things like "entity loaders", "input handlers", "collision handlers", "dynamic resource managers" without ever having a game or putting graphics on the screen.

    Similarly, many people seem to get stuck wondering how they actually create a project from start to finish.

    Don't feel ashamed if you need to watch a Youtube video to help you out, use a prototyping or wireframing tool, whatever helps you reach your target faster.

    If you like the puzzle-solving aspect of programming and feel like looking stuff up is cheating... don't worry, you can fill the gaps back in later. Better to look up how to do it right and veer yourself back on course than waste years writing a "game engine" that can do a million things except make people say, "Wow, this game is fun."

    That being said, you WILL need to learn BASIC SYNTAX, ALGORITHMS, DATA STRUCTURES, and COMMON METHODS AND PATTERNS first

    That's a bit wordy, but everyone uses programming differently. Some people see it as a collection of tools and functions they call at various times in order to build applications. Others care more about the abstract architecture behind programs, how they actually execute, etc.

    You can honestly get a job programming either way. Figure out your threshold and risk tolerance (more abstract / computer-sciencey programming will cost more upfront but probably give more job security down the line) and get going.

    Take some intro to programming courses and just stick through with them. I recommend something like the first three courses in UC Berkeley's computer science program, which are available online for free. That's 61A, 61B, 61C. Others have recommended Harvard CS50x.

    The gist is, find ONE or just a FEW really good courses on programming. Stick through with them. Should require at most a few months of effort (maybe longer for multiple courses). But you will learn a ton that will stick with you for a long time.

    If you watch "how to" videos on Youtube or get Udacity or Udemy courses, you will probably be able to get going even faster.

    Losing motivation? Lacking project ideas? Not sure what to do?

    Okay, do you actually want to program? Have you taken a walk outside lately? Do you have a life outside of sitting in front of the computer all day?

    I mean, there are literally lists of project ideas, communities where people program together, all sorts of stuff.

    I think it's both fair and healthy to re-evaluate your life frequently, enjoy a sunset, and reassure yourself whether or not you actually want to do this.

    What motivates each person is going to be different, so I can't tell anyone specifically what to do. Just know that it is absolutely normal to get demotivated learning programming, to feel like a failure, struggle with simple things like getting your code to compile, etc.

    Programming is an odd career. I mean, even when things go well, I spend more time debugging and validating code than I do writing it and enjoying the end result.

    That kind of love-hate relationship with work isn't for everyone. Figure out what's best for you.

    PRO TIP:

    • Debugging is the #1 skill I want a developer to have. Programming who can step through code and evaluate the environment watch conditions are "teach themselves to fish" kind of people. When I work with a junior on my team, I am constantly reminding them to first step through things in the debugger rather than try coding themselves out of a problem. The debugger will tell you exactly what code is actually doing, not just what you think it's doing and then you wind up confused and making code changes until your program somehow magically works.
    submitted by /u/TheAdventMaster
    [link] [comments]

    What are the biggest challenges you face learning programming?

    Posted: 20 Apr 2019 05:24 AM PDT

    I'm developing an online course to help people go from 0 programming experience to building web and mobile apps with Python and Javascript. I'd love to hear about any pain points you face when learning. What were the biggest issues you faced when learning programming? In terms of learning how to program, what would be the ideal situation/product for you? Thank you!!

    EDIT: Everyone, thanks so much for the wonderful feedback. If you're interested in getting the course when it's ready, DM me your email. If you'd like to be a test user, put the word "TEST" in the DM.

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

    How to write more efficient code

    Posted: 20 Apr 2019 08:06 PM PDT

    I guess I should clarify, I know the best way to get better is to practice more, but I'm wondering how people learn about the nitty-gritty details of a language. How and where to start to learn better optimizations? Will doing practice problems from hacker rank help? I've done a couple of problems, but there are ones where I'll time out.

    Background: I've never done anything super complex. I currently have 3-4 years of basic coding (and all of it is super basic). A semester of intro to Java in high school, a year of intro to python and python trees freshmen year, a semester of java gui's, a semester of C for a hard drive driver (probably the hardest project), and now I'm back to python for basic database connections. In short, in all my years, I've never personally had a class that really dived deep into a language or talked about optimization. As a matter of fact, none of those classes cared about optimization or efficiency. As long as you got the same output, it was "good enough."

    Anyways, here's an example. I was watching a video on a mock-up interview. The question was: given an array, return the reversed without using python's reverse(). My initial idea was to find the length and basically have a for loop that goes backward and have a string of those values. Well, here's what I learned. My idea is inefficient since it would be (if I'm correct) O(n^2). O(N) for the for loop, and O(N) for the string creation. Of course, reading the comments, I learned that using something like arr[::-1] or lambda is better. If I'm not mistaken, those two methods are O(N) efficiency? Never knew about that until now. I guess you learn something new every day or so?

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

    is udemy a good way to learn full stack?

    Posted: 20 Apr 2019 06:10 PM PDT

    i found a course on udemy, is that a good way to learn full stack and get a job? I know it will take several months but it is better than being stuck in a dead end job all my life

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

    Looking for a project-based tutorial for TensorFlow in Python.

    Posted: 20 Apr 2019 09:21 AM PDT

    I'm trying to really get into this TensorFlow stuff and I learn very well by example. So if you guys have anything let me know! I have found a good Lynda Tutorial I've been looking at.

    Thanks!!

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

    "You wanted a banana but what you got was a gorilla holding the banana and the entire jungle.” - what's considered best practice to avoid this situation?

    Posted: 20 Apr 2019 06:40 PM PDT

    I saw this quote in another subreddit.

    I interpret this quote as if you want a banana in an OO program you often get a reference to it's parent object.

    Isn't that necessary though? You often can't work on a banana in isolation, e.g. if you want to know the average weight of the banana in that particular jungle, or information from the banana's tree.

    This was criticized by some as one of the problems with OO programming, and as bad design by others.

    If we extend this example, what is best practice? Back pointers from the banana to its tree? And therefore it's jungle? Or, new attributes on the banana for any required information, e.g. tree height, average weight of bananas in its jungle etc.

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

    How to stay motivated??

    Posted: 20 Apr 2019 11:39 AM PDT

    Hey fellow programmers, I made many attempts to get into programming, starting in python, I get the basics down, start on a few projects, then I just stop. How can I keep my momentum going?

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

    Software Developers in the industry, what CS class in college gave you or would've gave you the most opportunities in your career?

    Posted: 20 Apr 2019 11:31 PM PDT

    Hey, I'm getting later into my CS major and have to choose two electives to take. I want to take one that would be most advantageous to me getting a job after college. Here's a list of them:

    • Software Testing Techniques
    • Introduction to Database Management Systems
    • Advanced Database Management Systems
    • Web Application Development
    • Free & Open Source Software Development
    • Mobile App Development
    • User Interface Design
    • Artificial Intelligence and Pattern Recognition
    • Digital Image Processing
    • Fundamentals of Information Security

    I'm mostly interested in back-end and desktop software development.

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

    What order of topics should I learn C++

    Posted: 20 Apr 2019 11:21 PM PDT

    Hello, I just finished an intro course to C++ and I found it really interesting and I want to learn more on my own (mainly since the other CS courses are only for majors at my school). I've learned up to pointers and some memory management but I don't know what I should do next. Any suggestions would help. Thanks!

    I don't really mind learning from scratch again.

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

    Java Polymorphism Explanation?

    Posted: 20 Apr 2019 03:31 PM PDT

    I'm currently doing the short object oriented course by the University of Helsinki. It's really good, and I'd recommend it to anyone who wants to start, but there's a section that I think has just been completely lost in translation. If anyone could give me a succinct explanation of section 50.4 (here: https://materiaalit.github.io/2013-oo-programming/part2/week-10/ ) , or point me at a source that can explain the concept better, I'd really appreciate it. As it is, I don't even know how to google this concept because I have no idea what the author is trying to convey.

    submitted by /u/10greenbottles
    [link] [comments]

    Big-4 technical whiteboard interviews - 1:1 tutoring

    Posted: 20 Apr 2019 10:59 PM PDT

    Hi everyone!

    I recently graduated from college studying computer science, and I was fortunate enough to get on sites, interviews and ultimately offers at companies like Google, Facebook, Expedia, and a handful of other startups. I went through the dreaded "leetcode" that's pretty much required to pass these interviews, and I know the pain! (it takes a long time, and is weakly correlated with what you actually do on the job).

    Anyway, I found it especially tough to go through leetcode alone, and I was wondering if some type of 1:1 (online) tutoring would be useful for anyone here? Especially subjects like dynamic programming, and the types of graph problems (Google loves these) I saw in my interviews.

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

    Is it bad that my interests in programming languages change too frequently ?

    Posted: 20 Apr 2019 04:10 AM PDT

    Hi. Another aspired-to-be-programmer 18 years old kid here, having close to none experience in programming. So I wish to be a programmer. I researched a lot, the pros and cons of each programming language and then I decided I'll stick to Java. (Because I then wished to develop android applications).

    1. Java

    I had a very very basic knowledge of data types and stuff when I started it. I practiced Java for a couple of days. Then I came across this article which said 'Kotlin will soon replace Java'. This kinda broke my motivation because I didn't want to learn outdated stuff. So I switched my interests to Python, because the majority of the people said it's quite easy to learn.

    2. Python

    Again, I started practicing it on Sololearn and downloaded a LOT of books over Python. Got done with a few chapters and then stumbled across this article which said 'The Most Popular and rising Programming languages' and JavaScript topped the list. You already know what happened next...

    3. JavaScript

    I read about JavaScript and the uses in web development. It seemed good so I decided I should practice it along with Python (haha wtf silly kid). Obviously, I wasn't able to do it. And also my HS exams started a few days after it so I decided to pack up my computer and not boot it up until exams are over.

    Exams ended.

    4. Java again

    I again came across some online resources stating the benefits to start with Java and strengthen my basics. UGH. SAME STORY AGAIN. Then I received a call from a friend.

    5. C++

    That friend of mine is in the first year of college taking a CS degree and is learning C++. He recommended me that I should stick with c++ as it is a pretty easy language to learn and also quite popular. He gave me access to a couple of Udemy courses on C++, that he had bought and then I practiced C++ for a week (finally something for more than 2 days)

    Now: Python

    Before writing this post I made up my mind that I should drop C++ and focus on Python because future era would be of Machine Learning and Automation. I also wish to get a Raspberry Pi by this month end and explore it along with Python.

    All summed up, it's messed up. I accept that it is my fault. I know I should stop jumping off from one to another and actually stick with one. The problem is, I don't want to invest my time on something which won't even have a recognizable reputation in the next 10-15 years. And according to me (100% chances of me being wrong), Python and GoLang seem the safest option. So before starting python again, I just want to know if my decision is okay or not.

    Is this scenario a sign that my mind's not stable and programming isn't my thing? Or is it common among people? Help me out, guys.

    Thanks

    Edit: I commit to practice Java for at least 6 months before rethinking my choices. A big big thanks to everyone who took out time to help this kid out. I appreciate it a lot.

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

    Academic Social Networks APIs with Python

    Posted: 20 Apr 2019 02:07 PM PDT

    TL;DR at the end

    Hi everyone.

    Recently, for a college project, me and a classmate had to get data from academic social networks, specifically ResearchGate, Academia.edu and Google Scholar. Manually, this would have taken hours of tediously looking at the numbers in thousands of profiles, so I decided to automate the process with Python.

    Unfortunately, none of the above have APIs, which means I had to scrape the data with Selenium.

    Thus, here's the purpose of this post: I want to share with you all the code. I'm not looking for help or tips for improvements, I mean they are welcome, but I am looking to share what I've done with others in a similar situation. These are not full-fledged APIs, as I've mostly written functions to scrape the metrics we needed like numbers of researcher profiles per institution (in our case it was schools of Instituto Politécnico do Porto), the number of profile visits, number of documents published, etc.

    Anyhow, I published the code on GitHub at https://github.com/Ze1598/Scrape-Academic-Social-Networks. The code will be a bit messy as I was more worried about getting the results than making the code readable and/or maintainable in the long run, but I feel it's still clear enough as I wrote docstrings for every function and wrote comments for everything. Even if the code is slightly tailored to our need, I believe it is general enough to be used for other data scraping needs in ResearchGate, Academia.edu and/or Google Scholar.

    To conclude, I hope it helps anyone looking to extract data in these platforms programatically and this code provides them with a starting point for the process.

    Thanks for your time and have a great day :)

    TL;DR: wrote basic APIs for ResearchGate, Academia.edu and Google Scholar using Python and Selenium. The code is available at https://github.com/Ze1598/Scrape-Academic-Social-Networks

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

    How to get better at leetcode?

    Posted: 20 Apr 2019 09:39 AM PDT

    I've been doing leetcode problems and while they're going alright I've been facing harder and harder problems that I just have no idea how to approach. How do I improve my algorithmic thinking if that makes sense so I can tackle higher level problems ?

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

    SQL query that selects based off a modified column value?

    Posted: 20 Apr 2019 09:25 PM PDT

    For example:

    SELECT * FROM Table WHERE MONTH(DateAdded) IN {1, 2, 3, 4};

    Is anything like this possible?

    Forgive me, I'm new to SQL and unsure of how to word this to get a good result in a search.

    The use case would be searching for a date range and I would like to convert a UTC timestamp to various formats (month, year, etc) for easy comparison. Is there a better way to do this?

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

    How do big social media websites (like Twitter) store and query through billions, if not trillions of tweets?

    Posted: 20 Apr 2019 12:12 PM PDT

    What I have in mind is that they divide their tweets by datetime. Then they have thousands of databases, each containing thousands of tables storing hundreds of thousands of rows of tweets from a specific range of time. For example, one database may be entitled '2019-04-20'. In that database, they'll have tables which contain tweets generated within a 30-second time frame, say 15:00:00 -> 15:00:30. According to a simple Google search, Twitter users generate about 350,000 tweets per minute, which means each of these tables would contain ~175,000 rows.

    Now since we know the exact date of the tweet, we can select the exact database to query from. We have the exact time, so we can select a table from 2*60*24 = 2880 possible tables. Then the most time-consuming part would seem to be to query through about 175,000 rows of tweets in that table to select, for example, all the comments which correspond to a Tweet's id. Which, after having reduced the rows from billions or trillions to hundreds of thousands, should be relatively quick(?).

    I'm probably wrong, so I would like to hear some of you data experts on what it takes to do such a thing.

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

    Advice for first Software Engineering job after college

    Posted: 20 Apr 2019 08:45 PM PDT

    Hello, i have been working at my first proper software engineering job after college for a couple months but I don't like I have caught up to the level of coding skills excepted from me. Do you have any advice for transitioning from a more theoretical computer science degree to practical programming skills? What were things that helped you when you started out?

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

    (Python/BeautifulSoup) Stop print outputting multiple digits

    Posted: 20 Apr 2019 06:11 AM PDT

    Hello,

    I'm starting to dabble in some web scraping for the first time & I'm having a bit of trouble with some print output.

    The code I've got currently is:

    td = tr.select('td:nth-of-type(4)') if str(td[0].text.strip()).isdigit() == True: print (str(td[0].text.strip())) else: pass 

    I'm scraping some HTML which has a few td tags nested inside of a tr tag, the 4th td tag contains a number & the rest of the td tags don't contain anything. It seems to be running fine but when it prints, it's coming out with 5 copies of the number like:

    1 1 1 1 1 

    Any idea what is causing it or if I can somehow remove duplicates from the print? Thanks.

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

    Can someone help me understand this code and make it as clearly (human) as possible? Im studying for the AP Computer Science Exam.

    Posted: 20 Apr 2019 08:23 PM PDT

    public static void main(String[] args)

    {

    for (int i = 1; i <= 5; i++)

    {

    for (int j = i; j > 0; j--)

    {

    System.out.print(i);

    }

    System.out.println();

    }

    }

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

    Trying to query an SQL db in C# and then display primary key

    Posted: 20 Apr 2019 08:11 PM PDT

    hey guys, I am so stuck right now, I'm trying to query specific rows based off of object fields, and then display only it's primary key in a list box. I'll post the method below I'm trying to write. Any guidance would be appreciated, thanks!

    FirstName is the primary key (I know that's bad practice, but this is just for a class that's about visual studio not Database Management) and I want to query the remaining fields based on conditions.

    private void CreateMatches(Student students) { SqlConnection con = new SqlConnection(@"This is the connection string"); SqlCommand cmd = new SqlCommand(); con.Open(); cmd.Connection = con; cmd.CommandText = "Select FirstName, FavoriteSport, MusicTaste, Hobbies From Students where FavoriteSport='" + students.Sport + "' and MusicTaste ='" + students.Music + "' and Hobbies = '" + students.Hobbies + "'"; SqlDataReader sdr = cmd.ExecuteReader(); while (sdr.Read()) { listBoxMatches.Items.Add(sdr["FirstName"]); } con.Close(); } 
    submitted by /u/ianmcbong
    [link] [comments]

    Can anyone Explain what's happening?

    Posted: 20 Apr 2019 08:03 PM PDT

    So I am trying to understand what's happening in the codes

    What's the use of config(text="|" + tt + "|") , buttons[x][0].config(text="--" + tt + "--") and the last one?

    def check_victory(button):

    global buttons
    x, y = get_coordinates(button)
    tt = button['text']
    if buttons[0][y]['text'] == buttons[1][y]['text'] == buttons[2][y]['text'] != " ":
    buttons[0][y].config(text="|" + tt + "|")
    buttons[1][y].config(text="|" + tt + "|")
    buttons[2][y].config(text="|" + tt + "|")
    return True
    # check if previous move caused a win on horizontal line
    if buttons[x][0]['text'] == buttons[x][1]['text'] == buttons[x][2]['text'] != " ":
    buttons[x][0].config(text="--" + tt + "--")
    buttons[x][1].config(text="--" + tt + "--")
    buttons[x][2].config(text="--" + tt + "--")
    return True
    # check if previous move was on the main diagonal and caused a win
    if x == y and buttons[0][0]['text'] == buttons[1][1]['text'] == buttons[2][2]['text'] != " ":
    buttons[0][0].config(text="\\" + tt + "\\")
    buttons[1][1].config(text="\\" + tt + "\\")
    buttons[2][2].config(text="\\" + tt + "\\")
    return True
    # check if previous move was on the secondary diagonal and caused a win
    if x + y == 2 and buttons[0][2]['text'] == buttons[1][1]['text'] == buttons[2][0]['text'] != " ":
    buttons[0][2].config(text="/" + tt + "/")
    buttons[1][1].config(text="/" + tt + "/")
    buttons[2][0].config(text="/" + tt + "/")
    return True
    return False

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

    How to get started with C++ for scientific applications?

    Posted: 20 Apr 2019 01:54 PM PDT

    I have relatively extensive experience with Python for data analysis and numerical calculations. What i need is a resource that teaches me how to do these things in C++.

    Specifically i will be using C++ for numerical integration and fitting models to data. I own the book Numerical recipes in C++, but it just gives the mathematical explanation and then the finished code, while assuming that the user is familiar with C++ itself. It also relies on their own libraries for matrices and vectors, which i would like to avoid.

    Are there any good resources available online explaining the use of C++ in scientific context?

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

    Function Programming Learning Resources

    Posted: 20 Apr 2019 07:37 PM PDT

    I'm interested in learning the theory and practise behind functional programming and what environment and tooling would be best to use to learn the paradigm.

    I've been toying with kotlin and f sharp, but these seem a little loose and allow easily crossing into other paradigms.

    And proficient in .net, Java, python, Js and typescript so it's more about learning the theory and thought processes than how to code. Adding another tool to the toolbox so to speak.

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

    [CSS] How to make the background image scrollable, while keeping everything else in place

    Posted: 20 Apr 2019 01:23 PM PDT

    My whole web-page has an image as its background. When the screen resolution is big enough, it looks fine. But since it's important that the user is able to see the whole image, if it doesn't fit on their screen, I'd like to make it possible for them to scroll horizontally. I'm not sure if it's because of some css options I've set, but right now when I get to a lower resolution, the image shrinks to maintain the aspect ratio, and the rest of the space is filled with a repeat in the y-direction (I've disabled this using no-repeat, now I have white space below the image which is ok). Horizontally, the part that doesn't fit is just cut off.

    What I want is to be able to scroll the image to the right, but not have the white area to the right everywhere else but in the image. Instead, I want the navigation-bar and whatever I put on the bottom (below the image) to remain in place. As I type this, I'm starting to think that this isn't achievable with just CSS. I tried searching but since scrolling can mean many different things in this context (like parallax etc.), nothing useful is showing up. Any help is appreciated.

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

    No comments:

    Post a Comment