• Breaking News

    Tuesday, June 15, 2021

    Finally got a Job in 2 years! Don't give up! learn programming

    Finally got a Job in 2 years! Don't give up! learn programming


    Finally got a Job in 2 years! Don't give up!

    Posted: 15 Jun 2021 07:33 PM PDT

    Just wanted to remind those who have been practicing and trying I'll tell you stick with it and you'll eventually get a job. I know it's hard and disheartening and will make you want to give up and work at the local fast food place. It took 2 long hard years on my mental health and it also hurt my pride a bit.

    But I coded anytime I could while taking care of my newborn till he now and he's 2 and half. I also was lucky enough to have a girlfriend now fiance to have my back.

    I eventually got let go at the company I worked with for 2 years cause the new manager said he couldn't rely on me in the busy season if I got a Job as a programmer. I was Scared shitless.

    But my family had my back and if you have a nice support system that believes in you GO FOR IT! Believe in them as they Believe in you!

    Also Thank you r/learnprogramming r/django r/learnjavascript these communities are the most helpful People on the web! The information and kindness you guys offer I could never repay you.

    So don't get disheartened if you haven't found a job in 3 months or 6 months I know you see a lot of those posts and Though I'm happy for them and I'm sure a lot of you are too that are learning programming. But know those are rare and usually you get connections either from friends or family a coding bootcamp co-ed.

    You do You and don't give up. This is your journey and your pace. and Apply to jobs everyday when you first wake up.

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

    Is the Full Stack Developer 32 week course through Emeritus offered by MIT a good place to start learning code?

    Posted: 15 Jun 2021 03:38 PM PDT

    The course is 7k and 32 weeks long. Is this worth it considering at the end you are provided with an MIT professional certificate as a Full Stack Developer? I apologize if this has already been asked I'm just looking for information anywhere I can get it because this course is rather new. Any help at all would be greatly appreciated.

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

    Need a Odin project buddy, Let’s become developers!

    Posted: 15 Jun 2021 09:04 AM PDT

    Anyone who's interested pm me or drop a comment, let's just work together on this and discuss any questions had or insights we have, with each other!

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

    Is it possible to "brick" the pc or RAM by messing around with C/C++?

    Posted: 15 Jun 2021 09:35 AM PDT

    I'm just starting to learn C (coded in java and python before), and don't have too much understanding of it yet. But from what I've learned so far, you have access/can manipulate memory easily.

    So my question is, can you theoretically break your RAM by deleting everything or overwriting important instructions? I'm not too familiar with hardware, so I'm not tooo sure if there is important stuff stored in main memory.

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

    I’m not trying to hate on other peoples projects but...

    Posted: 15 Jun 2021 08:08 PM PDT

    Currently in a part time bootcamp, and we just finished our personal react projects. I was able to meet the minimum requirements which is at least 2 CRUD features and also one optional feature using google firebase. My project was all my code but I did read documentation and had some mentoring along the way.

    But some people completed way more than that, they're projects were amazing. Some looked legit professional ones!

    I'm just curious how they did it? Some just ventured way outside of our regular lectures material etc. do they code more? Do they have more experience coding?CS backgrounds maybe? Are they smarter than me?

    I felt like mine was super simple and almost felt embarrassed by it.

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

    [Python] Confused on the point of using property decorators and getter and setters in Python

    Posted: 15 Jun 2021 01:27 PM PDT

    Hi there, I am an intermediate Python programmer and was studying OOP in Python. I ran into the use of the getters and setters but I don't understand why we use getters and setters when retrieving attributes instead of the dot annotation? I made an example to show case what I am talking about.

    class Circle(object): def __init__(self, x, y, r) -> None: self.x = x self.y = y self.r = r @property def x(self): return self._x @x.setter def x(self, value): self._x = value @property def y(self): return self._y @y.setter def y(self, value): self._y = value @property def r(self): return self._r @r.setter def r(self, value): if value > 0: self._r = value else: print("The radius must be positive") cir1 = Circle(1,2,3) print(cir1.r) 

    and then without decorators:

    class Circle def __init__(self, x, y, r) -> None: self.x = x self.y = y self.r = r cir1 = Circle(1,2,3) print(cir1.r) 

    In both these cases, they output the same thing (3 in this case). But to me, the second one is much more clean and less redundant. Yet it is recommended to use getters and setters like the first code block. Why is this? What is so wrong about calling class attributes using the dot annotation? I am here to learn so please let me know if I am mistaken somewhere. Thanks!

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

    When do you consider your unit tests be "enough"?

    Posted: 15 Jun 2021 10:05 PM PDT

    Hi Everyone!

    I would like to ask for opinions about adding unit tests in your code.

    Personally, I have this mindset that all kinds of software have some bugs in some way, shape or form whether it would be a logical or a runtime error but I also noticed that it also takes time to create and list down all the test cases needed to ensure that your code is "fool-proof", which now leads back to my question.

    When can you consider your unit tests as enough for your needs?

    I would like to get some insights on how you deal with test cases in particular in relation with my question.

    Thank you!

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

    How do you learn best?

    Posted: 15 Jun 2021 07:43 PM PDT

    How do you learn best? What are your favorite resources, techniques, etc. around picking up new skills or technology?

    What's your process for organizing your learning? Do you set a schedule, make a syllabus, etc.

    If you struggle to learn new skills, what's holding you back or is difficult about learning something new?

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

    [Java] Deleting certain values from a linked list, not seeing how this simple solution works when you have to delete all elements in list

    Posted: 15 Jun 2021 07:23 PM PDT

    Trying to delete certain vals from a linked list.

    Here is the solution code:

     class Solution { public ListNode removeElements(ListNode head, int val) { ListNode dummy = new ListNode(0); dummy.next = head; ListNode cur = dummy; while(cur.next != null) { if(cur.next.val == val) { cur.next = cur.next.next; } else cur = cur.next; } return dummy.next; } } 

    If you provide the test case of [7,7,7,7] with val = 7, this function should send back a null list as the answer.

    But when I trace it out on a whiteboard, there's no way this can happen.

    The code at the end return dummy.next as the head. Dummy.next is "head", and "head" is still "7". It's not null.

    What am I missing? How am I tracing this wrong?

    edit: LC question: https://leetcode.com/problems/remove-linked-list-elements/

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

    "this" keyword inside a callback function using addEventListener vs when you do it with an array method like map

    Posted: 15 Jun 2021 05:27 PM PDT

    so when we do something like this, then "this" is the h1:

    document.querySelector('h1').addEventListner('click', function () {

    console.log(this);

    }

    but.. if you do something like this, then "this" is the window object:

    let arr = [1, 2, 3, 4, 5];

    arr.map(function (){

    console.log(this);

    }

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

    Looking for a programming buddy [GMT +1]

    Posted: 15 Jun 2021 10:01 AM PDT

    So a bit of background:

    Im due to start a MSc Computer Science conversion course in the UK this year, and I have basic grasp of fundamental concepts by now.

    Currently Im learning basic data structures and algorithms and going through a technical interview book, to prepare for leetcode grind, as well as:

    1. Full Stack Open 2021 course - currently on part3
    2. 100 days of code in Python - Angela Yu's course on Udemy

    Would anyone be basically interested in partnering up with me for at least this whole summer to work on projects together? Or at least form accountability, getting help, etc.

    I lack any portfolio at the moment so desperately need this!

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

    The easiest way to learn matlab?

    Posted: 15 Jun 2021 11:26 AM PDT

    I have been learning Matlab for around 8 months now and I still have no clue what I'm doing half of the time as I am very new to programming and online uni was not of much help. Anyway, I would really like to improve my Matlab skills but I've struggled to make it interesting as I am a visual learner. I have tried to find websites online where you can practice Matlab codes and stuff but nothing was useful, I often get stuck on the smallest errors and it gets so overwhelming and I give up. I may or may not have ADHD so any advice from anyone that struggles to concentrate on daunting tasks would be much appreciated.

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

    How to generate Portable PDB for a C++/CLI DLL in Visual Studio to be used in Unity

    Posted: 15 Jun 2021 07:54 PM PDT

    Hi, I am currently getting a lot of bugs inside my CLI DLL. So, one good option I found was to generate PDB files, which are generating by default in VS 2019. But the only issue is I can't use PDB inside of Unity. I found this question asked on Stack Overflow where I came to know about Portable PDB files. I can easily generate them in a C# DLL but not in C++/CLI DLL.

    I've read a lot of MSDN and Stack Overflow posts, articles and questions, but found no answer. If anyone knows how to use it, please let me know.

    Thanks in advance.

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

    Keep data in form

    Posted: 15 Jun 2021 11:26 PM PDT

    Gday all.

    I need to keep the data in a HTML options form after i have submitted it. I am proccessing the form with python's flask. Any help is apreciated.

    here is my form at the moment:

    <script>
    function selectChange(val) {
    //Set the value of action in action attribute of form element.
    //Submit the form
    $('#myForm').submit();
    }

    </script>
    <form method="post" action="{{ url_for('main.home') }}" id='myForm'>
    <div>
    <select name="say" id="say" value="Hi" onChange=selectChange(this.value)>
    <option name="all" >All</option>
    <option name="lathe">Lathe</option>
    <option name="printer">3D Printer</option>
    <option name="drill">Drill</option>
    <option name="welder">Welder</option>
    <option name="milling">Milling Machine</option>
    <option name="cnc machine">CNC Machine</option>
    </select>
    </div>
    </form>

    Cheers

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

    Career change into programming

    Posted: 15 Jun 2021 06:56 PM PDT

    Hey yall, looking for any kind of advice of guidance. I'm a 33 year old process operator(oil refinery work) who decided to give cs50 a shot during the pandemic. I've always considered myself more tech savvy then my peers but never really took the time learn more until a few months ago.

    So far I am currently on week nine of cs50 and branched off to do freecodecamps intro into html, css and Javascript because I needed to learn a little more before finishing week nines project.

    Basically long story short for the first time in my life I'm having some major regrets I didn't go to school for computer science when I was younger. I want to try and transition into either a web developer career or even possibly into cyber security.

    I have looked into both coding bootcamps(coding dojo), going back to school for an accelerated degree(southern new hampshire university or devry) and even just trying to build my own portfolio and grow my skills with free web sources over time. Truth is at my age I have a mortgage and other bills and going to anyone of those programs is only going to add to my debt.

    Can anyone offer any insight into any of the above paths that I mentioned? Are any of them actually feasible to change careers. Sorry for the long post guess at this point I'm just looking for any kind of direction with this.

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

    C/C++ in ubuntu. I would like to use #include <folder/file> syntax with downloaded library but am not pulling it off.

    Posted: 15 Jun 2021 04:37 PM PDT

    I am having trouble trying to figure out how to use this include syntax with downloaded libraries of #include <folder\\header-file> where folder is the folder where the header-file is. I have seen it work in IDE's but I haven't been able to make it work with compiling from the command line.

    These 2 combinations do not work:

    #include <GL\glew.h> with command line of: g++ -I/usr/include main.cpp -o main #include <GL\glew.h> with command line of: g++ -I/usr/include/GL main.cpp -o main 

    Both bring error: fatal error: GL\glew.h: No such file or directory

    only can make it work like this so far:

    #include "glew.h" with command line of: g++ -I/usr/include/GL main.cpp -o main 

    Is there a way to make it work like this #include <GL\glew.h>?

    Thanks

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

    How do I choose multiple weighted random items from multiple lists?

    Posted: 15 Jun 2021 06:45 PM PDT

    I just started learning about 2 weeks ago. I am at the stage where I don't understand the vocabulary well enough to even know where to begin searching for what I'm trying to do and everything I find isn't what I'm trying to do. I have tried different configurations with putting random.choice(s) in various places, but it never seems to fix the problem. Here is what I have right now.

    import random user_input = int(input("Enter a number: ")) list_1 = random.choice(["red", "blue", "green", "yellow"]) list_2 = random.choice(["one", "two", "three", "four"]) list_3 = random.choice(["up", "down", "left", "right"]) list_4 = random.choice(["hi", "low", "middle"]) compiled_list = [list_1, list_2, list_3, list_4] random_items = random.choices(compiled_list, cum_weights=(25, 55, 85, 100), k=user_input) print(random_items) 

    My output usually looks like:

    Enter a number: 10

    ['one', 'low', 'left', 'low', 'left', 'left', 'yellow', 'one', 'yellow', 'left']

    It is choosing random values from each of the lists, but it is repeating the same random value each time. Since "one" was chosen, "two", "three", and "four" were never chosen for the list. How do I get an output more like below?

    Enter a number: 10

    ['one', 'low', 'left', 'hi', 'up', 'right', 'blue', 'three', 'green', 'left']

    Thank you in advance!!

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

    [COW] I'm trying to write a basic adder program in COW, but seem to be getting a compiler error

    Posted: 15 Jun 2021 01:43 PM PDT

    (I'm aware this is a esoteric language, and there are limited resources on it)

    I'm trying to write a simple addition program in COW, but ran into an issue. This code,

    Moo moO Moo MOO mOo MoO moO MOo moo mOo OOM 

    prompts a user for an input (the Moo command) and stores it in the first box. It then moves to the second box and does the same. My problem here is that the Moo command stores the stdin value as ascii, and therefore the box value won't correspond to the entered integer. The program manages to add to numbers, but prints the two ascii values added together (e.g 3(51) + 4(52) = 103). One would think changing the code to this:

    oom moO oom MOO mOo MoO moO MOo moo mOo OOM 

    would fix the issue, oom being the command to prompt for an integer, but this returns the error code:

    Compiling [adder.cow]... C++ source code: cow.out.cpp cow.out.cpp: In function 'int main(int, char**)': cow.out.cpp:11:203: error: redeclaration of 'char b [100]' char b[100];int c=0;while(c<sizeof(b)-1){b[c]=getchar();c++;b[c]=0;if(b[c-1]=='\n')break;}if(c==sizeof(b))while(getchar()!='\n');(*p)=atoi(b);p++; if(p==m.end()){m.push_back(0);p=m.end();p--;}char b[100];int c=0;while(c<sizeof(b)-1){b[c]=getchar();c++;b[c]=0;if(b[c-1]=='\n')break;}if(c==sizeof(b))while(getchar()!='\n');(*p)=atoi(b);M1:if(!(*p))goto m1;if(p==m.begin()){rterr();}else{p--;}(*p)++;p++; if(p==m.end()){m.push_back(0);p=m.end();p--;}(*p)--;goto M1;m1:if(p==m.begin()){rterr();}else{p--;}printf("%d\n",*p);x:return(0);} ^ cow.out.cpp:11:6: note: 'char b [100]' previously declared here char b[100];int c=0;while(c<sizeof(b)-1){b[c]=getchar();c++;b[c]=0;if(b[c-1]=='\n')break;}if(c==sizeof(b))while(getchar()!='\n');(*p)=atoi(b);p++; if(p==m.end()){m.push_back(0);p=m.end();p--;}char b[100];int c=0;while(c<sizeof(b)-1){b[c]=getchar();c++;b[c]=0;if(b[c-1]=='\n')break;}if(c==sizeof(b))while(getchar()!='\n');(*p)=atoi(b);M1:if(!(*p))goto m1;if(p==m.begin()){rterr();}else{p--;}(*p)++;p++; if(p==m.end()){m.push_back(0);p=m.end();p--;}(*p)--;goto M1;m1:if(p==m.begin()){rterr();}else{p--;}printf("%d\n",*p);x:return(0);} ^ cow.out.cpp:11:209: error: redeclaration of 'int c' char b[100];int c=0;while(c<sizeof(b)-1){b[c]=getchar();c++;b[c]=0;if(b[c-1]=='\n')break;}if(c==sizeof(b))while(getchar()!='\n');(*p)=atoi(b);p++; if(p==m.end()){m.push_back(0);p=m.end();p--;}char b[100];int c=0;while(c<sizeof(b)-1){b[c]=getchar();c++;b[c]=0;if(b[c-1]=='\n')break;}if(c==sizeof(b))while(getchar()!='\n');(*p)=atoi(b);M1:if(!(*p))goto m1;if(p==m.begin()){rterr();}else{p--;}(*p)++;p++; if(p==m.end()){m.push_back(0);p=m.end();p--;}(*p)--;goto M1;m1:if(p==m.begin()){rterr();}else{p--;}printf("%d\n",*p);x:return(0);} ^ cow.out.cpp:11:17: note: 'int c' previously declared here char b[100];int c=0;while(c<sizeof(b)-1){b[c]=getchar();c++;b[c]=0;if(b[c-1]=='\n')break;}if(c==sizeof(b))while(getchar()!='\n');(*p)=atoi(b);p++; if(p==m.end()){m.push_back(0);p=m.end();p--;}char b[100];int c=0;while(c<sizeof(b)-1){b[c]=getchar();c++;b[c]=0;if(b[c-1]=='\n')break;}if(c==sizeof(b))while(getchar()!='\n');(*p)=atoi(b);M1:if(!(*p))goto m1;if(p==m.begin()){rterr();}else{p--;}(*p)++;p++; if(p==m.end()){m.push_back(0);p=m.end();p--;}(*p)--;goto M1;m1:if(p==m.begin()){rterr();}else{p--;}printf("%d\n",*p);x:return(0);} ^ Could not compile. Possible causes: C++ compiler is not installed, not in path, or not named 'g++' or there is a bug in this compiler. 

    when compiling. Is there an issue in my code, or is my compiler the problem here?

    Edit: I should mention, compiling the first code I mentioned works without any problems

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

    Why this code takes 1 input instead of 2 ?

    Posted: 15 Jun 2021 09:50 PM PDT

    import java.util.Scanner;

    public class Main { public static void main(String[] args) { Scanner a= new Scanner(System.in); String b= a.next(); String c = a.nextLine(); System.out.println(b); System.out.println(c); } }

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

    Connecting a mobile app to a desktop one

    Posted: 15 Jun 2021 09:44 PM PDT

    Hello. I am kind of new to developing and programming in general. I want to make a mobile app that can be used for pc too. The mobile app has to send notifications to the desktop one and modify a shape (from green- free to red - busy). What is the best way to do this? I am willing to learn new programming languages.

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

    Learning as an autodidact

    Posted: 15 Jun 2021 05:57 PM PDT

    Hey y'all, recently i started learning about programming and i already know HTML. I'm having fun so far although it's a bit overwhelming if i study for too long.

    My family is really tight with the bills rn so i wanna learn as quick as i can to help them out, my roadmap is HTML (done) CSS, Javascript and ReactJs and a bit of NodeJs. How long you guys think it would take to learn so that i can make at least a bit of money? It's literally my last resort since finding a job in my country cuz of corona and all is really tough.

    tl;dr Struggling real bad, need money ASAP, how long would it take me to learn CSS, Javascript, ReactJs and a bit of NodeJs? (i normally study 5h daily)

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

    How much time to invest daily to learn Python?

    Posted: 15 Jun 2021 03:33 PM PDT

    I know absolutely nothing about programming but I want to learn Python. I'm curious how much time other people have devoted daily to learning Python and how long it took for you to feel like you know what you are doing with it.

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

    "Could not find or load main class StuNameRoster" How do i fix this

    Posted: 15 Jun 2021 05:35 PM PDT

    code:

    import java.io.*;

    import java.util.Scanner;

    public class Roster {

    public static void main(String\[\] args) { 

     // Declare Scanner input = new Scanner([System.in](https://System.in)); String fileName = null; int numStudents; String firstName; String lastName; StuName\[\] writeStudents = null; StuName\[\] readStudents = null; File file = null; FileOutputStream out = null; ObjectOutputStream writeStu = null; FileInputStream in = null; ObjectInputStream readStu = null; 

     // Assign System.out.print("Enter file name: "); fileName = input.nextLine(); file = new File(fileName); 

     System.out.print("Enter number of students: "); numStudents = input.nextInt(); writeStudents = new StuName\[numStudents\]; 

     input.nextLine(); 

     for (int i = 1; i <= numStudents; i++) { 

     System.out.print("\\nEnter first name of student " + i + ": "); firstName = input.nextLine(); 

     System.out.print("Enter last name of student " + i + ": "); lastName = input.nextLine(); 

     writeStudents\[i - 1\] = new StuName(firstName, lastName); 

     } 

     // Read and write StuName object try { 

     out = new FileOutputStream(file); writeStu = new ObjectOutputStream(out); 

     writeStu.writeObject(writeStudents); writeStu.close(); 

     } catch (FileNotFoundException e) { System.out.println("File not found."); } catch (IOException e) { System.out.println("Problem with input/output."); } 

     // Read File for StuName 

     try { in = new FileInputStream(file); readStu = new ObjectInputStream(in); 

     readStudents = (StuName\[\]) readStu.readObject(); 

     } catch (FileNotFoundException e) { System.out.println("File not found."); } catch (IOException e) { System.out.println("Problem with input/output."); } catch (ClassNotFoundException e) { System.out.println("Class could not be found to cast object."); } //Display students System.out.println("\\nList of students is"); for(StuName s : readStudents) { System.out.println(s); } input.close(); 

    } 

    }

    StuName Class:

    import java.io.Serializable;

    public class StuName implements Serializable {

    /\*\* \* This id is used in the serialization process across different platforms. \*/ private static final long serialVersionUID = -6859744685824631220L; //Attributes/ Fields private String firstName; private String lastName; 

    // Constructors /\*\* \* Default constructor \*/ public StuName() { super(); } 

    /\*\* \* u/param firstName \* u/param lastName \*/ public StuName(String firstName, String lastName) { this.firstName = firstName; this.lastName = lastName; } 

    /\*\* \* u/return the firstName \*/ public String getFirstName() { return firstName; } 

    /\*\* \* u/param firstName the firstName to set \*/ public void setFirstName(String firstName) { this.firstName = firstName; } 

    /\*\* \* u/return the lastName \*/ public String getLastName() { return lastName; } 

    /\*\* \* u/param lastName the lastName to set \*/ public void setLastName(String lastName) { this.lastName = lastName; } 

    u/Override public String toString() { return String.format("%s, %s", firstName, lastName); } 

    }

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

    What would be the Java equivalent of Setenv like in Go?

    Posted: 15 Jun 2021 09:18 PM PDT

    I have already googled for setting environment variable in Java but only got results which included writing own elaborate methods. I was wondering if there's any library function or we can set in some properties file (Maven build - Spring boot) ?

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

    No comments:

    Post a Comment