What have you been working on recently? [October 05, 2019] learn programming |
- What have you been working on recently? [October 05, 2019]
- How do you learn what "good" code is?
- Useful Bookmarks
- I am new to programming and would very much appreciate it if someone could point me in the direction of some helpful resources for a small project I'm working on
- How can I automate changes in my MySQL database?
- Unable to compile on Mac using gcc/g++
- Learning javascript
- python help
- What should I know before going to a cyber security hackathon?
- How not to comment (and how to).
- How can I fix this? It is giving me a probability of 0.0 for every number!
- [JAVA / Spring] Beyond basic CRUD apps.
- Is it possible to write your own 2FA app?
- What can I do more than just follow online courses?
- Finding the seed root of a number
- Help with C# UNITY movement coding
- Severity Code Description Project File Line Suppression State Error LNK2019 unresolved external symbol _main referenced in function "int __cdecl invoke_main(void)" (?invoke_main@@YAHXZ) 1
- Is it possible to run a python script in html code?
- How can my website edit a Google Sheet when a user votes on a poll on my website?
- Grade converter wont log Bs or Cs
- Program Design Class Help
- [Laravel] Homestead installed but not recognized as command
- When asked to write a program that involves "n" number of things, does that mean we are supposed to get that number from the user?
- What was so hard about learning "programming"??
- getting an unexpected token error in the console
What have you been working on recently? [October 05, 2019] Posted: 05 Oct 2019 09:04 AM PDT What have you been working on recently? Feel free to share updates on projects you're working on, brag about any major milestones you've hit, grouse about a challenge you've ran into recently... Any sort of "progress report" is fair game! A few requests:
This thread will remained stickied over the weekend. Link to past threads here. [link] [comments] |
How do you learn what "good" code is? Posted: 05 Oct 2019 11:49 AM PDT Code can run and still look like trash, be overly complicated (this is the hardest one for me: how do I make this working program simpler?), hard to read, etc. How does someone who's learning to program learn to write good code instead of just "making it do what it's supposed to"? [link] [comments] |
Posted: 05 Oct 2019 07:52 PM PDT Hi Everyone, Today I created a list of my browser bookmarks. I bookmarked these links when I was learning programming or when I discovered something new. I thought It would be helpful to share it with you guys so you can find it helpful too Furthermore there's a lot of work to be done since it's a simple markdown file but I will be working on hosting it as a static site so I can implement search that will make easier to search through bookmarks. What are you thoughts on this ?? useful-bookmarks[link] [comments] |
Posted: 05 Oct 2019 07:25 PM PDT I am familiar with web development, but I would like to try my hand at creating a very simple application for windows 10 and I just have no clue where to start. So any advice or links to tutorials or anything helpful would be much appreciated [link] [comments] |
How can I automate changes in my MySQL database? Posted: 05 Oct 2019 09:36 PM PDT So here is what I am trying to figure out. I have a database where I store memberships to a club. On January first of every year I need to update the status of these members based on whether or not they have paid a membership fee. Then on February First I need to change their state again, if they still have not payed the fee to reflect that they are no longer members. As it stands right now, I would be relying on someone to log into my online database, and check on the members page for anything to interact with the database. Is there a way I can trigger an event through MySQL to automatically change the state of these member fields at Midnight on January 1st, because if no one, hypothetically, were to log in during the entire month of January and check this page, it would effectively break the database because then no fields would ever be changed. TL;DR: How can I get my database to make changes to itself at a certain date or time without having to rely on people logging in and interacting with the database through PHP? [link] [comments] |
Unable to compile on Mac using gcc/g++ Posted: 06 Oct 2019 12:02 AM PDT I am using the command "g++ -std=c++11 -o file file.ext" to compile some c++ text that references a header file in my working directory. I get a lot of errors when trying to do this, but not when writing other simple c++ code that does not reference the file. When I am working over an ssh connection to my school's server (running linux) I have no issues compiling my code using the same command in the terminal. Its not ideal for me to be working on everything over the ssh connection, I don't even have internet at home. So I need to find a way to be able to compile code on my own machine that has these issues with different versions of c++ in it (i assume is what is happening). Hopefully Ive given enough information so far, but if anyone has any advice I would really appreciate it. I need to finish my homework! thanks [link] [comments] |
Posted: 05 Oct 2019 11:55 PM PDT What are some good youtubers that code in javascript? [link] [comments] |
Posted: 05 Oct 2019 11:41 PM PDT hi i was wondering with this -os.system("start cmd /D /C python3 file.py")- is there anyway to start it in a minimized form? [link] [comments] |
What should I know before going to a cyber security hackathon? Posted: 05 Oct 2019 11:39 PM PDT I've registered for a cyber security hackathon, mostly on a whim. I dont have any formal knowledge in the field so I was wondering - what should I definitely know/learn before taking part in such an event? [link] [comments] |
How not to comment (and how to). Posted: 05 Oct 2019 11:37 PM PDT I came across a comment today in a large pile of ugly (very ugly) legacy code I've been unlucky enough to inherit and it annoyed the hell out of me. I then came online hoping to find a place to share it so as to purge said annoyance (I searched for "Stupid code comment of the day", among other things). I couldn't find a dedicated place, but I did find this learning to program Reddit, so I thought I'd leave it here with a little "moral to the story" so those learning to program can, well, learn something that will help them not get a change request in the ol' code review. That there is the comment. I don't know if they were written by two people (bad) or the same person (even worse), but the lesson here is: do not be afraid to delete a comment. Once someone came along and added UDP support, the first line should have been deleted. But someone thought it needed to be preserved for posterity instead (this code has always been under a VCS, but maybe the author of the second comment thinks that is best done with comments; speaking of VCS, I could go back and find who put that second comment there, but I'm afraid it will be someone I still work with so I really don't want to know). Now, comments are important. There are other things that are more important, but as long as you're not writing things like "// Add 1 to i." right above "i += 1;", then they're important (and unless you're in a tight loop with an index named i, don't give a variable a meaningless name like 'i').
Good comments, like good code, take practice. I'm still adjusting what and how and where I write comments after 15+ years of programming professionally. The key is to always take a minute to evaluate what you're doing to see if you can do better - and don't be afraid to change. And one final note: while all seasoned programmers will agree with some of what I said above, I guarantee that some won't agree with all of it, which shows that, like many, if not most, things in programming, there aren't always hard and fast rules. Keep an open mind and experiment! /rant off; thanks for listening. [link] [comments] |
How can I fix this? It is giving me a probability of 0.0 for every number! Posted: 05 Oct 2019 11:27 PM PDT I'm making a program that will muffin' take the dang for to be playing n number of songs on your SHUFFLE MODE (of zune or iPods, etcetera) input from our user. I am making a program to determine the probability of hearing 3 sequential songs. here is the exact problem (dot)... You set your music player to shuffle mode. It plays each of the n songs before repeating any. Write a program to estimate the likelihood that you will not hear any sequential pair of songs (that is, song 3 does not follow song 2, song 10 does not follow song 9, and so on). every number I put in gives a 0.0 probability [link] [comments] |
[JAVA / Spring] Beyond basic CRUD apps. Posted: 05 Oct 2019 10:36 PM PDT Most of the stuff I find online are just simple management systems. Library Management, Movie Ticketing, Student Managment, etc etc. I'm so tired of them and have lost any feeling of progression. Can somebody please point to any resource that contains case studies of complex systems with a little explanation and code. I feel like my progress has halted and can't seem to know how to level up from here. [link] [comments] |
Is it possible to write your own 2FA app? Posted: 05 Oct 2019 07:41 AM PDT I wanted to do this as a final year project and implement new technologies on top of 2fa to make it more secure [link] [comments] |
What can I do more than just follow online courses? Posted: 05 Oct 2019 06:30 PM PDT Currently learning C# and Unity for the past 5-6 months. Online courses are great but I feel like I could be doing more. I try to make some side projects but I always quickly end up stuck on something, cave in, google the solution & follow a tutorial, which is basically the same as following an online course. Is there more I can do? Read a book during my commute to work maybe? Is that even useful? Listen to podcasts at work? Is that a even a thing? Or just keep going with online courses, one after the other until I'm good enough to be employable? Thanks, [link] [comments] |
Finding the seed root of a number Posted: 05 Oct 2019 10:14 PM PDT I am pretty new to coding and I have only been using c++ for about 2 months. I am having problems understanding an assignment of mine and I was hoping to get some clarification if possible. The instructions to my assignment are: Write a program in a file named SeedFinder.cpp that finds and displays all the seeds of a integer given by the user. Let's define a seed of an integer, n, to be a value that equals n when multiplied by its individual digits. For example, 23 is a seed of 138 because 23 × 2 × 3 = 138. 111 is an example of a seed of itself because 111 × 1 × 1 × 1 = 111. Many numbers have no seeds (e.g., 2) and some numbers have multiple seeds (e.g., 24 and 32 are seeds of 192). Implement the following functions as parts of your overall solutions:
I don't really understand step 2 and 3. In step 2 how do I determine the divisor? what is this second parameter "possible check to check" and how do i use it to determine the seed. We just started working with functions and this has been a little overwhelming. Any help would be greatly appreciated. [link] [comments] |
Help with C# UNITY movement coding Posted: 05 Oct 2019 10:08 PM PDT Hello guys, First of all, i would like to introduce me and my friend, who are NEWin programming a game. What game are we working on? We are working in a 2D PVP UNIQUE playability but that goal is really far since we are stuck in the basics Our problem? The reason of our shout of help? Movement. We want a 4 Direction, grid based movement yet what we have achieved is a not so smooth movement( if you press two arrow keys at the same time the character doesnt respond) but still, grid based. The main problem is that if you intercact with an object (fountain, enemies) the character gets stuck and tilting and uhg, you gotta restar the whole thing. Down below i'll copy you our code and would really appreciate some help, and improvements to make it 4 directions grid based and your computer not exploding. To top it off, we created an enemy ai to test our results but when they collide, they kinda "push" each other, sigh Thanks in advance from G&G Movement code: using System.Collections; using System.Collections.Generic; using UnityEngine; public class PlayerController2 : MonoBehaviour { public Rigidbody2D rb; private Animator animator; public int speed = 5; private DIRECTION dir = DIRECTION.DOWN; private bool attacking; private bool canAttack; private float timerAttack; private float delayAttack; void Start() { rb = this.GetComponent<Rigidbody2D>(); animator = GetComponent<Animator>(); attacking = false; canAttack = true; timerAttack = 0.0f; delayAttack = 0.25f; } void Update() { move(); //ATAQUE if (Input.GetKey("q")) { attacking = true; } else { attacking = false; } timerAttack += Time.deltaTime; canAttack = timerAttack > delayAttack; if (attacking && canAttack) { timerAttack = 0f; animator.SetBool("Attacking", true); if (dir == DIRECTION.UP) { animator.SetFloat("MoveX", 0); animator.SetFloat("MoveY", 1); } else if (dir == DIRECTION.DOWN) { animator.SetFloat("MoveX", 0); animator.SetFloat("MoveY", -1); } else if(dir == DIRECTION.LEFT) { animator.SetFloat("MoveX", -1); animator.SetFloat("MoveY", 0); } else if (dir == DIRECTION.RIGHT) { animator.SetFloat("MoveX", 1); animator.SetFloat("MoveY", 0); } } else { animator.SetBool("Attacking", false); } } private void move() { if (Input.GetKey(KeyCode.UpArrow)) { if (dir != DIRECTION.UP) { dir = DIRECTION.UP; } else { animator.SetFloat("MoveX", 0); animator.SetFloat("MoveY", 1); animator.SetBool("Moving", true); } } else if (Input.GetKey(KeyCode.DownArrow)) { if (dir != DIRECTION.DOWN) { dir = DIRECTION.DOWN; } else { animator.SetFloat("MoveX", 0); animator.SetFloat("MoveY", -1); animator.SetBool("Moving", true); } } else if (Input.GetKey(KeyCode.LeftArrow)) { if (dir != DIRECTION.LEFT) { dir = DIRECTION.LEFT; } else { animator.SetFloat("MoveX", -1); animator.SetFloat("MoveY", 0); animator.SetBool("Moving", true); } } else if (Input.GetKey(KeyCode.RightArrow)) { if (dir != DIRECTION.RIGHT) { dir = DIRECTION.RIGHT; } else { animator.SetFloat("MoveX", 1); animator.SetFloat("MoveY", 0); animator.SetBool("Moving", true); } } else { animator.SetBool("Moving", false); } } } [link] [comments] |
Posted: 05 Oct 2019 10:05 PM PDT my code:
I keep getting this damn error whenever I create a new Visual Studio project, does anyone know what it means? [link] [comments] |
Is it possible to run a python script in html code? Posted: 05 Oct 2019 09:57 PM PDT |
How can my website edit a Google Sheet when a user votes on a poll on my website? Posted: 05 Oct 2019 09:33 PM PDT I want to treat this google sheet as a backend for my website, but how can I edit the sheet in my frontend html code? Do I use POST or PUT? [link] [comments] |
Grade converter wont log Bs or Cs Posted: 05 Oct 2019 09:29 PM PDT
i cant get the converter to spit out a b or c.. [link] [comments] |
Posted: 05 Oct 2019 09:19 PM PDT For my program design class i have to make a function that uses pointers to encrypt a number in C. The function takes in two arrays as pointers and the size of the arrays as an int. Each array has each digit of the number as an element. it encrypts the number by taking each digit them from an array A adding six to each one then doing modulus by 10 and storing the new number in array B. it then would swap the first and the last digit. this is my code so far: void encrypt(int *a, int *b, int n) { int *i, *j; int k = 0; int temp; for(i = a; i < a + n; i++) { j = b + k; *j = (*i + 6) % 10; k++; } i = b; j = b + n; temp = *i; *i = *j; *j = temp; } it works fine up until the point at the end where it has to swap the numbers, im not sure whats going on here, any help is appreciated. [link] [comments] |
[Laravel] Homestead installed but not recognized as command Posted: 05 Oct 2019 12:26 PM PDT Hello A friend of mine suggested I started learning Laravel. In order to do that, I'm trying to follow this tutorial series: https://laracasts.com/series/laravel-5-fundamentals/episodes/2 The problem is that, before actually going into Laravel proper, it seems necessary to install a few other programs, including the last one, Homestead, which was properly installed (or at least appeared to be so, based on the texto from the command window). Unfortunately, when I try to use it it isn't recognized as an internal or external command. Googling the problem encounters suggestions of "setting the PATH", which I have no clue what it means. I have already tried rebooting my PC, to no avail. Any help with configuring homestead would be appreciated. Failing that, if you could point me to a tutorial that doesn't require as many other programs to be installed in order to go through with them, it'd also be most appreciated. Thank you very much for taking your time to read this :) [link] [comments] |
Posted: 05 Oct 2019 03:08 PM PDT Like for this problem- Rumors. Alice is throwing a party with n other guests, including Bob. Bob starts a rumor about Alice by telling it to one of the other guests. A person hearing this rumor for the first time will immediately tell it to one other guest, chosen uniformly at random from all the people at the party except Alice and the person from whom they heard it. If a person (including Bob) hears the rumor for a second time, he or she will not propagate it further. Write a program to estimate the probability that everyone at the party (except Alice) will hear the rumor before it stops propagating. Also calculate an estimate of the expected number of people to hear the rumor. It doesn't tell us how many people are there, nor does it tell us how long the party is or how long it takes to spread the rumor from one person to the next. So does it want us to get these numbers from the user? Is this what is meant by 'n'? [link] [comments] |
What was so hard about learning "programming"?? Posted: 05 Oct 2019 08:56 PM PDT Hello to anyone who is learning programming. I have a question about learning the subject. Since this is a reddit for people who are working hard in learning, I thought it would be great to ask this. Regardless of the language or concept, what was so hard about learning it? How did you overcome the obstacles in learning them? Waiting for great comments :) [link] [comments] |
getting an unexpected token error in the console Posted: 05 Oct 2019 08:42 PM PDT let convertToLetterGrade = function(score) { } } } } } convertToLetterGrade=(78) the error appears on line 2 but i dont have anything on that line [link] [comments] |
You are subscribed to email updates from learn programming. To stop receiving these emails, you may unsubscribe now. | Email delivery powered by Google |
Google, 1600 Amphitheatre Parkway, Mountain View, CA 94043, United States |
No comments:
Post a Comment