Learn Programming

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

Chess Game & AI Development Tutorial on Eclipse RCP (Video Series)

32 min 51 sec ago

I’ve put together a YouTube video series on developing an Eclipse RCP applicaiton in Java to build a chess game with a cool AI algorithm called alpha-beta pruning.

https://utkuufuk.github.io/2018/06/17/alpha-beta-chess/

submitted by /u/lord-bazooka
[link] [comments]

Help getting my app to run on IIS

34 min 40 sec ago

Hello guys.

So some small backstory.

I've basically got no background of programming, but i'm a fairly decent scripter (Powershell). What I know I've learned myself through experimenting and googling which means I've probably missed a ton of basics and need to know things.

What I'm doing: A basic C# web application that executes a Powershell script that creates a certificate request based on the information you enter.

My problem: I get it to execute from Visual Studio, but I can't get it to work on the IIS. I get generic security errors that tells me nothing. I've tried some basic things like delegating permissions to the app pool, setting my admin account as the application pool, impersonation etc.

I'm not sure exactly what permissions are needed to create a CSR, but I believe it might be quite high (possibly administrator)

I suspect this is really easy to figure out for someone who knows how to deploy and configure an application in IIS

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

Eloquent Javascript - Chapter 7 Robot Example in Typescript

1 hour 22 min ago

I re-wrote the Chapter 7 Robot example in TypeScript with comments and explanation to aid understanding.

https://pastebin.com/RrWwUmVr

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

Cannot get something to print in Ruby.

1 hour 22 min ago

Hello I have some code that i will post in the comments. I am just learning to code and have been having fun with it and am using Learn Ruby the Hard Way as my primary resource. I seem to have found that for whatever reason the last input line of this will not print but will still accept input?

Can anyone tell my why this is? Thanks in advance.

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

What is everybody's opinion on freeCodeCamp ?

2 hours 11 min ago

As most of you know, freeCodeCamp is a free website in where you learn html/css/javaScript mostly. I have been using it for a few years now on and off (when school is not busy) and I think it is ok. I am a compE student and we don't ever touch javaScript in any of my classes I don't think (I think it is an elective) and surprising a lot of compE jobs want applicants to know one scripting language.

I think the problem with the website is something they can't help themselves with. I really think javaScript is a horrible first language to learn (I would love to hear your argument if you disagree) because of the way functions and data types are written. My first programming (or scripting) language I attempted to learn was JS on freeCodeCamp. I then went to take my first really programming class (C) the following semester and nothing was making sense. I picked up so many bad habits while learning JS like not declaring data types in function parameters and such that I was really struggling with my C class. So essentially I tried to forget JS and tried to re-learn programming the "proper" way. After I took and passed that C class, things were making a lot more sense. When I first started learning on freeCodeCamp, I felt that they rushed everything and even the syntax wasn't sticking.

I also think the site gives people this optimism of "oh, I don't have to go to school or a bootcamp, if I just pass all these challenges cough cough copy/paste then I can get a real web development job. I get this vibe from reading the freeCodeCamp subreddit.

However, I do think the website is good because it is convenient and somewhat helpful. When I am bored I attempt a challenge and lately I have been drilling myself on the website.

So I am curious, what is your opinion of the website? If not, what do you recommend instead?

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

What about source control?

2 hours 28 min ago

I am kinda new to open source projects and git and currently I am working on a project of mine to be open source: https://github.com/DapfiDuck/SafeCom

I want people to be able to work with me on this project but still keep authority on what changes get copied into the project and which wont.

Any tipps on the structure? How should I organise my git repository?

Thanks for the help :)

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

Help learning to code to automate research work

2 hours 29 min ago

Hello. I’ve coded simple basic tutorials in some languages before but never really developed a full project. Im trying to learn more to help automize a monotonous part of my work. Essentially, I work with images which contain lots of broken up plant parts that need photoshopped back together like a puzzle piece. This work realisitically is rather simplistic in nature as most reassembly is fairly obvious and just simple Rotation and drag+drop. So my questions mainly are) what language would be best for this? Where could I learn more about coding some thing like that? What are some good available resources in learning to create something like this?

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

Motivation (and desperation) in learning to code

2 hours 35 min ago

I have struggled immensely throughout my learning journey. My first attempts at coding began with Usborne BASIC language books written for kids to code small games on the plethora of home computers back in the 1980s. I didn’t understand the concepts but I did love seeing how what I typed from a book translated into something I could play with.

In the 90s I was introduced to Pascal in high school, and again programming theory didn’t really make any sense - my drive was manipulating the computer to do certain things. I would try and try again to ‘get’ coding, and made a biggest effort in 2000 when starting an IT degree, but this lasted only a year. Across a large span of time I bought and borrowed numerous books on languages such as C and C++, tried online courses, began and quit more formal studies. And the same pattern emerged - I would start well and with great enthusiasm - and then hit some obstacle, become overwhelmed, and feel unable to continue.

A couple years back I found Free Code Camp and started the local chapter on Facebook for Meetups, and this again only lasted for a brief period. I moved on to try Treehouse and found The Odin Project last year, and even spent a good chunk of money on Launch School, an online curriculum which is very similar to TOP in the depth of content (but obviously they can afford to have paid staff to assist). I gave up on coding in the end as I figured I just wasn’t interested enough to maintain momentum.

Later last year I began to have physical and mental health issues that caused my work in I.T. technical support to be unbearable. I’ve worked in this arena for close on 20 years, and in the past decade have had these periods where I sink low into fatigue and despair, feeling too unwell to face the day’s duties. It seems that internal and external stressors become intolerable after a certain period of time.

Last week I was diagnosed with post-traumatic stress disorder (PTSD) as a result of early childhood trauma. I thought that was a diagnosis only given to war veterans or those who suffered from a severe accident, but apparently it encompasses a wide variety of experiences. And it’s at the root of these experiences of failure and disappointment that have repeated time and time again.

I decided to return this year to attempt to learn to code as I knew I couldn’t return to tech support. I began with a local college but found that again my intolerance to the stress from the workload led to me withdrawing. In one of our assignments there we were utilising Github and I found my repos while working on The Odin Project. I jumped back to the website and loved the new design and began working through it again.

What has grabbed me the most is the section “Gearing Up”. There is so much useful information in there that has become almost a daily reference for me. I am working through Learning How to Learn, the most popular MOOC in the world, to work out the best strategies to tackle learning with my challenges. Some of the best ideas from the MOOC are in that section. And I’ve noticed that there is a lot in the curriculum of TOP that come from the MOOC, such as the questions at the start of each section. It’s largely this that has kept me coming back (however slowly right now).

As I work through treatment of my concerns, I find doing just a little bit from Web Development 101 or a MOOC is really beneficial. I have typically kept myself isolated, but I can see the value in sharing in a community of developers.

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

[C++] is static memory always created at compile time and why dynamically allocate single instance variables?

2 hours 54 min ago

I have three questions regarding dynamic memory allocation that I need help on, can someone help me out? thank you.

  1. I hear dynamic memory is created at run time and static memory is created at compile time. if so, what if I take user input for the length of the statically allocated array? then doesn't that mean it's created at run time? can someone explain this to me?
  2. I hear that to prevent memory leaks, its not good to reallocate memory in a dynamically allocated array without first deallocating it but wouldn't deallocating it wipe the memory? what if I want to increase the size of the array but keep the values, how would I do that?
  3. If dynamic memory allocation is often used when the programmer is unsure about how much memory to allocate, then why do people dynamically allocate single instance variables like int or char? doesn't the memory used for single instance variables remain constant? dynamically allocating an int won't exactly let people store larger numbers anyways so shouldn't dynamic memory allocation be meant for arrays?
submitted by /u/dizzyflames
[link] [comments]

Can someone explain why Web Development skills such as HTML, CSS or Javascript will still be needed when there are tools such as Wordpress that exist?

3 hours 8 min ago

Wouldn't people just use these different tools/software to create and design websites? Thanks for the info in advanced.

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

How to find if there are at least k items less than x in a min heap, in O(k) time?

3 hours 19 min ago

The part that's troubling me with this is the O(k) constraint. How could this possibly be done in O(k) time?

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

ML help needed: Analyzing reviews based on multiple factos

3 hours 21 min ago

Hi, I am a beginner to ML with intermediate Python skills and have recently begun exploring NLP. Now, I have followed some tutorials online and seen how to go about basic sentiment analysis(classifying reviews/sentences as positive or negative). What I want to do is take something like restaurant reviews and classify EACH review based on a number of factors like ambience, food quality, value for money i.e. for each review, each of these factors should have a positive or negative value. Could someone suggest me a general approach for this problem?

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

What language should I learn for my next project?

3 hours 32 min ago

I am mostly a PHP type and I enjoy trying to learn and better myself at PHP, however PHP will not help me with my next project.

At work I process a monthly schedule, I won't get too into that but basically it is a painful manual process. The software use is very old and we use an old Pervasive SQL 2000 database.

I'd like to make an application that will automate the process. Basically I get a few files and I have to check over some flight numbers to make sure they are in an acceptable range. Then I have to replace an aircraft code with a different one so that our systems do not get confused. Lastly I have to reformat the file and save it with a different extension (it is just removing some useless information in the file - we have a tool for this part but I'd like an all in one tool. This will be the last thing I do in this tool).

So, what language would be best to learn for this? I imagine what I want to do might be complicated for a first project, but that is fine, all part of the learning process. I have considered Python (have dabbled in it a little), Java, and C++ but I am not sure what is best for this. Python is attractive because I can also dive into Django/Flask for my web stuff. Java is nice because it seems powerful and it can run on any OS. C++ seems to be a go to for windows applications and Microsoft has a lot of free resources for it. I do plan to create a few tools after this for editing and making changes within our data base (they are .dat datatables), so that is something for me to consider.

Thanks!

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

I´m making a basic frogger in visual 2015

3 hours 37 min ago

The final project of my programming course is to make a game like frogger and I already have almost everything but the only thing that until now I do not know how to make is the characters of cars move by themselves

Someone could help me please this is the first time I have a programming course and only know the basics

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

Is there another good site like CodinGame.com where you compete LIVE with other people?

Tue, 06/19/2018 - 23:27

I love CodinGame.com but it has an issue; the "Shortest" mode encourages using basically either Python or Ruby, and it happens more often than not 1/3 of the time since the gamemodes [3 of them] are random.

I'm sick of having to basically only use Python when I want to use a language I enjoy more in a competition environment like this, it's really fun getting a complicated algorithm solved the fastest and having it run well in the "Reverse" or "Fastest" modes.

On the forum of CodinGame.com; people have asked for optional Shortest mode, because of this, but it seems the general answer is LEARN PYTHON!!!!!!!!!!, which really shouldnt be the answer, especially when most people know such a simple language pretty well but just don't wanna use it sometimes.

My question is, is there another site where you compete live against other people in programming challenges? I'd prefer having it live, I already know about a bunch of sites that host problems and answers for you to solve on your own.

Thanks!

submitted by /u/0ldur
[link] [comments]

Please!!!! i need advice on python for this "simple" code (i just started learning so i guess its easy for you guys)

Tue, 06/19/2018 - 23:06

Its on python, and im rather new at it, i just know the very, very basics (functions, use of for, range, lists, if, else, dictionaries, etc) and this is what i need to do:

I need to simulate a micro electoral process, so i need:

  • Register candidates to the city hall (name, political afiliation and city he wants to be mayor of)
  • Generate three or four booths where they are going to vote (4 or so per city, like 5 cities max) (also the number of citizens per booth)
  • Generate random citizens (random age)
  • Simulate the line of a booth (so how long takes someone to vote)
  • show the voting booths on screen (this is what is screwing me the most)
  • generate random citizens with special needs (eldery, pregnant) and a special treatment to those
  • each citizen votes randomly
  • close the voting booths after a determined period of time

I know this is too much to ask for, but please, im really in a need. I could use some help, it doesnt matter if you can only help me with one little thing, it still counts :(

ll try to be a little more deeper:

i dont know how to generate random citizens. i literally dont have any idea besides just creating them myself

i tried to open a function called booth or stall that reads the citizen and assigns a random vote. but i dont know how to make it just one vote and then leave.

i dont know anything else.besides the candidate parts (which i still cant get right, because i just asiggn a name to a variable, i still cant get how to assign them a political party and a city )

please be mercyful :( i am really in the dark here.

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

Is Coding Bootcamp Worth It?

Tue, 06/19/2018 - 21:49

Hi. I'm a beginner at coding. I have very little experience working with Java from about two years ago, but it's been two years since I've touched it, so I barely remember anything. In other words, I'm as much a beginner as beginners get.

I've been a bit curious about coding recently, though. Web design in particular. I've been Googling around and ended up stumbling upon the concept of coding bootcamps, which, if I'm correct, are 12-week-long super-arduous classes meant to help people learn coding in a short time.

That said, yes, I do want to find a job eventually as a web designer. It just looks so cool and fun. But they cost a lot of money, so that begs the question... are they worth it? Do they really help in finding jobs in the market, or should I just try to learn coding myself and then find a job that way?

Some tips would be greatly appreciated! Thanks :)

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

My program is giving me a illegal start of expression error and while expected error: Where should I go for help outside of reddit?

Tue, 06/19/2018 - 21:38

Here's my code, idk why I'm getting this error, can someone explain it to me please?

import java.util.Scanner; public class VendingMachine{ public static void main(String[] args){ Scanner keyboard=new Scanner(System.in); double chips = 1.25; double soda = 1.00; double skittles = .99; double gum = .75; double water = 3.00; System.out.println("What do you want to buy?"); do{ System.out.println("0. Exit"); stop = opt; if (stop == 0) { break; } int p = keyboard.nextInt(); System.out.println("How much do you want to spend?"); double pay = keyboard.nextInt(); if (p == 1){ if (pay >= chips){ System.out.println("Here's your chips " + p + ", your change is $" + (pay-chips)); } if (pay < chips){ System.out.println("Please insert another " + "$" + (chips-pay)); } } else if (p == 2){ if (pay >= soda){ System.out.println("Here's your soda " + p + ", your change is $" + (pay-soda)); } if (pay < soda){ System.out.println("Please insert " + "$" + (soda-pay)); } } else if (p == 3){ if (pay >= skittles){ System.out.println("Here's your skittles " + p + ", your change is $" + (pay-skittles)); } if (pay < skittles){ System.out.println("Please insert " + "$" + (skittles-pay)); } } else if (p == 4){ if (pay >= gum){ System.out.println("Here's your gum " + p + ", your change is $" + (pay-gum)); } if (pay < gum){ System.out.println("Please insert " + "$" + (gum-pay)); } } else if (p == 5){ if (pay >= water){ System.out.println("Here's your soda " + p + ", your change is $" + (pay-water)); } if (pay < water){ System.out.println("Please insert " + "$" + (water-pay)); } } } } } submitted by /u/saidthaprince
[link] [comments]

I am 15 years old confused python developer help me pls

Tue, 06/19/2018 - 21:29

Hello guys I am 15 and I am writing python for 1 years I know classes,generator,decorators,advanced level methods for strings and for lists and I know os sys request beautifulsoup pillow,datetime,smtp modules and sqlite as database. So are there any projects that I can do something for it on github or am I really noob? I want to develop something which is open source.And I am really confused pls help me and (I am open for advices)

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

Pages