C++ nested class

Learn Programming - Thu, 11/15/2018 - 13:33

Can someone show me a template for a class inside the private section of another class. How is the inner class instantiated inside the outer class and how are the variables accessed inside the outer class. The user only interacts with the outer class , so I'm only able to pass the variables to the outer class where they are then modified to create an instance of the inner class.

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

PHP/SQL Inserting options from multi-select dropdown.. Can't seem to spot my error...

Learn Programming - Thu, 11/15/2018 - 13:09
$query = "INSERT INTO boats (boat_name, boat_year) "; $query .= "VALUES('{$boat_name}', $boat_year) ;"; print_r($boat_type); //testing multiple select foreach($boat_type as $selected){ if(!empty($boat_type)){ $query .= " INSERT INTO boat_types (boat_id, type_id) VALUES(LAST_INSERT_ID(), $selected);"; } }

I'm trying to concatenate the $boat_type (array) which comes from a multi-select drop down. It's producing an error in my SQL syntax. I can't seem to figure it out. When I type this command in my phpadmin SQL tab it works perfectly as I want it but when I try to insert it with this PHP it says SQL syntax.

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

How is having a job different than college? Are you happier?

Learn Programming - Thu, 11/15/2018 - 13:08

I'm currently struggling with college(computer science) to be honest. A lot of bull***t going on around here. On top of that I have to pay for it this semester(and my family isn't exactly the type to afford this type of things).

The stuff I learn is mostly useless and/or really old( I'm in the second year. In the first one the only useful stuff was Data Structures and OOP).

And I don't really like studying for college. I have started learning C# recently, and it is worlds apart. I feel more willing to learn C#.I don't feel disgust while learning.(as I do with most topics at uni). I actually enjoy it.

I would like to know from fellow programmers who are now working and finished a college(or went for at least a year :) ), how is you life now? Is it better? Harder? Easier? Are you happier?

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

[C] Customise gtk widget appearance? (gtk+2)

Learn Programming - Thu, 11/15/2018 - 13:03

I'm looking into using gtk for a personal project but I need to know if it's possible to modify the rendering code for the provided widgets. I know it's possible to create custom widgets (something which I have done already).

But what I need is the ability to customise the standard widgets.

The documentation is a bit lacking.

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

Starting blog in order to learn

Learn Programming - Thu, 11/15/2018 - 12:58

Hey guys, quick idea came to my mind recently. Would it be reasonable to start a blog to track your progress of learning new things (frameworks, concepts, algorithms) and document this for other people? Do you think there would be anyone who would be interested in such blog?

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

How to properly initialize a 2D array from string?

Learn Programming - Thu, 11/15/2018 - 12:53

Forgot to mention that this is in C++ in the title.

Whenever I run the program, I get a bad access error when initializing the 2D array in the constructor.

I declare the array as char ** grid; as a private member variable.

DirectedGraph(string maze){

rows = numRows(maze);

cols = numCols(maze);

//grid = new char\[rows];*

for(int i = 0; i < rows; i++){

grid[i] = new char[cols]; //BAD_ACCESS code occurs here


//create 2d grid from string

int count = 0;

for(int i = 0; i < rows; i++){

for(int j = 0; j < cols; j++){

if(maze[count] == '\n')


grid[i][j] = maze[count];


// cout << grid[i][j];


// cout << endl;



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

Question about Elements of Computing Systems

Learn Programming - Thu, 11/15/2018 - 12:49

Hi i know that in this book you learn how to program assembler , compiler , kernel and OS. Is things you develop fully coded or are they are built using tools.What I mean is are they just code that you wrote or when you built them some coding is handled by the given tools and it is bit more abstract? For instance can I share my actual compiler , and kernel that fully works on GitHub? If so can this compiler I wrote fully run on supported hardware without any additional learning tools like emulators.

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

Pseudocode conventions

Learn Programming - Thu, 11/15/2018 - 12:40

Yes, I know pseudocode means "do whatever you need to describe the behavior" and there is no formal notation. Still, I'd like to get some guides, good practices. For example, I found this:

It describes everything really well, it's just too mathematical (or so I was told from my superiors). I need to stick more to the programming level, so I was thinking if there are any conventions like this, but are closer to programming languages than math.


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

Is Udemy good for learning languages?

Learn Programming - Thu, 11/15/2018 - 12:37

Looking to supplement my knowledge as a CS Major who’s taken OOP and data structs in C++ but looking to learn languages like JavaScript, Python And Maybe Java

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

I Want to learn a language

Learn Programming - Thu, 11/15/2018 - 12:35

I really want to learn one of the languages preferably python because I already know the basics of it and want to expand my ability, I am a sophomore in high school and I want to start early and I was wanting some recommendations for free python courses that actually let you solve problems while teaching you king of like code academy any ideas welcome I am all ears.

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

Not sure where to start my web project!

Learn Programming - Thu, 11/15/2018 - 12:34

I was required to create a web project using django.
I must create a website that has inputs forms where users register things (theories from a field of study, with cause, explanations, results, etc). Then, another page to display the info registered by the users. Also, I must create graphs that will connect some of the answers (from theories that come from the same field of study), which I thought about using d3js.

The thing is, I've never done a big project and have no idea where to start. I know C and some python, but all I've ever done was code algorithms and little problems.
Can someone help me structure a list of steps, like I should start with the html for the web pages, then... etc.
(All the directions I received were the ones as listed, and more details about the data that must be requested from the user)

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

.equals help

Learn Programming - Thu, 11/15/2018 - 12:18

I need to modify my current code to meet the following requirements, Create 3 people. Two people should be “equal” and pass the .equals test. Then create 3 vehicles; two of which are equal and passes the .equals test. Next create 3 trucks; two of which are equal and passes the .equals test.

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

Anyone brand new to coding? Who want's to accomplish FreeCodeCamp with me?

Learn Programming - Thu, 11/15/2018 - 12:12

I feel the self taught rode to coding is lonely, I just started progressing on FreeCodeCamp and want to take this journey with others. Only beginners, unless some advanced coders want to help moderate and aid others on their journey. You'll be required to progress with at least 20 lessons a day.

I'm making a discord channel as we speak. Send a pm if you're interested or comment if you have any questions.

I've been dabbling on and off with coding for a couple of months now. I want to stay disciplined by incorporating coding as much as i can into my life. Moderating a channel sounds like a good way to stay focused, and help others stay focused on coding. I plan to make programming a career and I love creating things from nothing. This is the reason why I want to do this.

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