• Breaking News

    Saturday, December 26, 2020

    I am new to learning WebDev. However, while learning, I get demotivated by the fact that there are many Web Developers who have already been through my situation and are far far more experienced than me. How would I compete with them or become better than them? Ask Programming

    AskProgramming

    I am new to learning WebDev. However, while learning, I get demotivated by the fact that there are many Web Developers who have already been through my situation and are far far more experienced than me. How would I compete with them or become better than them? Ask Programming


    I am new to learning WebDev. However, while learning, I get demotivated by the fact that there are many Web Developers who have already been through my situation and are far far more experienced than me. How would I compete with them or become better than them?

    Posted: 26 Dec 2020 03:47 PM PST

    P5.JS QUESTION! Learning how to use Public APIs: How would I integrate the information I've extracted from a .JSON file

    Posted: 26 Dec 2020 10:12 AM PST

    Hello,

    I've successfully extracted data from a public API and pushed the data in to an array (using HTML, CSS, and Javascript).

    I want to create a data visualization tool with P5.JS by creating a line of ellipses with the doubles I've extracted from the .JSON file. How would I implement this in Javascript?:

    $.getJSON("http://api.openweathermap.org/data/2.5/forecast?q=Tokyo&units=imperial&appid={id-key}",function(data){
    //Log to see if data is retrieved
    console.log(data)

    var listOfStats=[];
    var listOfData=data.list;

    var listOfTemp=[];
    for (var i=0;i<listOfData.length;i++){
    listOfTemp.push(listOfStats[i].main.temp+"\n")
    }
    $(".temp").append(listOfTemp);
    });

    I know have an array called listOfStats that has a list of the temperatures from the public API, extracted from a .JSON file (random numbers like 44.19 43.95 44.71 49.69 51.89 50.27 49.26 48.67 47.26 45.5 46.56 49.46 51.85 51.35 49.87 48.25 47.07 45.27 47.23 51.51 53.58 53.44).

    I want to use the p5.js library to draw ellipses with a radius that has the same value has each double value in this array.

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

    How do I add pages to my domain?

    Posted: 26 Dec 2020 09:47 PM PST

    Let's say I have mobilemechanic.com, I know how to upload an index.html and stylesheet through cpanel but how do I add files so that I can have a page at mobilemechanic.com/losangeles?

    Would I upload a losangeles.html file with index.html?

    Also, what do I have to do so the domain is mobilemechanic.com/losangeles and not mobilemechanic.com/losangeles.html ?

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

    How to fix [Error] ld returned 1 exit status?

    Posted: 26 Dec 2020 09:34 PM PST

    https://stackoverflow.com/questions/27272525/what-does-collect2-error-ld-returned-1-exit-status-mean/27272651#:~:text=The%20ld%20returned%201%20exit,the%20consequence%20of%20previous%20errors.&text=The%20exit%20status%20error%20just,exit%20status%20%3E%200%20means%20errors.

    not helpful

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

    The problem is to parse a series of commands that instruct a robot arm on how to manipulate blocks that lie on a flat table. Initially, there are n blocks on the table (numbered from 0 to n − 1) with block bi adjacent to block bi+1 for all 0 ≤ i < n − 1 as shown in the diagram below:

    https://ibb.co/WpWQBYT

    The valid commands for the robot arm that manipulates blocks are:

    • move a onto b

    where a and b are block numbers, puts block a onto block b after returning any blocks that are stacked on top of blocks a and b to their initial positions.

    • move a over b

    puts block a onto the top of the stack containing block b, after returning any blocks that are stacked on top of block a to their initial positions.

    • pile a onto b

    moves the pile of blocks consisting of block a, and any blocks that are stacked above block a, onto block b. All blocks on top of block b are moved to their initial positions prior to the pile taking place. The blocks stacked above block a retain their order when moved.

    • pile a over b

    puts the pile of blocks consisting of block a, and any blocks that are stacked above block a, onto the top of the stack containing block b. The blocks stacked above block a retain their original order when moved.

    • quit

    terminates manipulations in the block world. Any command in which a = b or in which a and b are in the same stack of blocks is an illegal command. All illegal commands should be ignored and should have no effect on the configuration of blocks.

    Input:

    https://ibb.co/pWJ9c7Q

    Output:

    https://ibb.co/Nt03mm3

    [I only type the code of the first command for now.]

    my code:

    #include<stdio.h> #include<string.h> void back(int arr[]){ } int main(){ printf("---Problem 5---\n"); int noi=0; printf("please input n:"); int n; scanf(" %d",&n); int arr[n][n]; int i,j; for(i=0;i<n;i++){ for(j=0;j<n;j++){ arr[i][j]=-1; } arr[i][0]=i; } char str1[5]="",str2[5]; int s,d; while(strcmp(str1,"quit")!=0){ s=0; d=0; while(!(s>=1&&s<n&&d>=1&&d<n)){ scanf(" %s %d %s %d",str1,&s,str2,&d); } if(strcmp(str1,"move")==0){ if(strcmp(str2,"onto")==0){ //empty s for(i=0;i<n&&arr[s][i]!=-1;i++){ arr[arr[s][i]][0]=arr[s][i]; arr[s][i]=-1; } //empty d for(i=0;i<n&&arr[d][i]!=-1;i++){ arr[arr[d][i]][0]=arr[d][i]; arr[d][i]=-1; } //now move s to d i=1; while(arr[d][i]!=-1){ i++; } arr[d][i]=arr[s][0]; arr[s][0]=-1; }else if(strcmp(str2,"over")==0){ }else{ continue; } }else if(strcmp(str2,"pile")==0){ }else{ continue; } } //print results for(i=0;i<n;i++){ printf("%d:",i); for(j=0;j<n&&arr[i][j]!=-1;j++){ printf("%d ",arr[i][j]); } printf("\n"); } } 
    submitted by /u/JacksonSteel
    [link] [comments]

    Trying to get more serious about programming

    Posted: 26 Dec 2020 09:17 PM PST

    Been programming for a few years now, but I've taken lots of long breaks, and never really moved past light intermediate level. I have the book "Microsoft visual c# step by step" by John sharp. It came out in 2017. Is it worth reading? BTW I'm trying to start using unity. Thanks in advance.

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

    What is your favorite way of learning a new technology?

    Posted: 26 Dec 2020 12:11 PM PST

    For example if you wanted to learn a new programming language or library, what kind of resource do you use/how do you do it? I feel like one can either read documentation (more compact but less user friendly), or use tutorials (such as video courses, books, etc., which are less compact/concise but are more user friendly).

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

    Does anyone ever wonder how many million people Stack Overflow has turned away from programming for life?

    Posted: 26 Dec 2020 03:58 PM PST

    Edit: apparently people are assholes here too.

    There's no denying that it's a toxic community, especially for beginners. When I was starting out programming, my beginner-level questions were removed and got tons of hate because I didn't know the technical terms to describe the problems I was having, and as such didn't know what to search for to find the solutions to my problems. Due to the design of Stack Overflow's system, once your post is downvoted to a certain point, you can only regain your karma by answering questions which is impossible to do as a beginner, thus preventing me from participating in the community entirely. The toxicity of that website was enough to push me away from programming for 3-4 years (until I was forced to pick it up again because of university). It's gotten me wondering how many people went through similar situations as beginners, and never got to learn to enjoy programming properly (because once I had proper instruction from tutors, I really got to love it). What are everyone's thoughts?

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

    Don't know how to combine keypad inputs to get multi digit number. ex user inputs 1 then user inputs 3, user signals end of inputs. Input now = 13

    Posted: 26 Dec 2020 07:07 PM PST

    Hello. I've written a bit of code in C for a keypad, it's not super pretty but it works. However i need way more options than the 3x4 keypad provides just using 0 through 9 and the # and * keys. I'm not sure how to combine the inputs to achieve what I want. Strings, variables, concatenation I'm not sure. My aim is to have my code look something like this

    while( keypad input != *){

    wait for user to press key then read key //example user presses "2"

    keypad input = 2;

    store keypad =2;

    //user presses "7"

    keypad input = 7;

    stored keypad 2 = 7; // I imagine using a string here and putting each read value into it would make more sense than using multiple variables? but then I'm still not sure how to get the 27?

    // user presses "*"

    keypad input = * exit loop;

    }
    combine stored keypad 1 and stored keypad 2 and combine them to = "27";

    do stuff in selection 27;

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

    Struggling and Need Some Advice from Programmers.

    Posted: 25 Dec 2020 10:57 PM PST

    Hey guys! I'm new to the sub reddit, and I made this post because I'm in a really tough place with programming. I understand all the basics but I just can't break past into more complicated concepts to do my own projects. I'm almost a college graduate with a degree in Data Analytics but I'm terrified I won't be able to find a job cause I genuinely don't feel like I have any clue how to program anything meaningful. People say to always work on projects but I don't feel like I'm super creative and every time I come up with a project idea I have to give up because it ends up being way too complex for me to understand how to do. I don't have any programming friends so I have no one pushing me, and I feel like I'm being left in the dust and a failure at the one thing I can do with my life.

    What tips do you have for me to practically get better at programming and advanced topics to actually help me break through to understand how to build projects that I want to do? Even things like beginning programming projects sometimes feel complicated to me and I feel so stupid because of it.

    TLDR; I'm lost cause I can't break past the basics of programming and give up on every project due to lack of understanding complexities and lack of drive to code. Any tips are appreciated :/ <3

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

    Beginner programming languages?

    Posted: 26 Dec 2020 11:11 AM PST

    I'm learning programming from scratch, my goal being to learn javascript. Apart from HTML/HTML5 and CSS, which other programming languages are useful to learn for a novice? If someone can recommend a youtube channel that's also very much appreciated! thx for reading

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

    How to really delete all files in a folder on Windows using python?

    Posted: 26 Dec 2020 06:31 PM PST

    import os import glob files = glob.glob('C:\\Users\\0\\Downloads\\preoutput') for f in files: #os.chmod(f, 0o777) os.remove(f) 
    submitted by /u/hwpcspr
    [link] [comments]

    Clearing sys.stdin in python?

    Posted: 26 Dec 2020 12:13 PM PST

    Hello everyone. I'm currently attempting to make a slot machine in python. I want to make the slot machine as follows: My program prints a colored square to the terminal, clears the screen after 0.1 seconds, prints another colored square to the terminal, clears the screen, prints another square. This loop continues until the user presses 'enter'. When the user presses 'enter' the color of the square is saved (square 1).

    Then a square with color 1 is printed to the screen and directly under that square, another colored square is printed to the screen. After the two squares are printed the screen is cleared. After that a square with color 1 is printed to the screen with a square of a different color below the square with color 1. The screen is cleared and when the user presses 'enter' this process is repeated.

    A vertical time lapse of a hypothetical game of slot machine would look like this:

    1. Red square printed to screen
    2. Screen cleared
    3. Blue square printed to screen
    4. user presses 'enter'
    5. Blue square and red square are printed to screen.
    6. Screen gets cleared
    7. Blue square and blue square are printed to screen
    8. Screen gets cleared
    9. Blue square and yellow square are printed to screen
    10. user presses 'enter'
    11. Blue square, yellow square and red square are printed to screen
    12. Screen gets cleared
    13. Blue square, yellow square and blue square are printed to screen.
    14. Screen gets cleared
    15. Blue square, yellow square and yellow square are printed to screen.
    16. user presses 'enter'
    17. Blue square, yellow square and yellow square are printed to screen
    18. Game stops.

    I've been using sys.stdin to see whether the user has pressed 'enter' or not. It works for the first iteration of the program (when the user presses 'enter' to set the first color). But when the first color is set by the user pressing 'enter', sys.stdin "has an enter" in it. So when I get to step 5 of the hypothetical game of slot machine, the color red is immediately selected as the second color. I've been struggeling with this problem for a few days and help would greatly be appreciated

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

    Why doesn't my program let me input anything?

    Posted: 26 Dec 2020 06:00 PM PST

    #include"myheader.h" int main(){ FILE* p=fopen("input.txt","r"); int n; char nstr[10]; fgets(nstr,10,p); n=atoi(nstr); int arr[n]; int i; for(i=0;i<n;i++){ fscanf(p," %d",arr[i]); } mysort(arr,n); printf("Sorted finish.\n"); int target,result; while(1){ printf("Please input your target: "); scanf(" %d",&target); if(feof(stdin)){ break; } result=myBinarySearch(arr,target,0,n-1); if(result==-1){ printf("target not found.\n"); }else{ printf("target found at index %d.\n",result); } } fclose(p); } 
    submitted by /u/JacksonSteel
    [link] [comments]

    How do I even start learning django

    Posted: 26 Dec 2020 01:35 PM PST

    I'm trying to learn django to make a social media app but I can't find any good YouTube tutorials that is just straightforward in how to do things and doesn't make it so complex does any one have any recommendations on what I should use to learn django.

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

    Brainstorming from scratch vs. learning first about a topic

    Posted: 26 Dec 2020 09:18 AM PST

    If I for example wanted to learn about neural networks, should I try to write one from scratch by myself, without any other information (brainstorming), just for the sake of learning? Or should I inform and learn about them directly, and only afterwards try to build one?

    What do you think is the better way to learn? Trying to brainstorm something (taking more time), or first learn about it and then build it (less time and more guided)?

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

    System design resources

    Posted: 26 Dec 2020 03:40 PM PST

    What are the best resources for designing systems now? I'm thinking of doing something like Zappos, but I need some examples

    - 0x1F84481C7625E543

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

    Developing a bit torrent client

    Posted: 26 Dec 2020 06:47 AM PST

    I want to write a simple bit torrent client that can do basic stuff like downloading torrents. I have read some articles about similar projects but still can't find the courage to go forth as it seemed quite daunting. I am thinking of writing it in python but can learn other languages if need be. So, can you suggest some pre requisites or even topics/libraries/resources to check out? Any guidance is also much appreciated. Thanks y'all

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

    How much about cybersecurity does one need to know in order to write secure programs?

    Posted: 26 Dec 2020 07:29 AM PST

    Do you need to specifically know cybersecurity to write secure programs, or do you learn how to write secure code in regular software engineering too?

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

    How to use set and get functions for an array?

    Posted: 26 Dec 2020 07:01 AM PST

    Currently I am learning how to use set and get functions. I was just wondering how to do it and there I can find anywhere online that clearly shows me how to do this. Currently I have something that looks like this :

    class ClubManager

    {

    public:

    ClubManager();

    virtual ~ClubManager();

    string* GetPemail() { return Pemail; }

    void SetPemail(string val) { Pemail = val; }

    protected:

    //===================================================

    /// MEMBER VARIABLES

    //===================================================

    string Pemail[99];

    };

    No comments:

    Post a Comment