I feel like I’m playing on easy mode. I think I know Ruby pretty well, can anyone recommend something more powerful? via /r/learnprogramming


I feel like I’m playing on easy mode. I think I know Ruby pretty well, can anyone recommend something more powerful?

I always here about languages like C# or Java being more powerful than other languages. Should I learn one of those? I tried a bit of C++, but kept running into compiler errors, so I stopped.

Submitted September 30, 2015 at 07:15PM by iTARIS
via reddit http://ift.tt/1GipYSa

Using cron jobs to periodically update database — question about race conditions via /r/learnprogramming


Using cron jobs to periodically update database — question about race conditions

Right now I have set up a cron job on a web service that periodically updates table entries in my SQL database. What happens if a user makes a request from the applicationn to the web service to pull some data from the table that is currently being updated by the cron job? Since the cron job runs on its own thread, won't there be a race condition/conflict? How can I handle this issue without affecting the usability of the application?

Submitted September 30, 2015 at 07:17PM by sfxhamster
via reddit http://ift.tt/1GipYS8

Want to make something special with c++ help needed with the structure via /r/learnprogramming


Want to make something special with c++ help needed with the structure

I have been taking college courses on c++ but I am definitely still a beginner. I'm about a month into my classes.

So my question is how can I create a program that lets the user input their name and other things of that nature and have my program answer.

Currently in class we have been learning about input from the keyboard with cout and cin.

I wanted to create a program for my gf/mother of my child. I want to have it basically ask her name and converse with her. Have the program just tell her how grateful I am for her supporting me. I have a rough idea of how to make this work but just would love some advice on how to do it if maybe there is a better way in a different language. I use visual studio.

So to sum it up my idea is the program will ask her name and when she enters maybe the program will say wow that's a beautiful name or something then it will ask her what her favorite chocolate is and those sorts of things. I will end up having flowers and everything once the program ends and tells her to come to the door. I know it seems cheesy and lame but I want to be romantic and this is something I really love learning and to me creating it makes it so much more personal than anything I've ever done.

Thank you all who help me. I'm sorry if I was vague but feel free to ask whatever you need as I'll be checking this periodically.

Submitted September 30, 2015 at 07:21PM by Day_dreamer23
via reddit http://ift.tt/1FJ3qPM

Badly written c++ classes to prep for interview? via /r/learnprogramming


Badly written c++ classes to prep for interview?

Trying to prep for an interview and I know one of the questions is to go through a badly written class and find best errors / improvements? Anyone have any resources for this? I've been looking at and trying to improve my own code but would like to practice specifically for the interview.

Submitted September 30, 2015 at 07:23PM by LostCS_Student
via reddit http://ift.tt/1QLJtbp

Idea on an assignment, need help finding out where to start. via /r/learnprogramming


Idea on an assignment, need help finding out where to start.

So in my interactive media class we were given the assignment to "develop something that makes someone happy". I have a cool idea where you basically tickle a character and they begin laughing, but I have no experience programming applications, although I do want to learn, and I have a good background with web programming. I have been googling around trying to find out where to start, but i am having trouble. Do you think this is best made in a mobile application, and if so what languages/stuff should i look into to solve it. I am excited about the project, and appreciate and help.

Submitted September 30, 2015 at 07:31PM by AlmostAnonymousDylan
via reddit http://ift.tt/1OHqcuj

I tried to set up a VM on linux and now it seems some packages are broken, even a few programs just disappeared? via /r/learnprogramming


I tried to set up a VM on linux and now it seems some packages are broken, even a few programs just disappeared?

Hello, I'm on Ubuntu 14.04 LTS 64 bit version.

I was trying to set up a VM following the steps of a guide a guy on the ##PHP IRC channel on FREENODE gave me so I could work on a project.

Now, to install VirtualBox and Vagrant I followed this guide and I noticed a lot of packages where being removed/replaced with the

$ sudo apt-get install virtualbox-dkms 

command, being still a newbie I thought that was just okey and standard procedure but now not only I couldn't do

vagrant up 

as the guide says, because I got an error about the version I have installed and the version that should be installed so I run

$ sudo apt-get update 

and

 $sudo apt-get upgrade 

but a lot of things now look kinda of broken:

  • 1 .- The one that worries me the most, is that my terminal changed completely, it used to be like this and now it looks like this (I can barely see what's written on it), it has a weird X on the upper-right corner that wasn't there before and it's pure black and I can tell that it's not the same terminal emulator I am used to.

  • 2 .- My IRC client Pidgin, the one on the left in this picture, it isn't where it was before and now I can't find it anywhere as if it was uninstalled.

  • 3 .- I use Clementine to listen to music as you could have guessed from previous image, but now there's no clementine icon on my bottom panel and I get prompted this error when pressing the "?" button.

Please help me!! it took me SO LONG to configure both pidgin and clementine to feel comfortable, as I said before I'm still a newbie and my first guess is that I accidentally purged some incredibly relevant packages with the VirtualBox installation and I am afraid a lot more things got broken that I still don't know of.

Please, please help me restore my system, I can't see anything on this terminal.

Submitted September 30, 2015 at 07:32PM by autopoiesies
via reddit http://ift.tt/1OHqaCo

How much is too much for the __init__ function in my classes? via /r/learnprogramming


How much is too much for the __init__ function in my classes?

For example, I'm working on a program that scrapes pdf text and parses out the data depending on the need.

The entire program is operating out of one class (still new / trying to get a feel for OOP).

In the main program will loop through several PDFs extracting the data needed. I currently have it structured where whenever I create an instance of a class, the init function loads all of the pages of one PDF and scrapes the text out. The other functions in the class are of the getX variety, depending on what information I need from the file.

I'm wondering if I should set up a separate function to load/scrape the PDF than the init function, as creating the instance of the class is the most resource intensive part of my script.

Is there any good rule of thumb for what my init functions should accomplish?

I'm using Python 3. Thanks!

Submitted September 30, 2015 at 07:35PM by allaroundfun
via reddit http://ift.tt/1OHqam4