• Breaking News

    Monday, December 14, 2020

    Where do I find practice problems for OOP? learn programming

    Where do I find practice problems for OOP? learn programming


    Where do I find practice problems for OOP?

    Posted: 13 Dec 2020 01:35 PM PST

    I've searched it up on the internet, and seen a bunch of reddit posts asking this but the answers are always the same, "make your own project and use OOP," but the thing is if I do that I won't know if what I'm doing is correct(optimal) or not. I'm looking for something which poses OO design questions and has answers, so I know how I'm thinking about OOP is right.

    Thanks in advance.

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

    Machine Learning & Algorithms Courses for FREE from Coursera. They have made some of their Machine Learning Courses FREE due to COVID-19 and you can earn a Certificate for FREE until 12/31/20.

    Posted: 13 Dec 2020 10:01 PM PST

    Offer is subject to change and valid through 12/31/20. Discount applied at checkout. One-time use only. Offer valid until 12/31/20, while supplies last. Main Article

    Share with everyone who don't know. Here are courses:

    1. Getting Started with AWS Machine Learning ( offered by Amazon Web Services)
    2. Machine Learning for Business Professionals (offered by Google Cloud)
    3. Algorithms, Part I (Offered by Princeton University)
    4. Algorithms, Part II (Offered by Princeton University)
    5. Computer Science: Algorithms, Theory, and Machines(Offered by Princeton University)
    6. Data Science Math Skills (offered by Duke University)
    7. Cloud Computing Basics (Cloud 101). Offered by "LearnQuest"
    8. Google Cloud Platform Fundamentals for AWS Professionals (offered by Google Cloud)

    Happy Learning!

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

    Is there an easy way to implement "code reviews" in GitHub for a small, unexperienced team?

    Posted: 13 Dec 2020 02:03 PM PST

    We're 3 students working on a school project. As the project leader I would like to have control over what the two other students commit. We're only working with 1 branch (master) and have little other experience with git. All I know is, that in companies a senior developer usually reviews the code committed by other developers. Would this be a little too over-kill for us or is there an easy way to do this?

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

    I made a calculator in C++

    Posted: 13 Dec 2020 11:31 AM PST

    Hello, I made a basic calculator in C++ and I am haveing some issues. When i type in my 1st and 2nd nummber, and then the operation that i want it to complete i get this

    Enter the 1st nummber: 5

    Enter the 2nd nummber: 5

    Enter the operation: +

    103125

    --------------------------------

    Process exited after 3.359 seconds with return value 0

    Press any key to continue . . .

    So i was wondering if someon can help me out (I have little to no exeprience to C++ by my thinking and I wold like to learn it) The code can do the followeing operations: addition, subtraction, multiplication, and divison.

    #include <iostream>

    #include <cmath>

    using namespace std;

    int main()

    {

    double num1, num2; cout << "Unesi 1. broj: "; cin >> num1; cout << "Unesi 2. broj: "; cin >> num2; char znak; cout << "Unesi operaciju: "; 

    cin >> znak;

     if(znak == '-') { cout << num2-num2; } else if(znak == '+'){ cout << num1 + num2; } else if (znak == '/') { cout << num1 / num2; } else if (znak == 'p'){ cout << hypot(num1, num2); } else if (znak == '\*'){ cout << num1 \* num2; } else (znak == 's');{ cout << pow(num1, num2); } return 0; 

    }

    Edit: Here is the full code.

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

    I heard that learning a functional programming language like Lisp or Haskell can help with problem solving. Is this true? If so why?

    Posted: 13 Dec 2020 09:20 AM PST

    I have only studied a bit of Algorithms but I've gone through a few intro programming courses. I struggle sometimes with seeing solutions to new or novel problems that I had not seen before. I'd like to become a better computational thinker and have heard functional programming may help with that.

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

    Having difficulty creating my own projects.

    Posted: 13 Dec 2020 08:56 PM PST

    As a new programmer, I was able to learn the fundaments of my preferred language, which is C++. I created a few trivial programs that utilize the console, such as a bank management system or a grocery inventory system. However, I can't conceive of a way to develop something that is large scale and profitable. For example, how would I develop something like Facebook (I know it's not coded in C++, but that's the first thing that came to mind)? I feel like I'm stuck at just creating trivial, non-profitable console applications that anyone can code, and therefore I can't get hired anywhere because I don't really know how to do anything. Could some people give anecdotes on their progression from learning a language to actually coding real projects, and if I can get some tips on what I can do?

    submitted by /u/Ok-Echo3023
    [link] [comments]

    Programming Group

    Posted: 13 Dec 2020 09:33 PM PST

    Pretty soon, I'm going to start doing a weekly event focused around what tech I'm learning. Right now is web technologies such as HTML, CSS, and JS. I'm currently in a class for it and soon enough will be learning about JS. If you would like to join in, I'm thinking about starting at 6pm EST every Wednesday except the last Wednesday each month via Discord.

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

    Beginner Program requests

    Posted: 13 Dec 2020 08:42 PM PST

    Hi. I'm a new programmer who wants to try something different while working through my high school programming class.

    I started in September with my Computer Science and Programming class and we're working on Javascript control structures right now. I'd like to see what I can do with my little knowledge and put what I've learned into code.

    Just for myself.

    Is there a beginner program or sandbox I can use to practice with code? I'm excited to try something with Javascript.

    Thanks in advance!

    submitted by /u/Lily-x-Chronexia
    [link] [comments]

    Not sure how to fill my array with objects I created from a class. How can I do this?

    Posted: 13 Dec 2020 02:04 PM PST

    My goal is to create a table of player objects. The object has an int and a string value. Im not sure how i would put these objects into the array syntax and logic wise

    for example im looking to do this where each object is stored in the array as a row:

    class type Level
    "rogue" 1
    "warrior" 3
    "cleric" 2
    etc etc
    submitted by /u/PyriteLad92
    [link] [comments]

    Project idea to teach python to beginners

    Posted: 13 Dec 2020 01:55 PM PST

    Hi everyone! I am currently in the process of creating a 4 week online course about intro to python. I want to layout the course in a way that the students learn to code by coding a big comprehensive project (that it will have all the necessary topics that must be cover like function, classes, various data types etc...). The idea is that the students will code parts of the project as they learn the material and by the end they will have a complete program. Do you have any idea of what this project could be? I want to make it fun and innovative to avoid the regular projects like a calculator, tic tac toe, etc... Your ideas/advice will be greatly appreciated

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

    Hey self taught programmers, how long does it take to be a good frontend developer? And how long one needs to experiment with frontend before moving to backend or full stack development?

    Posted: 13 Dec 2020 09:46 PM PST

    I am trying to get into UI/UX but it seems I need to well versed in full stack development (afa what some people told me). It's been six month since I started frontend. Any advice would be really helpful.

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

    How to Learn Machine Learning Visualizations?

    Posted: 13 Dec 2020 09:27 PM PST

    I'm very interested in machine learning, but I'm curious how to apply the data visually. For example, projects where an AI plays chess, walks, builds structures, etc. Those are just some examples to provide context, my goal is to take the data from machine learning and apply it in a visual way and I'm curious what the possibilities for accomplishing this goal would be. Thank you!

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

    HTML/Script - Input/Output Questions

    Posted: 13 Dec 2020 09:26 PM PST

    DISCLAIMER: I'm a novice when it comes to anything programming and picked up most of (the very little) that I know from self teaching out of interest/necessity. My explanation will be pretty crappy and mostly in layman's terminology so bare with me.

    For work I frequently have to fill out 'reports' that are in Word doc 'template', often times the same information into different templates over the course of a few days. To make this easier & quicker on myself (and to track all of the necessary fields that get filled out), I rewrote the Word Doc template in HTML with the needed formatting, added an input box, use some Javascript to set the Input as a variable and then innerHTML all of the fields that need filling out.

    My process I have now, is I keep an excel sheet with each column being a new information set, then copy and paste a column from the excel sheet into the HTML input box, which splits the input by line into an Object/Array(?) (var x = [1,2,3]), click submit, and it fills the HTML doc. I then copy/paste that HTML page from Chrome into a new Word Doc, I copy and paste in the 'free entry areas' (that are from different Word Docs, unique per doc and will require their original formatting so they can't be innerHTML'd) then save/pdf.

    My questions to all of you fine programmers of Reddit are these:

    1) Is there a way/what would be your best way to be able to add in those 'free entry' sections to this process so they can also be tracked through (hopefully but not fully necessity) my excel document, and keep their formatting when innerHTML'd into the HTML template? I know that I COULD convert these sections into HTML format, add them as a new row in the excel sheet, and then innerHTML them in with the rest of the information but I feel like it wouldn't be saving me much time or making it any easier on myself.

    For some extra context, the Excel sheet currently contains basic information like 'Name, Address, $ Amounts, Dates' etc that will have the same formatting everytime, thus being easy to just set that formatting in the HTML page, but the free form sections are written by someone else on an account by account basis and the format can vary; think of it like a review. It could include tables, indents, bullet points, paragraphs etc and it differs every time.

    2) Is there a way, after I add the inputs into the HTML doc, to save the new HTML doc as a Word doc, rather than copying and pasting it out of Chrome and into a new Word doc each time? Just be able to make a 'Download' button and have it run a script that downloads a file that has all that information in it formatted how I need it? I've seen this on webpages with PDFs but I'm sure what goes into setting this up.

    Any help is much appreciated and please let me know if there are certain parts of my description that are tough to understand so I can try to better explain, or give better examples!

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

    SQL - Best Free Training

    Posted: 13 Dec 2020 12:20 PM PST

    Suggestions welcomed and appreciated!

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

    Can someone help explain this code

    Posted: 13 Dec 2020 09:04 PM PST

    I have absolutely no idea: weird code

    submitted by /u/Far-Operation-1580
    [link] [comments]

    what are you trying to automate and how?

    Posted: 13 Dec 2020 12:47 PM PST

    thanks for any suggestion

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

    Been practicing a little, got a project idea. Is there free hosting that I can implement my HTML/CSS/JS too to have people go on and check out the site?

    Posted: 13 Dec 2020 08:55 PM PST

    Its a simple yet fun idea I had. Mostly text based but would implement all 3. Just wondering if there's free hosting thats decent

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

    Question: Simple console application reading <tasks> from a XML file

    Posted: 13 Dec 2020 01:57 PM PST

    Hi,
    I have a challenge for my own.I want to learn a new programming language.

    I'm experienced with:

    • HTML / CSS, JavaScript - for many years
    • PHP / MySQL (SQL) - for many years
    • PowerShell, Batch and others - 2 years
    • Java - just a little bit 10 years ago

    So I want to start with a "high level" programming language like:

    • C++
    • C#
    • Python
    • Or maybe "Electron" since I came from web developement.(not a language though...)

    It needs to run on Windows / Mac (later in the future).

    I made this challenge for myself as a "starter project":

    Basically I want to make a simple console program )no user interface yet)!I need to program a Deploy.exe file which is able to read a Deploy.xml file and perform actions based on the <tasks> in the Deploy.xml file.For better understanding see my Project.png drawing here:

    https://drive.google.com/file/d/1ua0LrDqlWFcHg4PgJzAk4lVYAw2zgNBa/view?usp=sharing

    I guess any programming language would be "good enough" for that simple job.

    The only hard part I see for myself is to:

    • Wrap all of the files into another new Setup.exe file?!

    I'm not sure if something like that works or even is possible in the way I would want to have it...

    My questions:

    1. Which language would you recomment me for that job?
    2. Is there a tutorial to that language how to do simple stuff like that?Like going trough the XML-File <tasks> and perform one action, WAIT until this action is done, then continue to the next action.
    3. Is this programming language able to "wrap" all the containing files to an unextractable / not decompileable "container" like a Setup.exe?

    What I plan to do with it in the future:With Microsoft SCCM (ECM) you can deploy software via a network.You create a package into this system and it delivers this "package" to a client in your network into the:C:\Windows\CCMCachefolder and execute this package after downloading to this client.

    In general you basically deliver (deploy) a simple Setup.msi or Setup.exe file to a client, but you are really limited by that.

    I want to create a Deploy.exe which reads a Deploy.xml file and performs all the <tasks> action defined.From a simple "copy this file to this location" up to "install this .exe or .msi file" to "edit this registry value" and so on.

    Basically you can customizing a normal Setup.msi with a lot of extra needed stuff.
    Like delete the original created shortcut from the startmenu, create a folder and create a new shortcut into that folder for better grouping.
    Like you want to have all "Editoring" program shortcuts into the Startmenu-Group "Editors".

    Example:

    • .\Chrome
      (package name / root folder)
    • .\Chrome\Deploy.exe
      (file which do all the actions defined in the XML file)
    • .\Chrome\Deploy.xml
      (all the tasks listed here to get done from Deploy.exe)
    • .\Chrome\Files\Setup\Setup_Chrome.msi
      (file gets installed with Deploy.exe with /qn Silent parameter)
    • .\Chrome\Files\Copy\
      (setting files needed to be copied into the Chrome install location)

    and so on.
    Since it's much better to send just one "bigger" file through the network instead of many smaller files I want to put the whole structure above into a file calles:
    Chrome.exe

    If you execute:
    Chrome.exe type=i
    you basically execute the Deploy.exe file inside with the parameter type=i and the Deploy.xml <tasks> will be executed.

    To prevent people manipulate or seeing details of the Deploy.xml file or better said source code of the Deploy.exe file this Chrome.exe have to be "protected" somehow.

    • Not extractable
    • Not decompileable (both, Deploy.exe and Chrome.exe!)

    At the moment, this is a fun project for me to learn a new programming language.
    But maybe in the future I can offer the company I'm hired at to customize all software packages to their needs.

    Sure, you can simply deploy a Setup_Chrome.msi via Microsoft SCCM (ECM) or other tools like that and after the installation you customize things with a PowerShell-Script or whatever.
    But I just want to use this fun packaging way to improve and manage some things.

    Thanks for reading this and your help! :-)
    All recommendations and sources are really welcome! <3

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

    Java - how do I sort an arraylist by properties of a specific element?

    Posted: 13 Dec 2020 08:40 PM PST

    I wrote a working method to insert objects into arrayLists in my SortedArrayList class. The problem is, it sorts by the first letter of the first element of the ArrayList.

    I would like to be able to choose how the ArrayList is sorted (e.g. by first letter of the surName or by the number of books in a user object. How do I approach this?

    An example of the type of object stored: User(String firstName, String surName, int books)

    import java.io.*; import java.util.Scanner; public class Driver { //These SortedArrayLists have been derived from the sorted arraylist class public static SortedArrayList<User> sortedUsers = new SortedArrayList<>(); public static SortedArrayList<Book> sortedBooks = new SortedArrayList<>(); //This static method checks that input matches records and then sets the loaning user information //for the book to be loaned while incrementing the number of books held by the user. public static void loanBook(Book book, User user){ for (Book b : sortedBooks){ if(b.equals(book)) { b.setLoanStatus(true); b.setLoaningUser(user); break; } } for (User u: sortedUsers){ if(u.equals(user)){ u.setNumberOfBooks(u.getNumberOfBooks()+1); //The number of books of a given object is found then incremented by one to create the new value, which is set break; } } } //This static method checks that input matches records and clears loaning user information //for the book to be loaned while lowering the number of books held by the user by 1. public static void returnBook(Book book, User user){ for (Book b : sortedBooks){ if(b.equals(book)){ b.setLoanStatus(false); b.setLoaningUser(null); break; } } for (User u: sortedUsers){ if(u.equals(user)){ u.setNumberOfBooks(u.getNumberOfBooks()-1); //The number of books for the object instance of a user in question is decreased since they have returned a book and thus have one less book. } } } public static void main(String[] args) throws FileNotFoundException, User.InvalidBookLimitException { mainMenu(); //main menu printing method char ch = sc.next().charAt(0); sc.nextLine(); while (ch !='f') //the program ends as desired if f is pressed { switch(ch){ case 'b': System.out.println("Displaying information about all books in the library: "); //This toString replace method removes unwanted items for a cleaner print of book object information and removes the string description for user's name described in the user toString method. System.out.println(sortedBooks.toString().replace("[","").replace("]","").replace("Name: ", "")); break; case 'u': System.out.println("Displaying information about all users"); System.out.println(sortedUsers.toString().replace("[","").replace("]","")); break; case 'i': System.out.println("Enter the loaning out data. "); User user = readNames(); Book book = readBookName(); //A book object is created based on user input, then an attempt at altering the // relevant object information is made via the loanBook method. loanBook(book, user); break; case 'r': System.out.println("Please the details of the book to be returned: "); User userReturn = readNames(); Book bookReturn = readBookName(); //User input is used to create user and book objects so that a book can be returned //by use of the returnBook method, resetting any user information about the book and decreasing the count for number of booksheld by the user. returnBook(bookReturn, userReturn); break; default: //this case occurs if input does not match any of the switch statement cases. System.out.println("Invalid input, please enter f, b, i or r"); } mainMenu(); ch = sc.next().charAt(0); sc.nextLine(); } } } 

    The sortedArrayList class: import java.util.ArrayList;

    public class SortedArrayList<E extends Comparable<E>> extends ArrayList<E> { //This insert method ensures that an object added to an arraylist is added in a sorted order. public void insert(E value) { if (this.size() == 0){ this.add(value); return; } for (int i = 0; i < this.size(); i++) { int comparison = value.compareTo((E) this.get(i) ); if (comparison < 0) { this.add(i, value); return; } if (comparison == 0){ return; } } this.add(value); } 
    submitted by /u/WeWonIt6Times
    [link] [comments]

    Java programming

    Posted: 13 Dec 2020 08:36 PM PST

    Does anyone tell the difference between the void main and int main.. And where to use both while writing the code.

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

    How can I implement libraries from GitHub into my own projects?

    Posted: 13 Dec 2020 08:36 PM PST

    Hello everyone,

    For quite sometime, I've struggled with implementing online libraries into my own code. Currently, I'm developing a C++ application using CLion, and would like to use FlatUI to provide GUI functionality. In general, I don't know how to bring this code into my own projects, and this isn't the first time this has halted my progress. I've provided the relevant links below, if somebody could explain how to implement this specifically or teach me generally how to implement GitHub libraries into my own code, then I would greatly appreciate that.

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

    Which language should I learn for this project?

    Posted: 13 Dec 2020 08:30 PM PST

    I'm definitely new to coding and been doing some research and have been kinda in that ... stuck in just research and not really applying anything or actually trying to code. I'm finally going to try. So I've been using the FAQ as my main resource and I think it is wonderful.. so helpful. It suggest to have a project to work on for good stuff like drive and what not to learn. I have a project in mind and it's something for my work. We make this abrasive with 2 different chemicals that mix in water right? We use this instrument to measure the PH to chemical level and you have a range that is acceptable and outside of it is not and requires you to contact a supervisor or engineer. Right now we record it on paper, so I'd like to make a program or something where you can record the information on there. Here is some stuff it would need.

    1 Option to select which tank you're using. We have 2 different mixtures.

    2 Operators name input so we can track who filled it etc

    3 The measurements. I'd like to have it where you can just click what the measurement is. Our paper we use has the range and you just checkmark which one you read. I'd like to apply that to the program where you just select it.

    4 Timestamps of course. So we can track when the mixtures were created.

    I can not think of more right now. My question.. What language should I try to learn for this? Python? C#? I'm on the FAQs but I'm unsure which would be best.

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

    My program repeats itself

    Posted: 14 Dec 2020 12:15 AM PST

    I am new to programming and I wanted the program to give me 3 random strings of champions from league of legends in C#. It works fine when it is single but it gives the same strings when I do it like this.

    using System.Text;

    using System;

    class GenerateRandomString

    {

    static void Main()

    {

    randomchampiongenerator();

    randomchampiongenerator();

    randomchampiongenerator();

    Console.ReadLine();

    }

    static void randomchampiongenerator()

    {

    Random r = new Random();

    int x, y, z;

    string[] p = {

    "Aatrox",

    "Ahri",

    "Akali",

    "Alistar",

    "Amumu",

    "Anivia",

    "Annie",

    "Ashe",

    "Aurelion Sol",

    "Azir",

    "Bard",

    "Blitzcrank",

    "Brand",

    "Braum",

    "Caitlyn",

    "Camille",

    "Cassiopeia",

    "Cho'Gath",

    "Corki",

    "Darius",

    "Diana",

    "Dr. Mundo",

    "Draven",

    "Ekko",

    "Elise",

    "Evelynn",

    "Ezreal",

    "Fiddlesticks",

    "Fiora",

    "Fizz",

    "Galio",

    "Gangplank",

    "Garen",

    "Gnar",

    "Gragas",

    "Graves",

    "Hecarim",

    "Heimerdinger",

    "Illaoi",

    "Irelia",

    "Ivern",

    "Janna",

    "Jarvan IV",

    "Jax",

    "Jayce",

    "Jhin",

    "Jinx",

    "Kai'Sa",

    "Kalista",

    "Karma",

    "Karthus",

    "Kassadin",

    "Katarina",

    "Kayle",

    "Kayn",

    "Kennen",

    "Kha'Zix",

    "Kindred",

    "Kled",

    "Kog'Maw",

    "LeBlanc",

    "Lee Sin",

    "Leona",

    "Lissandra",

    "Lucian",

    "Lulu",

    "Lux",

    "Malphite",

    "Malzahar",

    "Maokai",

    "Master Yi",

    "Miss Fortune",

    "Mordekaiser",

    "Morgana",

    "Nami",

    "Nasus",

    "Nautilus",

    "Neeko",

    "Nidalee",

    "Nocturne",

    "Nunu & Willump",

    "Olaf",

    "Orianna",

    "Ornn",

    "Pantheon",

    "Poppy",

    "Pyke",

    "Qiyana",

    "Quinn",

    "Rakan",

    "Rammus",

    "Rek'Sai",

    "Renekton",

    "Rengar",

    "Riven",

    "Rumble",

    "Ryze",

    "Sejuani",

    "Shaco",

    "Shen",

    "Shyvana",

    "Singed",

    "Sion",

    "Sivir",

    "Skarner",

    "Sona",

    "Soraka",

    "Swain",

    "Sylas",

    "Syndra",

    "Tahm Kench",

    "Taliyah",

    "Talon",

    "Taric",

    "Teemo",

    "Thresh",

    "Tristana",

    "Trundle",

    "Tryndamere",

    "Twisted Fate",

    "Twitch",

    "Udyr",

    "Urgot",

    "Varus",

    "Vayne",

    "Veigar",

    "Vel'Koz",

    "Vi",

    "Viktor",

    "Vladimir",

    "Volibear",

    "Warwick",

    "Wukong",

    "Xayah",

    "Xerath",

    "Xin Zhao",

    "Yasuo",

    "Yorick",

    "Yuumi",

    "Zac",

    "Zed",

    "Ziggs",

    "Zilean",

    "Zoe",

    "Zyra",

    };

    x = Convert.ToInt32(r.Next(p.Length));

    for (int i = 0; i <= p.Length; i++)

    {

    if (x == i)

    Console.WriteLine(p[i]);

    }

    y = Convert.ToInt32(r.Next(p.Length));

    for (int i = 0; i <= p.Length; i++)

    {

    if (y == i)

    Console.WriteLine(p[i]);

    }

    z = Convert.ToInt32(r.Next(p.Length));

    for (int i = 0; i <= p.Length; i++)

    {

    if (z == i)

    Console.WriteLine(p[i]);

    }

    }

    }

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

    AVD launching error

    Posted: 14 Dec 2020 12:09 AM PST

    I've recently started learning android programming. When I want to launch the AVD it shows this error "The emulator process for AVD Pixel_4_API_30 was killed." I've tried solutions on stackoverflow and other websites but non of them were useful. What should I do to fix this???

    submitted by /u/i0ts-mr-N
    [link] [comments]

    No comments:

    Post a Comment