Learn Programming

Subscribe to Learn Programming feed
A subreddit for all questions related to programming in any language.learn programming
Updated: 26 min 13 sec ago

Buying my first laptop for school, Help with specs please.

26 min 50 sec ago

Hi, In October i begin 1 year intensive programming course in which i will learn C#/JS/CSS/ASP.NET/SQL.

I don't have a lot of money so i'm buying used laptop from my friend and here are the specs:

Dell Inspiron 5567, Intel i7-7500u, 8GB ram, 512GB SSD, AMD Radeon r7 m445 with 4gb memory card.

He want 700$ for it.

Is the laptop good for programming code? Did he gave me a good price?


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

C# - Have for each loops been optimized?

27 min 9 sec ago

My rule of thumb has always been: use for each loops for readability when performance is not an issue, use for loops when performance is an issue.

However, some time ago I started using for each loops for everything since someone told me (with an explanation) that for each loops had been optimized.

Now, I forgot that explanation and when searching for it online, I couldn't find anything.

Was it just BS?

After digging into for each loops and understanding its enumerator implementation, I don't see how it might have been optimized.

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

[Advice] What industry skills should a student develop that may offset poor grades obtained in degree.

57 min 33 sec ago

So, for various reasons I was not able to score well in the 3 semesters I've been to college. Now I am doing mostly CS related courses like Data Structures, Digital designs and a lot of math. But, I feel that despite working in them I won't have much apart from a slightly better report card as even after working for some time I can't feel any confident in working with code that's used by other people. I downloaded some software and tried to see how it works but I couldn't get the head or tail of it, neither could I get the various terms and keywords in it.

I want to know what skills I could develop apart from what's taught in college to become a better programmer (also something that covers up for marks for I fear there may be another drop in them as I'm losing interest).

submitted by /u/1080pfullhd-60fps
[link] [comments]

How can I learn?

1 hour 23 min ago

I watch tutorials, I complete them but not understanding them. I sometimes understand something small but nothing more. I can't do it myself, like if I want to make a character that can be controlled and walk, I can't do it myself. Is this normal?

And how do I learn all of the words in the language? Like there's public, private, bool, if, else, true, false etc, how do I learn all of these? Because there has to be thousands or millions of them.

Help, I do not understand. D:

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

I can't decide on Python or C++

1 hour 32 min ago

Hi, I have a small problem not knowing which of these programming languages would be better for me since I'm already learning the basics of C++, and I'm now on dynamic RAM allocation. BUT! I still think if I should learn Python instead anyway... Please help me decide, I don't want to waste my time...

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

How does scrum help?

1 hour 51 min ago

I've been read some blogs about scrum and practically the whole Wikipedia page. However, I still don't get how scrum helps adapting to changes in requirements.

Say, something was made 2 sprints ago. There might already be features that build on this. If the requirement changes now, a lot of work will be lost.

I get how small timeboxes help with time management. But how does scrum actually help with adapting to changes?

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

best java training in chennai

1 hour 51 min ago

With top-notch faculties and world class infrastructure, Softlogic systems must be the Best android Training in Chennai for your study. Every trainer in the Academy takes great effort in making the students understand the tool well. Each and every students gets hands-on-experience and free placement assistance by the end.

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

Why make a "new" parameter inside variables?

2 hours 22 min ago

In a lot of code I see instances where, when defining a function or variable it's like:

Vector 3 something = new Vector 3 (stuff)

This is not just for Vector 3s though. It's for everything from floats, to transforms, to gameObjects.

What is the purpose of this? Why would we define a new parameter inside itself when it already is that data type? How do you know when best to do this?

submitted by /u/Sparky-Man
[link] [comments]

What are the limitations of using Addition and Subtraction method for swapping two numbers in C/C++?

2 hours 52 min ago

This is the method I am talking about




Overflowing due to addition of large numbers is one. Are there more limitations?

I have tried different types of input and can't find any other limitations. I have given it more time than I should have. Am I missing something obvious? Please help.

submitted by /u/zed-reeco
[link] [comments]

Need explanation for a regex that checks if a string starts and ends with the same vowel

3 hours 36 sec ago

Hello reddit! I need some help regarding the following regex:

let re = /(^[aeiou]).*\1$/

I've read the regex documentation on mdn, fed the regex to https://regex101.com/ and read the explanation on it. Yet I still can't wrap my head around what .* does in the expression. Any explanation or clarification is greatly appreciated! Thank you!

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

Writing algorithms for beginner

3 hours 7 min ago

Hello guys i was watching a video on youtube about thinking like a programmer and they say that writing algorithm makes programming alot easy and i want to learn to write algorithms and is there a book or way i should learn ???

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

[100% Off] Build A Complete CMS App Using Angular 5

3 hours 52 min ago

Hello everyone,

Dive right into Angular 5 fundamentals with this course that starts at the very beginning, and is a great resource for anyone – whether they are familiar with Angular (other versions) or not. With Angular continuously gaining ground as a popular front-end framework, it is becoming an essential skill to have for developers around the world.

What you will learn in this course:

  • Introduction to Angular 5 and its documentation
  • Going over crucial commands such as components, directives, pipes, services, classes, guards, interfaces, enums, etc.
  • Go over the Angular 5 documentation including forms, validation, routing & navigation, etc.
  • AngularFire Tool component

    All of this and so much more is packed in this amazing course. So, what are you waiting for? Enroll now! -


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

Called function counted up the iterator of the calling function as well (same name) is this normal? Happened in google script

3 hours 59 min ago
function myFunction1() { var newArray = sheet.getData var a = newArray.length //2 for(i = 0; i < 2; ++i){ newArray.push(0); } return newArray } function myFunction2 { for (i = 0; i < 2; ++i) { console.log(i) //0 for (j = 0; j<2; j++) var someVariable = myFunction1() { }

What happens is that the nested loop is executed correctly. However the first loop in myFunction2 exists prematurely because the variable i is counted up by the for loop in the called function (myFunction1) as well. If I change the variable from i to k in the for loop for the called function (myFunction1) the problem is fixed and the loops in myFunction2 execute correctly. How does that happen, shouldn't the called function operate with its own copy of i ? I is not being returned. All that is being returned is an array.

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

C++/Java YouTube tutorials that teach using projects

4 hours 47 min ago


I'm looking for recommendations for YouTube playlists where a person completes a programming project and finishes it all on YouTube.

I like watching other people code and seeing possible stumbling blocks and how they solve it. Also I learn more by seeing a high level project and watching people break it down and code it bit by bit.


- coding a torrent client (teaches internet protocols),

- games (teaches data structures & a ton of other stuff)

- virtual election booth/bank system (teaches security)

I also recently watched "Python Plays GTA V", where a person coded a neural net that could self drive a car, and I found it extremely interesting. So I'm looking for more series to watch in my spare time. Thanks!

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

"How to Begin Thinking like a Programmer" by Andy Harris

5 hours 7 min ago

This is a must watch for All beginners no matter what language you are learning


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

Just starting to learn programming, it is so hard, am I just dumb?

5 hours 7 min ago

I am just starting to program. I installed eclipse and it was a pain in the ass to install Java. I have tried to install python and get it running on eclipse, but it is so hard and I keep running into problems. I go to look up a solution, but then when trying to go through the solution, I get another problem and that keeps going in circles. So I eventually gave up on trying to install python so I am trying to learn Java instead.


There are other issues with trying to install other add settings so I just left them and try to get started


When I try and to "run" I get this error message:

"An internal error occurred during: "Compute launch button tooltip".



And there are 0 solutions pertaining to my problem on the internet. If you search that error on the internet, there are only 6 results...


It all so hard and I feel so dumb. It took me a week to install eclipse and Java, I still cannot install python, and I am always getting error messages that I can never solve. I am currently a physics major, and I need to be able to program because there are not many job prospects after graduating without being able to program. This is really all stressing me out and making me sad and depressed.


If I cannot even install python and am already having trouble with doing the basics, am I too dumb and should just not pursue learning to program? Can someone actually be "too dumb" to program?

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

Should I learn Fortran?

5 hours 43 min ago

Hey y'all. Physics major here, planning to pursue a PhD after I finish my bachelor's this year.

I've become well-acquainted with Python and MATLAB (and AutoHotkey to a small extent). I asked my professor if I should try to learn Java as well—I was under the impression that Java was common in STEM environments. But he told me that it would be more practical in our line of work for me to learn Fortran. He said that it's one of the most common languages used in STEM today.

Can I get a verification from anyone on this? Is it worth it to devote my free time this semester to learning Fortran instead of, say, Java or C?

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

Why filter2D in OpenCV gives different results than imfilter in Matlab?

5 hours 46 min ago

I have an original image: https://imgur.com/a/m9ZRikY

I then read it, create a PSF, and blur it in Matlab:

lenawords1=imread('lenawords.bmp'); sigma=6; PSFgauss=fspecial('gaussian', 8*sigma+1, sigma); PSFgauss1 = PSFgauss/max(PSFgauss(:)); PSFgauss2 = PSFgauss1/sum(PSFgauss1(:)); lenablur1=imfilter(lenawords1, PSFgauss, 'conv'); lenablurgray1=mat2gray(lenablur1); imwrite(lenablurgray1, 'lenablur.bmp'); imwrite(PSFgauss1, 'PSFgauss.bmp');

I then applied a few mathematical operations:

ratioA = imfilter(lenablurgray1, PSFgauss2, PSF, 'replicate'); ratioB = lenablurgray1./ratioA; ratio = imfilter(ratioB, PSFgauss2, 'same'); disp(ratio(91:93, 71:75)) 1.0641 1.0808 1.0935 1.1027 1.1091 1.0961 1.1128 1.1254 1.1343 1.1403 1.1206 1.1371 1.1493 1.1577 1.1631

I then tried to apply the same mathematical operations in OpenCV. I checked the results for ratioA, and ratioB, and noticed they were the same or very close to the variables with the same names in Matlab. However, the result differs for ratio:

Mat img = imread("lenablur.bmp"); cvtColor(img, img, cv::COLOR_BGR2GRAY); img.convertTo(img, CV_64F); cv::Scalar s=255; divide(img, s, img); cv::Mat kernel = imread("PSFgauss.bmp"); cvtColor(kernel, kernel, cv::COLOR_BGR2GRAY); kernel.convertTo(kernel, CV_64F); cv::Scalar kernelsum = cv::sum(kernel); divide(kernel, kernelsum, kernel); Mat ratio; Mat ratioA; Mat ratioB; filter2D(deconv, ratioA, deconv.depth(), psf, Point(-1, -1), 0, BORDER_REFLECT); divide(observed, ratioA, ratioB); filter2D(ratioB, ratio, ratio.depth(), psf, Point(-1, -1), 0, BORDER_REFLECT); for (int r = 90; r < 93; r++) { for (int c = 70; c < 75; c++) { cout << ratio.at<double>(r, c) << " "; } cout << endl; }

the result for ratio is:

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

I suspect the values for ratio in OpenCV could also match the values for ratio in Matlab, but were rounded down somehow to int values instead of remaining double. Why did this happen, especially since the values for ratioA and ratioB were not rounded down in OpenCV?

submitted by /u/74throwaway
[link] [comments]