• Breaking News

    Friday, November 6, 2020

    I've managed to get a job but I'm super scared learn programming

    I've managed to get a job but I'm super scared learn programming


    I've managed to get a job but I'm super scared

    Posted: 05 Nov 2020 08:44 AM PST

    So I've managed to get myself a job as a web developper / programmer in a web agency but I'm scared as shit.

    I only really started learning how to program a year or so ago and I wasn't always diligent about it. I stopped and started again (the pandemic didn't help at time). Basically, I did CS50 and built myself a small web app using Python and Flask that was used at my old job. When I didn't know how to do something, I would Google stuff, find something that made sense on Stack Overflow, modify it to fit my needs and I would be on my way.

    The guy who hired me is the owner of the web agency (it's pretty small). During the interview, he said he had looked at the some of the code I had written and he said he was confident I could the job. The thing is, their stack is all PHP and C#, which I've never touched in my life. He's aware of it but he thinks I can learn the differences somewhat quickly (which, for that, I kind of agree with). I feel comfortable understanding algorithmic stuff in a theorotical sense and I'm ok with functional programming but I've never really touched OOP before. Like, I understand the principles but I've never done it before.

    I'm just really afraid that I won't be good enough. I know about impostor syndrome but I just wanna make sure I don't miss my shot and I wanna do great.

    I start in a week and a half. What would you do if you were me in that time?

    EDIT: Holy shit guys, I didn't expect that kind of support! I only wanted to share my fear with some people that might have gone through what I'll be going through but the support I received has been overwhelming. Thanks for the advices and kind word, this community is so great, I love it!

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

    I’ve just realised that a lot of people are really good programmers simply because they’ve had to work through so many problems and succeeded.

    Posted: 05 Nov 2020 10:56 PM PST

    I've been feeling down.

    I started learning web dev about 4 months ago and have been kicking myself that I'm not fluent in JavaScript yet but I've finally started to realise that the people I look up to in the industry were at the same point as me at one stage, they just persisted after facing challenge after challenge.

    You literally become better every time you encounter a problem and you solve it.

    Now there's no way I'm going to stop.

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

    Does being a developer consist of typing code all day?

    Posted: 05 Nov 2020 03:32 PM PST

    If not, what other duties do web developers have?

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

    What's the purpose of 'return 0' in C?

    Posted: 05 Nov 2020 10:58 PM PST

    Why do we need to add return 0; at the end of a C program?

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

    I'm hosting a generative art workshop for beginners!

    Posted: 05 Nov 2020 06:26 PM PST

    Here's the link up front: https://youtu.be/xuYaILT_BTI

    Basically, it will be lessons on YouTube (like the one above), followed by Zooms to review and answer questions! I'd love feedback from people who haven't programmed before on how this went. I think I probably could've gone into more detail about the code.

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

    Graduated in May 2020 scared to look for a job..The pandemic has removed the wind from my sails.

    Posted: 05 Nov 2020 02:41 PM PST

    I had so much momentum and then I lost it. I had a good internship developing code for automating lab equipment. My internship ended abruptly when shutdown hit. Now I am terrified for to apply for jobs. I feel like I'm lost. I have 3 years of learning python and got my degree in Information Science and Tech. But I just feel like finding a job is so hard now. I feel unqualified especially with the long list of qualification requirements for entry-level makes me feel like it's impossible. The more months that pass by from graduation and not being able to find a job makes me feel like a failure. The more time that passes feels like the more it will be harder to find a job. I feel like recruiters might see that I was class of 2020 and unable to find a job and it will put them off and go for more recent graduates. The only thing that keeps me going is doing side projects. But times are tough and I need to help my family financially. Does anyone have a similar experience? I'd like to feel like I'm not alone.

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

    Don't know if I am writing my code correctly.

    Posted: 05 Nov 2020 10:24 PM PST

    Hi all,

    I am currently in my second class in college that involves programming. We are using java and the project is to create a text based game. One of my classes is going to be pushing 500 lines of code and one of the methods having about 400 lines alone. The game works like it should and has no problems. But I still can't shake the feeling that I am doing something wrong. Its pretty much made up of for loops and if else if statements. Is this normal?

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

    Free python/javascript tutor

    Posted: 05 Nov 2020 10:03 AM PST

    Hi guys!

    I'm looking for someone who want to study web development by skype or zoom. Instead of money I want to get practice in English, because it's more important for me now.

    Also I have few requirements for candidate:

    1. English - your major language

    2. You use OS X or linux as main operating system(or you can install it as second OS), because I haven't used Windows for ten years.

    3. You know what do you want to be able to create. Especially if you have some idea which you want to realize.

    Few words about me. I've been developing different products since 2010. Most of them I created for web. Now I use python for development backend. Django framework in most cases, rarely Flask and another frameworks. Also I use javascript for create frontend. Vue+typescript is my choice. Therefore I will teach you only this languages.

    If you are interested in take me up on this send me PM with what day of the week and time with timezone you can do it. Also in message send me information about point 3.

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

    Using java sockets for my app's server and random IP's are connecting to my server

    Posted: 06 Nov 2020 12:33 AM PST

    As title says. should I be worried? Also should I change the port I'm forwarding?

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

    Simulated annealing, traveling salesman

    Posted: 05 Nov 2020 06:34 PM PST

    I'm making an app that needs to visit all cities (literally) from latitude and longitude values. Im looking at simulated annealing and im having a hard time understanding the neighbor or adjacent route part. The initial route is just the order of random cities I have. I'm not understanding what changes to make to that order. Seems like I am supposed to swap two cities? And if so how do I choose which two cities to swap?

    Also explain like I'm 5 please lol. I'm a comp sci student trying to learn. Thanks

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

    What do you consider the most complex and interesting thing in programming?

    Posted: 05 Nov 2020 03:38 PM PST

    Hey reddit! I'm wondering what's the most difficult thing to learn and to solve and also fascinating the things you could do with it.

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

    HELP: ISO C++ forbids comparison between pointer and integer

    Posted: 05 Nov 2020 08:26 PM PST

    The commented code at the bottom is the original code inside the setLED function. My teacher has challenged me to condense the below code and I'm having troubles with the method I've come up with. I feel like I'm close though...

    I originally ran this code in tinkercad:

    https://www.tinkercad.com/things/1dNqvd2KHDE-copy-of-p10-brayden-pack/editel?sharecode=HL0ihNKxdDD-qp9270eSGlYZFJ3QVeS5pvsQi_rE4Is

    // Project 10 - Serial controlled RGB Lamp char buffer[18]; int red, green, blue; int RedPin = 11; int GreenPin = 10; int BluePin = 9; void setup() { Serial.begin(9600); Serial.flush(); pinMode(RedPin, OUTPUT); pinMode(GreenPin, OUTPUT); pinMode(BluePin, OUTPUT); } void loop() { if (Serial.available() > 0) { int index=0; delay(100); // let the buffer fill up int numChar = Serial.available(); if (numChar>18) { numChar=18; } while (numChar--) { buffer[index++] = Serial.read(); } splitString(buffer); } } void splitString(char* data) { Serial.print("Data entered: "); Serial.println(data); char* parameter; parameter = strtok (data, " ,"); while (parameter != NULL) { setLED(parameter); parameter = strtok (NULL, " ,"); } // Clear the text and serial buffers for (int x=0; x<16; x++) { buffer[x]='\0'; } Serial.flush(); } void setLED(char* data) { for (int x=0; x<4; x++) { char* color[4] = {"r", "g", "b", "y"}; char* COLOR[4] = {"R", "G", "B", "Y"}; char* Cname[][12] = {"Red", "Green", "Blue"}; //int Cpin[] = {11, 10, 9}; if ((data[0] == color[x]) || (data[0] == COLOR[x])) { int Ans = strtol(data+1, NULL, 10); Ans = constrain(Ans,0,255); for (int n=0; n<3; n++) { int Cpin = 11-n; analogWrite(Cpin, Ans); Serial.print("%d is set to: ",Cname[n]); Serial.println(Ans); } int Ans = strtol(data+1, NULL, 10); Ans = constrain(Ans,0,255); analogWrite(RedPin, Ans); analogWrite(GreenPin, Ans); Serial.print("Yellow is set to: "); Serial.println(Ans); } } /* if ((data[0] == 'r') || (data[0] == 'R')) if ((data[0] == 'r') || (data[0] == 'R')) { int Ans = strtol(data+1, NULL, 10); Ans = constrain(Ans,0,255); analogWrite(RedPin, Ans); Serial.print("Red is set to: "); Serial.println(Ans); } if ((data[0] == 'g') || (data[0] == 'G')) { int Ans = strtol(data+1, NULL, 10); Ans = constrain(Ans,0,255); analogWrite(GreenPin, Ans); Serial.print("Green is set to: "); Serial.println(Ans); } if ((data[0] == 'b') || (data[0] == 'B')) { int Ans = strtol(data+1, NULL, 10); Ans = constrain(Ans,0,255); analogWrite(BluePin, Ans); Serial.print("Blue is set to: "); Serial.println(Ans); } if ((data[0] == 'y') || (data[0] == 'Y')) { int Ans = strtol(data+1, NULL, 10); Ans = constrain(Ans,0,255); analogWrite(RedPin, Ans); analogWrite(GreenPin, Ans); Serial.print("Yellow is set to: "); Serial.println(Ans); } */ } 

    Here are my error messages:

    /Users/braydenpack/Desktop/p10_brayden_pack1/p10_brayden_pack1.ino: In function 'void setLED(char*)': /Users/braydenpack/Desktop/p10_brayden_pack1/p10_brayden_pack1.ino:53:41: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings] char* color[4] = {"r", "g", "b", "y"}; ^ /Users/braydenpack/Desktop/p10_brayden_pack1/p10_brayden_pack1.ino:53:41: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings] /Users/braydenpack/Desktop/p10_brayden_pack1/p10_brayden_pack1.ino:53:41: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings] /Users/braydenpack/Desktop/p10_brayden_pack1/p10_brayden_pack1.ino:53:41: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings] /Users/braydenpack/Desktop/p10_brayden_pack1/p10_brayden_pack1.ino:54:41: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings] char* COLOR[4] = {"R", "G", "B", "Y"}; ^ /Users/braydenpack/Desktop/p10_brayden_pack1/p10_brayden_pack1.ino:54:41: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings] /Users/braydenpack/Desktop/p10_brayden_pack1/p10_brayden_pack1.ino:54:41: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings] /Users/braydenpack/Desktop/p10_brayden_pack1/p10_brayden_pack1.ino:54:41: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings] /Users/braydenpack/Desktop/p10_brayden_pack1/p10_brayden_pack1.ino:55:48: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings] char* Cname[][12] = {"Red", "Green", "Blue"}; ^ /Users/braydenpack/Desktop/p10_brayden_pack1/p10_brayden_pack1.ino:55:48: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings] /Users/braydenpack/Desktop/p10_brayden_pack1/p10_brayden_pack1.ino:55:48: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings] /Users/braydenpack/Desktop/p10_brayden_pack1/p10_brayden_pack1.ino:58:27: warning: ISO C++ forbids comparison between pointer and integer [-fpermissive] if ((data[0] == color[x]) || (data[0] == COLOR[x])) { ^ /Users/braydenpack/Desktop/p10_brayden_pack1/p10_brayden_pack1.ino:58:52: warning: ISO C++ forbids comparison between pointer and integer [-fpermissive] if ((data[0] == color[x]) || (data[0] == COLOR[x])) { ^ p10_brayden_pack1:64:45: error: no matching function for call to 'print(const char [15], char* [12])' Serial.print("%d is set to: ",Cname[n]); ^ In file included from /Users/braydenpack/Desktop/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/Stream.h:26:0, from /Users/braydenpack/Desktop/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/HardwareSerial.h:29, from /Users/braydenpack/Desktop/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/Arduino.h:233, from sketch/p10_brayden_pack1.ino.cpp:1: /Users/braydenpack/Desktop/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/Print.h:69:12: note: candidate: size_t Print::print(unsigned char, int) <near match> size_t print(unsigned char, int = DEC); ^~~~~ /Users/braydenpack/Desktop/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/Print.h:69:12: note: conversion of argument 2 would be ill-formed: /Users/braydenpack/Desktop/p10_brayden_pack1/p10_brayden_pack1.ino:64:44: warning: invalid conversion from 'char**' to 'int' [-fpermissive] Serial.print("%d is set to: ",Cname[n]); ~~~~~~~^ In file included from /Users/braydenpack/Desktop/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/Stream.h:26:0, from /Users/braydenpack/Desktop/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/HardwareSerial.h:29, from /Users/braydenpack/Desktop/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/Arduino.h:233, from sketch/p10_brayden_pack1.ino.cpp:1: /Users/braydenpack/Desktop/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/Print.h:70:12: note: candidate: size_t Print::print(int, int) <near match> size_t print(int, int = DEC); ^~~~~ /Users/braydenpack/Desktop/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/Print.h:70:12: note: conversion of argument 2 would be ill-formed: /Users/braydenpack/Desktop/p10_brayden_pack1/p10_brayden_pack1.ino:64:44: warning: invalid conversion from 'char**' to 'int' [-fpermissive] Serial.print("%d is set to: ",Cname[n]); ~~~~~~~^ In file included from /Users/braydenpack/Desktop/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/Stream.h:26:0, from /Users/braydenpack/Desktop/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/HardwareSerial.h:29, from /Users/braydenpack/Desktop/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/Arduino.h:233, from sketch/p10_brayden_pack1.ino.cpp:1: /Users/braydenpack/Desktop/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/Print.h:71:12: note: candidate: size_t Print::print(unsigned int, int) <near match> size_t print(unsigned int, int = DEC); ^~~~~ /Users/braydenpack/Desktop/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/Print.h:71:12: note: conversion of argument 2 would be ill-formed: /Users/braydenpack/Desktop/p10_brayden_pack1/p10_brayden_pack1.ino:64:44: warning: invalid conversion from 'char**' to 'int' [-fpermissive] Serial.print("%d is set to: ",Cname[n]); ~~~~~~~^ In file included from /Users/braydenpack/Desktop/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/Stream.h:26:0, from /Users/braydenpack/Desktop/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/HardwareSerial.h:29, from /Users/braydenpack/Desktop/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/Arduino.h:233, from sketch/p10_brayden_pack1.ino.cpp:1: /Users/braydenpack/Desktop/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/Print.h:72:12: note: candidate: size_t Print::print(long int, int) <near match> size_t print(long, int = DEC); ^~~~~ /Users/braydenpack/Desktop/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/Print.h:72:12: note: conversion of argument 2 would be ill-formed: /Users/braydenpack/Desktop/p10_brayden_pack1/p10_brayden_pack1.ino:64:44: warning: invalid conversion from 'char**' to 'int' [-fpermissive] Serial.print("%d is set to: ",Cname[n]); ~~~~~~~^ In file included from /Users/braydenpack/Desktop/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/Stream.h:26:0, from /Users/braydenpack/Desktop/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/HardwareSerial.h:29, from /Users/braydenpack/Desktop/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/Arduino.h:233, from sketch/p10_brayden_pack1.ino.cpp:1: /Users/braydenpack/Desktop/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/Print.h:73:12: note: candidate: size_t Print::print(long unsigned int, int) <near match> size_t print(unsigned long, int = DEC); ^~~~~ /Users/braydenpack/Desktop/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/Print.h:73:12: note: conversion of argument 2 would be ill-formed: /Users/braydenpack/Desktop/p10_brayden_pack1/p10_brayden_pack1.ino:64:44: warning: invalid conversion from 'char**' to 'int' [-fpermissive] Serial.print("%d is set to: ",Cname[n]); ~~~~~~~^ p10_brayden_pack1:67:12: error: redeclaration of 'int Ans' int Ans = strtol(data+1, NULL, 10); ^~~ /Users/braydenpack/Desktop/p10_brayden_pack1/p10_brayden_pack1.ino:59:10: note: 'int Ans' previously declared here int Ans = strtol(data+1, NULL, 10); ^~~ exit status 1 no matching function for call to 'print(const char [15], char* [12])' This report would have more information with "Show verbose output during compilation" option enabled in File -> Preferences. 
    submitted by /u/crafter32oo
    [link] [comments]

    Absolutely stumped with design Analysis and Algorithms

    Posted: 06 Nov 2020 12:09 AM PST

    I'm currently taking this course at a university and am just not understanding it. Professor goes through visual representations of what the algorithm should do which I follow very well. However, when I sit down and try to think about how to write an algorithm I draw a blank.

    Does anyone know a good place to where I can receive help on this?

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

    Languages/Frameworks with high job:competition ratio for remote jobs?

    Posted: 06 Nov 2020 12:02 AM PST

    From my linkedin search, it looks like there are way too many Java jobs, for example. However, the number of people with years of Java experience is also quite high. Are there some niche programming languages, frameworks, or an ecosystem of languages/frameworks whether there is relatively high demand in remote space yet there are relatively fewer people.

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

    [C++] Need explanation on how "&" bitwise operator can be used to check for oddity

    Posted: 05 Nov 2020 02:08 PM PST

    Suppose I have:

    int oddOrNot = 0; oddOrNot = 5 & 1; 

    How is the "&" being used to check for oddity? I know & represents the AND logical operation, but I'm unsure what that has anything to do with oddity and how that would even work...

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

    Get a freelancing programming job without a degree. Is this possible?

    Posted: 05 Nov 2020 11:23 PM PST

    I've been wondering if there is actually a person who hasn't had any degree (Didn't go to college but knows how to code or has learned bits of programming languages) and lands a programming job. Is it even possible? Sorry, if this is stupid and if I have offended anyone with this question but I just wanna know.

    I wanna prove this cause I had an argument with a family member. Please understand me... also sorry if my grammar is wrong.

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

    I want to get a job as a software engineer when I’m old enough. What are some things I should learn or do to achieve my goal?

    Posted: 05 Nov 2020 10:53 PM PST

    I'm still in high school and I'm hoping I can learn what I need to do to achieve my goal. And I'm doing cs50 introduction to computer science course.

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

    Run button and shortcut doesn't work for Python in 'Visual Studio Code'. How to fix?

    Posted: 05 Nov 2020 10:52 PM PST

    My code doesn't run in vscode when I click the run button or press ctrl+alt+n, instead it just shows the path. But it works when I right click and choose 'run program in python'. I have installed python 3, and 'python for vscode' extention. How do I fix this to run by either run button or ctrl+alt+n?

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

    Learning C#. Creating an "InputHelper" for fun. Wondering if I am doing something terrible or cool.

    Posted: 05 Nov 2020 04:29 PM PST

    Not suer if this is the right place for this.

    I am learning C# for school. I am in an intermediate class. We are often asked to get input from the user for basic console apps. Often we have to parse this input to a number or add a constraint in some way. I got tired of rewriting code over and over to validate input, so I decided to create an "InputHelper" class. I am hoping to get feedback on whether I am doing things in a cool or terrible way. Specifically wondering if:

    • Using a static class and static methods of varying protection levels to do something like this is a good idea
    • In an effort to reduce code reuse, I created a "WaitForParse" function that is called with a type T. That way I can call this one function to wait for an int or a double or decimal or whatever else and not have to do method overloading. Because I am doing things this way I need to use reflection to call TryParse for the appropriate type. Is this introducing much unneeded complexity? Should I just overload and be done with it?
    • Is there a better way to return a number from the GetInt and GetDouble methods then instantiating a variable, passing it be reference to WaitForParse? I am assuming there is a much cleaner way.

    And for the record I know there are probably dozens of libraries out there that handle this. I am just trying to learn.

    using System; namespace PCE_StarterProject { static public class InputHelper { static public int GetInt(string prompt = "Please enter an integer: ") { int num = 0; WaitForParse<int>(ref num, prompt); return num; } static public int GetInt(Func<int, bool> validator, string prompt = "Please enter an integer: ") { int num = 0; WaitForParse<int>(ref num, prompt, validator); return num; } static public double GetDouble(string prompt = "Please enter a double: ") { double num = 0; WaitForParse<double>(ref num, prompt); return num; } static public double GetDouble(Func<double, bool> validator, string prompt = "Please enter a double: ") { double num = 0; WaitForParse<double>(ref num, prompt, validator); return num; } private static void WaitForParse<T>(ref T output, string prompt, Func<T, bool> validator = null) { var TryParseMethod = (typeof(T).GetMethod("TryParse", new Type[] { typeof(string), (typeof(T)).MakeByRefType() })); if(TryParseMethod == null) { throw new ArgumentException("Cannot call TryParse on type passed to WaitForParse"); } object[] args = { typeof(string), null }; do { InputHelper.Prompt(prompt); args[0] = Console.ReadLine(); } while (!(bool)TryParseMethod.Invoke(null, args) || !(validator != null ? validator((T)args[1]) : true)); output = (T)args[1]; } public static void Prompt(string prompt) { Console.Write(prompt); } } class Program { static void Main(string[] args) { int num = InputHelper.GetInt(n => n < 10, "Please enter an integer less than 10: "); Console.WriteLine("Your number is: " + num); } } } 

    Any feedback and pointers would be appreciated. Thanks!

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

    Can i start with mit 6.006(DSA) YouTube video as beginners?

    Posted: 05 Nov 2020 10:21 PM PST

    Can i start mit dsa video from scratch or data structures and algo from freecodecamp on yt ?

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

    Why is js promises considered async?

    Posted: 05 Nov 2020 10:18 PM PST

    It has never been async, async in every other languages means multithreaded / running 2 things at the same time.

    When we do promises, it executes everything first before executing the next line of code. Why is everyone say that it's async?

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

    Implementing Radix Sort using Queues [Java]

    Posted: 05 Nov 2020 10:09 PM PST

    I am doing an exercise that requires me to sort an array through the Radix Sort method using Queues. I will be utilizing the java.util "ArrayDeque" class to implement the Queues.

    I have created 3 groups of 10 Queues. There are 10 Queues to represent the possible values for one digit column are 0-9. There are 3 groups of these Queues because the assignment is asking us to assume that the maximum number in the array will be no greater than 999.

    Where I'm stuck is, I can't figure out how to read only one column from each element of the array and add it to the corresponding Queue. For example, if I have an array like [23, 405, 5], I don't know how I would go about reading just the "3" in "23" so I can add it to the "onesColumnThree" Queue.

    Here is what I have:

    public static <T extends Comparable<? super T>> void radixSort(Integer[] a, int n) { for (int i = 0 ; i < a.length ; i ++) { // This is where I intend to separate each individual digit so // I can add it to the proper Queue } ArrayDeque onesColumnZero = new ArrayDeque() ; ArrayDeque onesColumnOne = new ArrayDeque() ; ArrayDeque onesColumnTwo = new ArrayDeque() ; ArrayDeque onesColumnThree = new ArrayDeque() ; ArrayDeque onesColumnFour = new ArrayDeque() ; ArrayDeque onesColumnFive = new ArrayDeque() ; ArrayDeque onesColumnSix = new ArrayDeque() ; ArrayDeque onesColumnSeven = new ArrayDeque() ; ArrayDeque onesColumnEight = new ArrayDeque() ; ArrayDeque onesColumnNine = new ArrayDeque() ; ArrayDeque tensColumnZero = new ArrayDeque () ; ArrayDeque tensColumnOne = new ArrayDeque() ; ArrayDeque tensColumnTwo = new ArrayDeque() ; ArrayDeque tensColumnThree = new ArrayDeque() ; ArrayDeque tensColumnFour = new ArrayDeque() ; ArrayDeque tensColumnFive = new ArrayDeque() ; ArrayDeque tensColumnSix = new ArrayDeque() ; ArrayDeque tensColumnSeven = new ArrayDeque() ; ArrayDeque tensColumnEight = new ArrayDeque() ; ArrayDeque tensColumnNine = new ArrayDeque() ; ArrayDeque hundredsColumnZero = new ArrayDeque() ; ArrayDeque hundredsColumnOne = new ArrayDeque() ; ArrayDeque hundredsColumnTwo = new ArrayDeque() ; ArrayDeque hundredsColumnThree = new ArrayDeque() ; ArrayDeque hundredsColumnFour = new ArrayDeque() ; ArrayDeque hundredsColumnFive = new ArrayDeque() ; ArrayDeque hundredsColumnSix = new ArrayDeque() ; ArrayDeque hundredsColumnSeven = new ArrayDeque() ; ArrayDeque hundredsColumnEight = new ArrayDeque() ; ArrayDeque hundredsColumnNine = new ArrayDeque() ; } 
    submitted by /u/fleaFlicker212
    [link] [comments]

    Is there anyone who LIKES JavaScript's "let's try to do something even when the code is nonsense" approach?

    Posted: 05 Nov 2020 10:08 PM PST

    I have some JavaScript. I wrote something that was totally nonsense. Referenced a function that didn't exist. Saved the file, compiled my React app, ran the React app. No warning, no error, nothing. Only found out about it when I switched from a class component to a function component. The details don't really matter: There was some total nonsense that would've caused an error later had I not found it today.

    So...

    Does anayone *like* JavaScript's "let's not throw an error and pass the nonsense output down the line to somewhere else" approach? I don't.

    I'm a newb compared to some people on this forum tho so I'd like to hear the opposite opinion if it exists.

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

    Help With First Real Self-Guided Programming Project

    Posted: 05 Nov 2020 10:35 AM PST

    Hello everyone, first time posting here. To get straight to the point, I wanted to get started on creating my first project with the knowledge I gained from my introductory computer science course at my university. So here's my idea of the project I want to make: throughout the class we are assigned multiple mini-projects that were mainly just solving very simple problems useful for beginners using programming, most of them requiring an input and then using a function to give an output. So I would like to create a project that contains all the mini-projects we did where the user can choose which one to look at and can directly use each one. Sort of like an arcade room, where each arcade machine is one of the mini-projects, then the user can go back to the room and select another arcade if they wish. Sorry if this was hard to understand for it is my first time trying to describe a project like this. I am just wondering how would I get started for an app like this? How would I be able to conjoin all these codes I have into one project where they can be separately used as a whole?

    EDIT: Forgot to include, that I will be developing this in Python 3.

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

    No comments:

    Post a Comment