• Breaking News

    Tuesday, March 5, 2019

    Learn C++ through Code Character - An online AI programming challenge learn programming

    Learn C++ through Code Character - An online AI programming challenge learn programming


    Learn C++ through Code Character - An online AI programming challenge

    Posted: 04 Mar 2019 11:17 AM PST

    Hey /r/learnprogramming !

    We're a small team of undergraduates who developed Code Character, a game where you write bots in C++ in a turn-based strategy game, and challenge other players. After some great reception and feedback on this sub last year (post), we've built a brand new game with a new interface. We've tried to make it as beginner friendly as possible, so please do give it a shot! The entire coding environment runs in the browser, there's no setup required.

    The event also has prize money sponsored by our university's tech festival, and so we'll keep the event running until the 17th of March. Since we're an independent student team, we probably don't have the funding to keep it hosted much longer after that. We'll try to keep it alive for as long as possible though.

    Thanks!

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

    Free Full Stack Programming Book

    Posted: 04 Mar 2019 10:44 AM PST

    Hello r/learnprogramming!

    I wanted to share that my beta version of my full stack web development book is now live.

    You can check it out on my website: http://www.codexplore.io/books/crash-course/

    The Github is here: https://github.com/codexplore-io/crash-course-django

    This is just the "Beta version", so I am open to suggestions if anybody has them. I am using this book as an experiment in "open source publishing", so we shall see how it goes.

    I am working on building a programming education website that allows anybody to learn how to program. There are many like it, but I truly believe that people learn much differently, so as many different explanations out there will make it easier for those to learn. Feel free to subscribe to learn more about what we are doing in the next couple of months as we are actively expanding across content mediums. We are going to be putting together a podcast as well, so if you have anyone in mind you would love to hear interviewed in the realm of STEM in general (or specifically Django), PM me or send us a contact on our website at http://www.codexplore.io/contact.

    Please follow us on Twitter if you find our information useful: https://twitter.com/codexplore_io

    Any feedback on the book, website or company. would be great.

    Thank you!

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

    my teacher wrote an exception handling code that records the error message and line number in a text doc. if he gets a tech support call, he asks them to read that info and claims he reduces overall debugging time. is this typical?

    Posted: 04 Mar 2019 12:47 AM PST

    he makes it seem like no one else does this and he's so smart for it. i'm just curious

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

    Next step towards first job in programming?

    Posted: 04 Mar 2019 02:25 PM PST

    Hello r/learnprogramming I am 27 years old and am currently a veterinarian. I graduated vet school around 2.5 years ago and have been practicing since that time. I am currently unhappy with my current career path and want to find a way into computer programming. I am almost finished with a course on UDEMY and have learned the basics of html, css, js, and some of react. By the end of it I should know some node.js/express and mongodb as well. I understand that having taken a course on UDEMY and building a few pretty basic applications through that course is likely pretty useless for employers, as is a degree in veterinary medicine.

    The reason for this post is to get advice on what next step to take in order to get a "first job" in programming. I have done extensive research into bootcamps and still can't tell if that is the best course to take to get my foot in the door and make connections that I wouldn't otherwise be able to make on my own. Some people say they're great and some say they are a complete waste of time/money. Is there a different route that would be better (outside of just going back to college and getting a degree)?

    The main reason I'd consider a bootcamp is simply because it seems like (some of them) they get your foot in the door with certain companies. There are so many online resources that a boot camp really doesn't seem necessary to actually learn how to write code. I guess I just don't know how to go from learning coding to getting a job.

    I am very serious about making this change and am willing to put in the work required. Any help would be greatly appreciated.

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

    Should i start with learning C++? Or Python / Javascript?

    Posted: 04 Mar 2019 05:32 PM PST

    Title is self explanatory. I don't really care if C++ is hard to learn, i'm willing to go through the struggle as long as the reward fulfills me. It's my dream to make a website like YouTube (i know it seems far-fetched) so that should also play a factor into what language i choose, depending on which language a broadcasting site would use the most. I appreciate any answers, and thanks for taking the time to read my post!

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

    We're doing a FREE Data Analysis workshop in case anybody is interested (Python, Pandas, matplotlib)

    Posted: 04 Mar 2019 02:59 PM PST

    Hello folks 👋! Last year we taught the Free Python course that was really popular (+2K peeps), here are classes 1, 2 and 3. Now we are experimenting with making workshops that will hopefully be a little bit more interactive and more focused on special topics (instead of a broad Python class).

    Tonight Monday, March 4th, 8PM Eastern we are making a FREE Data Analysis using Pandas and Matplotlib workshop. The idea is to show you how simple it is to analyze and visualize data using these Python tools.

    👉 We'll livestream in our YouTube channel, there's NO registration, as it's completely open: https://youtu.be/JeVq6e0_FOE

    What will be the workshop about?

    The focus will be on Data Analysis: getting a data file, cleaning and doing different types of analysis: understanding how the data is distributed, if there are outliers, if there are interesting patterns, etc.

    We'll also include activities and exercises to resolve during the workshop.

    Requirements

    Basic Python knowledge, we'll give you instructions to set all your tools up online so you don't have to install anything extra.

    Questions/Support

    Please join our Open Python Community: http://slack.open-python-community.org. Lots of folks willing to help over there.

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

    Trying to use FLTK library in Visual Studio 2017

    Posted: 04 Mar 2019 10:45 PM PST

    I'm going through Bjanre Stroustrp's ' Programming: Principles and Practice Using C++'. A couple of the chapters in it require using the FLTK GUI library. I'm having trouble trying to incorporate the library in my code.

    I've used this guide to help me. I followed it through without any problem until the final step. Where I get the following errors during building.

    ERROR

    I can't get it to work and therefore can't go further in the book. Need help in sorting out this stuff.

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

    Counting function

    Posted: 04 Mar 2019 10:11 PM PST

    can anyone tell me why this function I wrote isn't working? I've defined all the variables and parameters but it won't run. It tells me <function sum\_list at 0x032A9348> I really don't know what I could be doing wrong

    https://paste.ubuntu.com/p/ctHyhBzzVm/

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

    Programming exercises for Sed, Awk, Grep, Egrep, and Perl

    Posted: 04 Mar 2019 03:14 PM PST

    I was reading about Awk after I saw this post on askubuntu: https://askubuntu.com/questions/1028488/ubuntu-very-slow-after-deleting-old-kernel-images-and-cleanup which led me to this page: http://www.grymoire.com/Unix/Awk.html and then to this page: (which was real interesting, and, on a side-note, from where I learnt a new word - abactinal! But I digress... ) http://matt.might.net/articles/sculpting-text/

    So they were interesting to read but I suck at thinking of things to do with stuff like this, so do you know of any good exercises that lead you from beginner towards intermediate in a way that teaches you how they would be used IRL, not just in a theoretical way (if that makes sense.)

    Also more of the math-type stuff like on the last page (the matt.might.net one) without going off the deep end - it has been a while since I did my A levels so my math is rusty but I could get back into it a bit with this stuff. TIA!!

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

    Help with review question [C, pointers]

    Posted: 04 Mar 2019 08:52 PM PST

    #include <stdlib.h> #include <stdio.h> int foo(int *x, int *y, int z) { y = x; z = 7; *y = z; } int main() { int a = 0, b = 1, c = 2; foo(&a, &b, c); printf("a = %d, b = %d, c = %d", a, b, c); return 0; } 

    What is printed in main?

    I'm having trouble understanding why the answer is 7, 1, 2. My current thought process is:

    y = x does not appear to do anything. I determined this by testing through commenting out (z = 7) and (*y = z). However, I'm not sure why doesn't it change the value of y. It because neither variable y nor x are pointing to values? From the answer of 7, 1, 2, I am guessing that somehow x points to the value of y?

    z = 7 sets a new variable z equal to 7 (but not the same z as in the parameters?).

    *y = z changes the value of what is pointed to by y to 7. However, this changes the value of x? Is it because of y = x above? Why is this?

    Thank you for your help. I am learning about pointers currently and it is still going a bit over my head. Please let me know if any of my terminology is incorrect. Any help to learn this is appreciated. :) Have a great day!

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

    Can I learn and code in Swift without a Mac?

    Posted: 04 Mar 2019 08:51 PM PST

    I currently don't have access to a Mac but interested in learning Swift/iOS development. I know it's probably a lot better to use a Mac, but for right now, is it possible to run code in Swift with a Windows 10 laptop?

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

    A chrome extension built using `Chain Of Responsibility` Principle for modularity and extensibility in Javascript.

    Posted: 05 Mar 2019 12:17 AM PST

    In python with pyttsx3 how can I use a custom voice? Is it even possible?

    Posted: 05 Mar 2019 12:00 AM PST

    Essentially I have a chatbot that I made. I want it to have the glados voice from portal. I have a .TTS file for said voice. No idea where to go from here. Thought it may be possible to pull a switcheroo with a file or something? Don't want to break anything though. Any advice? Also, what is a TTS file (I know it stands for text to speech but apart from that)?

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

    Finance to Web Development

    Posted: 04 Mar 2019 11:43 PM PST

    I currently work in the finance field and also graduated with a degree in Econ and Accounting at UCLA. I am currently learning coding as my past time (HTML, CSS then Javascript) and I've been enjoying it so much. My goal is to able to build websites and do a bit of web design too.

    Does anyone have advice or experience with switching their careers? I personally do not want to go back to school since I already have loans. I am happy to just learn from other resources online and books, which what I practically did in college too. I am currently 24.

    TLDR switching careers from finance/other fields to Web Development, any advice? Thanks!

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

    How to Deep Clone an Array in JavaScript

    Posted: 04 Mar 2019 11:41 PM PST

    Is this much focus on theory normal?

    Posted: 04 Mar 2019 05:39 PM PST

    Hi, I recently joined a programming course at a location in my country and I'm a bit concerned about the teacher's methods. The first lesson was 3h of uninterrupted bombardment of terms & theory with no breaks. Out of 3h the lesson lasted, we did "hello world" for 5 minutes and remaining 2:55h was him almost reading from a book.

    Is this how programming is usually learned? I never saw it as this theory focused, I watched Bob Tabor videos before and it was nothing like this. I'm not one against theory, but this was like 5% talking about the actual code we did and rest was him talking about terms, not asking questions or trying to make us think. I'm pretty sure my fellow course-goers learned nothing today so I' concerned that he isn't the greatest teacher, but maybe it was just the wrong first impression.

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

    When does my code start to look less like shit?

    Posted: 04 Mar 2019 11:18 PM PST

    I've been studying javascript everyday for 5+ hours for about 2 weeks now, and I'm doing some problem sets. I can make the code produce the right answers for the exercises.. but when I compare my code to the reference solution, it is sometimes close, and other times WAY off on HOW it was written.

    The solutions have less lines of course, but the biggest difference is how the functions are planned out.

    For example, there's this code:

    var inventory = [

    {

    name: 'Brunello Cucinelli',

    shoes: [

    {name: 'tasselled black low-top lace-up', price: 1000},

    {name: 'tasselled green low-top lace-up', price: 1100},

    {name: 'plain beige suede moccasin', price: 950},

    {name: 'plain olive suede moccasin', price: 1050}

    ]

    },

    {

    name: 'Gucci',

    shoes: [

    {name: 'red leather laced sneakers', price: 800},

    {name: 'black leather laced sneakers', price: 900}

    ]

    }

    ];

    And it asks you to return this:

    [

    {

    "nameWords": [

    "tasselled",

    "black",

    "low-top",

    "lace-up"

    ],

    "targetWordIndex": 3

    },

    {

    "nameWords": [

    "tasselled",

    "green",

    "low-top",

    "lace-up"

    ],

    "targetWordIndex": 3

    },

    {

    "nameWords": [

    "red",

    "leather",

    "laced",

    "sneakers"

    ],

    "targetWordIndex": 2

    },

    {

    "nameWords": [

    "black",

    "leather",

    "laced",

    "sneakers"

    ],

    "targetWordIndex": 2

    }

    ]

    First.. it takes me pretty long to do it. And once it's tested and working, I compare my code to the reference and the reference has functions that are planned out a bit differently.

    Sometimes it's pretty close though, just minor differences in how it's broken up. And that makes me wonder if it's individual styles of writing, or if I'm just doing it wrong.

    How long does it take to learn to write functions and code that is well planned out? I am in the phase where I used to write everything as 1 function (doing small toy problems), to now writing functions that call other functions, using less variables and block statements, etc.

    The hardest part is breaking it up into little functions that are 100% efficient. I assign too many variables, use if statements when there methods like filter that I didn't think to use. etc.

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

    Best engine for a text and image-based game with graphics?

    Posted: 04 Mar 2019 11:10 PM PST

    Hey, I'd like to make a text and image-based adventure game, with a pretty shell, sprites, and backgrounds like this mockup I made. I also want to have a main menu with buttons that looks like this.

    What is the best/easiest engine to do this with? I am familiar with C++ but am not committed to any particular language.

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

    [DEBUGGING][C++] Simple Rock Paper Scissors Project

    Posted: 04 Mar 2019 07:11 PM PST

    Hello! I was given a project to make a simple rock, paper, scissors text game. Player 1 and player 2 input their choice of "R", "P", or "S", and the program determines who is the winner, and why. I am at a relative loss what to do at this point as to debugging this program. I have whittled it down to a couple of errors regarding two variable. Please help me finish r/learnprogramming , you're my only hope:

    //Program Start!

    #include <iostream>

    #include <string>

    using namespace std;

    int main() {

    //variable declaration char P1, P2; string p1out, p2out; //input (initializing variables for the program & displaying initial menu prompts) cout << "Bruhh let's play Rock, Paper, Scissors bruhh" << endl << "P = Paper" << "S = Scissors" << endl << "Player 1, play your hand!" << endl; cin >> p1out; cout << "Player 2, play your hand!" << endl; cin >> p2out; 

    switch (P1) { case 's': case 'S': P1 = 'S'; p1out = "scissors"; break; case 'r': case 'R': P1 = 'R'; p1out = "Rock"; break; case 'p': case 'P': P1 = 'P'; p1out = "Paper"; break; } switch (P2) { case 's': case 'S': P2 = 'S'; p2out = "scissors"; break; case 'r': case 'R': P2 = 'R'; p1out = "Rock"; break; case 'p': case 'P': P2 = 'P'; p2out = "Paper"; break; //evaluating and computing results if ((P1 == 'R') && (P2 == 'S') || ((P1 == 'S') && (P2 == 'P') || (P1 == 'P') && (P2 == 'R'))) cout << P1 << " wins because " << p1out << " beats " << p2out; else if ((P2 == 'S') && (P2 == 'R') || ((P1 == 'P') && (P2 == 'S') || (P1 == 'R') && (P2 == 'P'))) cout << P2 << " wins because " << p2out << " beats " << p1out; else ((P1 == 'R') && (P2 == 'R') || ((P1 == 'S') && (P2 == 'S') || (P1 == 'P') && (P2 == 'P'))); { cout << "Nobody wins"; } } 

    }

    ERROR

    Code C4700 | Unitialized local variable 'P1' used

    Code C4700 | Unitialized local variable 'P2' used

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

    i really struggle with this?

    Posted: 04 Mar 2019 10:46 PM PST

    i really struggle when i get a programming code challenge no matter how much i know about the concept, for example i learned about array list in a course and i really understood it very well but when i got an challenge after it i "just had no idea at all from where to start and what to do ", can anyone please help me on how to deal with situations and how to break down the question and plan your answer then code.

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

    Question about formatting a number

    Posted: 04 Mar 2019 10:21 PM PST

    So I need to format a number so that if it is less than 10, it will print out with a zero in front of it. As an example, 9 would print out as 09, but a two digit number like 15 would print out as 15. However, I am not allowed to simply prepend the number with a zero if it is less than 9. Any suggestions on how to do this? I thought about .format but couldnt think of any way to make it work.

    Thanks for your help.

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

    How would I use one class in an other in Java?

    Posted: 04 Mar 2019 10:04 PM PST

    Specifically in Eclipse. I have one class with a main method, but I want to use objects of another class (without a main method) inside the first class.

    EDIT: Should probably mention that my first thought was to just write "public class [A] extends [B] () {" but it didn't seem to work, so I'm guessing I'm doing something wrong and misunderstood what "extends" or "implents" do.

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

    Class design question to create an infection class that determines if a patient has an infection or not.

    Posted: 04 Mar 2019 09:57 PM PST

    I have an upcoming interview where this question might be asked. I might only have about 10-15 minutes to solve this program on a whiteboard. This question is not verbatim but what I could gather from online:

    "Create an infection class that determine whether a patient has an infection. An infection could be determined by several factors, one of them is based on fever. Everyone would have a different "normal" fever level, 1 degree fluctuation is considered normal. Identify infection locations."

    • Since everyone will have a different normal body temperature, my solution to handle this is to calculate the median value. Every time a patient temperature is recorded, we'll store it in an array with previous temperature, and calculate the median which will return an index and use that index to grab the median value.
    • Since +1 fluctuation is normal, I will add 1 degree to my median value and compare that against the recently recorded temperature. If the temperature is above my median+1 value, then the patient has a fever.

    The part where I'm confused is if fever is only one factor in determining an infection, how would I actually determine if the patient has an infection? Or would I only need to return a percentage of how much having a fever plays a part in determining the infection? The last sentence said to identify infection locations but that is impossible for a program to do since it would need a real doctor diagnosis.

    Guesswork is fine since the requirement is pretty much open to interpretation. I just trying to gain insights.

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

    Any programming projects that helped start you off?

    Posted: 04 Mar 2019 06:10 PM PST

    Any ideas for small beginner projects would be nice (python 3). I started watching a beginner guide to python and I learned a lot from it but I started wondering how to build a basic calculator. I learned how to make the calculator and I just realized how much I learned from just one project! Im thinking that by doing lots of mini projects I can start to understand python more. Im just struggling to find any meaningful projects that will help me with programming so any project that a beginner can learn from would be great.

    Thanks for reading/answers :)

    submitted by /u/-AJM-
    [link] [comments]

    Java Q - Best Practice when passing a variable (that we don't want to be altered) to a method? e.g. inside

    Posted: 04 Mar 2019 09:49 PM PST

    public void test (Vector3 receivedVec) { Vector3 newVec = receivedVec; newVec.scl(2f); System.out.println("newVec: " + newVec); } 

    Saw we make a call to this method

    Vector3 sendingVec = new Vector(1,1,1) test(sendingVec); System.out.println("sendingVec: " + sendingVec); 

    Output is

    newVec: (2.0,2.0,2.0) sendingVec: (2.0,2.0,2.0) 

    When we set newVec in the test method it seems it now points to exactly the same object as recievedVec and sendingVec. Any changes to any of them will be reflected in the others.

    If I don't want changes to newVec to effect sendingVec what is the best practice to achieve this? I assume it's a common problem. I could either send a copy to the test method. i.e.

    test(sendingVec.cpy()); 

    Or within test method when we create newVec I could create it off a copy instead. i.e.

    Vector3 newVec = receivedVec.cpy(); 

    Or maybe something else? Looking for best practice when dealing with this common problem. Thanks!

    submitted by /u/223am
    [link] [comments]

    No comments:

    Post a Comment