• Breaking News

    Sunday, May 26, 2019

    What have you been working on recently? [May 25, 2019] learn programming

    What have you been working on recently? [May 25, 2019] learn programming


    What have you been working on recently? [May 25, 2019]

    Posted: 25 May 2019 09:10 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]

    Possibly the most commonly asked front end interview question: Build a progress bar! A video tutorial with 2 different approaches

    Posted: 25 May 2019 12:04 PM PDT

    Hey guys! If you're preparing for a front end interview this question is a must-know going into it. Google, Facebook, and Uber have all been known to ask this question, particularly for entry-level software engineer positions in phone screens.

    I created a video tutorial to break down 2 possible approaches to this question. Cheers (:

    https://www.youtube.com/watch?v=WrSRGzQeN2o

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

    Age concerns and learning programming

    Posted: 25 May 2019 02:54 PM PDT

    I am learning C# after doing some learning of HTML and CSS. Long term I want to be making games put simply. There's so many people who feel being 19 is too old to learn to program and that is a sad thought. Firstly, all of you who are 19,23,24 learning to code to me I wish I had started learning at that age ! I'm 27 and I feel like I am nearing a point where am I learning too late ? If I am to master it and understand which will take years will I eventually be ready to take on a career or something when I'm like 30 odd and will that affect my chances ? Or Isit possible to have a good enough understanding and a few projects under my belt before I'm 30. I know this is a very generic question it all depends what I put in but what are other people's experiences ?

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

    Fear of open source

    Posted: 25 May 2019 01:38 PM PDT

    18 year old Irish student here, hoping to start Computer Science at college in September. For the past few years I've been learning a lot but I've never been able to actually apply what I've been learning. I really love learning about C++ but when I see code examples on GitHub it feels like I could never write something like it at my level.

    This sort of contributes to my fear of helping with an open source project; I'd be too overwhelmed to even begin making changes or helping out because my standard would be way too low to help in any meaningful way.

    Does anyone know of some beginner-friendly ways of starting work on open-source C++ programs?

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

    I created a tutorial for a neural network that learns to play a game.

    Posted: 25 May 2019 04:45 PM PDT

    Solving a problem on your own.... Teaches you a lot!

    Posted: 24 May 2019 11:56 PM PDT

    So a few days ago I was stuck on a problem on my project which I have been doing for some weeks. I am a college student learning django on my own. Apart from the theoretical knowledge I believe more in real world application . So I was trying to build a twitter clone by using django. The reason why I chose django is that I saw trends on the Internet that searches related to Django are increasing exponentially and also as PHP is getting older I saw some memes on it (lol). So coming to my problem I was stuck on creating a notification system using django. Actually because Django is fairly new so there were not many projects telling about this implementation. So I had to search around the internet on my own for its solution. What I experienced while solving this problem is that when you try to search for a particular solution, along the way you get to know a hell lot of new things which come in very handy and are very beneficial for you. I learnt a lot of things while searching for this solution and I think my understanding about django is improved. If I would have simply asked about this in a forum or something no doubt I would have got the solution very easily but I would have missed all the knowledge that way. So my advice for anybody would be that if you are stuck on a problem first try to solve it on your own and in the end even if you fail to solve it you would have learnt a lot of new things.

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

    Source documentation is underrated.

    Posted: 25 May 2019 06:29 AM PDT

    I usually never use source docs to learn or solve problems, instead I randomly look online like everyone else. This week I was trying to make a small app in python but I challenged myself to stick entirely to the python website's source documentation. The results were great, I managed to complete the project faster then I had expected given that this app was a new area of study for me. I also felt like I had learned 10x more in the process and I felt 10x more independent as a learner. The key to breaking impostor syndrome is having the confidence to not need other 3rd parties to show us how to do something specific, we, as engineers, should be able to read any fundamentals textbook and resolve the complex solution ourselves. Problem solving is our job, the resources are already right in front of us. I feel like allot of us waste too much time looking for solutions online when we should really practice coming up with them ourselves, I might be poking at the meta for programmers here but I genuinely believe the copy and paste culture is holding many of us back from learning at-least the basics.

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

    Mathematical concepts required for programming

    Posted: 25 May 2019 02:01 PM PDT

    I came across a few comments on various subreddits on how programming and coding is a very small part of CS and how mathematics is a major part of CS. Well, I intend to become a self taught programmer and I think I am well apprised with basic high school calculus.

    What topics should I begin covering thereafter? Also, it would be a huge help if I could get some examples of what mathematical concepts are applied in CS, how they are applied, and what areas require such applications.

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

    Understanding how recursion works

    Posted: 25 May 2019 12:15 PM PDT

    Recursion is one of the several topics that is very badly introduced to beginners. Most of the introductions tend to focus on the definition of recursion and how it is about breaking a large problem into several smaller problems and completely ignore how recursion works under the hood. Most of the explanations give one example and ask learners to practice more before they get the "hang" of it. I have had my share of struggles before finally understanding how recursion works. Here is my attempt at explaining recursion in an easily digestible way.

    To understand recursion, we first need to understand the concepts of stack frame and the call stack. Understanding a call stack is not that hard.

    Let's say, you have 4 methods, methodA(), methodB(), methodC() and methodD(). Let's say methodA() has a few lines of code, and then calls methodB(), which has a few more lines of code and then calls methodC() and and so on. Something like this:

    def methodA(p): q = p + 5 r = methodB(q) print(r+q) def methodB(s): t = s + 2 u = methodC(t) return u + t def methodC(v): w = v + 7 x = methodD(w) return w + x def methodD(y): return y + 9 

    The method definitions are quite straight forward. Now that the methods are defined, let us say we call methodA() with a value of 12

    methodA(12) 

    Before we move on, try to calculate what the methodA() will print when called with an argument of 12. If you have calculated the answer, following the next paragraph becomes easy. The answer is 97.

    In methodA(), the value of p will be 12 and the value of q will be 17. But when methodB() is being called, the value of q needs to be remembered as it will be used after methodB() returns with a value. So, the value of q will be stored in what is called a "stack frame" and pushed into a "call stack" before executing methodB() with the value of 17. The "stack frame" also contains information about where the code should start executing when the called method returns. The same way, when methodB() calls methodC(), a new stack frame is created for methodB() with s = 17, t = 19 and pushed to the call stack. So, finally when methodD() is called with a value of 26, the call stack contains 3 stack frames and looks like:

    methodC [v = 19, w = 26] methodB [s = 17, t = 19] methodA [p = 12, q = 17] 

    When methodD() returns with a value of 35, the top frame in the call stack is popped out. In our case, it is the stack frame of methodC(). In methodC(), the variable x will be assigned the value of 35 and the stack frame of methodC() already has the value of w as 26. So, methodC() returns a value of 61. At this time, the call stack has two stack frames

    methodB [s = 17, t = 19] methodA [p = 12, q = 17] 

    Now, in methodB(), u assumes a value of 61 and from the stack frame, we have t = 19, so, methodB() returns with a value of 80. Now, the last stack frame of methodA() is popped and r becomes 80. Since q is 17, the methodA() prints 97.

    This idea is neat, because this works well for any method hierarchy, and when one method returns, you continue with the top one in the call stack. If you have understood everything until this point, you are just one step away from understanding recursion.

    Recursion is when you call the same method again, and the magic is that the state of the method is kept in the call stack.

    Here is the recursive function to calculate a factorial. The function/method looks like this:

    def factorial(a): if a == 1: return 1 else: return a * factorial(a-1) 

    Now, let's say, we try to call

    factorial(5) 

    Notice, in the last line, we call the method factorial() again with a value of 4, so, a stack frame is created with a = 5 and after a few method calls when a = 1, the stack frame looks like

    factorial (a = 2) factorial (a = 3) factorial (a = 4) factorial (a = 5) 

    When a = 1, the method factorial() returns a value of 1 and from the top frame in the stack, a = 2, so, the method returns 2. When all the stack frames are popped, the method returns 24 and the value of a is 5, so, the final return value is 120.

    That is it! You have now understood how recursion works! It is now time to write a few recursive programs of your own.

    However, keep in mind recursion still has its pitfalls. The above case computed fine, but if we were to call

    factorial(1000000000000000000) 

    we will need 999999999999999999 stack frames before the answer is calculated. However, the call stack is not unlimited. When we keep adding a lot of stack frames into the call stack, we will eventually run into a "stack overflow" error (or a Recursion error) when the call stack runs out of space (The icon on the stack overflow site now makes sense, doesn't it?). Python and Java have ways of increasing the default call stack size.

    In the factorial() method, the condition for a == 1 that returns a value of 1 is very important to have, because without it, we will always run into a stack overflow exception(besides never getting a value). This is often referred to as the base case or the terminating case. Always think about the terminating case while programming a recursive function. For example, the factorial() function though having a terminating condition, is not fool proof, because it will produce a stack overflow error when we call

    factorial(-1) 

    So, be extra careful when dealing with recursion.

    I hope this helps! I love understanding complicated things and explaining them in an easy to understand way, so, if you are having a hard time understanding any concepts, let me know and I can attempt to explain them to the best of my abilities.

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

    I'm creating a free Python programming course and would love to know what you guys find most challenging with learning programming.

    Posted: 25 May 2019 04:48 AM PDT

    Hi all, I hope posting a survey is allowed; I read the rules and it seemed okay.

    I'm working on a free online programming course that teaches Python, and I would love to know what you are struggling most with when you were (or still are) learning yourself programming. So that hopefully, the course can actually help fix some real problems :)

    If you have the time to fill it out (it is very short) that would be amazing!

    https://forms.gle/X6rMJsf93yriChtm8

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

    Moving from python to C++ has been a hassle, and I want advice

    Posted: 25 May 2019 03:15 PM PDT

    I'm a hobbyist who primarily uses Python, but I've also messed around a small amount with lua, c#, c, and a couple other scripting languages in the past. I've spent some time with powerpc ASM too, learning how processors work, and what exactly is going on behind the scenes... on a powerpc chip, at least.

    My problem with C++ (and to a lesser extent, C), though, is that, even though it's so unbelievably fast once everything is in order and compiled, it seems so... SLOW to work with. The verbose, cryptic, long-form syntax is one thing, but setting up header files and makefiles and dependencies and preprocessor instructions, etc, further makes prototyping anything a huge PITA. I'm used to working with a handful of terminal windows and vim (i mostly use linux) and can experiment with things extremely quickly when I'm just using python, but I feel like that privilege is lost in other more powerful languages. I really do want to learn and understand it but it's just not as fun to exercise my curiosity, because the time investment for the same results are so much higher. However I do want to learn it, simply because it seems like there are more fun things I can do with it that are outside of Python's scope in terms of performance, and I don't like feeling "isolated" in a single environment like I do now.

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

    Recommendations to master CSS

    Posted: 25 May 2019 10:20 PM PDT

    Hi everyone,I know most of the basics of css but I want to become much better.So what are the best sources to learn css properly. Sources could be anything books or online tutorials m

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

    Is it best to learn a programming language by building?

    Posted: 25 May 2019 08:04 PM PDT

    I'm quite familiar with Python syntax and I want to challenge myself some more. Do I go about it by building a project?

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

    New here and need help! Bootcamps and edX

    Posted: 25 May 2019 09:09 PM PDT

    Ok, new to Reddit. New to Software Development. I have a few questions...

    1) Recommended Bootcamps with a Front End focus? 2) Best course(s) on edX to dip my toes in and make sure this is something I could excel at? 3) Any sage words of advice for someone just starting out?

    Thank you all in advance! -kasia

    Not sure if this belongs here or somewhere else lol

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

    Convert any html section to a image using a selector, easy job you think ?

    Posted: 26 May 2019 12:04 AM PDT

    I love challenging tasks and I think I just stumpled upon one of them tasks I don't think easy to acheive.

    I want to use any programming language, to fetch a html page then based on selectors, convert html to images.

    A realistic example could be, there's a website with html table, I want a image for each row... I will provide a html class selector to the code and code will generates image for whatever is returned for this class, if it's more then 1 element then multiple images...

    Fetching html and finding classes and html in them isn't a issue at all for me, I can use basically anything, what most challenging for me is to render this html just as it shows on website and convert to a image...

    Any real genius out there ?

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

    Stuck on SQL connecting to localhost.

    Posted: 25 May 2019 08:00 PM PDT

    Hi guys, I'm learning how to use SQL using an online tutorial involving POPSQL. I shut my computer down and came back to it and it will not connect. I get an error that says:

    ''' Uh oh :( connect ECONNREFUSED 127.0.0.1:3306 '''

    How can I rectify this?

    Thanks in advance.

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

    [c] Prevent child process from closing on EOF

    Posted: 25 May 2019 02:59 PM PDT

    I'm trying to write a program that will automatically send commands to child processes and occasionally will ask for user input when necessary. Right now I'm writing to files to communicate to the stdin of my child process. Unfortunately, I'm finding, a lot of programs will exit when they read EOF from stdin. The concept of my program depends on it being able to wait for user input from time-to-time. How can I prevent my child processes from closing when my program is waiting for user input?

    EDIT: Figured it out. See below in comments

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

    How do word processors / ereaders store highlighted text for later retrieval?

    Posted: 25 May 2019 07:25 PM PDT

    Hi, I'm just entering the world of programming so I hope my question is not too elementary…

    I'm trying to conceptualize how word processors and other programs that handle text like ereaders are able to store highlighted or tagged portions of text – that is, being able to indicate that there is a section within a string that is tagged, but the program is smart enough to know that if the document is edited, it can still recall the proper portions of text and highlight the appropriate section. If references to the highlight are stored within the text itself, or if there is a separate table that indicates the sections in the text to highlight (whether by character count, text position, etc…)

    Are there any tutorials for how to code this kind of functionality? I don't want to reinvent the wheel if it is ultimately a simple concept.

    Thanks!

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

    How do I create a Twitter reply bot that pulls specific information from a game server/leaderboard website?

    Posted: 25 May 2019 11:10 PM PDT

    Hey!

    So, long story short - I came up with a really cool idea but I have zero idea how to actually do it. I have zero experience with coding of any sort. I'm not necessarily looking for you to write the code/set this up for me. I'm more so looking for a point in the correct direction on how.

    The idea in theory is pretty basic I think. It's a Twitter bot for a specific game(s) where all you do is tweet the account your in-game username and you get an instant reply of your ranking. Example being: '@TwitterBot username5678' and the reply would be something along the basic lines of 'worldwide rank: 4519'.

    Creating something a bit more advanced is more what I'm thinking though. Where the account is dedicated to a single game on a single platform. You tweet to the account with your in-game username and the specific stats that you want to find out. Example being: '@TwitterBot username5678 !kill !rank !KD' and the reply would be 'Kills: 590 Rank: 610 KD: 2.30'

    I understand how to create a basic reply bot for Twitter with a generalized reply. But what I don't know how to do, is design a reply bot that pulls specific information from a game server or game stat website.

    If I could have some help with this, it would be really great and super appreciated because this is something I would love to start.

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

    "Make a 'TITANIC' using Netbeans IDE..."

    Posted: 25 May 2019 11:05 PM PDT

    So today I recalled a funny yet eye opening incident that I thought might be useful for some people here. I was in high school and there we had course of computer science which taught us Java. It was just an introductory course. Coming to the incident , since the start of the term 3 months had passed but there was no teacher teaching us this course. I really wanted to learn how to program so i was very upset. Then suddenly one day a teacher came took us to the lab saying lets do some programming. I was very happy and excited as I was going to learn how to code. In the lab he said, "Just right in front of you Netbeans IDE is opened . You have to make a Titanic by using the components pallet . Just drag and drop these components and let your creativity fly." And i was like what!!! I was very disappointed but did what I was told . Next day all of a sudden our principal came to the lab and started asking about various components . Luckily because of that Titanic exercise I was very much acquainted with all the components. Only then I realised the importance of that exercise. So I wanted to say that dont criticize your teacher, they know better than you what they are doing and how is it helpful.

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

    If I use VIM for a technical interview, but I'm clearly not a power user, will it look worse than if I didn't use VIM? Will it look better if I explain why?

    Posted: 25 May 2019 04:20 PM PDT

    My rationale for preferring it this way is as follows:

    On the whole, I feel like the best thing about VIM is that it allows you to create bugs faster than you can think, and the worst thing about IDEs is that they lag, which forces you to stare helplessly at your code and find bugs.

    But I had this one professor in college who thought anyone who hadn't mastered VIM or EMACS wasn't a real programmer, and because of that I have a handful of basic VIM commands in my muscle memory and it annoys me if they don't work.

    So I compromise on getting the VIM plugin for whatever IDE I'm using and not sweating it if my fingers want to go to the arrow keys or the mouse.

    Is that the sort of thing hiring managers want to hear?

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

    React.js Phone Screen & Pair Programming - need advice

    Posted: 25 May 2019 10:08 PM PDT

    I have a phone screen coming up that will be a pair programming session with React.js as the subject.

    Any advice / questions / possible react apps I could be asked to build?

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

    Can arrays hold duplicates? (Java)

    Posted: 25 May 2019 11:33 AM PDT

    Hey I know lists/collections can hold duplicates. Can arrays though?

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

    Need to create a database of local psychologists. How could or should I do this?!

    Posted: 25 May 2019 09:50 PM PDT

    I need to create a database that allows volunteers to search for psychology professionals by different criteria. Criteria would include type of therapy, hours available, cost, geographical location, languages etc. Initially the database would be just for professionals who have opted to get referrals from our organization, but eventually it would be nice to be able to migrate information from Psychology Today professionals list. Any tips on how to do this?

    We are a start up non-profit for helping people find a mental health professional, so we can't afford to hire a database expert currently! I don't have any programming skills but will try to learn what is necessary!

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

    Statistics: Trouble with R code

    Posted: 25 May 2019 09:28 PM PDT

    Howdy. Im learning to do PCA in statistics and Im supposed to use linear regression on my new variables. Here is the code I used:

    m1 = lm(bodyfat$BodyFat ~ pcbodyfat$x) m1

    Where 'bodyfat' is the dataset name and 'BodyFat' is the response variable, sorry if its super confusing.

    The output I got provided me with only the intercept value and not the classic table with the st error, tvalue and pvalue that im used to. here is a link to my output if it helps visualise [EDIT: apparently screenshots aren't allowed (sorry reddit) so Ive copied pasted output below instead]

    Call: lm(formula = bodyfat$BodyFat ~ pcbodyfat$x)

    Coefficients: (Intercept) pcbodyfat$xPC1 pcbodyfat$xPC2 pcbodyfat$xPC3
    20.195 2.936 -1.650 27.383

    In my experience the PC1, PC2 and PC3 should be listed under intercept

    Can anybody help identify what I've done and how to retieve my pvalues? Should I post in r/learnmath instead?

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

    Is it possible to create a WordPress blog section for my already existing website while keeping my website's Bootstrap navbar JS and CSS?

    Posted: 25 May 2019 09:17 PM PDT

    I have a non WordPress powered website https://scarymeter.com/ that I've managed to successfully create a WordPress sub-directory https://scarymeter.com/blog/ which I'd like to add blog posts to

    I'd like to use my existing Bootstrap navbar on all pages of the WordPress blog, however it requires JS Twitter Typeahead functions to work. Is it possible to integrate WordPress into a custom template that articles can be added into? I've looked everywhere and can't seem to figure this out.

    submitted by /u/00Terminator
    [link] [comments]

    No comments:

    Post a Comment