• Breaking News

    Friday, August 7, 2020

    I feel a little bit down when I see what other people programmed as their "first program". Need a little encouragement learn programming

    I feel a little bit down when I see what other people programmed as their "first program". Need a little encouragement learn programming


    I feel a little bit down when I see what other people programmed as their "first program". Need a little encouragement

    Posted: 06 Aug 2020 10:38 AM PDT

    Like, I visit r/madeinpython and see those github files, and I see lot of beginners in Python, who share their first ever thing they coded... And I'm like, bro, wtf, this is the FIRST thing you ever made? Like I see great programs that are complicated (hundreds of lines of code) and done very well presented as "absolute begginer". Is this really how it is? Maybe that's the first thing ever they made that they felt as worth of presenting online? I don't know.

    I'm few weeks in python... And so far, "my first thing" I programmed is a simple shitty math "game", that lets you choose what operation do you want (only basic ones,square root and power) and after you choose, it gives you the problem with random "a" and "b" numbers (for example 54 + 47) and you have to solve it and enter result, then if it's correct, it prints "correct", if not, then "incorrect". yeah, that's my "first thing" I have built, by myself.

    EDIT: Thanks guys for your comments. You know what, those people on github who say about their project "it's nothing", or something like "this a total noob program" etc. I feel like when I see instagram post of extremely pretty girl that says "I'm sooo ugly :("

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

    C Programming Tutorials

    Posted: 06 Aug 2020 04:28 AM PDT

    Hey everyone,

    I came through /r/learnprogramming when I did my undergrad degree in Computer Engineering and wanted to share a resource. One of my former professors recently began releasing some of his c programming tutorials on Youtube. His style of teaching helped me develop a good intuition for programming at foundational level.

    Introduction to Programming using C

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

    How to create a personal website as a non-web developer - a short practical guide

    Posted: 06 Aug 2020 01:13 PM PDT

    Hello World!

    After a long time of preparations and attempts, I finally managed to set up a nice-looking personal website, so to help people in the situation of me-a-few-months-back, I decided to write about my experience with some hints how to avoid at least some of the inevitable frustrations.

    By no means is this a comprehensive resource, but is instead intended so that beginners can have a working site without (or before) actually having to become web developers themselves.

    So give it a read and let me know what you think!

    (disclaimer: I hope this doesn't count as tasteless self-promotion - it is targeted explicitly at people without extensive web development experience, and hopefully can be considered to be of good quality, although I'm very open to criticism)

    https://redtachyon.me/post/personal-website/

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

    i’m feeling discouraged, worthless and all around horrible about my coding. i don’t know what to do.

    Posted: 06 Aug 2020 01:55 PM PDT

    i recently started a CS50 course on computer science (around june) and i've been moving along nicely until week 2. i have been stuck here for AGES, and nothing seems to help me. for the life of me i can't seem to grasp the readability program (a C program that calculates the grade level of a certain text using the coleman liau index). it has come to the point where programming is becoming a burden and a reminder of my incompetence. i have tried using video and text tutorials (trying to understand the program, not copying the code) and i just don't understand it. what should i do?

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

    How often will I ever actually need to use one of the various sorting algorithms?

    Posted: 06 Aug 2020 02:55 PM PDT

    I'm curious. Most languages have their own built in sorting function, class etc, so I was wondering when would I ever on my own need something more robust? For example I have 100ish items that needed to be sorted on my website, and I just used the inbuilt JavaScript sort function. I know how to build a couple on my own, but felt it would be overkill.

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

    Why isn’t everything pre-imported in programming languages?

    Posted: 06 Aug 2020 06:21 PM PDT

    Instead of having to import whatever it is you want to import, why can't it already be available?

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

    Converting PDF book to mp3. Is there a faster way to do this?

    Posted: 06 Aug 2020 10:01 PM PDT

    Hi, I'm trying to convert PDF to mp3 with Python.

    I used this to convert a 300-page book. So far it has generated 2 hours of audio in about 30 minutes. Is there a faster way to do this?

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

    Weird and annoying line in Python

    Posted: 06 Aug 2020 09:48 PM PDT

    Hi everyone, I'm a beginner in Python (and in programming) and I have a silly question, but let me first describe my situation...

    When I spend too much time writing code, the line that appears on the screen when I write/type (I unfortunately don't know how it's called) turns thick. It also deletes the things in front of what I type while I'm typing.

    So my question is: what can I do to fix that line and turn it back to normal?

    I'm really bad at describing things (and english is not my first language) so I don't know if you underand what I'm saying, please let me know. I would really appreciate it if you helped me because, as dumb as it may sound, I usually spend too much time trying to rewrite the code that the thick line deletes.

    Thank you very much,

    Diego

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

    Have you tried Nuklear?

    Posted: 07 Aug 2020 01:28 AM PDT

    Hi,

    I am thinking of using Nuklear as the GUI engine for my project.

    Has anyone had a go at it?

    What are your experiences, Pros and Cons?

    Thanks!

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

    How to intergrate googleOAuth and perform custom CRUD operations to that user within your own app?

    Posted: 07 Aug 2020 01:16 AM PDT

    So from what i know, due to security reasons, using something like google oAuth or any other sites oAuth is the best way to go. Now, you can authenticate that user i get that, so their logged in. Now, as example ill use a todo app. You want that user to have todos, read them, update, and delete them, all linked to that account. Can you do that with these oAuth things? Sorry im quite beginner but all the tutorials ive seen are just to authenticate with google. I hope i explained my question well enough :)

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

    Feeling difficulty with differentiating c programing and all the web coding

    Posted: 07 Aug 2020 12:57 AM PDT

    I found myself confuse lately with both of these entirely different systems.

    What should I do?

    Should I stick to either of them?

    Or should I do both of them with atleast something in common to understand?

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

    Is there such thing as "too much comments"?

    Posted: 07 Aug 2020 12:52 AM PDT

    When I write code, I tend to be really descriptive with my functions especially when it's not obvious what they're actually trying to do.

    But I've noticed lately that when my code get really complex, I tend to write lots and lots of comments. So I was wondering if writing "too much comments" is an actual thing.

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

    Infinite scrolling without waiting fixed time

    Posted: 07 Aug 2020 12:44 AM PDT

    I was looking for a guide how to scrape data with infinite scrollig and I found this

    Infinite Scrolling With Selenium

    It explains, differently from others guides, how to scrape data without waiting a fixed time, but waiting only that the page is loaded. This seems very interesting.

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

    Java help

    Posted: 07 Aug 2020 12:22 AM PDT

    Hi everyone

    How could I make it so that when I input a valid raw number between 1-25,

    the program just displays "The number is (what ever number between 1-25). Instead of first displaying

    "number must be from 1-25" and then displaying "The number is (what ever number between 1-25)"

    So when its valid it should only display "The number is (what ever number between 1-25)"

    and not "number must be from 1-25" and then "The number is (what ever number between 1-25)"

    ---------------------------------------------------------------------------------------------

    import javax.swing.JOptionPane;

    public class InvalidDialogData

    {

    final static String PROGRAM_NAME = "Invalid Dialog Data";

    public static void main (String[] args )

    {

    double number;

    number = getNumber("Enter a number:");

    JOptionPane.showMessageDialog( null,

    "The number is " + number +".", PROGRAM_NAME,

    JOptionPane.PLAIN_MESSAGE);

    }

    private static double getNumber(String prompt)

    {

    String str;

    double number =0;

    boolean valid;

    do

    {

    str = JOptionPane.showInputDialog(null,

    prompt, PROGRAM_NAME,

    JOptionPane.PLAIN_MESSAGE);

    try

    {

    number = Double.parseDouble(str);

    valid = true;

    }

    catch(Exception e)

    {

    JOptionPane.showMessageDialog(null,

    "Invalid number.", PROGRAM_NAME,

    JOptionPane.ERROR_MESSAGE);

    valid = false;

    }

    JOptionPane.showMessageDialog(null,

    "Number must be from 1 to 25.",

    PROGRAM_NAME,JOptionPane.PLAIN_MESSAGE);

    } while(number<1 || number>25);

    return number;

    }

    }

    submitted by /u/After-Expression-181
    [link] [comments]

    Regarding my university

    Posted: 07 Aug 2020 12:10 AM PDT

    So they teach only Java.. shit. I found this out when it was too late because I was told Python, not java.

    Although java is good to learn because it, so far, has made python a breeze. However I want to really know where I can get resources to learn languages for Cybersecurity and cybersecurity software engineering. My language plan so far: Java (thru university), Pyrhon, C++, C#, SQL, and maybe JavaScript.

    If anyone here has experience with cybersecurity or cybersecurity software engineering please let me know :)

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

    What is needed to weekly query api and store the data in db and then display it.

    Posted: 06 Aug 2020 08:17 PM PDT

    Lets say i want to build an app called New York Sunday weather. i want it to show the weather of every Sunday from 2 months ago to the indefinite future just for New York. Lets say i want to use ReactJS.

    I know how to get information from the db to front end but my question is how would i update the db with new weather data every Sunday. Do I run a separate python script to update the db every Sunday and have the data available for react to use? or should this be implemented in React also?

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

    How Does Java Know When Recursion Takes Place And Why Doesn't The Obvious Happen?

    Posted: 06 Aug 2020 08:15 PM PDT

    I'm new to recursion and its really confusing. Take the code below for example. Its a method which finds the factorial of any number.

    The base case is x==1, return 1.

    So if that method keeps looping until x is decremented to 1..............why doesn't the method return 1 no matter what value you put in the method? If x eventually comes down to 1, it should return 1 right?

    It seems like when recursion takes place, Java is changing the rules by which it operates? How is that possible? How does it know that recursion is taking place?

    public static int factorial(int x){ if(x==1){return 1;} return x * factorial(x-1); } 
    submitted by /u/JaguarBolt
    [link] [comments]

    C++ or Java?

    Posted: 06 Aug 2020 11:51 PM PDT

    Thinking of learning a new programming language and I'm between C++ and Java which one do you recommend.

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

    Help with error using service account to invite users to a calendar event.

    Posted: 06 Aug 2020 04:13 PM PDT

    I am currently working on an application where the desired flow is as such:

    1. A gsuite invites a service account to a Google Calendar Event.
    2. That service account then invites other gsuite users to the event.

    I have been using the following api to try to update the attendees list to add new users to the event. https://developers.google.com/calendar/v3/reference/events/patch However, when I try to invite a user using the service account I get the following error: Service accounts cannot invite attendees without Domain-Wide Delegation of Authority.

    However, Domain-Wide Delegation of Authority is enabled for the service account.

    Have any of you run into this issue before or have ideas on how to fix this?

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

    Wildlife/biology related project for a beginner?

    Posted: 06 Aug 2020 07:56 PM PDT

    TLDR; any wildlife/biology related projects for a beginner that would be substantive to building a career?

    Hello. I've spent such a long time on basic fundamentals (almost three months) because I just keep going back to them simply because I can't find a project to work on. I'm stagnating so bad yet I'm literally only at the beginning levels of learning code. I know the best way to learn after learning the fundamentals is to find a project to work on, but I can't think of anything, nor can I even think of where I would begin even if I did have one. Another problem is I don't know what kind of project would be at the right skill level for optimal learning. I don't want something too easy to the point I don't gain any skills or experience, or too hard for obvious reasons.

    I love wildlife, so I was wondering; do you guys have any ideas for a project I could do related to that, and how would I begin actually coding it (in C#)? I'm pretty worried about my future - I only have about three years of college left in CS (after switching majors from two years of biology) and I'd like to get a job right afterwards, so I need to study and work my best until then. I feel like I'm running out of time and chances.

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

    [C++] How do i hook a key without using loops and GetAsyncKeyState?

    Posted: 06 Aug 2020 12:22 PM PDT

    So im on a mission to make this work. I dont want my program to constantly check if a key is down. As for now i use this to hook keys:

    while (!GetAsyncKeyState(VK_END)) { if (GetAsyncKeyState(VK_NUMPAD4) & 1) { //do stuff } } 

    As you can see it needs to check constantly if a key is down :(. Thats very annoying to do that to the pc. Is there a better way to this perhaps similar to how AutoHotKey does it?

    I was suggested the windows function SetWindowsHookEx

    But it seems too complex. How do i make it work for example to do this:

    SetWindowsHookEx(0x44){ //when the key D is pressed Beep(400,500); //send a beep } 
    submitted by /u/SneakyJessica
    [link] [comments]

    C++ - linking C and C++ libraries

    Posted: 06 Aug 2020 11:37 PM PDT

    I'm making a static library in C++ that uses headers from two C libraries, and then the program that uses the static library will also include those headers as well as their static library files. I'm getting undefined references when compiling the program. Do I need to take extra steps in setting up the compilation of either (e.g. extern "C")?

    The two libraries I am using are GLFW 3.3.2 and Dav1dde/glad. My static library includes the headers of both and compiles fine, but I can't compile another program that uses my static library and the .a file of GLFW.

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

    Need a little insight on the complexities between this two different piece of codes. Can you help?

    Posted: 06 Aug 2020 11:27 PM PDT

    I'm trying to solve this Challenge on Hackerank and at first my logic came out to be correct but 4 - 5 test cases did not pass because of the complexity of the program.

    Now in the program i have a check Anagram function which returns a boolean value.

    I found that the simplest to check if two strings are anagrams are not is using the following code:

    def checkAnagram(s1,s2): # if(sorted(s1)==sorted(s2)): # return True # else: # return False 

    Now as i understand that the sorted function in this is the fastest there is. It has the complexity of O(n log n). and since im sorting two of the Strings i suppose the complexity would be O(2(n log n)) and then comparing the string. With this code, my program passed all the test cases.

    But since this is inbuilt i wanted to make something of my own so (without the help of inbuilt function) i came up with the following code:

     count = [0] * 26 for i in range(len(s1)): count[ord(s1[i])-97] +=1 count[ord(s2[i])-97] -=1 for val in count: if val != 0: return False return True 

    Note: i've checked the length of string prior to this and this code only executes if two strings have same length.

    To my surprise this doesn't pass the test. I want to know why and how? the logic of this code is just O(n) + 26 and the previous code i assume is more than O(2 (n log n)). So why didnt my code execute all the test cases. What can i do to make it better?

    submitted by /u/red-hooded9
    [link] [comments]

    Need help understanding 4byte Hexadecimal numbers

    Posted: 06 Aug 2020 07:40 PM PDT

    So im trying to understand why the float number 10 converts to 41200000 as a 4 bytes hexadecimal.

    And that the flat number 20 converts to 41A00000 as a 4 bytes hexadecimal?

    What is the sense of this? Wasnt 10 supposed to be A and 20 supposed to correspond to 14 in hexadecimal?

    What am i missing herE?

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

    No comments:

    Post a Comment