• Breaking News

    Thursday, May 14, 2020

    I finally created a program that I think could be useful to others: hexc - A simple terminal program to convert to and from hexadecimal, decimal, and binary. learn programming

    I finally created a program that I think could be useful to others: hexc - A simple terminal program to convert to and from hexadecimal, decimal, and binary. learn programming


    I finally created a program that I think could be useful to others: hexc - A simple terminal program to convert to and from hexadecimal, decimal, and binary.

    Posted: 14 May 2020 09:45 AM PDT

    https://github.com/sntdrr/hexc
    Please let me know what you think! You'll need gcc to install it via the makefile, otherwise you can just compile it yourself. It has certain limitations which I'm working on, and I'm hoping to add conversion to and from ASCII soon!
    I am not asking for a code review (although it is certainly welcome), I just thought I'd share this little project.
    It was designed in and for Linux, I haven't done any testing in MacOS or Windows.
    EDIT: Modularized into functions as per a bunch of advice I got!

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

    I hit a wall trying to learn algorithms and coding them. Should I focus on learning math up until a certain point and then switch back to coding?

    Posted: 14 May 2020 08:12 PM PDT

    I started back at Pre-Calc because I never took Calc 1 or AP Calc. I finished Community College at Trig and remember none of it so I've been using Khan Academy and plan to take Pre-Calc and then AP Calc BC since it includes Calc 1+2 plus proofs (i think). Then after that I was going to start Discrete Math and then move onto learning algorithms. Is this a good plan or should I switch back to coding somewhere in here?

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

    Offering free mentoring in C#

    Posted: 14 May 2020 01:53 AM PDT

    Hi everyone! I'm a senior backend web developer working almost exclusively in C# (.NET Core) these days. I'm fairly well versed in most aspects of C# (except Unity). I really enjoy teaching and mentoring people trying to learn, so I figured I'd throw out an offer for a free 1-on-1 mentoring session.

    A little about you:

    • Available for a one hour voice/screenshare session in the timeslot of 20:00 to 23:00 CEST (GMT+2, UTC+2).
    • Interested and enthusiastic about programming.
    • Know what variables, functions and classes are (so not brand new to programming in general).
    • Have a working headset/microphone. This will be over voice with screenshare/liveshare.

    I'm offering a one hour session for everyone. During this hour we can do almost anything you want, from code review to deep diving on individual topics to working on a project. You decide.

    The sessions will not be livestreamed or recorded and are 1-on-1 so I can provide the most individual feedback. Once the session is over, if both parties are interested there might be more sessions in the future.

    If you are interested in a session, please comment below or PM with the following information:

    • What you want to do during your session (code review of existing code, deep dive (what subject?), pair programming (what project?), etc...)
    • What days and times are best for you? Remember, it must be within my target timeslot of 20 to 23 CEST.
    • Your discord ID so I can reach you.
    submitted by /u/pobiega
    [link] [comments]

    Is it necessary for a beginner to first understand the big picture of the internet and computer before jumping into the coding?

    Posted: 14 May 2020 09:14 AM PDT

    Hello guys. I apologize if this question was already answered but I didn't found the answer.

    So I've been wondering these days how necessary is for a beginner to first understand the big picture of How do computers, the internet, and websites work? How can I build a website? before jumping into the coding.

    I went to the blog from Andrei Neagoie and I read a post: Learn to code in 2020, get hired, and have fun along the way. And the first thing that he is mentioning is to understand the bigger picture of how everything works.

    So I wanted to ask you guys for your opinions if you think that it's necessary to first understand the bigger picture of how everything works and then jumping into the coding or you think that beginner first should learn some languages and then along the way pick up these things?

    Thanks in advance for your answers :)

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

    I can teach you programming =)

    Posted: 14 May 2020 04:49 AM PDT

    Hi everyone! I've been teaching programming professionally for 2 years now and have interned at a FAANG last year. I usually tutor one-on-one but I wanted to practice teaching for a larger group.

    Thus I'll be teaching the CS50 entire curriculum from beginning to end for free as practice for myself. My goal is to have 1 hour sessions where we go over the main points of lecture and then have individual 15 minute one-on-one sessions to go over individual questions. The entire course will take 4.5 months and we will meet once a week on weekends.

    The prerequisite in just speaking English fluently. If anyone is interested just PM me. Cheers!

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

    Looking for ideas for summer projects for a beginner/intermediate programmer

    Posted: 14 May 2020 08:06 PM PDT

    What's up guys, I'm a college freshman who just got done with finals. Due to the pandemic, all of our class instruction went online, and I feel like it seriously impeded my ability to learn. I kinda got carried by my friends towards the end, and I want to make sure I can hold my own for the upcoming semester's classes. For reference, my spring programming class was the second programming class offered by my university, and covered a lot about ADTs and c++ container classes. I'm looking for projects big or small that will strengthen my skills in these areas, especially when it comes to queues, sets, and maps. But feel free to drop project ideas that don't relate to these, thanks guys!

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

    How to align output text in java

    Posted: 14 May 2020 11:08 PM PDT

    I'm very new to java and I wrote a program that outputs a stream of numbers after numerous simulations. The number of decimal places and the amount of digits are unpredictable and I was wondering how I would be able to align each column.

    This is what the output looks like. Thank you for your help.

    1 0 0.0 2 2702 0.002702 3 5533 0.008235 4 8049 0.016284 5 10708 0.026992 6 13335 0.040327 7 15645 0.055972 8 18175 0.074147 9 20537 0.094684 10 22274 0.116958 11 24340 0.141298 12 26017 0.167315 13 27640 0.194955 14 28726 0.223681 15 29684 0.253365 16 30786 0.284151 17 31746 0.315897 18 31898 0.347795 19 32620 0.380415 20 32228 0.412643 21 32475 0.445118 22 31855 0.476973 23 31179 0.508152 
    submitted by /u/jamescleelayuvat
    [link] [comments]

    Am I just too stupid to become a programmer?

    Posted: 14 May 2020 10:55 PM PDT

    I'll be upfront, I am dealing with a lot of outside anxiety and depression with the pandemic. So, if this sounds horribly depressed I'm sorry.

    Little background on me, I'm in my mid-20s and got my undergrad degree in management at a pretty good university. I went on to work in pro sports for three years and fell in love with data analytics side of it. How we could compute cool visualizations and software platforms to display and analyze information is so cool to me. And in the long-term, I'd love to help develop that software, do data analysis, etc. Sort of a complete 180 in terms of everything I've done prior in undergrad and even dating back to high school, where I always leaned towards English than mathematics.

    Anyway, I started graduate school at a top 100 program for CompSci this spring. I know you don't need school to specifically become a programmer, but I'd like a more tangible and versatile degree, and I want my Master's. Plus, school will give me structure. I work best when I have due dates, a schedule, criteria to meet, etc. When I have complete free reign, I may opt to do something else or become instantly overwhelmed.

    So I've started this semester with an intro to programming class for Python. For loops, while loops, functions, dictionaries, all of that. My professor has been great at conveying information, and I feel I have a surface level understanding of what he teaches: such as when to use a for loop versus a while loop, when to use a list versus a dictionary, stuff like that. But, now more than halfway through the semester, I'm hitting a wall.

    The problems are a lot harder and I'm having a hard time even knowing where to begin without guidance. It makes me feel so stupid. And then, I'll look up similar questions online or browse stack overflow....and I'll see solutions and hit myself for just not thinking of such an obvious thing sooner. Like for instance, tonight, I had to do a problem creating a rock paper scissor simulation (it's more in depth than just getting results, but nothing anyone would find overtly difficult) - or a problem I had was being able to return a list all the prime factorizations of an inputted number. They took hours and hours and hours and I just didn't know where to begin, it felt like Chinese. Then it's back to stack overflow to see the answer and it becomes so clear as i deconstruct it.

    I feel awful about myself not being able to even know where to begin. I know also I'm in a horrible headspace. COVID has taken a significant impact on my life. I'm 2,000 miles away from any friend or family (I was here for a job and as I was getting ready to move this hit), I have been furloughed, my days are very full of depression and lack of motivation. I wake up at noon and lay down by 8. It's truly been awful as I fall deeper and deeper into depression. And it's been so hard to find that isolated time to really continuously study. I do spend time trying the problems and reading the book chapter, but I get angry and upset at myself for how long I take, or I get distracted. Working from home and now school from home has been brutal.

    This isn't a mental health sub and I'm not seeking that kind of help...I'm just trying to rationalize my lack of motivation. I truly don't think I'm lazy. My prior industry I grinded 80 hour weeks, put my heart and soul into it, and did well. But when it comes to this....it's been really hard. And I know programming isn't easy. I knew what I was getting into. But my mind is not wired like a programmer. Little parts of solutions I just hit myself and say "that's so simple, I would've never thought of that myself." It sucks and makes me hate myself. But again, I just don't want this thread to make me seem like I'm upset work is hard and I rather play video games all day. But I can't deny the frustration.

    I've been pretty insecure about my intelligence for a long time. I've always excelled. I'm not an A student but I've always done well....3.2+ usually everywhere I've been. I think I'm well-written, but I just feel so fucking stupid about this. And it's not like I take this lightly. It's a complete career change. And I think the problems were given are so cool. Like last week, my professor went over just decoding a message or creating a simulation for a game of craps and I thought it's so cool. And that maybe one day I'd love to be able to develop some cool game in depth or some piece of analysis software. It truly draws me. But I feel like I'm dumb or not good enough or not wired to do it. And my current depression is really severe to the point that during the day I just barely leave bed. And at night when I do spend 3-4 hours doing homework that I'm doing terribly. I have doubts that because I was never a math person that I can never do this. I'm a logical person who loves data, but I've never built a model or done much more than communicate it.

    I know this is all super loaded and I apologize. I guess more of it is a rant than anything. I did just purchase a workbook for more python on amazon thinking maybe something tangible will help me. I'm just wondering I guess if anyone has advice. What can I do to get better. How can I structure myself and my schedule to do this a good amount of time and begin to understand it to where I begin to think like a programmer and solve more complex problems....any help would be appreciated. And I'm sorry if I come off whiny, this has all just impacted me so poorly and now getting into the nitty gritty of the semester and comparing myself to others has made this worse. I just feel so dumb.

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

    I put together an electron app for managing and viewing nest cams

    Posted: 14 May 2020 08:42 PM PDT

    I wanted to have tiny camera feed windows that would always be on top of other windows, so I made an electron app that overrides the CSS on nest cam sharing urls. I just cut the first release and would love feedback and bug reports!

    https://github.com/chriswhong/electron-nest-cam-viewer

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

    Discord for python learning :)

    Posted: 14 May 2020 03:39 PM PDT

    Hello fellow learners, we'd like to invite you to our growing community if you're interested in learning python, discord link is : https://discord.gg/xUeuFNu

    Have fun learning :)

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

    Question on programming language

    Posted: 14 May 2020 10:05 PM PDT

    So I've never coded in my life and one of the things people in youtube say is that it's easier to start with godot since gdscript is easier. Is it true? Also, if I want to progress from gdscript to other languages, can I use my knowledge in gdscript for them? Asking the second question because, who knows in the future if I'm going to use other game engines or other languages (apparently, godot now has C# support).

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

    Having two domains for one webapp?

    Posted: 14 May 2020 07:46 PM PDT

    Is it possible to have 2 domains on one website that both function the same?

    Say I have hello.myTestSite.com which is a domain for it. But I also want to add my.site.com as a short domain to it.

    Its basic HTML site, with javascript that console.log(window.location.hostname).

    My expectation is that it will console.log hello.myTestSite and my.site respectively depending on whichever domain I use. I will then be able to go to hello.myTestSite.com/about and my.site/about, which both take you to the exact same about page.

    is this possible?

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

    Getting stuck

    Posted: 14 May 2020 07:41 PM PDT

    I have finished a python course recently and decided to go over hackerrank to do some exercises, some are really easy others are crazy hard and I get stuck a lot. Its going over hackerrank a big step? Where I should go from here to get better?

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

    Where can I share my projects and ask for opinions?

    Posted: 14 May 2020 06:03 PM PDT

    Basically I'm doing some Python 3 projects to improve my skills and I don't have anyone that I can talk about programming or share my projects and ask for opinions and suggestions. Is there a place that I can share my codes to people and they can rate it and make some suggestions and corrections? Thanks

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

    What are webdev jobs like for big companies who's business model isn't necessarily tied to webdev and programming?

    Posted: 14 May 2020 09:46 PM PDT

    Like in the Oil & gas industry for example. Aside from making a nice site and maybe some maintenance what else is there to do?

    Sounds like theres no job security unless your constantly churning out websites or maintaining webapps

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

    I took some programming classes about 10 years ago in college. For the past year, I've been trying to hop back on but I keep getting bogged down

    Posted: 14 May 2020 09:12 PM PDT

    Back in 2010/11 I took a Java course and a C++ course (beginner stuff) and I got basically to the Desert of Despair and sort of forgot about it while feeling like it was unfinished. For the past year or so I've been trying to get back into it a bit but I keep getting bogged down whenever I restart with feeling like I've forgotten too much to just jump back in but nearly all beginner books are way too rudimentary and if I have to make another F to C converter I will die. I've been flirting with python recently, but in general, if anybody can give any recommendations about getting started again or some good resources they like it would be appreciated.

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

    One SVG file with multiple hotspot links

    Posted: 14 May 2020 06:40 PM PDT

    I have an svg file Id like to insert into my webpage. I also would like to add in links to multiple parts of the image, so you can click on it and go to a different page. Is there an easy way to do this?

    Also, Im making the svg file in Adobe Illustrator. And Im hoping to have an image that when you hover over the hotspots, also displays some text or popup.

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

    Tips for learning to create GUI?

    Posted: 14 May 2020 02:26 AM PDT

    Looking for advice when it comes to GUI. I have very little experience with it. I just started a new project that is sort of like a sim game that I would like to make a GUI for. I'm using java and eclipse for writing the code and have been using the console for now. I've only ever messed with the GUI stuff provided in the java jdk and it seems pretty outdated. After looking online I saw there is software called javafx, and scene builder which seems to make it easier while also looking modern. I'd like to make a central menu with lots of tabs that the user can go through, that can show different tables of stats. Is javafx/scene builder the way to go? Or is there a better way to make GUI?

    I'd like to be able to make something like this eventually, in terms of visuals

    submitted by /u/All-ProEra
    [link] [comments]

    Is writing code by hand on paper useful for learning a language?

    Posted: 14 May 2020 02:02 PM PDT

    Just asking. We finally started python in senior high school here.

    We have to write some code by hand on paper , take a pic and send it to our teacher. We also have to write during the exams

    Are those viable for learning or is it better just typing and learning?

    Edit 2 : Slightly unrelated, but is teaching python starting at 11th grade too late?

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

    I need your help to choose a cloud service

    Posted: 14 May 2020 11:42 PM PDT

    Hello learnprogramming. As part of the final project of our school, our teachers asked us to create a product, and our team decided to create a repository of the residence projects.

    I want to learn API REST, so decided to create a backend that answers with JSON data. First i'm going to create a simple web site, but maybe in the future will create a mobile app.

    As the users will upload and download PDF, I need a storage service too.

    I have searched in google, but I can't found any answer to this question

    Anyone can help me?

    The project needs to be on Internet, so I need sugestions of services that include database, storage and a way to run the backend (I don't know if it will be PHP or NODE).

    We hope that it can allow at least 500 uploads this year, and we don't have money yo pay a great service.

    Please , tell me if i'm wrong or something.

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

    Why can't I stop this concurrent Java program?

    Posted: 14 May 2020 07:54 PM PDT

    So I'm doing a restaurant/cafe simulation in Java and I was hoping to use a static volatile boolean to stop all threads, since Thread.stop() is considered a big no no. But for some reason only one thread(the one where the volatile boolean is located) is the only one that stops.

    Basically once it's been 30 seconds the boolean "continueRunning" should be changed to false and then the other threads should finish their run methods and the program should stop gracefully. But only the time thread stops. The other two(Table and Owner) continue to run.

    Here is my code for the my classes:

    public class CafeSim { static Queue<Customer> OutsideQueue = new LinkedList<Customer>(); static Queue<Customer> InsideQueue = new LinkedList<Customer>(); static ReentrantLock QueueLock = new ReentrantLock(); static Condition QueueCon = QueueLock.newCondition(); static ReentrantLock TapAccess = new ReentrantLock(); static ReentrantLock CupboardAccess = new ReentrantLock(); static int waitTimeForJuice = 2000; static int waitTimeforCupboard = 2000; //These should be adjustable in the final version, and customer seeding should also be adjustable. public static void main(String[] args) { new Time(Instant.now().getEpochSecond()).start(); new Owner().start(); new Table().start(); //new Waiter().start(); for (int i = 0; i < 10; i++) { new Customer().start(); } } } 

    public class Table extends Thread{ String choice; public void run(){ CafeSim.QueueLock.lock(); while(Time.continueRunning == true){ CafeSim.QueueLock.lock(); if(CafeSim.OutsideQueue.size() == 0 && Time.continueRunning == true) try { CafeSim.QueueCon.signal(); CafeSim.QueueCon.await(); } catch (InterruptedException ex) { Logger.getLogger(Table.class.getName()).log(Level.SEVERE, null, ex); } else if(CafeSim.InsideQueue.size() == 10){ System.out.println("Seats inside filled, please wait!"); try { CafeSim.QueueCon.await(); } catch (InterruptedException ex) { Logger.getLogger(Table.class.getName()).log(Level.SEVERE, null, ex); } } else if (CafeSim.OutsideQueue.size() != 0 && Time.continueRunning == true){ if(CafeSim.OutsideQueue.peek().choice == 1){ choice = "juice"; } else{ choice = "coffee"; } System.out.println(CafeSim.OutsideQueue.peek() + " is at the table and has ordered " + choice + "!"); CafeSim.InsideQueue.add(CafeSim.OutsideQueue.poll()); } CafeSim.QueueCon.signal(); CafeSim.QueueLock.unlock(); } System.out.println("This should end[Table]."); CafeSim.QueueCon.signal(); CafeSim.QueueLock.unlock(); } } 

    public class Owner extends Thread{ Customer temp; int counter = 0; public void run(){ CafeSim.QueueLock.lock(); while(Time.continueRunning == true){ CafeSim.QueueLock.lock(); if(CafeSim.InsideQueue.size() == 0 && Time.continueRunning == true){ try { CafeSim.QueueCon.signal(); CafeSim.QueueCon.await(); } catch (InterruptedException ex) { } } else if(CafeSim.InsideQueue.size() != 0){ temp = CafeSim.InsideQueue.poll(); CafeSim.QueueCon.signal(); CafeSim.QueueLock.unlock(); if(temp.choice == 1){ CafeSim.TapAccess.lock(); try { Thread.sleep(CafeSim.waitTimeForJuice); } catch (InterruptedException ex) { } finally{ CafeSim.TapAccess.unlock(); System.out.println(temp.name + " has been served by the owner and has left the restaurant!"); counter++; } } else{ CafeSim.CupboardAccess.lock(); try{ Thread.sleep(CafeSim.waitTimeforCupboard); }catch(InterruptedException ex){ } finally{ CafeSim.CupboardAccess.unlock(); System.out.println(temp.name + " has been served by the owner and has left the restaurant!"); } } try { CafeSim.QueueCon.signal(); CafeSim.QueueCon.await(); } catch (InterruptedException ex) { Logger.getLogger(Waiter.class.getName()).log(Level.SEVERE, null, ex); } } } System.out.println("This should end.[Owner]"); CafeSim.QueueCon.signalAll(); CafeSim.QueueLock.unlock(); } } 

    public class Time extends Thread{ public static volatile boolean continueRunning = true; private long startTime; private long currentTime; boolean lastordersinformed = false; public Time(long timeatStart){ this.startTime = timeatStart; } public void run(){ while(Time.continueRunning == true){ CafeSim.QueueLock.lock(); currentTime = Instant.now().getEpochSecond(); if(currentTime - startTime < 20){ try { CafeSim.QueueCon.signal(); CafeSim.QueueCon.await(); } catch (InterruptedException ex) { Logger.getLogger(Time.class.getName()).log(Level.SEVERE, null, ex); } } if (currentTime - startTime > 20 && lastordersinformed == false){ System.out.println("LAST ORDERS RESTAURANT WILL CLOSE VERY SOON!"); CafeSim.OutsideQueue.clear(); //Waiter.timeToLeave = true; lastordersinformed = true; try { CafeSim.QueueCon.signal(); CafeSim.QueueCon.await(); } catch (InterruptedException ex) { Logger.getLogger(Time.class.getName()).log(Level.SEVERE, null, ex); } } if(currentTime - startTime > 30 && lastordersinformed == true){ Time.continueRunning = false; System.out.println("Cafe is closed."); CafeSim.QueueCon.signal(); CafeSim.QueueLock.unlock(); } } System.out.println("Thread has ended.[Time]"); CafeSim.QueueCon.signal(); CafeSim.QueueLock.unlock(); } } 
    submitted by /u/SACHD
    [link] [comments]

    Simple exercise to learn the basics of Storybook for React apps

    Posted: 14 May 2020 11:34 PM PDT

    I wrote a simple tutorial for React beginners, it uses Storybook and creates one component with 2 variations. It's meant for starters who know a bit of JS but find React intimidating or don't know where to start from.

    https://www.newline.co/@andreeamaco/the-ultimate-guide-to-storybook-for-react-applications-part-ii--a8e6dc59

    Hope you find it useful!

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

    How to maintain loose coupling between services in Spring Boot?

    Posted: 14 May 2020 11:27 PM PDT

    My app needs to make a schedueled call at 20 sec intervals to a warcraft 3 API which returns a list of all currently hosted lobbies. It should proceed to persist that data in a DB which will be used by any user that wishes to get a ping or SMS when his lobby has filled up (instead of making N requests for N users).

    My code:

    https://pastebin.com/qYqCSmwz

    My problems are:

    1. LobbyUpdateTask is supposed to be submitted to SchedueledExecutorService, so it isn't a Spring bean. But it calls Spring services like GameDAO (it needs to persist data) and StatService (http requests to the warcraft 3 API). I get the warning that I can't reference Spring beans in non-spring beans.A task is obviously not a service. How then should it be done?
    2. Besides the networking layer, there are business logic layers like the classes which determine when to ping a player his lobby is full, classes that check how full a lobby is etc. These are not "services" but computational logic classes. How should they talk to Spring beans and reference them?
    3. Where should business logic classes be placed within the project structure if they are not services?
    4. Should the communication between these "domains" of my app be mediated by a controller? Cause in Spring controller mediate between views and backend, yet it seems wrong to have no "hub" for my increasingly high-coupled backend logic.
    submitted by /u/BarAkiva
    [link] [comments]

    100 Days of Code - TOPIC SUGGESTIONS?

    Posted: 14 May 2020 11:17 PM PDT

    Hey! This is my first post here. I am starting the #100DaysOfCode challenge, and I was thinking of creating a Productivity SaaS web-app. Being an Enterprise UI Designer, I was thinking of creating a website enumerating guidelines to create a complete SaaS in 100 days.

    Is this a good idea? Or was the purpose of the challenge not meant for this?

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

    No comments:

    Post a Comment