• Breaking News

    Sunday, August 4, 2019

    What have you been working on recently? [August 03, 2019] learn programming

    What have you been working on recently? [August 03, 2019] learn programming


    What have you been working on recently? [August 03, 2019]

    Posted: 03 Aug 2019 09:10 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:

    1. If possible, include a link to your source code when sharing a project update. That way, others can learn from your work!

    2. If you've shared something, try commenting on at least one other update -- ask a question, give feedback, compliment something cool... We encourage discussion!

    3. If you don't consider yourself to be a beginner, include about how many years of experience you have.

    This thread will remained stickied over the weekend. Link to past threads here.

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

    Useful Big-O Notation Cheatsheet

    Posted: 03 Aug 2019 06:58 AM PDT

    Big-O complexities of common algorithms used in Computer Science

    bigocheatsheet.com

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

    Am I too stupid for programming?

    Posted: 03 Aug 2019 07:37 AM PDT

    I don't have any life opportunities. I always liked computers, adding modes to games, creating servers, etc. So I decided to learn to code to have some life skills before I finish school.

    I started by learning C++ and it was, well, fun. I liked that and I often found myself thinking about the code, even in my free time. I was thinking that maybe I finally found something in life that I like.

    I was striving to create a project instead of working with a code in a "playground". I wanted to try and write a game in a Unity. I was following a tutorial on YouTube and wow, it was so difficult. I had no idea where names of functions came from, I was ordered to use scripts I had no idea what they do. Just one huge overwhelming experience.

    Then I tough - OK, maybe I should start by something more in my range, and I decided to learn how to write an app. Someone told me about this course: https://developer.apple.com/library/archive/referencelibrary/GettingStarted/DevelopiOSAppsSwift and I started following it. It is just, very difficult for me. Again, I use functions I have no clue about (how they work, or when to exactly implement them). I'm just lost and shortly tutorial felt for me like copy-paste, rather than learning something.

    I suffer depression, and I often feel overwhelmed and demotivated, so I'm trying to find out is programming too difficult for me, or I just made some mistake. Maybe I jumped from learning basic stuff like syntax to programing software too fast? What would you recommend to a beginner that just feels lost?

    Sorry if this post is not strictly about programming problems and stuff, but I need help and this sub seemed the most appropriate for me.

    Edit: Thank you all for your comments. I realized that there is an amazing community in programming, and probably I will be able to ask for help when I need it. I'm truly thankful for your effort :)

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

    How do I motivate myself?

    Posted: 03 Aug 2019 08:55 PM PDT

    I'm a novice programmer, and I find programming to be very fun. Being a beginner, I get very excited when I've successfully run a program without errors and when it goes the way I want it to. I enjoy programming very much and I have become very passionate about it and eager to learn more than just one language. I've recently started learning Python (about a month ago) and I started by learning the basics before I do my own projects. I started out learning little by little and I was excited to get into it; I would even stop every now and then to do small projects using what I'd learned so far. But lately I've been forgetting things within a few minutes after learning them, and I've been procrastinating a lot. I realize that this is because I've become lazy and tired, and just not wanting to do more learning. Any tips about motivating myself and having the mindset to continue learning?

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

    Ok bit random question but...Why do the vast majority of computer books, but ESP programing books always have really random cover pictures? Like fruit, or a fish or a train or somthing....

    Posted: 03 Aug 2019 10:36 PM PDT

    Iv noticed it a while ago and its been bugging me lol. Like my c++ book has a giant half a orange on it, another book i was looking at has a salmon on the cover................

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

    Good Code? Bad Code? Or whatever makes it work?

    Posted: 03 Aug 2019 09:48 PM PDT

    I posted a project on here about a week ago and decided to continue working on it. I've gotten pretty far but I was just curious how do you know if you are writing good code? I'm currently working on an ability/spell list system for my game, where players will unlock skills when they achieve a certain level and the way I have the skills created is an object for each spell with all the info in the object. So as of right now I have a file called abilities.js with 24 objects in it for each ability. Is it any different if I wrote an ability class and then did

    let fireBall = new Ability(name, damage, cost, levelRequired, statusEffect);

    and then I would just do that for all 24 abilities? Which way is better, they essentially cover the same info. The objects list is just me writing way more code?

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

    Is it fine to learn C# from 3-4 years old book?

    Posted: 03 Aug 2019 11:49 PM PDT

    I would like to finally learn C# and to do so I would like to buy a book but there are not many good options in my country. I found one that looks nice and has good reviews but the book was published in 2016 and I am not sure how much are 3-4 years in terms of C# development. Is there a risk of learning some obsolete / incorrect informations or is it safe to buy?

    Would send link but the store and book are not in English

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

    What kind of rest api can I make?

    Posted: 03 Aug 2019 08:30 PM PDT

    Sorry if the title is odd. I'm not sure how to phrase my question. I am learning spring boot right now and I want to focus on backend as I don't enjoy anything frontend. So I guess my question is how can I make a rest api? I mean, I know technically how, but what information could I even serve up? How would I even obtain that information?

    Sorry I am new and am having a little trouble wording my question right!

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

    Trying to make a title menu screen that takes me to various applications. for instance, I want to go to option 1 and be able to roll dice simulator. 3 days into python and im just taking codes to put together and learn from them.

    Posted: 03 Aug 2019 08:25 PM PDT

    import random from pip._vendor.distlib.compat import raw_input ## Text menu in Python def print_menu(): ## Your menu design here print(30 * "-", "MENU", 30 * "-") print("1. Roll Dice") print("2. Menu Option 2") print("3. Menu Option 3") print("4. Menu Option 4") print("5. Exit") print(67 * "-") loop = True while loop: ## While loop which will keep going until loop = False print_menu() ## Displays menu choice = input("Enter your choice [1-5]: ") if choice == 1: print("Menu 1 has been selected") roll_dice() elif choice == 2: print("Menu 2 has been selected") ## You can add your code or functions here elif choice == 3: print("Menu 3 has been selected") ## You can add your code or functions here elif choice == 4: print("Menu 4 has been selected") ## You can add your code or functions here elif choice == 5: print("Menu 5 has been selected") ## You can add your code or functions here loop = False # This will make the while loop to end as not value of loop is set to False else: # Any integer inputs other than values 1-5 we print an error message raw_input("Wrong option selection. Enter any key to try again..") def roll_dice(): print("Let's roll some dice!") min = 1 max = 6 roll_again = "yes" while roll_again == "yes" or roll_again == "y": print("Rolling the dices...") print("The values are....") print(random.randint(min, max)) print(random.randint(min, max)) roll_again = raw_input("Roll the dices again?") roll_dice() 
    submitted by /u/Kaleidoe
    [link] [comments]

    Feeling overwhelmed with how many resources there are out there?

    Posted: 03 Aug 2019 11:51 PM PDT

    Hello! I'm so sorry if someone posted this somewhere else but I'm on gap year and trying to do the free online courses before I switch my majors. However I am trying so many of them (free code academy, oden, coursera, Edx, code academy ...) that I always feel so overwhelmed and that I'm wasting time on the wrong resource. I just end up spending so much time researching and organizing the resources I want to use and end up not doing any studying at all! I was wondering if you guys felt that way too starting out and any tips to deal with it?

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

    I would like to start studying Machine Learning and Data Science

    Posted: 03 Aug 2019 05:52 AM PDT

    Hello, my name is Luis. After a long time researching the areas of programming, I decided I wanted to start studying Machine Learning and Data Science, but honestly, I have no idea where to start. I wish someone could send me handouts, books, or even courses so that I can have an introduction on the subject.

    Thanks

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

    Difficulty understanding Induction in Algorithm Design Manual.

    Posted: 03 Aug 2019 10:46 PM PDT

    Increment([ (2m + 1)/2] )=2 · Increment( [m + 1/2] ) = 2 · Increment(m) = 2(m + 1) = 2m +2= y + 1

    I don't understand how (m + 1/2) becomes (m)

    I've done discreet math but this chapter is quite hard to digest fully for some reason. Is this a scenario where everything is clarified in the rest of the book or do I need to understand this before I can handle the rest?

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

    Hello how Can i make config file

    Posted: 03 Aug 2019 10:37 PM PDT

    I have a java se application developed and I need to make a config file like in wordpress where I can paste the db name username and password, of course I know if i make a class in java that will also work but the thing is if i make a java class again i need to compile it so if i can make a config file enternally i can overcome that problem

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

    Translating a Maze Generator From Python to Java

    Posted: 03 Aug 2019 10:32 PM PDT

    Hi!

    I'm trying to translate a short maze generator from Python to Java.

    Here's the code in Python:

    from random import shuffle, randrange def maze_generator(w=16, h=8): vis = [[0] * w + [1] for _ in range(h)] + [[1] * (w + 1)] ver = [["| "] * w + ['|'] for _ in range(h)] + [[]] hor = [["+--"] * w + ['+'] for _ in range(h + 1)] def walk(x, y): vis[y][x] = 1 d = [(x - 1, y), (x, y + 1), (x + 1, y), (x, y - 1)] shuffle(d) for (xx, yy) in d: if vis[yy][xx]: continue if xx == x: hor[max(y, yy)][x] = "+ " if yy == y: ver[y][max(x, xx)] = " " walk(xx, yy) walk(randrange(w), randrange(h)) s = "" for (a, b) in zip(hor, ver): s += ''.join(a + ['\n'] + b + ['\n']) return s if __name__ == '__main__': print(maze_generator()) 

    Here's what I have so far:

    import java.util.*; public class MazeGenerator { public static final int HEIGHT = 8; public static final int WEIGHT = 16; public static void main (String[] args) { walk(WEIGHT + (int)(Math.random() * ((WEIGHT) + 1)), WEIGHT + (int)(Math.random() * ((WEIGHT) + 1))); } public static void walk(int x, int y) { int[] array1 = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}; int[] array2 = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; int[][] arrays1 = {array1, array1, array1, array1, array1, array1, array1, array1, array2}; String[] array3 = {"| ", "| ", "| ", "| ", "| ", "| ", "| ", "| ", "| ", "| ", "| ", "| ", "| ", "| ", "| ", "| ", "|"}; String[] array4 = {}; String[][] arrays2 = {array3, array3, array3, array3, array3, array3, array3, array3, array4}; String[] array5 = {"+--", "+--", "+--", "+--", "+--", "+--", "+--", "+--", "+--", "+--", "+--", "+--", "+--", "+--", "+--", "+--", "+"}; String[][] arrays3 = {array5, array5, array5, array5, array5, array5, array5, array5, array5}; arrays1[y][x] = 1; int[][] array6 = {{x - 1, y}, {x, y + 1}, {x + 1, y}, {x, y - 1}}; } } 

    I have no idea how to approach the second half of the program. Can anyone help me finish translating the code? Thanks!

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

    Take a live beach cam and show it on screen

    Posted: 03 Aug 2019 09:49 PM PDT

    So im building a weather station program and i want to take a live beach cam from here:

    https://www.coastalwatch.com/surf-cams-surf-reports/nsw/terrigal

    and display that live on screen using PyQt4

    is there anyway i can do this?

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

    C# - Critique please...

    Posted: 03 Aug 2019 05:46 PM PDT

    Hey there.

    So I'm BRAND NEW to programming... I literally started 2 weeks ago. I spent the first week piddling with C++ and Python but I'm QUICKLY falling in love with C#. So for the past week, I've been trying to learn. So I am working on understanding the logic behind for loops etc.

    I came across a challenge that was to get a string of characters from a user and then print out those characters in a pyramid. For characters 12345, the output should look like this..

    My solution works fine. I was wondering if some would take a moment to go over the code and see if there are opportunities to improve it.

    using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace LetterPyramid { class Program { static void Main(string[] args) { Console.Write("Enter a string of characters and I will build you a pyramid: "); string userInput = Console.ReadLine(); int characterCount = userInput.Length; int position = 0; foreach (char c in userInput) { int spaceCount = characterCount - position; while (spaceCount > 0) { Console.Write(" "); spaceCount--; } for (int i = 0; i < position; i++) { char current = userInput[i]; Console.Write(current); } Console.Write(c); for (int i = position - 1; i >= 0; --i) { char current = userInput[i]; Console.Write(current); } Console.WriteLine(); ++position; } Console.ReadLine(); } } } 

    I appreciate any help and feedback.. Btw... I'm super proud that I figured this out. I know it'll be trivial for most... but it's dang cool to me :)

    Edit... Can these two lines be combined?

    char current = userInput[i]; Console.Write(current); 

    Tom

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

    I'm a future-CS student wondering what type of knowledge this would require?

    Posted: 03 Aug 2019 09:14 PM PDT

    I'm a future CS student who hasn't taken any classes yet, so I'm not well-versed in anything. I was hoping to code myself a website similar to the way this is one is set-up:

    https://billwurtz.com/

    I like how it has a notes section, a place to share songs, etc I like the retro style.

    Is this something I'll be able to learn through CS classes taught in college, and if not, what steps can I take to learn this?

    Thank you!

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

    Assembly: Where does the stack pointer initially point to?

    Posted: 03 Aug 2019 09:04 PM PDT

    Byte addresable and stack grows toward lower addresses.

    Once the OS passes control to your program does the stack pointer to the end of user memory + 1?

    e.g. UserMem: 1000-2000; sp = 2001

    So for example when you push a 1 byte data sp points to user memory or does it start a bit higher e.g. sp = 1990 and UserMem 1991-2000 is "inaccessible" because via convention or hardware you must always decrement sp before storing data?

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

    Can someone figure out why my code doesn't pass any test case?

    Posted: 03 Aug 2019 08:52 PM PDT

    package flashcards; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner reader = new Scanner(System.in); String answer, testing; int numberOfCards = 0; System.out.print("Input the number of cards: "); numberOfCards = reader.nextInt(); testing = reader.nextLine(); String[] cards = new String[numberOfCards]; String[] definition = new String[numberOfCards]; for (int i = 0; i < numberOfCards; ++i) { System.out.println("The card #" + (i+1) + ":"); cards[i] = reader.nextLine(); System.out.println("The definition of the card #" + (i+1) + ":"); definition[i] = reader.nextLine(); } for(int x = 0; x < numberOfCards; ++x) { System.out.println("Print the definition of " + cards[x]); answer = reader.nextLine(); if (definition[x].equals(answer)) { System.out.print("Correct answer. "); continue; } if(!definition[x].equals(answer)) { System.out.println("Wrong answer (the correct one is " + definition[x] + ")."); } } } } 

    This is Stage 3 of the FLASHCARDS app from https://hi.hyperskill.org/

    I can compile it in IntelliJ and it runs and works fine but the exact code within my browser fails test case 1. Can anyone help point out why or where the problem is so I can fix it?

    EDIT: Thank you in advance.

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

    How do I put quote marks in a System.out.println() in java?

    Posted: 03 Aug 2019 08:38 PM PDT

    This is a simple question, but I've been looking for a solution to this for awhile online, but I keep getting an error message.

    Let's say I want to print out the phrase (unquoted "quoted"). This sounds simple enough, right? Just type it out in system.out. However, This

    System.out.println("unquoted "quoted"");

    would not work.

    I tried to look this up, but when I try to use backslashes like this

    System.out,println("unquoted \"quoted\"");

    I get an error message.

    I would like to mention that I don't need to do this. I know I could just do two single ' marks. In fact, the thing I am trying to program doesn't even need quote marks. I would just like to know just because I want my code to feel more professional.

    p.s. please let me know if any of this encroaches on rule 10. I don't want to be a plagiarist.

    EDIT: Found it. The usage of the backslashes is correct. Just remember that it goes as backslash - quote mark - word to be quoted - backslash - quote mark.

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

    Do you think it's worth it for me to pay $700 to take an R programming class?

    Posted: 03 Aug 2019 08:35 PM PDT

    Basically, I am preparing to apply for PhD programs in psychology in the Fall of 2020, to start in the Fall of 2021. The only software I know how to use is SPSS, and I can tell that R is quickly becoming a necessary and predominant programmign language in the field. As much as I want to believe I can teach myself R, I am not 100% convinced that it's possible. Do you think it is worth it to take a structured class with a qualified instructor? Or can I just teach myself?

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

    Is it too late/too much?

    Posted: 03 Aug 2019 08:37 AM PDT

    Hey y'all. I'm looking into learning programming but I'm a little worried I'm too old and/or too late to the game.

    I'm about to turn 38 and aside from normal internet usage, I have zero computer knowledge.

    I've worked blue collar jobs my entire life. Oil industry, machine shops, plumbing, etc. I'm used to being on my feet all day in a hot environment. Long hours. You get the picture. I want to transition.

    A little less than a year ago I bought a cheap laptop and got reacquainted with how to actually operate a computer, with help from my gf. This is the first computer I've owned since around 2009 when I bought my first smart phone.

    Math: I slid thru highschool with literally the bare minimum of math.

    Programming: I'm not even sure what it entails, exactly. At this point when I read this sub it's like reading Latin. I'm not really even sure what the different between a web developer or coder is.

    I'm not completely technologically ignorant. I recently started a podcast and was able to learn how to edit and launch it. So I CAN learn.

    I'm literally the guy the "learn to code" meme was made for. My question is - can I?

    Any tips or advice would be greatly appreciated. Thanks in advance.

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

    Drag & drop web forms from mysql/csv/excel data source

    Posted: 03 Aug 2019 08:02 PM PDT

    Hi Everyone,

    Are there suggestions for a drag and drop form to HTML type of product, ideally that one that can create from mysql tables (database) and/or Excel/CSV; Main thing is easy to swap between various input types etc?

    Quick and dirty is fine. It's not sensitive information. It's just a matter of making sure tables/fields are correct in a practice page until concept is stable. I don't mind if it needs a bit of programming, but looking for something faster as an Agile process that non-coders could pick up easily enough.

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

    I can't connect to my local host

    Posted: 03 Aug 2019 07:52 PM PDT

    Hi all!

    I'm trying to connect to my local host but it keeps popping up with an error on my local host that says:

    Not Found

    The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.

    Below is a snippet of the message I received after running the command 'flask run':

    (venv) C:\Users\kobby\microblog>flask run * Serving Flask app "microblog.py" * Environment: production WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead. * Debug mode: off * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit) 127.0.0.1 - - [04/Aug/2019 03:40:58] "GET / HTTP/1.1" 404 - 

    I've tried copying the exact link: http://127.0.0.1:5000/ into my search bar but that unfortunately didn't work out.

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

    Web Development path to success?

    Posted: 03 Aug 2019 10:32 AM PDT

    I'm looking to start getting into web development, and want to know what is the best course to take? I already started learning Python when I heard that i should've started withHTML, CSS and Java... Any help is greatly appreciated!

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

    No comments:

    Post a Comment