• Breaking News

    Thursday, October 1, 2020

    Techniques and tips to learn coding in a more efficient way. Some are backed by research in Neuroscience, Behavioral Psychology, and Years of experience. learn programming

    Techniques and tips to learn coding in a more efficient way. Some are backed by research in Neuroscience, Behavioral Psychology, and Years of experience. learn programming


    Techniques and tips to learn coding in a more efficient way. Some are backed by research in Neuroscience, Behavioral Psychology, and Years of experience.

    Posted: 30 Sep 2020 09:40 AM PDT

    Let's get to it.

    If you're not struggling, you're not learning.

    What's your idea of learning to code?

    Whip out your computer, type out a couple of cool commands. And bam - beauty personified.

    Sorry, nope.

    The process is at least 50% struggling especially at the beginning. And that's how it should be. I've seen people quit programming because they don't want to struggle with bugs. That's like hating the gym because you don't want workouts to hurt.

    But the struggle is the way.

    You don't run from bugs;

    You train yourself to find them quicker.

    A proficient programmer is an efficient detective of bugs.

    If you're feeling frustrated that things are not smooth, remember that this is how learning actually works.

    Neuroscience research confirms that practice doesn't simply make you perfect; it is deliberate practice to improve in a specific task that makes you better. And deliberate practice involves struggling.

    So your mantra should be:You code.

    You debug.

    You struggle.

    You overcome.

    And you repeat.

    If you've not struggled at all, you're simply playing around. If you struggle all the time, then the next section is for you.

    You're not dumb, you're learning at the wrong level.

    Let's start with a little analogy.

    Imagine learning the English language (the language of exceptions :)

    You start with a tutorial motivating you to learn to spell big words like ELEPHANT.

    But it's not working. After beating yourself for so long you decide to go to a lower tutorial and learn to spell smaller words like ANT.

    But you still struggle.

    So you conclude that you're dumb because you lowered your tutorial level and still didn't grasp anything.

    But when a new teacher investigates why you're struggling, they find out that you've been struggling because you actually don't know the English alphabets.

    Let's bring this home to our coding world.

    Some people jump into beginner tutorials to learn a React framework (ELEPHANT). Then realize it makes no sense so they move on to learn JavaScript (ANT). But that still makes no sense to them, so they quit.

    But they're simply working with something that's too advanced.

    Even introduction courses can be advanced because your thinking is not wired yet to programming in general. There's no shame in finding something lower than Intro courses and starting from there to build up to Intro courses.

    I don't see this recommended enough but if you're struggling with intro courses, you should consider Intro to programming for kids.

    Learn with tools like

    - Scratch,

    - Alice or

    - Codewars.

    Since you're older, you'll go through them faster. But they'll give you the much needed soft intro that makes sense and builds your appetite.

    Again, this has nothing to do with ego.

    It's your learning journey.

    If you learn the alphabets first, you'll gain the confidence needed to start spelling ANT, ELEPHANT, and later constructing long-winded sentences.

    It doesn't matter what discipline or area of coding you jump into, this holds for Intro to Python as much as it holds for Intro to Machine Learning.

    You'll learn more efficiently if you learn at the right level.

    Elevate how you learn with spaced repetition.

    This technique is from research in Neuroscience. And I'll summarize it short and quick.

    How it works:

    - You learn.

    - Recall in 48 hours.

    - Then review in 72 hours.

    Doing this:

    - You'll forget less.

    - Connect new ideas to old; and

    - Retain more in long term memory.

    I put 48 and 72 hours but you can expand that timeline to days and weeks. The most important takeaway is not to simply learn once. But to intentionally set aside time for you to come back and review.

    The longer the delay between reviews, the more it gets buried in long-term memory.

    - Duolingo uses it.

    - Quizlet adopted it.

    - You can also apply it.

    1 project > 10 hello worlds

    Don't get caught up in `hello worlds` forever.

    I understand the thrill of completing simple exercises: print "I am awesome" // print "you're cool".

    But I have to be honest with you, this won't cut it.

    Going back to our ANT analogy, no matter how many ways you rearrange the words ANT, you'll never arrive at ELEPHANT.

    No matter how many Intro tutorials you learn, you'll never really get past the basics unless you push yourself beyond that.

    But I don't know what projects to start as a beginner. No worries. Here are two examples:

    Random Password Generator

    • Creating a program that intakes some words from the user and then generates a random password using those words.

    Currency converter

    • Create a program that converts currencies from one unit to another, for example, converting Indian rupee into dollars, pound to euros, etc.

    If you find these boring, here are 40 other ideas to choose from

    And if all of them seem too difficult:

    • DM me and I'll create something that you can start with. Remember, this is not about ego; it's about your learning level and growth.

    Motivation is like taking a hot shower.

    Taking a hot shower feels good – you should do it.

    But if your hot water is out for 2 weeks, would you not shower?

    The question sounds ridiculous but in the same way, you really shouldn't base your learning on only days when you're motivated.

    There are lots of exciting days in coding; but there will also be dark, un-motivating days.

    Honestly, this is not just with coding. It's with life and embarking on any new adventure. But you have to train yourself to show up not only when you're feeling hyper inspirational but also on low, boring days.

    This doesn't mean forget motivation.

    Far from it - on days when you feel super motivated, use your motivation to quickly commit yourself to something big that will keep you accountable when the motivation goes dry.

    How? Join an accountability movement like

    • 30daysofcode
    • #100DaysOfCode
    • #30DaysOfCodingChallenge

    Something. Anything. To keep you accountable on slow days.

    In Behavioral Psychology, this is known as pre-commitment. You use moments when you're optimistic to commit yourself in the future for when you have zero optimism.

    The journey of learning is never-ending.

    No one teaches you how to learn. But it's crucial in going far.

    You may have started with the idea of simply learning to code or to one day become a developer. But there's more.

    When you come out on the other side, you'll come out not just a coder but a renewed person because you've picked up a new way of approaching things.

    Don't get me wrong. This isn't easy peasy lemon squeezy – you'll work like hell.

    But in the end, it'll be worth it not just because of coding but because of the joy of transforming yourself.

    Remember, the ball's always in your court…

    Thanks for reading.

    Not going to lie, this took a lot of hours.

    If you enjoyed it and you're on Twitter, like and retweet this thread to help spread the word. I know it sounds trivial but it actually really helps reach other people who need help.

    If you prefer a blog post format with images: here you go.

    This post is part of a series. In each post, I provide answers to questions and DMs that came from my 1st post. For now, I'm putting together resources and write-ups based on what people need the most help with. If you're interested and have more questions, let me know on Twitter. If you prefer sending a direct message, my DM is open.

    Heads Up - I love research so I tend to back my advice and approach with concepts from Behavioral Psychology and Neuroscience.

    Edit: typos fixed.

    submitted by /u/a-gentility
    [link] [comments]

    Secrets detection learning center: A complete handbook to understand leaked credentials and how to mitigate

    Posted: 30 Sep 2020 03:04 PM PDT

    Secrets inside git and other services is a well documented and growing threat, here is a comprehensive learning center that covers why leaked credentials is a threat, best practices and mitigation.

    https://www.gitguardian.com/secrets-detection

    submitted by /u/Mackenzie-GG
    [link] [comments]

    Learn how computers work by building a computer

    Posted: 30 Sep 2020 08:35 AM PDT

    I do not mean assemble a desktop, I mean build it using logic gates.

    I recently read Hackers by Steven Levy and am in awe of how the early computer industry got started. Not a small number of people designed a whole computer by themselves. I would have no idea as to how to create a computer but I can learn from others.

    Here's what I found.

    https://eater.net/8bit

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

    Should i "privatize" badly written projects on my github?

    Posted: 01 Oct 2020 12:59 AM PDT

    Lets say i have 5 open source projects.

    3 of them are "quick and dirty" spaghetti code.

    Should i privatize these 3, and only keep the two professionals public?

    Employers will surely have a look at my gh when applying

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

    Sleep on it!

    Posted: 30 Sep 2020 10:44 AM PDT

    I was killing myself yesterday working on my Calculator assignment through The Odin Project. I built the whole thing from scratch in one day and got the math functions working properly except for the big kicker. I was unable to string math equations together (12 + 7 - 5 * 3 = 42). I worked on this thing for probably close to 5 hours yesterday and 2 of that was testing to solve that bug. My wife and I had dinner plans so I was forced away from my computer but I did not stop thinking about it.

    I ended up not returning to it when we got back from dinner and slept instead. I woke up this morning and took a crack at it after some coffee and the problem was solved in 5 minutes.

    Lesson learned there to not overdue it each day. Take pride in what you are able to accomplish in one day and if you are banging your head against a wall sometimes its best to give your head a rest.

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

    Programming Podcasts?

    Posted: 30 Sep 2020 10:05 PM PDT

    I'm somewhat new to the programming scene and looking for a programming/tech podcasts. Excited to see what you guys listen to!

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

    Are there other differences between NoSQL vs SQL (besides table vs Json, schema vs schemaless)?

    Posted: 01 Oct 2020 01:14 AM PDT

    I am learning both SQL and NoSQL databases at the moment.

    But I can't seem to see any other differences between them.

    I know NoSQL store data in document format while SQL stores them in a table. I also know NoSQL is schemaless and SQL has a schema.

    My question is:

    If I enforce a schema on NoSQL database too, then there would be no extra differences between them, right?

    Since the attributes in SQL can easily be translated to NoSQL too. Or am I missing something important?

    Thank you.

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

    How do I get better at figuring out solutions to problems I don't understand?

    Posted: 01 Oct 2020 12:04 AM PDT

    Had to make a basic program for the possible movements a bishop chess piece could do (only 1 movement from a pre-determined position) in 25 minutes I didn't even know where to start, to figure it out... Could someone give me an example how you would go about figuring it out in your head step by step? Every time we get a task like this, my mind just goes blank and I can't do it in time, how do I learn, get better at problem solving? How should I approach it? Need advice :(

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

    Help with C++ clock problem.

    Posted: 30 Sep 2020 08:57 PM PDT

    Link to github gist of code. I have written a lot of the code, but i'm really struggling at determining whether a set time is AM or PM after it has been changed. That is in the very bottom section of the gist. Do I need a loop for this or something?

    Here is a description of the problem:

    Write a C++ program that reads in a time, along with a time adjustment. If you can, move the user forward or backward in time the appropriate amount. Alternatively, display the resulting time after the adjustment.

    Your program should take an input of the current hour and an 'A' or 'P' to indicate AM or PM. Next, your program should ask how many hours forward or backward you want to set the clock. Finally, the program should compute and output the resulting time.

    Do not assume that the number of hours adjusted will be fewer than 24 hours. The output should also be correct for times greater than 24 hours.

    submitted by /u/4ust1n0-
    [link] [comments]

    Any tutorials to develop custom feed in my app like Facebook and Reddit does??

    Posted: 30 Sep 2020 11:09 PM PDT

    Are there any tutorials out there who teach you building APIs like this and designing your app this way? All I see online is people teach CRUD operations :(

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

    Website design/development?

    Posted: 30 Sep 2020 08:01 PM PDT

    I'm a comp sci student who is not at all interested in web development, but my boss recently asked me if I could help them fix / re-design their website. I really want to help, but I never feel confident talking about stuff that I've only googled/had minimal experience with, so i was wondering what I could ask her with the limited knowledge that I have that would seem competent / help me to figure out where to go from there? Do I ask what platform she's using? does that matter, or should I just ask about the features she wants and see if ic an do something?

    thanks for your help.

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

    What are some good resources for learning AI?

    Posted: 30 Sep 2020 09:52 PM PDT

    I am taking an Artificial Intelligence class this semester and my professor isn't very difficult to understand and his teaching is hard to follow. According to some past students, most had this issue and the professor basing almost all of the class on the AI class at Stanford.

    Does anyone have some online resources for this subject, besides what is on the stanford website, that they would like recommend?

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

    C/C++ How To Make Syscalls Without <windows.h>

    Posted: 30 Sep 2020 09:34 PM PDT

    Asking for learning reasons. Assume Windows OS and C programming language.

    How do you make a Windows API call (kernel32.dll) directly in C code, without using a header file such as <windows.h>? What do <windows.h> and its sub-files do to make the call?

    • Is it using some kind of #preprocessor directive to tell the linker to include kernel32.dll function names?
    • Is it doing some kind of __asm() code?

    I took a peek at the <windows.h> source code, and it just #includes a bunch of other headers. I did a search on Stack Overflow, I didn't find this exact question.

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

    Any resources for creating a web framework like react?

    Posted: 01 Oct 2020 01:10 AM PDT

    Any resources or advice will be helpful thanks.

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

    C# Is system.net.socket a WebSocket?

    Posted: 01 Oct 2020 01:03 AM PDT

    I have 2 questions about the socket.

    1. Is system.net.socket a WebSocket?

    2. If system.net.socket is Websocket what is the difference between socket and WebSocket?

    3.What about socket.io ?

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

    Am I misunderstanding module.exports?

    Posted: 01 Oct 2020 12:56 AM PDT

    Using node.js I am attempting to share/modify an array across files. I have a main function that calls separate commands contained in other files. Breakdown:

    shared-list.js

    • declares an empty list named 'shared'
    • declares 'shared' as a module export.

    function1.js

    • Does the following inside an execute function as part of function1.js's module.exports

      • declares a list utilizing: const list = require('../shared-list');
      • pushes a value to 'list'
      • prints 'list' to console

    main.js

    • calls function1.execute
    • declares a list utilizing: var list = require('../shared-list');
    • prints 'list' to console

    When list is printed in function1 it always returns the expected value, but the value does not seem to persist when later called in main. I also noticed that the print statements happen in the reverse order than expected (main prints first followed by function1 module). If anyone is willing to help clarify what exactly I'm doing wrong I'd really appreciate it. If you need any more information please feel free to ask! Thanks.

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

    IP encryption on a laptop

    Posted: 01 Oct 2020 12:55 AM PDT

    This comment [1] says that you can "encrypt your IP". How can I do that? How can I encrypt my IP on a laptop?

    [1] : https://news.ycombinator.com/item?id=4175078

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

    Lost on a Python Assignment (Print an E out of asterisks, using nested for loops)

    Posted: 01 Oct 2020 12:52 AM PDT

    So I'm taking classes trying to learn the basics of coding, and the class uses terrible online teaching software called "MindTap", with the book and the coding interface built into the same website.

    I'm into unit 5 and have aced everything else except for this one ridiculous puzzle at the end, which the book does not give any context on whatsoever, and my mind cannot parse it. It starts to almost melt as soon as I try. My mind cannot hold and finagle around that much clutter at once.

    It wants me to use nested for loops and if statements to solve a random puzzle about arranging asterisks. Can someone take a look and give me some context on what the heck to do? I would greatly appreciate it.



    The Code is here:

    https://gist.github.com/Void-Eyes/a3eb573973cc25bb801cf4ab989c93db

    submitted by /u/Dead-Eyes
    [link] [comments]

    GIS / Python for advancing career

    Posted: 01 Oct 2020 12:48 AM PDT

    Hi all,

    I am about a year and a half from graduating with a BS in Environmental Science. I have taken GIS courses along with basis CS 101.

    I understand a lot of folks say python is a great language to learn for advancing your career. I also hear people say it depends on what you will be doing.

    If I am looking into a career within natural resources which language would be most beneficial to getting a solid job after graduation? I have had 2 internships, but only exclusively within enviro with field work type stuff. Nothing technical really.

    Additionally, which languages build best off of GIS?

    Thanks ahead, cheers.

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

    [HELP] Bash makefile doesn't echo variable value into markdown file

    Posted: 01 Oct 2020 12:36 AM PDT

    I am trying to learn Bash/ zsh scripting, and right now got stuck at a makefile problem. I am using macos Catalina with default zsh shell version 5.7.1, and output of bash --version is: GNU bash, version 5.0.18

    Now my problem: create_file.txt: ans="This is answer" echo "$ans" >> readme.md

    make create_file.txt it creates readme.md with text ns not This is answer. Let me clarify this one more time, if you run vim readme.md it has been populated by the string "ns" (without quote), not by the string "This is answer"

    I tried to google the cause of it but couldn't find. only found one at stackoverflow with sed but it went over my head.

    How to solve this issue, and also what is causing it?

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

    [JAVA] Am I stupid if I cannot find a way to implement Levenshtein Distance?

    Posted: 01 Oct 2020 12:20 AM PDT

    This is making me feel an absolute retard: https://www.codewars.com/kata/5259510fc76e59579e0009d4/train/java

    I understand how to do it in paper and how it's dinamically solved but when I open IntelliJ and try to do it step by step my brain freezes. Should I take LSD or go to Tibet and meditate? Or am I just stupid? It's level 5kyu, it's supposed to be a noob problem... What's going on with my brain? Why is it not functioning even if I tell him to fucking work because otherwise we will starve on a street?! Life is so complicated...

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

    C# my program keeps throwing this error: CS7036 There is no argument given that the corresponds to the required formal parameter ‘needed’ of ‘Program.AccountInfo.AmountNeeded(double)This is my first program with classes and I don’t know what to do with this error I’m so lost.

    Posted: 01 Oct 2020 12:13 AM PDT

    using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Funds { class Program { double tax = .025; double wage = 12; double hours = 7; class AccountInfo { private double balance; private bool balanceCheck = false; private string name; double left; public AccountInfo() { while (balanceCheck == false) { Console.Write("What is your name? "); name = Console.ReadLine(); Console.WriteLine($"Welcome {name}"); Console.Write("Enter your balance in the bank right now: "); balance = Convert.ToInt32(Console.ReadLine()); Console.WriteLine($"\n\nYour balance is {balance} is this true? "); string balanceCheckAnswer = Console.ReadLine(); if (balanceCheckAnswer.ToLower() == "yes" || balanceCheckAnswer.ToLower() == "true") { balanceCheck = true; } } } public double AmountNeeded(double needed) { left = balance - needed; return left; } class SavingFor { string title; double amountNeeded; double amountLeft public SavingFor() { Console.Write("What are you saving up for? "); title = Console.ReadLine(); Console.Write("\n\nHow much do you need to buy it? "); amountNeeded = Convert.ToDouble(Console.ReadLine()); amountLeft = ¡AmountNeeded!(amountNeeded); } } class Schedule { } } static void Main(string[] args) { } } 

    }

    Between the exclamation marks are where the error is coming from. They are not normally in the code

    Edit: ignore the title error. I fixed that one this is the new error: CS0120: An object reference is required for the nonstatic field, method, or property 'Program.AccountInfo.AmountNeeded(double)'

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

    Dynamic memory allocation

    Posted: 30 Sep 2020 11:47 PM PDT

    int n; scanf("%d",&n); int array[n]; 

    this vs. dynamic memory allocation. What does it mean?

    submitted by /u/Open-Cause3272
    [link] [comments]

    CodeWars - Replace With Alphabet Position - C Language - Compiler Errors

    Posted: 30 Sep 2020 11:46 PM PDT

    I'm looking for help on this CodeWars problem. I just started learning C. I've got a working algorithm, but I have some problems.

    • One of the secret tests is causing a segmentation fault. Solving this should solve the problem.
    • My compiler is giving the warning "ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]".
    • CodeWars compiler is giving the warning "fixture.c:17:11: warning: implicit declaration of function 'time' is invalid in C99 [-Wimplicit-function-declaration] srand(time(NULL));"

    Any help appreciated :)

    CodeWars Question

    https://www.codewars.com/kata/546f922b54af40e1e90001da/train/c

    Welcome. In this kata you are required to, given a string, replace every letter with its position in the alphabet.

    If anything in the text isn't a letter, ignore it and don't return it.

    "a" = 1, "b" = 2, etc.

    Example alphabet_position("The sunset sets at twelve o' clock."); Should return "20 8 5 19 21 14 19 5 20 19 5 20 19 1 20 20 23 5 12 22 5 15 3 12 15 3 11" (as a string)

    My Answer In C

    #include <string.h> // strlen #include <ctype.h> // tolower #include <stdlib.h> // malloc // #include <time.h> // trying to fix srand(time( warning. didn't work though char *alphabet_position(char *text) { if ( ! text ) return text; //if ( ! *text ) return text; int len = strlen(text) * 3 + 1; char *str = (char *) malloc(len); int i = 0; int pointer = 0; char value; int abcPosition; int digitLeft, digitRight; while ( (value = text[i]) ) { value = tolower(value); abcPosition = (int)value - 96; // ascii lowercase a = 97 // if single digit if ( abcPosition >= 1 && abcPosition <= 9 ) { str[pointer] = (char)(abcPosition + 48); // ascii 1 = 49 pointer++; } // if double digits else if ( abcPosition >= 10 && abcPosition <= 26 ) { digitLeft = abcPosition / 10; digitRight = abcPosition % 10; str[pointer] = (char)(digitLeft + 48); // ascii 1 = 49 pointer++; str[pointer] = (char)(digitRight + 48); // ascii 1 = 49, ascii 0 = 48 pointer++; } // add a space if ( abcPosition >= 1 && abcPosition <= 26 ) { str[pointer] = (char)32; pointer++; } i++; } // handle blank string as input, only punctuation as input, etc. if ( pointer == 0 ) { str = ""; text = str; return text; } // Delete last space. Replace it with string terminator. str[pointer-1] = '\0'; text = str; return text; } 
    submitted by /u/RedDragonWebDesign
    [link] [comments]

    No comments:

    Post a Comment