• Breaking News

    Thursday, August 13, 2020

    3 important tips for anyone who wants to learn programming learn programming

    3 important tips for anyone who wants to learn programming learn programming


    3 important tips for anyone who wants to learn programming

    Posted: 12 Aug 2020 10:16 PM PDT

    Hi all, I have taught computer science and programming courses since 2003 and since schools are about to re-start, I wanted to share these 3 important tips/reminder with anyone who wants to learn programming:

    1- Focus on learning the concepts of how to program rather than programming languages. Once you learn the logic, design and the concepts of programming fundamentals, learning different languages becomes easier since its just a syntax.

    2- Make sure to learn the basic functionality of the IDE you'll be using first before starting to code in it, to eliminate the added frustration of not knowing where things are. ( example: how to start a new project, how to open an existing project, where does your projects get saved at, how to retrieve it, where is your output console, how to run and debug and .etc)

    3- Give yourself a break and know that there will be a learning curve. Don't get disappointed if you don't understand something or many things. It's very normal! You'll need patience, perseverance, and lots of practice.

    Best of luck!

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

    My books on regex and grep/sed/awk are free through this weekend

    Posted: 12 Aug 2020 03:31 AM PDT

    Hello!

    At the end of March, I had made all my ebooks free to download (see this post) and uploaded markdown source files as well to GitHub repos. In April, I decided to update my existing books instead of starting a new one. I had expected it to take about 1 to 1.5 months. But when I started incorporating changes based on reader feedback (like adding more exercises, solutions, clarity to some sections, epub version, etc), it took until yesterday to finish the updates (and there's still some pending minor tasks).

    All the six ebooks consisting of regex (Ruby, Python, JavaScript) and cli tools (GNU grep and ripgrep, GNU sed, GNU awk) are free until this weekend (Aug 16, 2020) and then go back to being paid. You can get pdf/epub versions from either of these links:

    I'm also creating web versions of these books, done for the three regex books so far:

    I hope you find my books useful. I'd highly appreciate your feedback so that I can continue improving my books. Happy learning and stay safe.

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

    Pluralsight : Every course is free this weekend only.

    Posted: 12 Aug 2020 09:44 PM PDT

    Link

    Sign up to get notified when Free Weekend starts so you don't miss out. Free Weekend starts Friday 8/14 at 9am MT.

    Prepare yourself for a weekend filled with as much learning as you can handle.

    We're unlocking our technology skills platform and making our 6,500+ expert-led video courses, 40+ interactive courses and 20+ projects free for one weekend only.

    So get your work zone ready for some serious skill development because it's time to take advantage of our platform free for three glorious days, starting Friday.

    Your free Pluralsight access will expire Sunday, August 16 at 11.59 p.m. MT.

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

    Why use else statements when you can just say if a again rather than else if

    Posted: 12 Aug 2020 12:28 AM PDT

    It just seems weird to me

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

    To all the programmers, is it just me or does majority of our coding comes from coy-paste-modify and knowing what to copy/modify?

    Posted: 13 Aug 2020 01:25 AM PDT

    Honestly speaking, I am just an average coder.

    I can't say I've coded anything from scratch (if it means without using code bits from anywhere). I've mostly used many references from SO and other place on the internet.

    For me, developing something means dividing the whole task into small sub-tasks and coding them out with references from internet whenever required.

    So, are there people out there who can code with just minimum references/docs?

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

    I don’t expect anyone to respond to this unless your bored outta your mind and want to fix code. This is c# I wrote it to do an equation for a game called space engineers and I know it can be shorter I just don’t know how.(They’re are no bugs it works perfectly it’s just unnecessarily long.)

    Posted: 12 Aug 2020 08:48 PM PDT

    using System; using System.Data.SqlTypes;

    public class SpaceEnginnersThrust {

    static public void Main() { /*If you want to find the speed your ship is able to go type speed then enter how many large atmospheric thrusters are on your ship. Then enter it's weight in kilograms. If you want to know how many large atmospheric thrusters you need on your ship first type thrust then type speed in meters per second. Finally add the weight of your ship in kilograms. If you want to know how heavy your ship is first type in weight then type your speed in meters per second afterwards enter in how many large atmospheric thrusters your ship has. */ string option = Console.ReadLine(); Console.Write("Do you want to find weight, speed, or thruster power? "); if (option == "weight") { weight(); } else if (option == "speed") { speed(); } else { thrust(); } } //Main ends here static public void weight() { string thrusterB = Console.ReadLine(); Console.WriteLine("Your using a {0} thruster", thrusterB); if (thrusterB == "small atmospheric") { double kn = 96; double thrusters1 = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("You have {0} thrusters on your ship.", thrusters1); double ms1 = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("\nYour ship can go {0} meters per second", ms1); double kg1 = thrusters1 * kn * 1000 / ms1; Console.WriteLine("\nYour ship weighs {0} kilograms.", kg1); } else if (thrusterB == "atmospheric") { double kn = 648; double thrusters1 = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("You have {0} thrusters on your ship.", thrusters1); double ms1 = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("\nYour ship can go {0} meters per second", ms1); double kg1 = thrusters1 * kn * 1000 / ms1; Console.WriteLine("\nYour ship weighs {0} kilograms.", kg1); } else if (thrusterB == "large atmospheric") { double kn = 576; double thrusters1 = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("You have {0} thrusters on your ship.", thrusters1); double ms1 = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("\nYour ship can go {0} meters per second", ms1); double kg1 = thrusters1 * kn * 1000 / ms1; Console.WriteLine("\nYour ship weighs {0} kilograms.", kg1); } else if (thrusterB == "extra large atmospheric") { double kn = 6480; double thrusters1 = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("You have {0} thrusters on your ship.", thrusters1); double ms1 = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("\nYour ship can go {0} meters per second", ms1); double kg1 = thrusters1 * kn * 1000 / ms1; Console.WriteLine("\nYour ship weighs {0} kilograms.", kg1); } if (thrusterB == "small ion") { double kn = 14.4; double thrusters1 = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("You have {0} thrusters on your ship.", thrusters1); double ms1 = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("\nYour ship can go {0} meters per second", ms1); double kg1 = thrusters1 * kn * 1000 / ms1; Console.WriteLine("\nYour ship weighs {0} kilograms.", kg1); } else if (thrusterB == "ion") { double kn = 31.25; double thrusters1 = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("You have {0} thrusters on your ship.", thrusters1); double ms1 = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("\nYour ship can go {0} meters per second", ms1); double kg1 = thrusters1 * kn * 1000 / ms1; Console.WriteLine("\nYour ship weighs {0} kilograms.", kg1); } else if (thrusterB == "large ion") { double kn = 172.8; double thrusters1 = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("You have {0} thrusters on your ship.", thrusters1); double ms1 = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("\nYour ship can go {0} meters per second", ms1); double kg1 = thrusters1 * kn * 1000 / ms1; Console.WriteLine("\nYour ship weighs {0} kilograms.", kg1); } else if (thrusterB == "extra large ion") { double kn = 4320; double thrusters1 = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("You have {0} thrusters on your ship.", thrusters1); double ms1 = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("\nYour ship can go {0} meters per second", ms1); double kg1 = thrusters1 * kn * 1000 / ms1; Console.WriteLine("\nYour ship weighs {0} kilograms.", kg1); } if (thrusterB == "small hydrogen") { double kn = 98.4; double thrusters1 = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("You have {0} thrusters on your ship.", thrusters1); double ms1 = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("\nYour ship can go {0} meters per second", ms1); double kg1 = thrusters1 * kn * 1000 / ms1; Console.WriteLine("\nYour ship weighs {0} kilograms.", kg1); } else if (thrusterB == "hydrogen") { double kn = 1080; double thrusters1 = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("You have {0} thrusters on your ship.", thrusters1); double ms1 = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("\nYour ship can go {0} meters per second", ms1); double kg1 = thrusters1 * kn * 1000 / ms1; Console.WriteLine("\nYour ship weighs {0} kilograms.", kg1); } else if (thrusterB == "large hydrogen") { double kn = 480; double thrusters1 = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("You have {0} thrusters on your ship.", thrusters1); double ms1 = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("\nYour ship can go {0} meters per second", ms1); double kg1 = thrusters1 * kn * 1000 / ms1; Console.WriteLine("\nYour ship weighs {0} kilograms.", kg1); } else if (thrusterB == "extra large hydrogen") { double kn = 7200; double thrusters1 = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("You have {0} thrusters on your ship.", thrusters1); double ms1 = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("\nYour ship can go {0} meters per second", ms1); double kg1 = thrusters1 * kn * 1000 / ms1; Console.WriteLine("\nYour ship weighs {0} kilograms.", kg1); } } static public void speed() { string thrusterA = Console.ReadLine(); Console.WriteLine("Your using a {0} thruster", thrusterA); if (thrusterA == "small atmospheric") { double kn = 96; double thrusters2 = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("You have {0} thrusters on your ship.", thrusters2); double kg2 = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("\rYour ship weighs {0} kilograms.", kg2); double ms2 = (thrusters2 * kn) / (kg2 / 1000); Console.WriteLine("Your ship can travel at a speed of {0} meters per second", ms2); } else if (thrusterA == "atmospheric") { double kn = 648; double thrusters2 = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("You have {0} thrusters on your ship.", thrusters2); double kg2 = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("\rYour ship weighs {0} kilograms.", kg2); double ms2 = (thrusters2 * kn) / (kg2 / 1000); Console.WriteLine("Your ship can travel at a speed of {0} meters per second", ms2); } else if (thrusterA == "large atmospheric") { double kn = 576; double thrusters2 = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("You have {0} thrusters on your ship.", thrusters2); double kg2 = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("\rYour ship weighs {0} kilograms.", kg2); double ms2 = (thrusters2 * kn) / (kg2 / 1000); Console.WriteLine("Your ship can travel at a speed of {0} meters per second", ms2); } else if (thrusterA == "extra large atmospheric") { double kn = 6480; double thrusters2 = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("You have {0} thrusters on your ship.", thrusters2); double kg2 = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("\rYour ship weighs {0} kilograms.", kg2); double ms2 = (thrusters2 * kn) / (kg2 / 1000); Console.WriteLine("Your ship can travel at a speed of {0} meters per second", ms2); } if (thrusterA == "small ion") { double kn = 14.4; double thrusters2 = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("You have {0} thrusters on your ship.", thrusters2); double kg2 = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("\rYour ship weighs {0} kilograms.", kg2); double ms2 = (thrusters2 * kn) / (kg2 / 1000); Console.WriteLine("Your ship can travel at a speed of {0} meters per second", ms2); } else if (thrusterA == "ion") { double kn = 31.25; double thrusters2 = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("You have {0} thrusters on your ship.", thrusters2); double kg2 = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("\rYour ship weighs {0} kilograms.", kg2); double ms2 = (thrusters2 * kn) / (kg2 / 1000); Console.WriteLine("Your ship can travel at a speed of {0} meters per second", ms2); } else if (thrusterA == "large ion") { double kn = 172.8; double thrusters2 = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("You have {0} thrusters on your ship.", thrusters2); double kg2 = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("\rYour ship weighs {0} kilograms.", kg2); double ms2 = (thrusters2 * kn) / (kg2 / 1000); Console.WriteLine("Your ship can travel at a speed of {0} meters per second", ms2); } else if (thrusterA == "extra large ion") { double kn = 4320; double thrusters2 = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("You have {0} thrusters on your ship.", thrusters2); double kg2 = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("\rYour ship weighs {0} kilograms.", kg2); double ms2 = (thrusters2 * kn) / (kg2 / 1000); Console.WriteLine("Your ship can travel at a speed of {0} meters per second", ms2); } if (thrusterA == "small hydrogen") { double kn = 98.4; double thrusters2 = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("You have {0} thrusters on your ship.", thrusters2); double kg2 = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("\rYour ship weighs {0} kilograms.", kg2); double ms2 = (thrusters2 * kn) / (kg2 / 1000); Console.WriteLine("Your ship can travel at a speed of {0} meters per second", ms2); } else if (thrusterA == "hydrogen") { double kn = 1080; double thrusters2 = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("You have {0} thrusters on your ship.", thrusters2); double kg2 = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("\rYour ship weighs {0} kilograms.", kg2); double ms2 = (thrusters2 * kn) / (kg2 / 1000); Console.WriteLine("Your ship can travel at a speed of {0} meters per second", ms2); } else if (thrusterA == "large hydrogen") { double kn = 480; double thrusters2 = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("You have {0} thrusters on your ship.", thrusters2); double kg2 = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("\rYour ship weighs {0} kilograms.", kg2); double ms2 = (thrusters2 * kn) / (kg2 / 1000); Console.WriteLine("Your ship can travel at a speed of {0} meters per second", ms2); } else if (thrusterA == "extra large hydrogen") { double kn = 7200; double thrusters2 = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("You have {0} thrusters on your ship.", thrusters2); double kg2 = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("\rYour ship weighs {0} kilograms.", kg2); double ms2 = (thrusters2 * kn) / (kg2 / 1000); Console.WriteLine("Your ship can travel at a speed of {0} meters per second", ms2); } } 

    static public void thrust() { string thruster = Console.ReadLine();

     Console.WriteLine("Your using a {0} thruster", thruster); if (thruster == "small atmospheric") { double kn = 96; double ms3 = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("Your ship can travel at a speed of {0} meters per second", ms3); double kg3 = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("\rYour ship weighs {0} kilograms.", kg3); double thruster3 = ms3 * (kg3 / 1000) / kn; Console.WriteLine("\nYour ship will need exactly {0} thrusters.", thruster3); } else if (thruster == "atmospheric") { double kn = 648; double ms3 = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("Your ship can travel at a speed of {0} meters per second", ms3); double kg3 = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("\rYour ship weighs {0} kilograms.", kg3); double thruster3 = ms3 * (kg3 / 1000) / kn; Console.WriteLine("\nYour ship will need exactly {0} thrusters.", thruster3); } else if (thruster == "large atmospheric") { double kn = 576; double ms3 = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("Your ship can travel at a speed of {0} meters per second", ms3); double kg3 = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("\rYour ship weighs {0} kilograms.", kg3); double thruster3 = ms3 * (kg3 / 1000) / kn; Console.WriteLine("\nYour ship will need exactly {0} thrusters.", thruster3); } else if (thruster == "extra large atmospheric") { double kn = 6480; double ms3 = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("Your ship can travel at a speed of {0} meters per second", ms3); double kg3 = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("\rYour ship weighs {0} kilograms.", kg3); double thruster3 = ms3 * (kg3 / 1000) / kn; Console.WriteLine("\nYour ship will need exactly {0} thrusters.", thruster3); } if (thruster == "small ion") { double kn = 14.4; double ms3 = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("Your ship can travel at a speed of {0} meters per second", ms3); double kg3 = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("\rYour ship weighs {0} kilograms.", kg3); double thruster3 = ms3 * (kg3 / 1000) / kn; Console.WriteLine("\nYour ship will need exactly {0} thrusters.", thruster3); } else if (thruster == "ion") { double kn = 31.25; double ms3 = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("Your ship can travel at a speed of {0} meters per second", ms3); double kg3 = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("\rYour ship weighs {0} kilograms.", kg3); double thruster3 = ms3 * (kg3 / 1000) / kn; Console.WriteLine("\nYour ship will need exactly {0} thrusters.", thruster3); } else if (thruster == "large ion") { double kn = 172.8; double ms3 = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("Your ship can travel at a speed of {0} meters per second", ms3); double kg3 = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("\rYour ship weighs {0} kilograms.", kg3); double thruster3 = ms3 * (kg3 / 1000) / kn; Console.WriteLine("\nYour ship will need exactly {0} thrusters.", thruster3); } else if (thruster == "extra large ion") { double kn = 4320; double ms3 = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("Your ship can travel at a speed of {0} meters per second", ms3); double kg3 = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("\rYour ship weighs {0} kilograms.", kg3); double thruster3 = ms3 * (kg3 / 1000) / kn; Console.WriteLine("\nYour ship will need exactly {0} thrusters.", thruster3); } if (thruster == "small hydrogen") { double kn = 98.4; double ms3 = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("Your ship can travel at a speed of {0} meters per second", ms3); double kg3 = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("\rYour ship weighs {0} kilograms.", kg3); double thruster3 = ms3 * (kg3 / 1000) / kn; Console.WriteLine("\nYour ship will need exactly {0} thrusters.", thruster3); } else if (thruster == "hydrogen") { double kn = 1080; double ms3 = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("Your ship can travel at a speed of {0} meters per second", ms3); double kg3 = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("\rYour ship weighs {0} kilograms.", kg3); double thruster3 = ms3 * (kg3 / 1000) / kn; Console.WriteLine("\nYour ship will need exactly {0} thrusters.", thruster3); } else if (thruster == "large hydrogen") { double kn = 480; double ms3 = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("Your ship can travel at a speed of {0} meters per second", ms3); double kg3 = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("\rYour ship weighs {0} kilograms.", kg3); double thruster3 = ms3 * (kg3 / 1000) / kn; Console.WriteLine("\nYour ship will need exactly {0} thrusters.", thruster3); } else if (thruster == "extra large hydrogen") { double kn = 7200; double ms3 = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("Your ship can travel at a speed of {0} meters per second", ms3); double kg3 = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("\rYour ship weighs {0} kilograms.", kg3); double thruster3 = ms3 * (kg3 / 1000) / kn; Console.WriteLine("\nYour ship will need exactly {0} thrusters.", thruster3); } } } 
    submitted by /u/NathanTuc
    [link] [comments]

    Im making a program in c on macos. however instead of a CLI interface i want to make GUI interface. How would i go about this?

    Posted: 12 Aug 2020 10:09 PM PDT

    As the title suggests, Im making a program in c on macos. however instead of a CLI interface i want to make GUI interface. How would i go about this?. google isnt being my friend?

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

    Looking for a beginner friendly project? Want to practice some API usage?

    Posted: 13 Aug 2020 03:07 AM PDT

    Hello everyone,

    I often read posts here from people who don't know which project to tackle next or that they want to learn more about REST APIs. I found an interesting website that provides a free API to build your own quiz app.

    This is the website: Link

    IMO it's a good start for beginners who want to do something else than webscraping ;).

    Some ideas what to build:

    • Build a web application with HTML/CSS/JS (You can use vanilla JS, React, Vue, whatever you want)
      • Create a deck of x questions and store the amount of correct answers inside a database for example
      • Create a page to display your highscores
      • Deploy the web app via Electron to use it offline
      • Share the app with your friends and play together with them
      • If you use React --> Migrate to React Native to develop a mobile application
    • Build a gui application
      • Same like in the web app (excluding electron and react native :))
    • Create a cli application
      • Same like in the web app (excluding electron and react native :))
    • Android/IOS App
      • Same like in the web app (excluding electron and react native :))

    I hope this is helpful :)

    Cheers

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

    Refactoring a class that breaks the Single Responsibility Principle

    Posted: 13 Aug 2020 01:10 AM PDT

    I'm having trouble getting my brain into quite grasping the solution.

    I have a class that creates a database. In this class data can be added in and removed. It can return the data and it can format the data. This is obviously a breach in the SRP. I wish to solve this by creating a new class that handles formatting, but I'm not quite understanding how to go about this and keep the code readeable. Could you point me in the right direction please?

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

    How do I read an API?

    Posted: 12 Aug 2020 09:56 PM PDT

    Right now I'm making a program that takes values from an excel spreadsheet and using them to create drawings based on those values. I already have a system that technically works, a python program that reads the spreadsheet using pandas, do some math stuff with the aid of numpy, and write to a dxf file. Right now my drawing software is LibreCAD, which its save files with the dxf extension are just text files, so I was able to understand the definitions of lines, text, circles, etc to make my drawings.

    Now this is insanely inefficient and messy over a long period of time. you have to interact with 3 programs: the spreadsheet editor of choice, python, and LibreCAD. I at least want to bring that down to two, and I wish I could python script in LibreCAD but I found no good scripting resources. LibreOffice Draw seemed like a good option at first, as it would bring down the programs the end user would actively need to interact with down to 1, since theoretically you could script in LibreOffice Calc, take all the values from there, bring up a Draw window and do all the necessary drawing in software, and all you would need to do in Draw is print if necessary. Problem with that approach is that I found literally no useful documentation or guides for the API of Draw specifically.

    Krita is another option that caught my eye. it has built-in python scripting, it has its own API separate from a whole office suite, and it would bring down end user software interaction down to two. problem is, the documentation I find to be confusing and unwelcoming, and the guides I found focused more on extraneous stuff rather than actually drawing things on the screen using scripting. If I could script that stuff it would be nice, but I don't understand the API.

    That brings me back to my question. what's a good way to read an API? particularly one that is documented in a way not friendly to newer programmers, or one that isn't as popular so it doesn't have as many examples or guides online. libraries like numpy are so well documented with detailed descriptions and examples of how to use each method. pandas I find isn't quite at the same level of documentation as numpy, but it still has plenty good documentation and is plenty popular enough to where there's a good chance you can find the solution eventually. I need to be able to interact with a library that isn't in the same position those other two are in; there's a good chance later that something I need doesn't have the best documentation.

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

    Best Github tutorial?

    Posted: 12 Aug 2020 08:19 PM PDT

    I've been toying around with Python for roughly two months now, and figured now would be good to become acquainted with Github. Are there any clear and easy tutorials anyone could recommend I follow?

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

    Private members in parent assigned in child constructor

    Posted: 12 Aug 2020 11:45 PM PDT

    Hello!

    So I am having this problem where I have to use private variables in my parent class and use inheritance. However the child constructors are giving error since the parent members are private. How can I solve this issue without changing parent members to protected or public?

    Language c++.

    Example

    class Parent{ private: string a; string b; string c; public: Parent(){} Parent(string a, string b, string c){ this->a = a; this->b = b; this->c = c; } }; class Child: public Parent{ private: string d; public: Child(string a, string b, string c, string d){ this->a = a; this->b = b; this->c = c; this->d = d; } }; 
    submitted by /u/StrawBro
    [link] [comments]

    How do you create a toggle using Boolean variables in C#?

    Posted: 13 Aug 2020 03:17 AM PDT

    I tried using a counter then finding the remainder of it when dividing by 2 but it seems unnecessary. Can anybody tell me how to do it with just a Boolean variable?

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

    How literally am I supposed to take the Single-Responsibility Principle?

    Posted: 13 Aug 2020 02:38 AM PDT

    If I took this to the extreme logical conclusion, if I had a class for handling database functions, would I create a new class to handle queries, one for inserts, one for updates, and one for deletes?

    submitted by /u/Puzzleheaded-Mine789
    [link] [comments]

    One of my first few C++ programs!

    Posted: 12 Aug 2020 10:51 PM PDT

    I want to share one of my first few programs in c++ with you, I know it's not much but I am slowly getting there :) I have learned a bit of python before giving c++ a try and so far it is a breeze. I look into pointers a bit and got a bit confused so I think i'll learn the foundations here then dive deep into them. Does this code look acceptable for a beginner and am I headed in the right direction?

    main.cpp

    #include <iostream>

    #include <string>

    #include <vector>

    #include <algorithm>

    #include <cmath>

    #include "Animal.hpp"

    int main()

    {

    Animal cat("Kitty", "White");

    std::cout << "Created " << cat.getColor() << " cat, his name is " << cat.getName() << "!" << std::endl;

    cat.meow();

    }

    Animal.hpp

    #pragma once

    #include <string>

    class Animal

    {

    std::string name;

    std::string color;

    public:

    Animal(std::string newName, std::string newColor);

    ~Animal();

    void meow();

    std::string getName();

    std::string getColor();

    };

    Animal.cpp

    #include <iostream>

    #include "Animal.hpp"

    Animal::Animal(std::string newName, std::string newColor)

    {

    name = newName;

    color = newColor;

    }

    Animal::~Animal()

    {

    }

    void Animal::meow()

    {

    std::cout << "Meow!" << std::endl;

    }

    std::string Animal::getName()

    {

    return name;

    }

    std::string Animal::getColor()

    {

    return color;

    }

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

    How often do you get stress from studying programming?

    Posted: 12 Aug 2020 03:49 AM PDT

    I'm an aspiring Java programmer. It's been a year since I became serious in self-studying. I took a Java course from udemy by Tim buchalka. I have a part time job and lots of free time to study. But most of the time I rest in long hours due to stress in studying. So far, I learnt the basics, OOP concepts, a "little" bit of IO, javafx, maven, collection, and threads. It's been a year but I only manage to write a simple time calculator that will add multiple input of time using Javafx. I feel like I'm slow compare to other people. I easily forget stuff too. What am I doing wrong? Is there any way to learn fast and reduce information overload aside from meditation, napping, exercise... you know not the typical advice you get from internet?

    Here's my routine:

    I will study in 3 days for 4+ hours using pomodoro technique and then the next day, nothing seems to come into my mind no matter what kind of rest I do. My head hurts and it will take me 2 or 3 days to completely feel mentally rested.

    Now I look up in Job description and they demand so many skills even for a Junior position such as Java, JSP and servlets, Javascript, Maven, J2EE, Spring and so many things which is overwhelming. Imagine, I only learn Java in a year and still not perfecting it.

    About me:

    - Programming makes me question my intelligence. I thought I wasn't that stupid when I managed to win a 2 digit lottery after carefully "analyzing" the pattern in numbers.

    - I easily forget stuff.

    - Can't even finish the entire videos coz it's confusing to my brain.

    What's your studying routine and how often do you get stress? Please please help me or at least give me some proper advice to study that you just don't get in the internet.

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

    Merge/Unmerge cells and assign value to unmerged excel cell using openpyxl module

    Posted: 13 Aug 2020 02:02 AM PDT

    Merging and unmerging cells in excel using python is not so difficult. But assigning the value to unmerged cells is little bit tricky.Because of this i tried to write an blog about how to merge/unmerge excel cells and assign value to unmerged cells using openpyxl module in python

    . This might be helpful to you guys as well.

    http://thequickblog.com/merge-unmerge-cells-openpyxl-in-python/

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

    i'm looking for "learning pal"!

    Posted: 12 Aug 2020 03:13 PM PDT

    Hey, I decided to try learn Java (once again, but it is long story) so now I want to try something new to stay motivated - find learning pal. If you are total beginner or not and learn Java (or maybe other language too!) let's do it together and have somebody to share our little and puny achievements like "hell yeah! I did my first Scanner use!" and support each other!

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

    Create a ripple animation inside an input field ?? (React)

    Posted: 13 Aug 2020 01:35 AM PDT

    I have a password input field. Inside absolutely positioned is an image which if clicked it changes( its a padlock locked/unlocked). On the click of that padlock image, how could i create a ripple animation inside the input field with the origin of the ripple being the center of the image.

    Ive seen loads of people do this with buttons , but ive been seriously trying to figure out how i could do it in my case. Im sure ive seen websites do this too somewhere

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

    Angular/React - CORS issues (interview take-home)

    Posted: 13 Aug 2020 01:35 AM PDT

    Say you're given a task to make a SPA using a provided APIs.

    How do you solve any cors issues? I just used corsanywhere, but do I have to ask them to change something in the backend?

    I can't quite ever wrap my head around CORS

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

    C++ Help required!

    Posted: 13 Aug 2020 01:05 AM PDT

    Hello, im having a few difficulties getting this to work:

    Sorry im not sure if this is the right channel

    ```c++

    #include "Windows.h"

    int main()

    {

    DWORD procID;

    DWORD minecraftBlock = 0x9C36B18C;

    submitted by /u/Sensitive-Match8321
    [link] [comments]

    [Python3] time.sleep() method executes always first when executing python script from shell script

    Posted: 13 Aug 2020 01:03 AM PDT

    I have the following two scripts:

    testPy.py:

    from time import sleep print("hi") sleep(0.5) for _ in range(3): print("hi") sleep(0.5) 

    testB.sh:

    #!/bin/bash py testPy.py 

    The problem is that instead of alternating between printing "hi" and waiting, the program first waits 4 * 0.5 = 2 s and then prints all 4 hi's.

    Why is that? Is there a way to circumvent it?

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

    WHAT SHOULD I DO AFTER LEARNING PYTHONS BASICS?

    Posted: 13 Aug 2020 12:41 AM PDT

    I learned python from https://www.youtube.com/watch?v=rfscVS0vtbw. Now i am confused what should i do? i want to study python but i don't think i am on the level to learn something such as AI or ML. please SUGGEST ME WHAT SHOULD I DO NEXT?

    i am familiar with the following topics:

    Variables & Data Types

    Working With Strings

    Working With Numbers

    Getting Input From Users

    List Functions

    Tuples

    Functions

    Return Statement

    If Statements

    If Statements & Comparisons

    Building a better Calculator

    Dictionaries

    While Loop

    Building a Guessing Game

    For Loops

    Exponent Function

    2D Lists & Nested Loops

    Building a Translator

    Comments

    Try / Except Reading Files

    Writing to Files Modules & Pip

    Classes & Objects

    Building a Multiple Choice Quiz

    Object Functions Inheritance

    Python Interpreter

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

    Pluralsight offering free weekend (8/14 - 8/16)

    Posted: 12 Aug 2020 08:52 AM PDT

    https://www.pluralsight.com

    "Exciting news—we're making every single one of our 6,500+ expert-led video courses, our 40+ interactive courses and our 20+ projects free for one weekend only."

    Just got this email from them. I took a few courses and I think it is really worth to take a look! 😀

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

    How to retain Data Structures knowledge?

    Posted: 12 Aug 2020 11:40 PM PDT

    Hello r/learnprogramming I started learning about Data Structures and solving problems a few months back. I started with Stacks and finished all the good problems that I could find on GeeksforGeeks and Leetcode. While solving the problems I often had to read up the solutions and tutorials to get the correct answers but I made sure I understood the approach and I felt quite confident about them after coding them up. But now after about a month I look at those questions about 20 to 30 of them that I wrote down as important ones and I can solve a lot of them but there are also ones that I was so confident I knew back then but can't seem to solve now. I put lot of effort into each question but in just a month I'm forgetting the medium level problems, am I doing something wrong? Any suggestions?

    Thank you for answering in advance!

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

    No comments:

    Post a Comment