Programming

Computer courses that mean something

Learn Programming - Thu, 09/20/2018 - 14:00

Hi,

So I don't know if this is the right place for this but I am very interested in programming and I need some help

I live in the UK and while I do not want to do computing A-level (I have heard its not that important for universities and careers in computing), I do want to do some courses on my own and in my own time. However, I would like courses that I could put on my CV and they actually mean something. If anyone had any suggestions I would be extremely grateful.

Thanks!

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

I know basic C++, where do I go from here?

Learn Programming - Thu, 09/20/2018 - 13:58

It feels a big overwhelming reading through what languages people recommend. I'm currently in college, studying in CS and was wondering what are some good beginner projects for someone like me? I know basic C++ (only language I've practiced with so far, other than BSL) and was wondering if there's any beginner projects I could work on to practice my skills? Also, should I look into other languages as well? I'm not to sure what I want to do as a career in C++, but I really do enjoy the problem solving aspect of programming.

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

Ruby: Need help understanding beginner code: creating a hash

Learn Programming - Thu, 09/20/2018 - 13:54

X-post from r/ruby
Hi, I'm very new to programming and am having difficulty understanding what this code is doing. I realize that there are possibly several easier and/or shorter ways to write this code, but I need to understand what is going on here first. I would appreciate any help:

Q: Create a hash that expresses the frequency with which each letter occurs in this string:

Given:

statement = "The Star Wars Movies Rock"

Ex. output:{ "T"=>1, "h"=>1, "e"=>2, "S"=>1, "t"=>1, ... }

Provided Solution:

result = {} letters = ('A'..'Z').to_a + ('a'..'z').to_a letters.each do |letter| letter_frequency = statement.scan(letter).count result[letter] = letter_frequency if letter_frequency > 0 end

My understanding:

  1. initialize a variable to store the hash result
  2. declare a variable, letters, and convert to array since we have to check for alphabets
  3. iterate over the letters for element, letter
    a) declare a variable, letter_frequency, to store the count of each letter, which we get by scanning statement for letter, and then count it.
    b) This is the line I do not understand. Why result[letter] ? What is this part, result[letter] doing?

I sincerely apologize if I've made an error in the way I've asked this question and also if I've screwed up the formatting. Any explanation would be much appreciated. I'm new to programming, so if you could describe in simple language that would be very helpful.

Thank you!

edit: formatting

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

Kit Programming Language

Programming - Thu, 09/20/2018 - 13:34
Categories: Programming

Need help creating a Openfire plugin

Learn Programming - Thu, 09/20/2018 - 13:23

Hi. I want to learn and get better at coding (I'm kind of a beginner and I need all the practice I can get) so I'm trying to create a plugin for Openfire. I'm trying to find some guide but none of the are really "step by step" with instructions for newbies like me. I'd appreciate any help, especially how to start. (For the record I have learned Java, but I have not used it, I haven't made anything practical, just so that you understand my level of understanding of the problem)

submitted by /u/Sigmund-
[link] [comments]

Does anyone do projects from "Scratch" anymore or should everyone be picking a framework (React, Angular, Laravel) first and trying to work off that?

Learn Programming - Thu, 09/20/2018 - 13:19

I have had a hard time developing with frameworks so far just because a lot of it seems to be "Memorize these commands that make the framework do this stuff". And every new one is a ton of new documentation to figure out. And I can't ever pick one and stick with it enough to learn it well lol...

Just wondering what people think about development strategy

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

[C++] Best Lib/Tutorial for Web Scraping?

Learn Programming - Thu, 09/20/2018 - 13:19

I'd like to create a program that can search up NFL player information by name and put it into a vector/dict. I'm having trouble finding the correct library (and helpful tutorials) that would allow me to navigate HTML and do this solely with C++.

Anyone have any sources I could use? This would be a lot easier to do with Python imho but I want to learn C++ and I figure this would be a good project to start with.

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

Mongoose: how to populate nested schemas with cross-references?

Learn Programming - Thu, 09/20/2018 - 12:58

Hi guys,

I am building a webapp for learning purposes with NodeJS and Mongo (Mongoose). It should be a Job Board that allows users (HR managers) to keep track of the job openings and the candidates. I am probably creating too much confusion with Mongoose Schema so I'd be happy to find some suggestion.

I have 3 Schema for:

- Company

- Position

- Candidate

These are the working cross-references amongst them (using mongoose.Schema.Types.ObjectId):

- each Company has a property that includes the array of open positions for that company

name: String, logUrl: String, positions: [{ type: mongoose.Schema.Types.ObjectId, ref: 'Position' }]

- each Position has a reference to its own company

role: String, salary: Number, jobDescription: String, company: { type: mongoose.Schema.Types.ObjectId, ref: 'Company' }

- each Position has also an array of candidates that applied

... candidates: [{ type: mongoose.Schema.Types.ObjectId, ref: 'Candidate' }]

- each Candidate has an array of positions (a single candidate can apply to multiple positions).

name: String, surname: String, email: String, positions: [{ type: mongoose.Schema.Types.ObjectId, ref: 'Position' }]

Using .populate( ) I am able to manage all of them and access specific properties of linked objects. In this example, I can open the profile of a candidate, read the list of positions he applied and display the logo of the companies that have those openings. In this other example, I can open the profile of a company, read the list of openings and see the number of candidates for each one of them.

So far so good, everything works as expected ✌️

Now my goal is to add two properties to the array of positions in the Candidate schema than can keep track of the status of that application and the notes taken by the HR manager: the output should be similar to this.

My Candidate schema is now:

name: String, surname: String, email: String, positions: [ { detail: { type: mongoose.Schema.Types.ObjectId, ref: 'Position' }, progress: { type: String }, // keep track of the status comment: { type: String } // keep track of internal notes }],

My code for opening and populating the candidate's page is:

app.get('/:id', (req, res) => { Candidate .findById(req.params.id) .populate({ path: 'positions.detail', model: Position, populate: { path: 'company', model: Company } }) .exec(function (err, foundCandidate) { if (err) { console.log(err) } else { res.render('candidates/show', {candidate: foundCandidate}) } }) })

Now the problem: positions.detail is not getting populated. With the previous Schema (and without these two new properties), I was able to easily retrieve data on the position with position.property as well as on the company with position.company.property; now I am using position.detail.property and position.detail.company.property but they don't work: Cannot read property 'property' of undefined

Can anyone help me with this?

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

Dealing with burnout :(

Learn Programming - Thu, 09/20/2018 - 12:51

Hey guys,

I have been consistently teaching myself how to code for about 2 months. I work 40 hours a week. Recently I have been skipping days and its mainly because I am tired. I know what my goals are but i find myself with another day wasted. After i get home around 7 pm i am just done.

How do you manage working fulltime then coming home to program? I really enjoy it and want to make progress but i feel the burnout real bad. Anybody relate?

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

why use an Open Source Search Engine?

Learn Programming - Thu, 09/20/2018 - 12:47

I have heard about ElasticSearch but I'm wondering what is the utility of an open-source search engine concretely ? I have seen some articles and I'm confused with all the technical jargon

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

College student laptop

Learn Programming - Thu, 09/20/2018 - 12:44

I’m a student who studies computer science.Ive been always building PCs and never had being interested in a laptop before.May I have any suggestions.Btw my budget is 500$

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

need help with loops c++

Learn Programming - Thu, 09/20/2018 - 12:35

So my goal here is that I need to ask the user how many math problems they would like. When the user types in the amount of problems, I need it to show x amount of problems.

I'm having trouble on which loop to use (at the case1) and how to code it in a way that 'test' is only shown the amount of times that the user inputs for numberOfProblems.

//Display Menu cout << "1. Addition" << endl << "2. Subtraction" << endl << "3. Multiplication " << endl << "4. Division" << endl << "5. Quit" << endl; //Prompt for menu choice cout << "Which type of problem do you want me to present? (Type the number!)" << endl; cin >> typeOfProblem; //Prompt for number of problems to present cout << "How many problems do you want me to present?" << endl; cin >> numberOfProblems; switch (typeOfProblem) { case 1: //code for addition for (numberOfProblems = 0; xxxxxx; numberOfProblems++) cout << "test" << endl; break; case 2: //code for subtraction break; case 3: //code for multiplication break; case 4: //code for division break; case 5: //code for quit break; } return 0; }

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

Java printing String characters as unicode decimal value.

Learn Programming - Thu, 09/20/2018 - 12:29

I put a word into a string array and now I'm trying to print the letters as their unicode decimal values.

Scanner so = new Scanner(System.in);

String word = so.nextLine();

String[] chars = word.split("");

System.out.println(chars[0]);

So the code should print out the first letter of the word, but I want to convert it to its unicode decimal value. I've been scouring the internet for the last hour but nothing is working. does anyone have any answers? thanks!

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

Query

Learn Programming - Thu, 09/20/2018 - 12:20

Hi. Just started studying assembly course. Wanted to know if the combination bx+sp is legal or not.

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

Learning Programming for career?

Learn Programming - Thu, 09/20/2018 - 12:15

Hey guys, I just graduated college with a pretty much worthless bachelors degree. I'm really interested in working as a web developer or something to do with IS. I love computers. Problem is I have no knowledge or skills in programming besides a course in high school. What is my best bet for making entry into the field with an unrelated degree? Should I go back to school and get an associates or something in programming to learn more? or would I be better off learning myself and then trying to get my foot in the door somewhere?

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

Is this a bad pattern to use in Javascript?

Learn Programming - Thu, 09/20/2018 - 11:56

Hi,

There's a heavy emphasis of OOP style in javascript and broadly speaking in web application design, but a common pattern I've been using is for example:

function exampleScript() {

// Does something

}

And then in a utility folder, export out a few helper functions

import { utility1, utility2 }
function exampleScript() {

utility1()
utility2()
// Does something

}

This could be applied for all sorts of things, e.g. backend REST API route handling. I find it easy to implement and modularize. But it's clearly not OOP. And so, is this a bad pattern to use? What is the best 'practice' here?

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

This PHP code works, but I feel there is a more elegant way to update my database. Help please?

Learn Programming - Thu, 09/20/2018 - 11:48

https://gist.github.com/Jreye039/60f2d4db78debfe3f382a855f4c11e16

So while this does update my database, it doesn't notify the user that the database has been successfully updated.

I want the update page to be on one page, like I shouldn't have to go to an entirely different page after the user updates to notify them that the update succeeded. Kinda like how Reddit's is on the same page. And what if they made a mistake and want to change it again? I want it to be right there for them.

However, I know this is sloppy.

Basically what this code does is it takes the current joke, automatically updates it with the exact same joke, then allows the user to submit the form with any changes which then updates it again.

As you can see, not very elegant. I want to know a better way to go about doing this which I'm sure there has to be.

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

Pages