• Breaking News

    Tuesday, April 2, 2019

    C++ For a complete beginner to coding! (Guide, Windows) learn programming

    C++ For a complete beginner to coding! (Guide, Windows) learn programming


    C++ For a complete beginner to coding! (Guide, Windows)

    Posted: 02 Apr 2019 09:17 AM PDT

    Hello world!

    This is a real quick guide to start C++ coding on a windows computer and to learn this challenging language first! (This language is recommended for future game devs or if you just want to add more to your coding knowledge.)

    https://www.udemy.com/share/1001jKB0sZdVlbQHQ=/

    This is a link to an udemy course that teaches C++, about 80 videos or something like that, anyway, this requires commitment and time, all things do, especially learning how to code!

    Before you start this course, you need to get a program to run your C++ code.

    Use the visual studio program, you can download it through the microsoft website, here's a link!

    https://visualstudio.microsoft.com/downloads/

    *Note, get the community version as an independent learner.*

    Now that you have downloaded this, run the installer program and make sure to install with this package:

    https://visualstudio.microsoft.com/wp-content/uploads/2018/05/LUHboih732iHV6xl-C2B2B-Tutorial2C-Installing-C2B2B.png

    *Note, image link to what package you need to additionally install!

    After visual studio is installed, it is approx. 6.25 GB, then open the program.

    Go to file, then New, then New Project.

    Click on installed, then open the "Windows Console Application"

    Now you are ready to write code, whenever you'd want to run it and have it compiled, press ctril + F5.

    You can also click the green play button.

    That is it, you are ready to follow the course, good luck and persevere!

    Happy Coding!

    (Comment any problems or questions you may have with setup, windows only!)

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

    Advice on how to start a project

    Posted: 02 Apr 2019 03:05 AM PDT

    Sorry if I've got the wrong sub, I've looked around but think this post fits here best.

    TL;DR

    Learning to do computer things, have (idea for) personal project, questions about resources/am I on the right lines?

    Background

    I'm currently following OSSU and teaching myself, but have an idea for a project that I've started to sketch out and I'm trying to figure out what I need to learn to make this happen. I don't want to run before I walk, but I find it easier to learn this sort of stuff on the side when I've got a pre-defined goal (career progression/professional development is too vague for me). I've dabbled in Java and Python previously and done a couple easy daily challenges, but I wouldn't call myself proficient.

    Project

    I want to build a web app that will display results from a database by matching one or more input fields, and also a second option to display a random result related to the first input field. Here's a terrible mockup.

    What I think I need (and plan to learn) to build the project

    • A web scraper to build the database - I have the information that I need available at work (the cheapest routes from x to y). I'm currently using Python for this and have a small enough database to start working on the rest of the project. I will be improving this as I learn. The VP of engineering knows I'm doing this and is fine as long as I don't "take the piss" (I've only run the scraper a handful of times so think I'm cool)
    • A database I can access online - This is where my knowledge starts to fail. I think this is where I should be looking at MongoDB or MySQL, but I don't know where to start.
    • A way to search this database through the web app - Because my knowledge of databases is lacking, this is also something that I'm not sure where to start. My gut says Ruby, because the app/company that I work for is built on Ruby and handles something similar, and I know a lot of people that would be happy to help me if I run into problems

    Questions for you guys

    Is there anything glaring that I've missed? Have I oversimplified some of the things I need without realising (e.g. a step between scraping/building the DB/things I need to take into account when creating the search)? Can anyone point me to any resources that include creating similar projects as an exercise? Do you have any advice or comments or even criticisms (constructive please) about what I'm thinking about doing? Can anyone recommend resources specifically for learning about databases?

    Bonus question

    Is it worth learning about Git and version control for this or should I leave that until a later time?

    [EDIT] - Thanks to everyone for taking time to make suggestions, comments and even offer to help. It's been a long day at work, but I have my "weekend" tomorrow, and I'm stocked up with snacks, coffee and enthusiasm for trying to tackle some of this shit. Should anything come of it I'll be sure to post an update.

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

    How to create a Sneaker Bot?

    Posted: 02 Apr 2019 09:18 PM PDT

    I am interested in creating a sneaker bot, and I have been searching around on how to do it just to come up with minimum results (expected). I have a small amount of knowledge with Python, which I believe is the language used for most bots. If you have any ideas/tips please help. Thanks!

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

    Started To learn Web development today. Spent 5 hours got to my First "Holy that worked" excitement moment!

    Posted: 02 Apr 2019 10:13 PM PDT

    So today i decided to try and learn how web development works. For a long time now i have been Really interested in it but never had that motivation on actually learning it. Well recently My fiancé has been complaining about her Meal Planning for the diet she is doing with her mother. Well that was when it hit me i wanted to make a Web app that will do it for her so its quicker. even if they are done the diet by the time i'm done learning its okay! this is still a-lot of fun!

    So i tried learning with a few Video tutorials but i seemed to just copy the code and not understand why the code is doing what its doing. I really didn't the feeling that gave me it was boring and i felt like i "should understand whats going on because i just wrote it" well No the only stuff that i picked up that way was the basic HTML and CSS. That was basically just memory of how it functions. When i decided to start learning Javascript i relied on trial and error and Google. I feel like i actually have learned something i know what "sorta" does what i'm obviously still learning but after 5 hours i finally was able to make something that excited me and made me go holy shit that worked?Its very basic and lets be honest very horribly done but i got this working.

    I have been using Bootstrap to learn how to make Tables and Navigation bars as well as other Aesthetics and functions.
    But im including the Javascript that i was messing around with that made me happy i got it to Write to A Table after they input the Information i ask for.
    If you have any suggestions on how to learn and see the Errors or better methods in this code please let me know! I know this is probably done horribly! but hey its my first 5 hours!
    i also left in some of my Trial and error commented out to see what i started with.

    var Meal = document.getElementById('Meal') var Protein = document.getElementById('Protein') var Carbs = document.getElementById('Carbs') var Calories = document.getElementById('Calories') var Fats = document.getElementById('Fats') var Confirm = document.getElementById('Confirm') var Done = false var mealArr = [] Meal.addEventListener("input", conjoin); Protein.addEventListener("input", conjoin); Carbs.addEventListener("input", conjoin); Calories.addEventListener("input", conjoin); Fats.addEventListener("input", conjoin); Confirm.addEventListener("click", setTrue); function setTrue(){ var Done = true //var one = Meal.value; //var two = Protein.value; //var three = Carbs.value; //var four = Calories.value; //var five = Fats.value; //var table = document.getElementById("table"); var meal1 = document.getElementById("meal1"); var protein1 = document.getElementById("protein1"); var carbs1 = document.getElementById("carbs1"); var calories1 = document.getElementById("calories1"); var fats1 = document.getElementById("fats1"); if(Done = true) { //alert("The details to your first meal are: "+ one + " " + "Protein: " + two + " " + "Carbs: " +three + " " + "Calories: " //+ four +" "+ "Fats: " + five ) //I made this before i figured how to set text to a table innerText. meal1.innerText = mealArr[0]; protein1.innerText = mealArr[1]; carbs1.innerText = mealArr[2]; calories1.innerText = mealArr[3]; fats1.innerText = mealArr[4]; } } function conjoin() { mealArr[0] = Meal.value; mealArr[1] = Protein.value; mealArr[2] = Carbs.value; mealArr[3] = Calories.value; mealArr[4] = Fats.value; console.log(mealArr) } 

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

    learning coding

    Posted: 02 Apr 2019 04:15 PM PDT

    hello all,this should be my first post on this sub,so i've passed my basic coding course in uni with bare minimum,i'm interested in coding but i can't help but feel lost in the ideas it have,i've finished the codeacademy tutorial,but i still feel kinda lost,so where should i go next,any ideas?

    ps: could coding help me as an ME student,aside from matlab

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

    [C++] using std::cout /using namespace std

    Posted: 02 Apr 2019 07:18 AM PDT

    So from some reading and watching others program I've kinda gathered why people might not so keen on using namespace std; but in that case why not then explicitly declare the using std::stuff; that you need to use regularly (such as cout, cin, endl,etc) instead of typing them out with the scope resolution operator every time?

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

    Would anybody be interested in practicing whiteboarding/interviewing live on stream?

    Posted: 02 Apr 2019 09:13 AM PDT

    I think it could be helpful for people to practice coding in front of people for those that struggle to do that. I've been starting to stream programming related content and thought this might be helpful for some people. I could have different difficultly levels, but feel it would be most beneficial to people that have never done this before.

    The chat would be moderated for those that are fearful of being ridiculed/laughed at for performing poorly. I could give feedback at the end. I have experience interviewing various types of programming positions. I'm also open to having other experienced people help out.

    I'm just tossing around the idea. Feel free to give input, or let me know if you're interested in participating.

    EDIT: As long as you reply showing interest, I'll be contacting you with more details!

    Link to stream: https://twitch.tv/sadsheeep

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

    Any Ex-Developers here?

    Posted: 02 Apr 2019 10:09 PM PDT

    Anyone here used to be a professional developer but decided it isn't for them, but still code as hobby or for personal projects?

    What you didn't like about being a dev?

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

    Best learning path for C++?

    Posted: 02 Apr 2019 09:18 PM PDT

    I'm currently in University taking my second fundamentals of computer science course in C++, but this second class is absolute trash, I haven't learned hardly a thing even with reading all of the book we are going over, our professor is assigning us even harder questions. Anyone have a C++ learning path that can take me from beginner to advanced?

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

    Creating a blog without a CMS?

    Posted: 02 Apr 2019 06:37 PM PDT

    I'm working with a local business to redo their website. I've been a huge WordPress fan in the past and originally planned to built their site on the CMS; however, due to some budget restrictions I think I may need to build the site from scratch with Node, Express, and Mongo.

    Here's my question:

    Is it a bad idea to build blog posts as simple HTML pages, store the content in mongo, and host them on the site? Or is this much more complicated than I'm imagining? I'm really focused on allowing my website to maintain its original SEO value and continue to thrive in search engines, and I know WordPress takes care of many SEO quirks, which is why I'm asking here.

    I've looked at some CMS's like Keystone, but my time frame doesn't allow me to dive deep into learning a new framework at the moment.

    Any advice and help would be extremely appreciated.

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

    Practicing forEach in JS

    Posted: 02 Apr 2019 11:41 PM PDT

    So I have the below code. How do you go about using for each and specifying that if the element in the array has only 1 element, add ' is pretty' and if >1 add 'are pretty' using forEach.

    so say in the [3] element I have 2 names. I 'd like to add either ' are pretty' or ' is pretty' for both

    let nameArray = [
    'Jenny',
    'Timmy',
    'Dancer',
    ['aRandomGuy', 'anotherRandomGirl']
    ];
    nameArray.forEach (function (nameArray) {
    nameArray += ' is pretty';
    nameArray = nameArray.toLowerCase();
    console.log(nameArray);
    });

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

    Trying to skip the introductory part of my college’s C++ course, need advice

    Posted: 02 Apr 2019 11:31 PM PDT

    Hello all. Apologies if this is better off in r/compsci . I am a newly converted computer science major here at my local community college. I made myself a great education plan and am excited to transfer to the local state school and earn my degree.

    My community college breaks C++ into two courses: introduction to c++ is part A and then the objected oriented part of it is part B, requiring the completion of the introductory class to enroll in part B.

    Part B is the class that transfers to the state school. It is also the ONLY computer science class being offered over this coming summer semester in my entire community college district. I want to get this ball rolling and start taking classes. I have been teaching myself C++ through a book I have bought as well as the entirety of codecademy, some hackerrank exercises, videos, etc. in hopes of skipping the part A.

    A counselor directed me to the department chair who would have to sign off on the prerequisite clearing. The chair kind of laughed at what I had to say, saying that that's great and all but "signing off on prerequisites isn't something we do here and is something I will never consider doing". Saying something about the only way to prove I can take part B is by passing part A.

    I wasn't really expecting this type of response. I asked if I could meet with the summer instructor to see if there's any way I can test out by making a program, taking a test, anything. The chair said if the summer instructor green lights it that he will sign off on the prerequisite clearing, but to not get my hopes up even if the instructor was okay with it.

    I'm looking for any advice for when I meet with the summer instructor or thoughts on my situation. Was I really that naive thinking I could do this? Thank you for taking the time to read this!

    TL;DR: I have been self teaching myself c++. I'm trying to get introduction to C++ waived so I can take object oriented programming over summer and be on track with my educaction plan. Any thoughts/input on trying to convince an instructor to let me skip introduction to C++?

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

    [Code Review] Network file sync

    Posted: 02 Apr 2019 11:26 PM PDT

    Hello, we have been working on this project for a couple of months. Could you please review it. Any kind of feed back is welcome

    gitub repository

    submitted by /u/Superb-username
    [link] [comments]

    [C] help making a Complex number calculator using pointers

    Posted: 02 Apr 2019 11:21 PM PDT

    Hello! I am writing a calculator that adds, subtracts and multiplies complex numbers.

    These are my guidelines

    I am stuck on the read_num function where:

    "The function then reads in the real component of the imaginary number and points the first pointer passed

    to it to that number. "

    Please help me move forward, thank you!

    this is my code so far:

    // this program is supposed to add, subtract and multiply complex numbers. #include <stdio.h> #include <stdlib.h> //function prototypes void add(float real_part_1, float imaginary_part_1, float real_part_2, float imaginary_part_2, float* real_result, float* imaginary_result); void subtract(float real_part_1, float imaginary_part_1, float real_part_2, float imaginary_part_2, float* real_result, float* imaginary_result); void multiply(float real_part_1, float imaginary_part_1, float real_part_2, float imaginary_part_2, float* real_result, float* imaginary_result); void read_num(float* real_part, float* imaginary_part); void read_nums(float* real_part_1, float* imaginary_part_1, float real_part_2, float* imaginary_part_2); void print_complex(float real_part, float imaginary_part); //main function int main (void) { return 0; } // function definitions void add(float real_part_1, float imaginary_part_1, float real_part_2, float imaginary_part_2, float* real_result, float* imaginary_result){ *real_result = &real_part_1 + &real_part_2; *imaginary_result = &imaginary_part_1 + &imaginary_part_2; } void subtract(float real_part_1, float imaginary_part_1, float real_part_2, float imaginary_part_2, float* real_result, float* imaginary_result){ *real_result = &real_part_1 - &real_part_2; *imaginary_result = &real_part_1 - &real_part_2; } void multiply(float real_part_1, float imaginary_part_1, float real_part_2, float imaginary_part_2, float* real_result, float* imaginary_result){ *real_result = &real_part_1 * &real_part_2; *imaginary_result = &imaginary_part_1 * &imaginary_part_2; } void read_num(float* real_part, float* imaginary_part){ printf("Please type in the real component: "); scanf("%f", ); printf("Please type in the imaginary component: "); scanf("%f", ); return; } void read_nums(float* real_part_1, float* imaginary_part_1, float real_part_2, float* imaginary_part_2){ printf("Reading the first imaginary number...\n"); read_num(first); printf("Reading the second imaginary number...\n"); read_num(second); return; } void print_complex(float real_part, float imaginary_part){ printf("The operation yields %f + %fi\n", real_part, imaginary_part); return; } 

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

    HTML in a Flask API?

    Posted: 02 Apr 2019 11:20 PM PDT

    I'm checking out the innards of a half-finished Flask API, and there's an HTML file in a templates folder that seems to correspond with one endpoint. Here it is:

    <!doctype html> <html> <head> <title>Test Table</title> </head> <body> <div> <div> <h1>Test Table</h1> </div> <!-- pass in the result variable which holds the database content --> {% for r in result %} <div> <!-- modify the index template to accept the form data --> <h3>Val: {{ r.val }} Rand: {{ r.rand }}</h3> </div> {% endfor %} </div> <!-- /container --> </body> </html> 

    What is this thing?

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

    How to create this tree in Python?

    Posted: 02 Apr 2019 11:06 PM PDT

    I am practicing Python want to create a tree in python with a starting node and some requirements for the children. The value of each node will be 3 digits (e.g. 320, 110), and I want to generate the children in the following order:

    • 1 is subtracted from the first digit
    • 1 is added to the first digit
    • 1 is subtracted from the second digit
    • 1 is added to the second digit
    • 1 is subtracted from the third digit
    • 1 is added to the third digit

    Constraints:

    • You cannot add to the digit 9 or subtract from the digit 0;
    • You cannot make a move that transforms the current number into one of the forbidden numbers;
    • You cannot change the same digit twice in two successive moves.

    Note that since the numbers have 3 digits, at the beginning there are at most 6 possible moves from starting node. After the first move, the branching factor is at most 4, due to the constraints on the moves and especially due to constraint 3.

    I have already implemented a Node class for my tree, but I am having problems with actually building the tree.

    This is what I have done with the Node class:

    class Node(object): def __init__(self, data): self.data = data self.children = [] self.parent = [] def add_child(self, obj): self.children.append(obj) def add_parent(self, obj): self.parent.append(obj) root = Node(320) def get_root(): print(root.data) # some things I've tried # p = Node(root.data-100) # p.add_parent(root.data) # root.add_child(p.data) # set_root(320) get_root() # print(root.data) # print(root.children) # print(p.parent) # p = Node(root.data-100) 

    I have implemented a BFS which gives the correct path output when give a graph, but I am unable to create the actual graph to use in this BFS. Here is my BFS:

    visited = set() def bfs(graph_to_search, start, end): queue = [[start]] # visited = set() while queue: # Gets the first path in the queue path = queue.pop(0) # Gets the last node in the path vertex = path[-1] # Checks if we got to the end if vertex == end: return path # We check if the current node is already in the visited nodes set in order not to recheck it elif vertex not in visited: # enumerate all adjacent nodes, construct a new path and push it into the queue for current_neighbour in graph_to_search.get(vertex[]): new_path = list(path) new_path.append(current_neighbour) queue.append(new_path) # Mark the vertex as visited visited.add(vertex) 

    Any help would be very much appreciated. Thank you.

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

    I suck at understanding programming ?

    Posted: 02 Apr 2019 11:02 PM PDT

    So pretty much as the title says I suck at understanding programming, I am currently doing my first OOP language in C# and I am really struggling on how to problem solve. I have done pascal, HTML and CSS in the past. I will read my task sheet and sometimes im really lost on what to do, I am falling behind in my work. I feel like I will never understand this and I don't know if I should just drop out ? Do any of you have any advice on what to do or how I may improve?

    At the moment I am trying to find a tutor so if any of you do tutoring message me. Also thinking of doing a course on udmey even tho I am doing this at university, to maybe help me better?

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

    I am curious about the standard placement of forward declarations.

    Posted: 02 Apr 2019 10:48 PM PDT

    I just learned about forward declarations such as function prototypes. The sample programs I was looking at on learncpp put the function prototype before main. Why is this?

    I ask because I have some confusion about how the program executes. I keep reading that when you run your program, the OS calls your main function(I can't seem to find any specific info about this). If that is true, doesn't it skip the forward declaration?

    My only guess about this is that because a forward declaration is necessary to appease the compiler when an undeclared function is called, it isn't necessary to be present in the lower level code. More so, compiler reads the forward declaration in order to properly compile the lower level codes but the forward declaration doesn't actually end up in the lower level codes. I looked at the assembly code and forward declaration didn't have any corresponding code.

    The only evidence against this I have seen is that when I define a global variable before main, it doens't have any corresponding assembly. I guess what I am asking is, what is forward declaring doing? How does it play into the assembly?

    If you have time:

    If I define a global variable outside of main(not that I would or should), there is no corresponding assembly either. Why?

    Why can't I call a function after main(not that I would or should)? If I can have statements before main, why can't I have statements after main?

    Lots of questions. Sorry for any incorrect assumptions. I would appreciative any help. Thank you.

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

    Help writing conditional statements (if...elseif...) into while loop.(Matlab)

    Posted: 02 Apr 2019 06:58 PM PDT

    A certain video game internally stores the classes of characters as integers. Write a Matlab script that prompts the user for an integer called ClassNum whose values should be between 0 and 11, inclusive. Check that the user has entered a value in that range and print an error if he didn't and then end without printing anything else. For entered values in the correct range, use if andelseif statements and convert that number into a string, according to the table below. Store the string in a string variable (character array).

    Use fprintf to print the value of the stored string as the Character Class Name

    I need help writing these conditional statements within a while loop. I have ruined the program but I can't make it into a loop. For instance, if the user inputs a "1", his characters name is Barb. I want to program to continue asking him to keep on inputing values.

    Code: %name = ["Barbarian", "Bard", "Cleric", "Druid", "Fighter", "Monk";

    % "Palarin", "Ranger", "Rogue", "Sorcerer", "Wizard", "Abberarion"]

    ClassNum = input('Enter a number between zero to eleven to access character name: ');

    value = 0;

    while ClassNum >= value;

    if ClassNum == 0;

    fprintf('Barbarian')

    elseif ClassNum == 1;

    fprintf('Bard')

    elseif ClassNum == 2;

    fprintf('Cleric')

    elseif ClassNum == 3;

    fprintf('Druid')

    elseif ClassNum == 4;

    fprintf('Fighter')

    elseif ClassNum == 5;

    fprintf('Monk')

    elseif ClassNum == 6;

    fprintf('Palarin')

    elseif ClassNum == 7;

    fprintf('Ranger')

    elseif ClassNum == 8;

    fprintf('Rogue')

    elseif ClassNum == 9;

    fprintf('Sorcerer')

    elseif ClassNum == 10;

    fprintf('Wizard')

    elseif ClassNum == 11;

    fprintf('Abberation')

    elseif (ClassNum >= 11);

    fprintf("Error, please enter values between 0 zero to 11")

    end

    break

    end

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

    Web3d/xhtml - Texture Mapping - How to find texture coordinates?

    Posted: 02 Apr 2019 10:34 PM PDT

    So for an assignment I have, some extra credit can be gotten if we can apply a certain texture to an object.
    The object is a sort of dodecahedron meant to be the shell of a turtle, and the texture goes with that concept. However there is a deliberate bug of sorts in that the texture is not the same dimensions as the object and has transparency which results in a visual bug in which the edges of the shell dont meet. We've been told to use texture mapping to make it all line up but I cant for the life of me figure out what the coordinates are supposed to be, nothing seems to work.

    I've made a Google Drive here with some files of the stripped down code related to my question (we're not allowed to publicly upload full code for assignments). To run it you should just need to have each of the files loaded into one directory and then open the .xhtml file with your preferred browser, I use firefox.

    The area of interest in the code is lines 65 to 77, you can see what I've left empty, that's where I'm struggling.

    To see how the code runs as is, just cut out and paste texCoordIndex=' ' and <TextureCoordinate point=' '/> from the code and save it and then refresh the page and you should see 4 different 'shells'.

    I would prefer a non direct answer, telling me how to fix it rather than just what exact code / coordinates I should use but obviously I won't be upset by getting a direct answer.

    I thank you in advance if you can help in any way!

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

    [java] how do I Scan two variables with functions

    Posted: 02 Apr 2019 06:47 PM PDT

    the teacher wants me to create a function which asks the users to enter two integers and another function to get their average. How do I make a function that asks the user to enter two integers and how do I use these integers?

    I'm only on the fourth lecture so please, try to keep it simple :) Here is what I have so far:

    import java.util.Scanner; public class Student { private String name; private int g1,g2; public Student(String studentname) { name = studentname; //fill in this block g1 = grades1; g2 = grades2; } // --------------------------------------------- //inputGrades: prompt for and read in student's grades for test1 and test2. //Use name in prompts, e.g., "Enter's Joe's score for test1". // --------------------------------------------- public void inputGrades() { System.out.println("Enter grades for test 1 and test 2: ");//fill in this block Scanner scan = new Scanner(System.in); int grade1, grade2; grade1 = scan.nextInt(); grade2 = scan.nextInt(); } // --------------------------------------------- //getAverage: compute and return the student's test average // --------------------------------------------- public double average(int grade1, int grade2) { double average; average =(double)(grade1+grade2)/2; return average; } // --------------------------------------------- //getName: print the student's name // -------------------------------------------- public String getname() { return name; } public static void main(String[] args) { String name = "Harry"; Student s1 = new Student(name); double average; int grade1=0, grade2=0; String name1 = s1.getname(); System.out.println(name); s1.inputGrades(); average = s1.average(grade1,grade2); System.out.println(average); } } 
    submitted by /u/kenm_v2
    [link] [comments]

    [C++]Getting abnormal errors when I add a "class as a friend class" in a nested class with Visual Studio 2019

    Posted: 02 Apr 2019 10:07 PM PDT

    This class

    template <class T> class Iterator { private: Node<T>* v; Iterator(Node<T>* u) { v = u; } public: T& operator*(); bool operator==(const Iterator& p) const; bool operator!=(const Iterator& p) const; Iterator& operator++(); Iterator& operator--(); // Friend class List <--- This line breaks everything }; 

    is a nested class of this class

    Template <class T> class List : public Node<T> { public: List<T>(); ~List<T>(); Node<T>* Get(int index); void InsertHead(const T& Data); void InsertTail(const T& Data); void Insert(int index, const T& Data); int search(T Data); void RemoveHead(); void RemoveTail(); void Remove(int index); void print(); virtual bool isEmpty(); virtual bool isFull(); Iterator<T> begin() const; Iterator<T> end() const; protected: Node<T>* head; Node<T>* tail; int size; }; 

    when I add friend class List to the end of the Iterator class, I get abnormal errors such as

    Severity Code Description Project File Line Suppression State

    Error C2182 'List': illegal use of type 'void' 261

    Is my code just plain wrong? or is it a bug

    I'd past the entire source but its really long.

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

    2D Breakout Game Using JavaScript and HTML [beginners]

    Posted: 02 Apr 2019 02:34 PM PDT

    uizard - digitalize ui drawings

    Posted: 02 Apr 2019 10:02 PM PDT

    https://uizard.io I saw something like this on Instagram and started to think about it. If this is possible what do we need anymore about user interface? What are your thoughts about it?

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

    No comments:

    Post a Comment