• Breaking News

    Saturday, July 13, 2019

    I created a video for watching experienced engineers add features to real codebases they've never seen before! learn programming

    I created a video for watching experienced engineers add features to real codebases they've never seen before! learn programming


    I created a video for watching experienced engineers add features to real codebases they've never seen before!

    Posted: 12 Jul 2019 05:57 AM PDT

    TLDR: Here's a video of an experienced engineer adding a feature to a codebase they've never seen before. It's an open source clone of medium, and it's less about the code they write and more about the process they go through (e.g. how do they find where to add the code, what questions do they ask themselves, when do they start thinking about design).

    I've been subscribed to /r/learnprogramming for a couple of years now when I started to learn to program and have found the content very useful. Since then, I career switched into being a software developer about a year ago. I'm posting on a new account as I'd like to keep my main private.

    I really enjoy video content and learnt so much from places like youtube (e.g. Traversy Media), thoughtbots free upcase, devtube or udemy courses. Watching experienced devs code and talk through their process really works for me.

    Why I created this video: Something I've tried to find online quite a few times (unsuccessfully) are videos of devs adding features to real code bases that they've never seen before. I really wanted to see how they navigate it (e.g. how do they find where they need to make the code?) and learn about what process they go through (e.g. what questions do they ask? When do they start thinking about design?) .

    What this video is about: I'm in the video along with a colleague (experienced engineering lead) James. I ask James to add a simple feature to a codebase he's never seen before (an open source clone of Medium, called stories). It's less about the code he writes and more about watching his process, with me doing my best to stop him and explain why he's doing what he's doing.

    I hope that by watching this you'll get a few things:
    1. You'll see that experienced devs don't magically know where everything is, they have to go through a process of investigation and digging, just like you. It's actually quite simple steps and you can replicate them easily.

    1. You'll get to see what a real codebase actually looks like. This isn't a particularly complex codebase, but it's a fully functioning site. In the next one I think I'm going to use a bigger app that has a massive amount of complexity.

    2. Hopefully you'll get some practical tips on how to navigate a codebase you have never seen before, and some insight into what kind of questions you might want to ask yourself/your colleagues.

    This is just the first video and I'm really keen for feedback. I couldn't find this content online and I hope to start providing more of it, and the more constructive feedback I get the better I can make it :) What did you find useful? What would you like more/less of? What would you like to see in the next one?

    HERE's the link to the post. It's a blog post that has a summary and the video itself.

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

    How should I organize my programming learning time?

    Posted: 12 Jul 2019 04:49 PM PDT

    So I work a full-time job and can usually only devote around 2-4 hours a day learning. As such, this is what my current breakdown looks like:

    - 1-3 algorithm tests on LeetCode.

    - A section on FreeCodeCamp (currently on the React section).

    - If I have time, I'll watch a Udemy course. Currently going through Stephen Grider's React course.

    I was wondering what people thought of this breakdown? Is this an efficient use of my time? I'd like to transition onto a full-time role as a software developer in the near future, and would love to know if there's anything I'm missing.

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

    Youtube videos for web development interview questions and answers

    Posted: 12 Jul 2019 05:56 PM PDT

    I'm trying to find videos for React, JavaScript, Node, web development, etc that are questions you'll most likely get asked during an interview and answers for them. I guess technical questions that don't include coding. Was curious if anyone has any recommendations because I've been going through a lot of videos that include coding questions. It's mainly because I drive a lot and what to get this stuff stuck in my head

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

    I did a workshop at a local user group on learning programming through game development. Here are the assets.

    Posted: 12 Jul 2019 06:50 PM PDT

    I double checked all the rules of the subreddit. The assets are available freely on Itch, no paywall or registration: https://dragonruby.itch.io/dragonruby-gtk-workshop

    If you have any questions or feedback, post a comment there or here and I'll answer them :-)

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

    Looking for buddies / mentor to contribute to open source projects

    Posted: 13 Jul 2019 12:27 AM PDT

    Hey,

    I'm looking for buddies / mentor to contribute to open source projects together..

    Message me your discord if you also feel for that! :)

    Thanks.

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

    How to create frequency lists for a given type of words?

    Posted: 13 Jul 2019 12:22 AM PDT

    I have several text files and wanted to create 2 different types of frequency lists:

    1. Frequency list of all the words in round brackets i.e. ().
    2. Frequency list of all the words at the beginning of a sentence.

    I'm clueless as to how I'm gonna do this. Do you have any idea on how to do this?

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

    Programming College Recomendations

    Posted: 12 Jul 2019 04:34 PM PDT

    So my friend and I are a year away from entering college and we're planning to study programming (I know the basics of C, C++, and Java, he is a blank slate) so we can establish an indie development studio of our own with some other friends or apply for a job in a company like Google and such, I know it sounds a bit visionary and not all that likely to happen but I guess only the future will tell

    With that in mind, we've searched for schools where we can learn everything we need and I thought "why not ask the senior programmers of Reddit?"

    So, where did you guys study? Or to what places do you recommend we apply to? I've also read about people being self-taught developers so out of the two what do you recommend?

    Right now we are looking to study abroad because I don't know if my country (Mexico) has what we are searching for, but if someone knows a good school to apply to here that would be great, either way, we are already saving money to try and afford all the expenses and if possible with our grades get a scholarship

    And if you took the time to read all the way to get down here, thanks :)

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

    Queue implementation using linked list

    Posted: 12 Jul 2019 10:22 PM PDT

    Hi, so I have a Node class, a LinkedQueue class and a Job class (queues store objects of this class).

    I am getting errors. I hope someone can point me in the right direction. I have included screenshots for clarity. I dont understand what "Job class (queues store objects of this class)" means. Does that mean "Job" is an abstract data type.

    ahhh the learning process.

    Error:(59, 55) java: incompatible types: java.lang.Object cannot be converted to Job

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

    confused to start with deep program learning

    Posted: 12 Jul 2019 04:23 PM PDT

    i have studied and understood the basic of cs, data structures, oops, c & c++.

    Now what should i do? Go with C/C++, to get them strong or go with python/java.

    I don't know what to do.., help needed.

    If i have to go with c/c++, where should i start and how? any methods? same question for python/java also.

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

    What to do about enums in base classes?

    Posted: 12 Jul 2019 09:51 PM PDT

    I have a base class with an enum holding various errors. This stack overflow question says that enums can't be inherited, OK cool. My question is what happens if I make an identically named enum in a derived class? Does it overwrite the base class enum? is there anything to overwrite since the base enum only exists in the base class namespace? Can I still access the base enum with base::enum? Do I need a "using" keyword?

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

    Unhandled Exception: System.Net.WebException

    Posted: 12 Jul 2019 09:43 PM PDT

    I have a program in C# that takes a url and downloads the images off the page onto a folder on the users computer. It works fine until about the 21st image and then it stops working and gives me this error. I'm Not sure why this is happening.

    Code:

    using System;

    using System.Collections.Generic;

    using System.IO;

    using System.Linq;

    using System.Net;

    using System.Text;

    using System.Threading.Tasks;

    using System.Windows.Forms;

    using static System.Net.Mime.MediaTypeNames;

    using System.Drawing;

    using Image = System.Drawing.Image;

    using System.Drawing.Imaging;

    using System.Runtime.InteropServices;

    using System.Security.AccessControl;

    using System.Security.Principal;

    using System.Security.Permissions;

    using System.Security;

    namespace ConsoleApp12

    {

    class Program

    {

    public static string pah = "";

    public static string src = "";

    public static int start = 0;

    static void Main(string[] args)

    {

    int num = 0;

    GrantAccess("C:\\My kitty collection");

    for (int i = 0; i > -1 ; i++)

    {

    FindSrc();

    num++;

    Console.WriteLine("src number" + num.ToString());

    Console.WriteLine(pah);

    try

    {

    SaveImage(pah + "\\kitty" + num.ToString() + ".jpg", ImageFormat.Jpeg, src);

    }

    catch (ExternalException)

    {

    //Something is wrong with Format -- Maybe required Format is not

    // applicable here

    Console.WriteLine("Error:Wrong Format");

    }

    catch (ArgumentNullException)

    {

    Console.WriteLine("Error: Stream is bad");

    //Something wrong with Stream

    }

    }

    }

    public static void FindSrc()

    {

    string url = "https://www.google.com/search?q=kitty&source=lnms&tbm=isch&sa=X&ved=0ahUKEwix57KhhbHjAhWSB80KHa21BL8Q_AUIECgB&biw=1920&bih=920";

    WebClient client = new WebClient();

    string html = code(url);

    int beg = html.Substring(start).IndexOf("img height")+start;

    int mid = html.Substring(beg).IndexOf("src");

    int end = html.Substring(beg + mid + 5).IndexOf("\"");

    src = html.Substring(beg + mid + 5, end);

    start = beg + mid + 5 + end;

    Console.WriteLine(src);

    }

    public static void SaveImage(string filename, ImageFormat format, string imageUrl)

    {

    WebClient client = new WebClient();

    Stream stream = client.OpenRead(imageUrl);

    Bitmap bitmap; bitmap = new Bitmap(stream);

    if (bitmap != null)

    bitmap.Save(filename, format);

    stream.Flush();

    stream.Close();

    client.Dispose();

    }

    public static String code(string Url)

    {

    HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create(Url);

    myRequest.Method = "GET";

    WebResponse myResponse = myRequest.GetResponse();

    StreamReader sr = new StreamReader(myResponse.GetResponseStream(), System.Text.Encoding.UTF8);

    string result = sr.ReadToEnd();

    sr.Close();

    myResponse.Close();

    return result;

    }

    public static void GrantAccess(string file)

    {

    bool exists = System.IO.Directory.Exists(file);

    if (!exists)

    {

    DirectoryInfo di = System.IO.Directory.CreateDirectory(file);

    pah = di.FullName;

    Console.WriteLine("The Folder is created Sucessfully");

    }

    else

    {

    Console.WriteLine("The Folder already exists");

    }

    DirectoryInfo dInfo = new DirectoryInfo(file);

    DirectorySecurity dSecurity = dInfo.GetAccessControl();

    dSecurity.AddAccessRule(new FileSystemAccessRule(new SecurityIdentifier(WellKnownSidType.WorldSid, null), FileSystemRights.FullControl, InheritanceFlags.ObjectInherit | InheritanceFlags.ContainerInherit, PropagationFlags.NoPropagateInherit, AccessControlType.Allow));

    dInfo.SetAccessControl(dSecurity);

    }

    }

    }

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

    [Python] Cannot properly close socket in server program

    Posted: 12 Jul 2019 03:45 PM PDT

    I have a program in which I have a server and a client and I am trying to receive TCP packets from the client. I create the socket an I bind the socket to the port. The client (which is not shown here) knows the IP address of the server. The issue I have is that I cannot run this server code twice with the same port number. If I do it twice, I get an "address already in use error". I believe I am not closing the socket correctly. What do I need to do?

    #server import socket # TCP/IP socket sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # Bind the socket to the port server_address = ('10.0.2.6', 2113) print('Starting up {} port {}'.format(*server_address)) sock.bind(server_address) # Listen for incoming connections sock.listen(1) # The number of queried connections. while True: # Wait for a connection print('waiting for a connection') connection, client_address = sock.accept() try: print('connection from', client_address) # Receive the data in small chunks and then send back while True: data = connection.recv(90) print('received {!r}'.format(data)) if data: print('sending data back to the client') connection.sendall(data) else: print('no data from', client_address) break finally: print("Closing current connection") # Cleans up the connection connection.close() 

    The exact error I have is below:

    Starting up 10.0.2.6 port 2113 Traceback (most recent call last): File "/home/lubuntu/Server", line 9, in <module> sock.bind(server_address) File "/usr/lib/python2.7/socket.py", line 228, in meth return getattr(self._sock,name)(*args) socket.error: [Errno 98] Address already in use [Finished in 0.1s with exit code 1] [shell_cmd: python -u "/home/lubuntu/Server"] [dir: /home/lubuntu] [path: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin] 
    submitted by /u/gamefaqs_god
    [link] [comments]

    Getting a wrong answer due to testing on Hackerrank, but when I run my code I get the right answer. Test case is adding my variable to the output which is getting it marked wrong.

    Posted: 12 Jul 2019 09:30 PM PDT

    https://www.hackerrank.com/challenges/py-if-else/problem

    Compiler Message

    Wrong Answer

    Input (stdin)

    3

    Your Output (stdout)

    n: Weird

    Expected Output

    Weird

    https://pastebin.com/5iLmijgR

    I don't understand why the test case is adding the variable to the output

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

    C++, what does it mean when there's a colon in a function (not a class) declaration/definition?

    Posted: 12 Jul 2019 12:33 PM PDT

    what does it mean when there's a colon in a function definition? I know a colon in a class declaration means inheritance, but what about in functions?

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

    A heavily tested (2k lines) and commented classic Red Black Tree implementation in Python and Ruby. Great for learning the material.

    Posted: 12 Jul 2019 05:11 PM PDT

    Back when I was trying to implement the structure, I could not find any open source implementations that were well written and commented. I did not manage to find any implementation that had any significant amount of tests and as such was not sure if it even worked correctly.

    I tried my best to describe the different operations needed thoroughly and have written a lot of tests (functional too) covering all operations, with drawn out trees in comments.

    https://github.com/Enether/Red-Black-Tree

    Any feedback is greatly appreciated :)

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

    Trouble setting up a virtual environment and installing/running django on windows 10 with python.

    Posted: 12 Jul 2019 08:28 PM PDT

    I am trying to set up a virtual environment and run django. I'm using the guide from https://developer.mozilla.org/en-US/docs/Learn/Server-side/Django/development_environment. I put in $ mkvirtualenv my_django_environment. and then i just have spam of "Running virtualenv with interpreter c:\users\owner\appdata\local\programs\python\python37-32\python.exe" it goes nowhere and i have to CTRL C to stop. Any advice would help.

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

    Question for javascript expert

    Posted: 12 Jul 2019 08:28 PM PDT

    I have two divs on my index.html. One called nameDiv and one called gameDiv. gameDiv has style="display:none".

    I would like to get the user's first name first, which is why nameDiv is showing first because it has a simple html form that asks for their first name. Thing is, index.html also has the following..

    <script src="/socket.io/socket.io.js"></script> 

    so io.on('connection', (sock) => {...}); on the server side is being called. What's a good way to get the user's first name first before io.on is being called?

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

    What are the best IDEs to use for Python GUI applications?

    Posted: 12 Jul 2019 07:52 PM PDT

    Something similar to using Visual Basic on Visual Studio.

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

    Why have an Init() or Run() function?

    Posted: 12 Jul 2019 12:17 PM PDT

    Doing C++ and noticed that a lot of classes have an Init() or Run() function rather than putting everything under the constructor (Ex. glfwInit()). Can someone explain to me the benefits of this are? I'm guessing it is to postpone instantiation but if you construct the class, obviously you are going to be using it anyway.

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

    Trying to get into a Web design school looking for advice

    Posted: 12 Jul 2019 07:48 PM PDT

    Hope this isn't breaking a rule but I was looking into going to Lambda and applying for the stipend so I could go into it full time without starving to death but they aren't accepting anymore applicants at this time, those that managed to go how did you get through the 9 months? Those who couldn't afford it what resources did you end up using to get started? I did Colt Steele's Udemy courses and found that this would be a field I would enjoy I just need a little nudge in the right direction!

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

    Why is Using Streams to Iterate Over Object Lists Slower for the First Iteration

    Posted: 12 Jul 2019 07:32 PM PDT

    Let's assume that I have some code that uses streams to iterate over a list of 10,000 objects. Each object has a getter called getNumber for a string attribute existing within that object.

    public void objectStreamIteration(List<FakeObject> myList){ List <FakeObject> copyMyArray = new ArrayList<>(); copyMyArray.addAll(myList); Instant starts = Instant.now(); copyMyArray.stream().forEach( element -> { element.getNumber(); } ); Instant ends = Instant.now(); System.out.println("With Stream Iteration "+ Duration.between(starts, ends)); } 

    Let's assume I run that method twice. The first time I run it, the message With Stream Iteration PT0.066S is printed out. Then, within the same running process, I call that method again. During the second call, the message With Stream Iteration PT0.001S is printed. The second time I call that method the time is always .001S. The first time its usually greater than .066S. Why is that? I cant make head or tails of it.

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

    How can I ask for user input in my server.js file? Prompt isn't working for some reason.

    Posted: 12 Jul 2019 07:30 PM PDT

    I'm trying to get a user's first name, but not sure how. I thought I could use prompt like so..

    var person = prompt("Please enter your first name"); 

    But it says that prompt is not defined. Then I tried

    var person = window.prompt("Please enter your name"); 

    same thing except now window is not defined.

    Any solutions?

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

    Coding Jokes on NXT

    Posted: 12 Jul 2019 02:46 PM PDT

    In my summer program, we're making robots to perform simple tasks, running on Lego NXT and controlled by Logitech gamepads. The instructor has given us the opportunity to perform a joke action, one of our own choice, when the Konami code is input. Any ideas?

    The robots are four-wheeled, ours has a flywheel intake and an extendable arm.

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

    No comments:

    Post a Comment