• Breaking News

    Sunday, August 9, 2020

    Programming Expectation vs Reality? learn programming

    Programming Expectation vs Reality? learn programming


    Programming Expectation vs Reality?

    Posted: 09 Aug 2020 07:01 PM PDT

    Hi,

    I've started learning Java and doing some research on what working as a programmer is like. I've come across lots of videos about the differences between how people imagine a programming job to be, and how it really is. The reality part in these videos almost always picture programming to be a copy-paste and googling job.

    My question is: Is that really true? How much code do you write yourself and how much do you find it on google and paste it to your workspace?

    Edit: thank you for your answers. I understand the concept now.

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

    Anyone else love the feeling of pushing a project you just wrote to GitHub?

    Posted: 09 Aug 2020 07:26 PM PDT

    Nothing quite like the high you get after willing your ideas into reality through a couple hundred keystrokes.

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

    Am I learning Programming the wrong way?

    Posted: 09 Aug 2020 10:02 AM PDT

    Hey Guys,

    so I started learning Python 1 or 2 months ago. I had some programming experience before, but only the basics like Variables, Functions, Classes etc.

    in those 2 Months I fully focused on learning the Python Basics, now im trying to realize some project ideas I got in my head. But here comes the problem.

    I just finished a Project where the Scripts looks for my Face using OpenCV. If it can't find my face for 30 Seconds, the Script will lock my PC. Works perfectly fine.

    But all of the code is 90% copy and paste. I had absolutely no knowledge using OpenCV. So I looked up a bunch of guides n stuff. Cause the Documentations are sooo hard to understand for me. The Docs are most of the time so complex that I don't even know where to start. Thats my problem I think.
    So I read trough alot of guides and articles explaining OpenCV. I collected different Code Parts from different articles. But I don't wanna copy and paste stuff all the time. I wanna be able to read trough the docs myself and get the knowledge I need and write the Code by myself.

    And I do this for all my Projects. I hope you guys know what im talking about. Maybe im too dumb?
    Maybe thats it... idk.

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

    Just need help with drawing lines for school project, thanks heaps :)

    Posted: 09 Aug 2020 09:35 PM PDT

    UNITY 2D - C#

    TLDR; We need to be able to click on an element, then draw a visible path that the element will follow.

    Full run down: We're making a game in school where we will have planes appear off screen randomly, then fly onto the screen. The user will click on the plane to select it from the others, then draw a visible path from the plane to the runway that the plane will follow. Once the plane get's to the runway the user will move onto the next plane. What we need help with is the coding to draw the line & path in front of the plane, to the runway.

    like seen here (yes it's a rip off lol)

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

    Is solving algorithm neccessary for the job?

    Posted: 09 Aug 2020 06:54 PM PDT

    I see people talking about this and especially mention leetcode a lot in here. This is the most discouraging part of programming for me. Some problems feel very easy but some take me 2 weeks just to see that I got the wrong approach. I like web programming a lot and I plan to focus on this role but I don't see how algorithms would benefit it.

    For the context I am in Ontario, Canada. I talk with my friends in the field and they have different thoughts about it. Some says it's only needed for the interviews, some says they don't find it useful at all. I assume it depends on their roles and positions.

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

    Using Github for the first time

    Posted: 09 Aug 2020 09:25 AM PDT

    I am a collaborator on a Github repository, but I have been doing a lot of the work on the project and I've been committing the changes to the master repository. However, it doesn't show up in my list of repositories or projects, and I'm worried that it won't be clear to somebody looking at my Github that I've been working on the project.

    How can I present it on my Github account? Do I just have to fork it after the entire project is completed? Thanks in advance for helping out a beginner!

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

    [Java] Having trouble trying to use Object's arguments.

    Posted: 09 Aug 2020 06:50 PM PDT

    I didn't know how to word my title accurately, so I hope my description and code can help.

    I'm making a program where you can instantiate an object with arguments to have different baseball statistics (e.g. hits, at bats).

    BaseballV7 Barry = new BaseballV7(2935, 9847, 762, 1539, 91);

    What I'm trying to do is make a method that calculates the average of a specific statistic between all of the objects that are instantiated.

    So if you have:

    BaseballV7 Barry = new BaseballV7(2935, 9847, 762, 1539, 91);

    BaseballV7 Hank = new BaseballV7(3771, 12364, 755, 1383, 121);

    and you want the average of hits between the two (first argument), the output would be 3353.

    In the Object class, these are my ints and constructors:

    private int myHits, myHomeruns, myAtBats, myStrikeouts, mySacFlyouts;

    public BaseballV7(int hits, int atBats, int homeruns, int strikeouts, int sacFlies) {

    myHits = hits;

    myHomeruns = homeruns;

    myAtBats = atBats;

    myStrikeouts = strikeouts;

    mySacFlyouts = sacFlies;

    }

    public BaseballV7(){

    }

    This is the method:

    public int getStats(String average, String stat, int players){

    BaseballV7 baseballV7 = new BaseballV7();

    int averageInt = 0;

    int sum = 0;

    if (average.equalsIgnoreCase("Average")){

    if (stat.equalsIgnoreCase("Hits")){

    for (int i = 0; i < players; i++) {

    sum += baseballV7.myHits;

    }

    } else if (stat.equalsIgnoreCase("At Bats")){

    for (int i = 0; i < players; i++) {

    sum += baseballV7.myAtBats;

    }

    } else if (stat.equalsIgnoreCase("Homeruns")){

    for (int i = 0; i < players; i++) {

    sum += baseballV7.myHomeruns;

    }

    } else if (stat.equalsIgnoreCase("Strikeouts")){

    for (int i = 0; i < players; i++) {

    sum += baseballV7.myStrikeouts;

    }

    } else if (stat.equalsIgnoreCase("Sacrifice Flyouts")){

    for (int i = 0; i < players; i++) {

    sum += baseballV7.mySacFlyouts;

    }

    }

    averageInt = sum / players;

    }

    return averageInt;

    }

    }

    This is how I'm trying to call the method in my main class:

    BaseballV7 baseballV7 = new BaseballV7();

    System.out.println(baseballV7.getStats("Average", "Hits", 4));

    Except that when I run it, the output is 0.

    https://gist.github.com/PolarIce1/103371fa5cd8829655f13c02f07b6083

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

    Help on Big-O

    Posted: 09 Aug 2020 05:24 PM PDT

    I was wondering if anyone knew of any resources or helpful "tricks" to be able to decipher and understand time complexity (figuring out which to use when writing code as well as being able to figure out what's used when reading code).

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

    Learned basics of python and now I dont know what to do

    Posted: 09 Aug 2020 10:46 AM PDT

    Basically I followed a tutorial on youtube like one of those 4 hour ones, and did a ton of exercies that went along with it. Well my question is now what? I cant think of any projects to do with my skill set, and I dont know what to learn next. Right now I wanna learn how to actually apply python because everything I've been doing only affects the python interpreter, but I have no idea how to start applying python.

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

    I'm fairly new to learning programming and it makes me feel like an idiot. Is this normal?

    Posted: 09 Aug 2020 10:49 PM PDT

    So like a lot of people on this sub, I recently decided on making bacareer transition from finance to programming. I'm starting a college program in January 2021 but in the meantime I've started the Odin project and am working my way through the curriculum. Everything was fine until I hit the damn CSS flexbox and grid stuff. I swear to God, this shit is making my head hurt. I'm having a tough time wrapping my head around the concepts and I have to Google pretty much everything. TOP has to go through the freecodecamp tutorials but I honestly don't understand the way they explain it and I'm having to find myself consulting multiple external sources.

    I pretty much blew through the html curriculum and the CSS basics but I feel like I've hit a rock wall at the flexbox portion and it's making me feel kinda dumb, because it's still essentially the "beginning" stages of TOP.

    Is it normal to feel this way?

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

    I’m not sure if I’m allowed to do this but I’m learning c#. And I’m getting a lot of problems with this code and I’ve tried fixing them all but it’s causing more. Could someone help?

    Posted: 09 Aug 2020 10:39 PM PDT

    using System;

    using System.Security.Cryptography.X509Certificates;

    public class HelloWorld {

    //For speed type speed then enter atmospheric thrusters than weight //For weight type Kg than enter thrusters then speed //For thrusters type thrusters then enter weight and speed static public void Main() { string option = Console.ReadLine(); if (option == "Ms") { static void Speed(); } else if (option == "Kg") { static void Kg(); } else if (option == "Thrusters") { static void thrusters(); } } static void Kg() { //To find how much weight a ship is first enter thruster amount. then ener how fast the ship can fly in meters per second double Thrusters = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("Enter the amount of thrusters on ship: {0}", Thrusters); double kn = 408; double ms = Convert.ToDouble(Console.ReadLine()); static void speed(){ Console.WriteLine("Enter m/s: {0}", ms); double thruster = Convert.ToDouble(Console.ReadLine()); Console.WriteLine(Thrusters * kn * 1000 / ms); } static void Speed() { //Finding the speed your ship will go. Enter Kg first then enter the ships weight Console.WriteLine("How fast does my thruster go?"); double largeAtmosphericThrusters = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("Enter the amount of large atmospheric Thrusters: {0}", largeAtmosphericThrusters); double Kilog = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("Enter weight of ship: {0}", Kilog); int thrust = 408; Console.WriteLine((largeAtmosphericThrusters * thrust) / (Kilog / 1000)); } static void thrusters() { //Find the ships thrust by first typing in Kg than Meters per second. double Kilog = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("Enter weight of ship: {0}", Kilog); double ms = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("Enter how fast the ship can fly. {0}", ms); double thrust = 408; Console.WriteLine(ms * (Kilog / 1000) / thrust); } 

    } }

    Edit: if you were wondering it was to help speed up a couple equations for a game called space engineers

    Edit 2: this is the error message I get:

    ./Playground/file0.cs(21,25): error CS8112: 'Speed()' is a local function and must therefore always have a body. ./Playground/file0.cs(27,25): error CS8112: 'Kg()' is a local function and must therefore always have a body. ./Playground/file0.cs(32,24): error CS8112: 'thrusters()' is a local function and must therefore always have a body. ./Playground/file0.cs(48,45): error CS8421: A static local function cannot contain a reference to 'ms'. ./Playground/file0.cs(53,51): error CS8421: A static local function cannot contain a reference to 'ms'. ./Playground/file0.cs(53,39): error CS8421: A static local function cannot contain a reference to 'kn'. ./Playground/file0.cs(53,27): error CS8421: A static local function cannot contain a reference to 'Thrusters'.

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

    Can someone please give me feedback on my code, Im not sure why its failing. I figured it could be that "amount" should probably be different after each time it changes, but that got the same result.

    Posted: 09 Aug 2020 08:09 PM PDT

    def withdraw(amount): hundred_bills = amount//100 amount_one = amount % 100 fifty_bills = amount_one//50 amount_two = amount % 50 twenty_bills = amount_two//20 return [hundred_bills, fifty_bills, twenty_bills] 

    These are the results:

    AssertionError: Lists differ: [2, 1, 0] != [2, 0, 3] First differing element 1: 1 0 - [2, 1, 0] ? ^ ^ + [2, 0, 3] ? ^ ^ 

    This is the problem:An ATM only has 100, 50 and 20 dollar bills (USD) available to be dispensed.Given an amount between 40 and 10000 dollars (inclusive) and assuming that the ATM wants to use as few bills as possible, determinate the minimal number of 100, 50 and 20 dollar bills the ATM needs to dispense (in that order).Here is the specification for the withdraw method you'll complete:

    withdraw(amount)

    Parameters amount:

    Integer - Amount of money to withdraw. Assume that the amount is always divisible into 100 , 50 and 20 bills.

    Return ValueArray (of Integers) - An array of 3 integers representing the number of 100 , 50 and 20 dollar bills needed to complete the withdraw (in that order).

    Constraints40 ≤ amount ≤ 1000

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

    Thoughts on free code camp?

    Posted: 09 Aug 2020 10:11 PM PDT

    What are your thoughts on free code camp? I'm a beginner and learning coding. Wanted to know your thoughts on freecodecamp

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

    Newsletter suggestions

    Posted: 09 Aug 2020 10:01 PM PDT

    Hey all. I have many newsletter subscriptions and I found it a very good way to learn. Are they are newsletters that send out great programming content?

    I dont want it to a generic technology newsletter- whats latest and stuff. But instead more hands on, that writes about concepts,maths, sends relevant problems ,etc..

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

    Movies on programming/computers?

    Posted: 09 Aug 2020 09:40 PM PDT

    I'm aware of the Imitation Game which shows the life of Alan Turing and his Enigma Machine. But are their any other recommendations on cool documentaries or movies which dig deep into certain computer languages or the history of computers, etc?

    submitted by /u/Cacodemon-Salad
    [link] [comments]

    Is it possible to generate schematic maps (transit maps) with Python?

    Posted: 09 Aug 2020 09:09 PM PDT

    I've been coding in Python, and I've always been interested in maps like this are made: https://nycmap360.com/nyc-train-map

    The only project I found is this, but it's in JavaScript and it seems very complicated:https://github.com/juliuste/transit-map

    Do you think I should continue doing research or trying this if I have little knowledge?

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

    From C to Web development - struggling with context and looking for resources

    Posted: 09 Aug 2020 10:54 AM PDT

    Hey,

    TLDR: Looking for high level reads on web app architectures explaining what the hell is going on under the level of abstraction provided by modern frameworks.

    So, I've been learning to code on and off for a couple of years but really could put time in in 2020. I focused on C and built a couple of small projects. What really clicked with C is the relative simplicity of the language and the full control you get over what the program is doing. There is vert little abstraction.

    I have a personality where I need to understand what each line is doing. When when the tutorial says "well, just don't worry about this part for now" I'm opening a new tab to investigate that part of code.

    Since June, I'm doing Harvard's CS50. The C and Python part was very cool and I have chosen the Web Track and will probably be doing CS50Web course after. Things feel VERY different after switching to web development.

    It feels like everything is 5 layers on abstraction and it is difficult to understand the context. How is Flask actually managing user sessions? How do other frameworks approach this point? How is the backend framework connected to the template engine? What are the alternatives to this architecture? What are the alternatives to the MVC model? What is the historical context?

    With low level programming the challenge felt more on the logical side. You needed to figure out how to accomplish the task with a few basic tools your were given. With web dev, the way it is presented in courses, it feels like it's more about knowing the framework and reading documentation.

    Where can I read about all the mechanics going "behind the scenes"? I'm interested mostly in high-level overview of backend and databases. Either online reads or physical books..

    Thanks.

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

    Undefined behavior in stack? Leetcode problem

    Posted: 09 Aug 2020 08:30 PM PDT

    The problem is making a MinStack. push(), pop(), getMin() need to have constant time. But my output has undefined behavior. Thanks

    class MinStack { public: /** initialize your data structure here. */ int minVal; stack<int> s; stack<int> minVals; MinStack() { } void push(int x) { s.push(x); if (minVals.empty() == true) minVals.push(x); if (s.empty() == true) { minVal = x; } if (minVal > x) { minVal = x; minVals.push(minVal); } } void pop() { if (s.top() == minVal) { s.pop(); minVals.pop(); minVal = minVals.top(); } else s.pop(); } int top() { return s.top(); } int getMin() { return minVal; } }; /** * Your MinStack object will be instantiated and called as such: * MinStack* obj = new MinStack(); * obj->push(x); * obj->pop(); * int param_3 = obj->top(); * int param_4 = obj->getMin(); */ 

    I'm using 2 stacks, one for the actual stack and one to keep track of min values. When I pop, if the value i'm popping is the min value, i replace minVal with minVals top after popping minVals.

    Output [null,null,null,null,-1094795586,null,0,-1094795586] Expected [null,null,null,null,-3,null,0,-2] 
    submitted by /u/epicboyxp
    [link] [comments]

    Beginner CS Projects (C++)

    Posted: 09 Aug 2020 11:46 PM PDT

    Hi All,

    I've learned the basics of C++ and want to really solidify my foundation by doing projects. Does anyone have suggestions for beginner projects and how to plan/approach the project? How do I decide whether or not a project is manageable?

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

    Am I doing this wrong?

    Posted: 09 Aug 2020 07:57 PM PDT

    When I "make" a project like I always copy the code from websites, for example when I made a python project that is going to alert me for how many minutes I choose I copied the code from a website then I change it to my liking so instead of it alerting me through the console it's going to open a text file instead.

    But the thing is I also got that code from a different website like stack overflow and I usually do this for every project I do and when the code from stack overflow doesn't work I usually modify it which is probably the only real work that I have done.

    And yes I do understand the code after I read it but it's really frustrating that I always have to search in Google 90% of the time making me feel like I haven't learned anything.

    Tl;Dr: When I "make" projects I just mix and match code from other websites and modify it as I see fit.

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

    how to get a substring of a dataframe

    Posted: 09 Aug 2020 07:40 PM PDT

    Can someone help me figure out how to substring the "Start_Time" of this dataset? For example, the row is '2016-02-08 06:07:59' and I want to get a substring of '08'. I want to do this for each row of the dataset but haven't found a good solution.

    When I convert this dataset into a dataframe and do df.info(), the "Start_Time" and "End_Time" columns read as objects. When I try to convert them to strings, they maintain their object value (was explained to me along the lines of an object being counted as a string (still pretty confused)).

    The solution I found was when I do

    df['Start_Time'][1][5:7], I am able to get the string at position 5:7 for row 1. How can I implement this to get the 5th to 7th value for each row of my dataset?

    source: https://www.kaggle.com/sobhanmoosavi/us-accidents

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

    For some reason, still struggling with logic

    Posted: 09 Aug 2020 07:38 PM PDT

    I started programming for a class in 11th grade, and then I dropped it in 12th grade for the school year. This summer I've immersed myself in programming again, doing it everyday, and for some reason I still struggle to do simple logic problems.

    TLDR: I've essentially been programming for a year and half and it still takes me so long to do even one leetcode easy, like an hour and a half. What can I do to make my logic better?

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

    Should I learn python or JavaScript first? Or something else? And what would you recommend is a nice way to learn it?

    Posted: 09 Aug 2020 10:55 PM PDT

    Any recommendations welcome!

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

    Help an educator...please.

    Posted: 09 Aug 2020 10:52 AM PDT

    I work in special education and have about 100 kids on my caseload. This generates a lot of documentation as I have to document every interaction with or about a child. Our district uses the Google realm so I need to work within that.

    What I have...a google form that populates the responses into a google sheets page.

    What I need...a google scripts code that upon form response submission will send the data to a folder titled the students name. So every time I see student A through the school year that documentation response will be filed in a spreadsheet in student A's folder.

    The script I have created now is making a folder for every single response. That is of no help as I could just leave it in the spreadsheet an occasionally sort alphabetically.

    Thank you in advance. This is my first post on Reddit. Sorry if I left out any information.

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

    No comments:

    Post a Comment