• Breaking News

    Sunday, August 2, 2020

    What have you been working on recently? [August 01, 2020] learn programming

    What have you been working on recently? [August 01, 2020] learn programming


    What have you been working on recently? [August 01, 2020]

    Posted: 01 Aug 2020 09:04 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]

    "Automate the Boring Stuff with Python" online course is free to sign up for the next few days with code COPSHOTMEINPORTLAND

    Posted: 01 Aug 2020 09:55 AM PDT

    https://inventwithpython.com/automateudemy (This link will automatically redirect you to the latest discount code.)

    You can also click this link or manually enter the code: COPSHOTMEINPORTLAND

    https://www.udemy.com/course/automate/?couponCode=COPSHOTMEINPORTLAND

    This promo code works until August 4th (I can't extend it past that). Sometimes it takes an hour or so for the code to become active just after I create it, so if it doesn't work, go ahead and try again a while later.

    Udemy has changed their coupon policies, and I'm now only allowed to make 3 coupon codes each month with several restrictions. Hence why each code only lasts 3 days. I won't be able to make codes after this period, but I will be making free codes next month. Meanwhile, the first 15 of the course's 50 videos are free on YouTube.

    You can also purchase the course at a discount using my code COPSHOTMEINPORTLAND or clicking https://inventwithpython.com/automateudemy to redirect to the latest discount code. I have to manually renew this each month (until I get that automation script done). And the cheapest I can offer the course is about $16 to $18. (Meanwhile, this lets Udemy undercut my discount by offering it for $12, and I don't get the credit for those referral signups. Blerg.)

    Frequently Asked Questions: (read this before posting questions)

    • This course is for beginners and assumes no previous programming experience, but the second half is useful for experienced programmers who want to learn about various third-party Python modules.
    • If you don't have time to take the course now, that's fine. Signing up gives you lifetime access so you can work on it at your own pace.
    • This Udemy course covers roughly the same content as the 1st edition book (the book has a little bit more, but all the basics are covered in the online course), which you can read for free online at https://inventwithpython.com
    • The 2nd edition of Automate the Boring Stuff with Python is free online: https://automatetheboringstuff.com/2e/
    • I do plan on updating the Udemy course for the second edition, but it'll take a while because I have other book projects I'm working on. Expect that update to happen in late-2020. If you sign up for this Udemy course, you'll get the updated content automatically once I finish it. It won't be a separate course.
    • It's totally fine to start on the first edition and then read the second edition later. I'll be writing a blog post to guide first edition readers to the parts of the second edition they should read.
    • I wrote a blog post to cover what's new in the second edition
    • You're not too old to learn to code. You don't need to be "good at math" to be good at coding.
    • Signing up is the first step. Actually finishing the course is the next. :) There are several ways to get/stay motivated. I suggest getting a "gym buddy" to learn with.
    submitted by /u/AlSweigart
    [link] [comments]

    Build a project. Don’t rely on tutorials

    Posted: 02 Aug 2020 12:11 AM PDT

    Hi reddit (first-time poster here)

    I'm a software instructor on Udemy (Rayan). I'm also filling an enterprise development position for the government of Canada.

    I noticed a lot of posters were discussing "tutorial hell". This is something my students have messaged me about as well.

    If you're in that position, I can't give you a concrete solution to becoming a professional developer. But, I can tell you what worked for me.

    1. Do not aimlessly watch tutorials. Look for tutorials that will help you build a project that you're planning.

    2. Plan a large scale project. Build it at any cost. I first learned how to program by building an anonymous chat application. This incorporated front-end and back-end. This also forced me to learn crucial design patterns (i.e MVC)

    3. Never fear bugs. Embrace them. Encountering a bug means you found a vulnerability in your app. This is great news! The easiest way to fix bugs is to set a series of breakpoints. Then, run print statements at each breakpoint. Or, sometimes it helps to compare the current version of your code to a previous version. See what changed. This may help isolate the issue. Of course, there are many ways to debug a program (some beyond the scope of this post) In any case, do not leave a bug unsolved. Resolve it at any cost. It's only when we struggle that we learn.

    4. A coder's best friend is stack. Everybody uses stack. It doesn't matter what level.

    5. There are many more things I could write about. But, I believe the first 4 points are the best advice I can give to a beginner in development.

    This may get lost in the millions of programming posts. But, I hope this can at least guide one person.

    Head up and happy coding!

    Edit: word

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

    I know very little programming, Where should I go to learn C++?

    Posted: 01 Aug 2020 08:38 PM PDT

    I want to learn C++ because its an inbetween for C and C#, both of which i want to know for work in the Linux kernel and for developing apps and games. My thinking is that if I learn C++, it would be easier for me to transition to C and/or C#, since I would already have a grasp of the C family of programming languages.

    Is there any online course you all recommend? im not an idiot when it comes to computers, but I don't know much about programming. The closest thing I got to programming was Scratch when I was in elementary school.

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

    What was the moment you started to really like a programming language you're learning?

    Posted: 01 Aug 2020 07:40 PM PDT

    In my case even though is not exactly about the language itself, it was while I was learning more typescript/javascript and realized that many of the tools I use also use it, for example VSCode and Joplin.

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

    MIT Open Course Ware - Fundamentals of Programming

    Posted: 01 Aug 2020 08:09 PM PDT

    I am making my way through MIT Open Course Ware. Looking for other resources that would closely align with 6.009 - Fundamentals of Programming.

    Would appreciate any information on alternative resources - especially of you have made a similar journey! Thanks in advance for any help :)

    Edit: Course builds off of Intro to CS and Python from MIT, linked:

    https://www.edx.org/course/introduction-to-computer-science-and-programming-7

    Course description: Introduces fundamental concepts of programming. Designed to develop skills in applying basic methods from programming languages to abstract problems. Topics include programming and Python basics, computational concepts, software engineering, algorithmic techniques, data types, and recursion. Lab component consists of software design, construction, and implementation of design.

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

    I'm looking for an "awesome" kinda list of implementations

    Posted: 01 Aug 2020 10:06 PM PDT

    that has links to blog posts that answer questions like "How do I write a window manager?" or "How do I write an init system?"

    I'm pretty sure I saw one on github (or maybe I saw it in a dream?), but I can't for the life of me google it

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

    Zero's Initiative AWS COURSE FOR FREE(Beginner)

    Posted: 01 Aug 2020 11:26 PM PDT

    https://www.udemy.com/course/the-aws-course/?couponCode=DE18609881A2B214054D

    Disclaimer: This is not SPAM and I know the Author Personally I have permission to share this LIMITED TIME COUPON CODE

    Happy Learning!

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

    Does anyone know of any interactive tools that will help you learn linkedlists, graphing, BST...etc interactively?

    Posted: 01 Aug 2020 08:21 PM PDT

    I'm feeling so overwhelmed! I'm going through CTCI and am so stuck!

    Thanks in advance.

    Aside: If you could also give me additional tips to prevent being panicked and frustrated (I seriously break down at how stupid I am), that would also be very helpful.

    Also, is there a way to increase IQ. I think eating protein and exercise helps. I know this sub isn't a place for therapy, but I feel like my long (years and years and years) frustrations about things, depression, and anxiety has killed my brain cells off for good.

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

    CSS or Javascript?

    Posted: 01 Aug 2020 04:14 PM PDT

    Hello everyone, i have began my journey a little over a month ago and have been focusing mostly HTML and CSS , from all kinds of sources i can find such as udemy courses, youtube, free code camp
    My question is should i spend some more time learning css or do i fully commit to Javascript?

    I have learnt enough to design decent looking web pages with html css and create clones of other websites to a good level, however i dont know if i should spend the rest of my time learning Javascript and its frameworks/libraries or still focus on css a bit, as i wanna know which will benefit more in a long run as i plan on having a job by next year summer, any advice on what i should focus my learning from now on is really appreciated !

    P.S. ( Before i begin learning anything related to Front-end Web dev i usually spend around a week or 2 going through other courses and introductions on topics before beginning starting curriculum on websites like FreeCodeCamp/Code Academy or The odin project so that i can fully understand everything im learning from all resources)

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

    Is polymorphism used only in classes?

    Posted: 01 Aug 2020 09:11 PM PDT

    In Python, polymorphism is described as "different behaviors happen depending on which subclass is being used, without having to explicitly know what the subclass actually is."

    My question is, can you use the same "root" idea of polymorphism, in that your algorithms can change, in other areas of programming, not specifically in Object-Oriented Programming?

    And in doing so, would that only apply to, say, security?

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

    Is C++ better than Java for game development?

    Posted: 01 Aug 2020 06:58 PM PDT

    I took Java in high school but I'm currently taking C++ in college, and I wanted to do some side projects with both to practice. I'm eventually planning on making some simple game with both, but I know that a few people I knew that went into game dev always used C++. This might sound like a stupid question, but is there some specific reason that C++ is better than Java (or other similar languages) for game design?

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

    What exactly separates a "tutorial-level" app from a "production-level" one?

    Posted: 01 Aug 2020 03:11 PM PDT

    When I go through a book or tutorial for building an application, invariably the author will mention how the app being built won't production-ready, as in ready to be put on the App Store, or something. Since that's ultimately my goal, this is a bit puzzling. I doubt it's as simple as throwing a few Exception handles in there, right?

    So, I'm just wondering what the differences in the code would be to get it to that level. Is it mostly a matter of being able to handle the data load on the backend on a remote server vs a local one?

    If there's any resources I could look at to figure out how to bridge the gap between the two, I'd appreciate a link to them.

    I'm mostly familiar with Python, but I've recently been getting into Kotlin for mobile app development.

    Thanks!

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

    Why do languages have different compilers?

    Posted: 02 Aug 2020 12:31 AM PDT

    A lot of programming languages have different compilers that allow different permissions or liberties, what is the reason behind that such as in Java or C++? Why not just use one type of compiler per language?

    submitted by /u/Instance-Famous
    [link] [comments]

    Does java have multiple compilers like C++?

    Posted: 02 Aug 2020 12:27 AM PDT

    So C++ has various compilers that can be used to uphold the standard such as clang or mingw. When I tried to research for Java, I could not come across different compilers, I may have researched wrong. Any reason for the difference between the two languages? I have only seen javac talked about on the web.

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

    Java: Classes, Polymorphism, and Methods

    Posted: 01 Aug 2020 08:24 PM PDT

    I've been doing pretty well in my Java class, and all of a sudden I feel like I hit a brick wall. I have 3 classes and a driver class, 2 of the classes are 2 separate species of animals that are supposed to hold various values of data. the 3rd class is a superclass that the other two extend off of. I also have my driver class which is where im getting stuck currently. Below are the sets of data I have and what I am trying to do. following that is the route I think I should take but feel as though I am wrong. Works in all caps are to distinguish my comments and questions.

    DATA BEING HELD IN THE THREE CLASSES

    protected String name;

    protected String type;

    protected String gender;

    protected int age;

    protected float weight;

    protected SimpleDateFormat acquisitionDate;

    protected SimpleDateFormat statusDate;

    protected String acquisitionSource;

    protected Boolean reserved;

    protected String trainingLocation;

    protected SimpleDateFormat trainingStart;

    protected SimpleDateFormat trainingEnd;

    protected String trainingStatus;

    protected String inServiceCountry;

    protected String inServiceCity;

    protected String inServiceAgency;

    protected String inServicePOC;

    protected String inServiceEmail;

    protected String inServicePhone;

    protected String inServicePostalAddress;

    WHAT MY DRIVER CLASS HAS SO FAR(IF I AM DOING IT COMPLETELY WRONG PLEASE LET ME KNOW)

    package modfive;

    import java.util.Scanner;

    import java.text.SimpleDateFormat;

    import java.util.ArrayList;

    import java.text.ParseException;

    public class Driver {

    public static String main(String\[\] args, Object userCity, Object userInput, String userEmail) { 

    Scanner scnr = new Scanner(System.in);

    // Instance variables

    System.out.println("Welcome to Grazioso Salvare!");

    // Create New Dog

    Dog dog1 = new Dog();

    // Create New Monkey

    Monkey monkey1 = new Monkey();

    //Adding an ArrayList to the program allows me to add cities to the program for comparison when requesting a rescue.

    ArrayList<String> citiesAvailable = new ArrayList<String> ();

    citiesAvailable.add("Chile");

    citiesAvailable.add("Greece");

    citiesAvailable.add("Japan");

    citiesAvailable.add("Madagascar");

    citiesAvailable.add("Singapore");

    citiesAvailable.add("South Korea");

    citiesAvailable.add("Turkey");

    citiesAvailable.add("United Kingdom");

    citiesAvailable.add("United States");

    // Method to process request for a rescue animal

    System.out.println("Enter country you reside in: ");

    userCity = scnr.next();

    if (userCity == citiesAvailable) {

    System.out.println("We are availble near you!");

    } else {

    System.out.println("I am sorry, we do not currenty operate near you. Please check frequently as we are expanding.");

    }

    System.out.println("Please enter the species of animal you want to rescue: ");

    userInput = scnr.next();

    if(userInput == dog1) {

    System.out.println("Good news! We have dog's availble!");

    } else if (userInput == monkey1) {

    System.out.println("Good news! We have Monkey availble!");

    } else {

    System.out.println("We're sorry we do not have that species availble at our rescue.");

    }

    System.out.println("Please enter you're email address for contact: ");

    userEmail = scnr.next();

    return userEmail;

    WHAT I STILL NEED TO ADD:

    // Method(s) to update information on existing

    I FEEL LIKE USING SETTERS AND GETTERS HERE? BUT I ALSO FEEL LIKE THAT WOULD BE REALLY REPETITIVE AND ADD A TON OF UN-NEEDED CODE.

    //Method to display matrix of aninmals based on location and status/training phase

    IM LOST ON THIS ONE AND THE FOLLOWING.

    // Method to add animals

    // Method to out process animals for the farm or in-service placement

    // Method to display in-service animal

    // Process reports from in-service agencies reporting death/retirement

    I am not looking to have my code written for me, but point me in the general direction of what in the actual F\** I need to do.*

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

    A weather API tutorial for one specific city?

    Posted: 02 Aug 2020 12:08 AM PDT

    I am trying to find a weather API tutorial (preferably for JavaScript) that will show the current weather for one specific city and does not allow user input, however I am only finding tutorials that allows user input for any city or based off user location.

    Thank you in advance!

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

    (JavaScript) How to sort an array by having items that also exist in another array appear first (alphabetically) and then the rest of the array items, not in the other array display after in alphabetical order?

    Posted: 02 Aug 2020 12:08 AM PDT

    I'd appreciate an answer. Thanks!

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

    What I need in order to build websites with wordpress?

    Posted: 02 Aug 2020 12:06 AM PDT

    Right now I know html,css and the fundamentals in javascript and I want to get into wordpress but I don't know how it works

    What techs does it use? How does it work? Which is the best way to learn building website with wordpress?

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

    ElectroCRUD 2 - Now Support SQLite (limited) | Open Source

    Posted: 01 Aug 2020 08:15 PM PDT

    Due to the requests for SQLite support (from here too), I worked hard the last days to release the first limited support for SQLite Database. The project is built on top of Electron (TS), If someone wants to help me I will grateful.

    https://garrylachman.github.io/ElectroCRUD/

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

    How can I build a news bot for my WhatsApp group

    Posted: 01 Aug 2020 11:55 PM PDT

    I need a bot that could automatically search for news from major websites then post the article in my WhatsApp group.

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

    Code Review Request

    Posted: 01 Aug 2020 11:51 PM PDT

    Hello I'm learning python and I'm just running through some of the problems on leetcode. I know this problem is marked as easy but it took me a while to figure it out and it was really satisfying when it finally worked. The thing is even though I know what's going on conceptually the code kind of looks a mess. I'm asking for tips on how to make it more readable or make it more obvious how the code is working.

    The problem:

    The count-and-say sequence is the sequence of integers with the first five terms as following:

    1 is read off as "one 1" or 11.

    11 is read off as "two 1s" or 21.

    21 is read off as "one 2, then one 1" or 1211.

    Given an integer n where 1 ≤ n ≤ 30, generate the nth term of the count-and-say sequence. You can do so recursively, in other words from the previous member read off the digits, counting the number of digits in groups of the same digit.

    Note: Each term of the sequence of integers will be represented as a string.

    My solution:

    class Solution: def countAndSay(self, n: int) -> str: count = 0 say = "1" map = {} c = count s = say m = map while c < n: m.update({(c+1): s}) c += 1 groups = [] uniquekeys = [] data = list(s) for k, g in groupby(data): groups.append(list(g)) uniquekeys.append(k) x = [] for i in range(0,len(uniquekeys)): x.append((str(groups[i].count(uniquekeys[i])) + uniquekeys[i])) s = "".join(x) return m.get(n) 

    PS: Yes I know it wasn't part of the problem to keep track of everything in a dictionary, I just did it because it made it easier for me to work through the problem.

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

    Want to learn a new language. C#/C++/Java

    Posted: 01 Aug 2020 11:41 PM PDT

    Hello~~ I am wanting to start learning/writing in a new language. I'm coming from mainly Python and light programming from various languages. There are a few things i want to do with my new language:

    •Develop android applications

    •Develop windows GUI applications

    •Potentially develop games in the language in the future

    My thoughts were initially Java, but one thing that struck me was Unity, for example which uses C#.

    So right now i'm leaning towards C# which is a more modern language than C++ and gives me the benefit of developing in unity, which i am already relatively familiar with.

    So ultimately my question is: Will i run into any issues developing Android apps and Windows apps by choosing to learn C# over Java? Is there a reason to choose C++ at the moment (I do have slight interest in low-level stuff)?

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

    JetBrains CLion (or any other program) to start learning C

    Posted: 01 Aug 2020 11:38 PM PDT

    I'm starting to learn C, the teacher recommended using CodeBlocks but I've recently updated my Macbook's OS and can't use CodeBlocks anymore since it's not possible to run 32-bit programs with the new update... He recommended me to use CLion, I just downloaded it but the program looks way more complicated than CodeBlocks, it looks more "professional" if that's the word?

    He also mentioned a program called CodeLite. Which one would you recommend? I'm only going to learn the basics of C.

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

    With dependency injection containers, what's the correct way to "own" the interface I'm using

    Posted: 01 Aug 2020 11:21 PM PDT

    I've been a "programmer" for a long time, but for the last decade and a half most of my work has been in SQL. I still touch C# from time to time and try to keep up with the language itself, but a lot of the developments in things like frameworks and patterns have passed me by. Today, I'm trying to understand the correct pattern to follow when using constructor injection and DI containers.

    Suppose I am writing a program, MyProgram, that has a need to enqueue and dequeue things. In other words, I want something which implements a contract, and of course what I need is defined by me:

    // somewhere in MyProgram.csproj interface IQueue<T> { void Enqueue(T item); T Dequeue(); } 

    I could write my own implementation:

    // somewhere in MyProgram.csproj class MyQueue<T> : IQueue<T> { ... } 

    Then I hear about an amazing queue someone else wrote, which I can just get via a nuget package.

    But when the third party author wrote their code, they used their own namespaces, their own interface names, and so on. They of course know nothing about my IQueue interface, so their implementation does not implement my interface.

    When looking at actual examples of DI container use on the net, I see a different approach. The author of MyProgram firsts builds (or downloads) an implementation, then extracts the interface from that (made easy by visual studio), or uses an interface that happens to already be defined on the third party. MyProgram is then written in such a way that it uses the interface so defined, and thus the interface can be used in a DI container. Conceptually it looks something like this:

    // in MyLibrary.csproj interface ISomeInterface { ... } class SomeClass : ISomeInterface { ... } // in MyProgram.csproj using MyLibrary; container.Register<ISomeInterface, SomeClass>(); 

    That seems wrong to me. If I'm writing a program that has certain requirements, then I should be specifying the required interfaces. But the catch 22 is that any concrete implementation written by anyone other than me won't specify that it implements my interface.

    I can see the obvious solution to this - I grab that third party queue, and then either inherit from it if appropriate, or compose it into my own impementation. When I do this, instead of having my program add a reference to the implementation, I turn that around and have the implementation reference my program, which has pre-defined the interfaces. And I wrap the implementation as appropriate. For example, with inheritance:

    // not necessarily in MyProgram.csproj using MyProgram; public class MyDerivedQueue<T> : ThirdPartyQueue<T>, IQueue<T> {} 

    or with composition...

    // not necessarily in MyProgram.csproj using MyProgram; public class MyComposedQueue<T> : IQueue<T> { private ThirdPartyQueue<T> queue; public void Enqueue(T item) { queue.Enqueue(item); } public T Dequeue() { return queue.Dequeue(); } } 

    Now dependencies have been inverted, and when I use the DI container, I am tying "arbitrary" implementations to interfaces defined by me, in MyProgram.

    My question is whether I'm thinking about this in the wrong way entirely. It seems to me the assertion that "I own my required contract" *must* be true, and so this pattern seems to follow. But most of the code I see doesn't do this. Instead, MyProgram takes a dependency on the implementation, and writes MyProgram according to an interface the library merely happens to define (or the author of MyProgram also writes the implementation, and so defines the interface they know they need). So I feel like I've missed something.

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

    No comments:

    Post a Comment