• Breaking News

    Wednesday, March 18, 2020

    Which books have substantially helped your programming abilities? Ask Programming

    Which books have substantially helped your programming abilities? Ask Programming


    Which books have substantially helped your programming abilities?

    Posted: 18 Mar 2020 01:58 PM PDT

    How does the WiFi strength icon indicator work?

    Posted: 18 Mar 2020 03:06 PM PDT

    My friend attempted to explain to me today that the WiFi signal strength indicator isn't derived from the speed of the network but rather the strength of the signal being broadcast by the router. He argued that, even though the signal might be strong, the network speeds could be experiencing issues such as throttling.

    This seems reasonable, but I can't seem to find any material to back it up. I figured maybe somebody could point me in the right direction?

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

    Can one learn DSA with the help of C language?

    Posted: 18 Mar 2020 09:38 PM PDT

    Help me! I have a doubt as in C programming language you have to queues stack again n again for tress and other DS and recently i found it a real daunting task . I was thinking to learn C++ instead. What should i do should i stick with c or transit to C++?

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

    How do guitar tuning apps/software work?

    Posted: 18 Mar 2020 10:37 AM PDT

    First of all sorry if this is the wrong sub for a askscience like question

    I am trying to wrap my head around how these would work. Do they compare a the incoming signal to a already pre recorded note and then calculate how far the note is based on it. Or is there another method of doing this that I'm not considering?

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

    Unity3D - Custom Trie Data Structure works in Windows but not Mac/HTML5?

    Posted: 18 Mar 2020 08:11 PM PDT

    Working on a Scrabble-like game in the Unity3D engine, and so I turned a .txt of the Scrabble word dictionary into an alphabetized trie. The structure is relatively simple: every Node in the Trie contains a char Value, an int Depth, a Node parent, a List children, and a List Words. So the word MEATS gets inserted into the Trie as Node A -> E -> M -> T -> S, and the word gets added to the List Words of this S Node. MATES would also get added to the WORDS list of this S node as it has the same letters, as would STEAM, TEAMS, etc.

    The dictionary build process and word lookup work perfectly in-editor and the built .exe (I am working on a PC.) The dictionary is built in about 3 seconds, and given and "hand" of letters can find all possible words in that hand in about 100ms.

    However, when I attempt to build the game in HTML5 or for Mac the word lookup fails. My current Debug Logging is such that all I know is that the list of possible words returned has 0 entries on these platforms. Whether this is because the initial dictionary creation is failing I don't know. I am using Coroutines during the game's Start function (run before all other methods) to build the dictionary trie, but not when populating the word list... is it possible that on Mac and HTML5 (but not on Windows) the list is returned before the lookup has actually been completed? What could be the cause for these platform-specific issues? I am willing to share the code for the Trie class, dictionary trie building and word lookup if that helps at all

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

    C/C++ program that is supposed to create and display a linked list not displaying.

    Posted: 18 Mar 2020 05:00 AM PDT

    I wrote a program that is supposed to create a node, then insert a second node and finally display these two nodes. For some apparent reason the display function is not working. What seems to tbe the issue here.

    CODE:

    #include<stdio.h>

    #include<stdlib.h>

    struct Node

    {

    `int data;` `Node* next;` 

    };

    void create(Node* first, Node* last, int x)

    {

    `first=(Node*)malloc(sizeof(Node));` `first->data=x;` `first->next=NULL;` `last=first;` 

    }

    void insert(Node* first, Node* last, int y)

    {

    `int choice;` `Node* t=(Node*)malloc(sizeof(Node));` `t->data=y;` `printf("1-Insert Node at Start\n2-Insert Node at End ");` `scanf("%d",&choice);` `if(choice == 1)` `{` `t->next=first;` `first=t;` `}` `else if(choice == 2)` `{` `last->next=t;` `t->next=NULL;` `last=t;` `}` `else` `{` `printf("ENTER A VALID CHOICE");` `}` 

    }

    void display(Node* p)

    {

    `while(p != NULL)` `{` `printf("%d",p->data);` `p=p->next;` `}` 

    }

    int main()

    {

    `int x;` `int y;` `Node* first;` `Node* last;` `printf("Enter First Value: ");` `scanf("%d",&x);` `create(first,last,x);` `printf("\nEnter Second Value: ");` `scanf("%d",&y);` `insert(first,last,y);` `display(first);` 

    }

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

    Mini Rambo 1.3 - Voltage Input

    Posted: 18 Mar 2020 01:55 PM PDT

    Hello, I am not used to programming using Arduino boards / pins, so I have a few questions.

    I have a Mini Rambo 1.3, which is hooked up to a LCD monitor, and eventually a plasma cutting machine. In the long run I am trying to do resolve this issue. https://github.com/MarlinFirmware/Marlin/issues/16695

    Currently, I have a voltage divider, and am trying to read the voltage from the Fan2 pin and take it as input through analog input (T1/T2?) I understand the examples for standard Arduino boards ( https://www.instructables.com/id/Arduino-Reading-Analog-Voltage/ ), but am unsure of what the code is that represents specific pins on my board. I'm sure the coding itself isn't long or difficult, so an example/solution would be very helpful.

    Thank you!

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

    How do I change the number of my y-axis to the mm:ss time format?

    Posted: 18 Mar 2020 03:51 PM PDT

    I have a bit of code to create a plot of the best times for each distance per season in speedskating. Currently it looks like this, which is decent but I want the numbers of the y-axis to be 1:08.50 instead of 68.5 and so on. I've looked around online but I can't find how to do that. Can anyone here help me with that?

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

    How the fuck do I read man pages?

    Posted: 18 Mar 2020 03:30 PM PDT

    I have been developing for years, but somehow this is a gap in my knowledge that I have never filled.

    I do not know how to read help pages and then make the commands out of them.

    For example, with the git command:

    usage: git remote add [<options>] <name> <url>

    --mirror[=(push|fetch)]

    What syntax is --mirror[=(push|fetch)] ?

    It looks like regex, but I'm not sure. Where can I read about this standardized syntax that all man/help pages use?

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

    HTML beginner needs help with a problem...

    Posted: 18 Mar 2020 10:59 AM PDT

    I'm currently practicing HTML inputs. I noticed that when I ran this code. The drop down list outputs one option twice. At first I thought it must just be because I placed text in between the opening and closing option tags, even though I already gave them a value. However, if that's the case. Why aren't the other two options being output twice, just like the last one?

    ...sorry I'm stupid. Please explain. I've tried this is different code editors to make sure it wasn't simply a bug. However the outcome is the same in each one

    https://imgur.com/a/VYnPjm1

    https://imgur.com/a/SaPmO31

    https://imgur.com/a/8I9MIFs

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

    Wanted to make a keyboard remapping software

    Posted: 18 Mar 2020 02:37 PM PDT

    Hey guys, i am a freshman in college and was thinking of making a keyboard remapper so i could open applications or do specific application actions using a combination of keys as a side project. But i dont know where to get started. Any help would be appreciated. Thanks!

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

    Anybody know how to de-obfuscate things?

    Posted: 18 Mar 2020 04:36 PM PDT

    I have a program for a game that I purchased, but the GUI is in Russian. The guy who sold me it didn't finish the English version, and won't let me do it myself, and said he isn't going to do it, and the program is obfuscated. I was wondering if anybody knew how to make it so I can do it myself.

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

    Is it just me or do you find yourself skipping through tutorials to the good stuff?

    Posted: 18 Mar 2020 06:34 AM PDT

    I find myself often watching YouTube tutorials in 2x and even then skipping to the good / useful parts. Eg I'm doing the CS50 gaming course (free on YouTube), currently doing the pong part.

    Is it perhaps because I already know programming concepts and have coded quite a bit? There just seems to be a lot of talking about non-important stuff. Not a criticism of CS50, I find myself doing this with alot of coding tutorials.

    Just wondering if others do this too?

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

    [JS] I tried to invent a command prompt system, but I am unsure whether this code is good or bad form.

    Posted: 18 Mar 2020 11:16 AM PDT

    Hello!

    I was trying to make a command-prompt-style thing, and this is what I came up with. I have no idea whether it is ok, and I have only today learned how to make object methods, so if you could tell me where I am wrong, and which part of code could be improved, and how the whole system compares to an optimal one, I'd be very grateful.

    https://www.w3schools.com/code/tryit.asp?filename=GCYGQASLRP67

    I tried to port this to jsfiddle for people who prefer it, but the result didn't seem to work at all. And I tried on 3 browsers. Weird.

    Anyway. My little example takes your input and when you press the button it changes the button to good or bad response.

    I made a little object with properties. The text input reacts to two commands. "o" and "options". One of them is the main one, and the other one just redirects to it. Then a method is activated.

    I made use of the trick in objects where you can access a property via bracket notation, and that gives me the power to just slap any string I want and check whether such a command property exists.

    This system looks more fancy and programming-like to me than making switches and cases, but I am afraid what might happen if I have 100 commands, and the program has to loop through them all to find the correct one.

    Please give advice!

    Thank you !

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

    Assistance in identifying the similarity between news articles using cosine-similarity

    Posted: 18 Mar 2020 11:13 AM PDT

    TL;DR i'm currently creating a cross-platform mobile news aggregator, which will identify news articles from different publishers, but about the same topic, e.g. a celebrity passes away.

    I believe I found an appropriate journal that can guide me through the steps 'Document Clustering with grouping and chaining algorithms'.
    (https://www.aclweb.org/anthology/I05-1025.pdf)

    However many of the steps are confusing me such as:

    1) Document clustering

    2) Grouping and chaining algorithms

    3) Understanding equations such as step 3 of 'Identical Word Similarity' (page 2/12)

    Any help on the matter, or a brief description of the steps would be greatly appreciated.

    Thanks for the help.

    I'm also interested in any experts in this field, and would love to use your knowledge as qualitative evidence for my project. If you'd be be up for it please DM, or drop a comment. Thanks again!

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

    What key concept am I missing?

    Posted: 18 Mar 2020 06:22 AM PDT

    Hi everyone! I've run into a bit of a stump here and thought that this sub could be a good place to ask. I'm sorry if this isn't the usual sort of thing that is posted here; it's my first time looking.

    So for some context, I am an adult in my early 20's. I learned how to code HTML, CSS, etc. when I was much younger. When I went to university I intended to minor in computer science and took all of the required courses (I ended up with a math minor instead because I couldn't pass my Assembly class). I took classes on Java, data structures, Assembly, and a course where we did projects in various different languages, essentially a tools class to teach us how to use our resources.

    But I always come to this stump where I am completely unable to understand anything past a certain point. I can figure out the problem mathematically and I feel like I know the answer, but when it comes to writing a bunch of loops and statements, I just get so lost. When the variable i starts getting used in counters to increment something and then you have to put it with other things, I have absolutely no idea what to do. But I feel that I understand how loops and if/else statements work, and how counters work, so I'm not sure why I never know how to implement them. It's frustrating because I feel like I understand the basic concepts but there is just one "A-ha!" that isn't clicking and is preventing me from learning further. I would like to learn how to code because I've always had a project I wanted to start, and being isolated recently has given me a lot of free time to learn outside of university (I'm a grad student in an unrelated field).

    If anyone has been in a similar rut or has any resources that they feel may help me, please let me know! I just feel like there's this last learning curve that I need to get over.

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

    As an independent programmer, what do you expect a client to already have prepared when approaching you for a commission?

    Posted: 18 Mar 2020 09:01 AM PDT

    I don't mean money wise, just content wise. (If someone comes to you wanting to write a training program for a job, the "next big game", or a simple website)

    Basically, what do they need to make it easier for you to turn their vision into reality? You can be specific or general. Anecdotes are welcome.

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

    C Program Issues

    Posted: 18 Mar 2020 07:33 AM PDT

    I need help figuring out the issues in my C program. Thank you! It will store roster and rating information for a soccer team. Coaches rate players during tryouts to ensure a balanced team.

    (1) Prompt the user to input five pairs of numbers: A player's jersey number (0 - 99) and the player's rating (1 - 9). Store the jersey numbers in one int array and the ratings in another int array. Output these arrays (i.e., output the roster). Ex:

    Enter player 1's jersey number:

    84

    Enter player 1's rating:

    7

    Enter player 2's jersey number:

    23

    Enter player 2's rating:

    4

    Enter player 3's jersey number:

    4

    Enter player 3's rating:

    5

    Enter player 4's jersey number:

    30

    Enter player 4's rating:

    2

    Enter player 5's jersey number:

    66

    Enter player 5's rating:

    9

    ROSTER

    Player 1 -- Jersey number: 84, Rating: 7

    Player 2 -- Jersey number: 23, Rating: 4

    ...

    (2) Implement a menu of options for a user to modify the roster. Each option is represented by a single character. The program initially outputs the menu, and outputs the menu after a user chooses an option. The program ends when the user chooses the Quit option. For this step, the other options do nothing. Ex:

    MENU

    u - Update player rating

    a - Output players above a rating

    r - Replace player

    o - Output roster

    q - Quit

    Choose an option:

    (3) Implement the "Output roster" menu option. Ex:

    ROSTER

    Player 1 -- Jersey number: 84, Rating: 7

    Player 2 -- Jersey number: 23, Rating: 4

    ...

    (4) Implement the "Update player rating" menu option. Prompt the user for a player's jersey number. Prompt again for a new rating for the player, and then change that player's rating. Ex:

    Enter a jersey number:

    23

    Enter a new rating for player:

    6

    (5) Implement the "Output players above a rating" menu option. Prompt the user for a rating. Print jersey number and rating for all players with ratings above entered value. Ex:

    Enter a rating:

    5

    ABOVE 5

    Player 1 -- Jersey number: 84, Rating: 7

    ...

    (6) Implement "Replace player" menu option. Prompt user for jersey number of player to replace. If player is in roster, then prompt again for a new jersey number and rating. Update the replaced player's jersey number and rating. Ex:

    Enter a jersey number:

    4

    Enter a new jersey number:

    12

    Enter a rating for the new player:

    8

    My code:

    #include <stdio.h>

    int main(void)

    {

    //declare the variables

    char option = ' ';

    int jersey[5];

    int rating[5];

    int jer = 0, rate = 0, index, k = 0;

    //read the player's jersey number and rating

    for (int i = 0;i < 5;i++)

    {

    printf("Enter player %d's jersey number:\n", i + 1);

    scanf("%d", &jer);

    jersey[i] = jer;

    printf("Enter player %d's rating:\n", i + 1);

    scanf("%d", &rate);

    rating[i] = rate;

    //printf("\n");

    }

    //print the player's jersey number and rating

    printf("\nROSTER\n");

    for (int i = 0;i < 5;i++)

    {

    printf("Player %d -- Jersey number: %d, Rating: %d\n", i + 1, jersey[i], rating[i]);

    }

    int i = 0;

    //iterate a loop

    do

    {

    //print the menu

    printf("\nMENU\n");

    printf("u - Update player rating\n");

    printf("a - Output players above a rating\n");

    printf("r - Replace player\n");

    printf("o - Output roster\n");

    printf("q - Quit\n");

    printf("\nChoose an option:\n");

    scanf(" %c", &option);

    //use switch case

    switch (option)

    {

    case 'u':

    //update the player's rating

    //read player's jersey number and new rating

    printf("\nEnter a jersey number:\n");

    scanf("%d", &jer);

    printf("Enter a new rating for a player:\n");

    scanf("%d", &rate);

    //search for the player

    for (i = 0;i < 5;i++)

    {

    if (jersey[i] == jer)

    break;

    }

    //update the ratings

    index = i;

    rating[index] = rate;

    break;

    case 'a':

    //Output players above a rating

    //read a rating

    printf("\nEnter a rating:\n");

    scanf("%d", &k);

    //print the players above a rating

    printf("\nABOVE %d\n", k);

    for (int i = 0;i < 5;i++)

    {

    if (rating[i] > k)

    {

    printf("Player %d -- Jersey number: %d, Rating: %d\n", i + 1, jersey[i], rating[i]);

    }

    }

    break;

    case 'r':

    //Replace player

    //read the jersey number

    printf("\nEnter a jersey number:\n");

    scanf("%d", &jer);

    //search for the player

    int p;

    for (p = 0;p < 5;p++)

    {

    if (jersey[p] == jer)

    break;

    }

    index = p;

    //read new player's jersey number and rating

    printf("Enter a new jersey number:\n");

    scanf("%d", &jer);

    jersey[index] = jer;

    printf("Enter a rating of new player:\n");

    scanf("%d", &rate);

    //replace the player

    rating[index] = rate;

    break;

    case 'o':

    //output roster

    printf("\nROSTER\n");

    for (int i = 0;i < 5;i++)

    {

    printf("Player %d -- Jersey number: %d, Rating: %d\n", i + 1, jersey[i], rating[i]);

    }

    break;

    case 'q':

    break;

    default:

    break;

    }

    } while (option != 'q');

    return 0;

    }

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

    What would be needed to develop a gps tracking app for everyone’s phone to calculate risk for virus exposure? Are private companies able to access everyone’s phone gps info to map out user interaction? I am mostly curious how to calculate risk for exposure by location and time through gps data.

    Posted: 18 Mar 2020 11:07 AM PDT

    why doesn't the government / private companies push for authorization to track everyone's phone to find out who is at risk for virus exposure?

    Would this be a privacy issue? Even if it was mandated that the information cant be used for anything else? I imagine if everyone has a phone with gps, and it is known who is positive for a virus, they would be able to track specific locations and times where people would be at risk for getting infected. Everyone could then review the daily results and find notice for locations theyve been exposed to know if they should place themselves in self quarantine or to get to a hospital. Or would this cause a false sense of security? Im staying home and not doing anything, but i know ill need to get groceries and pharmacy items/prescriptions in the near future and want to know if there is any risk of exposure. Assuming everything and everyone is at risk is a terrible way to live for the next year and a half. I suppose i have the option for home delivery, but that too poses risks for warehouse/fulfillment center workers as well as the delivery drivers.

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

    Android BottomNavigation problem

    Posted: 18 Mar 2020 07:10 AM PDT

    Hi,

    I created a bottom navigation module in one of my projects and the xml doesn 't show as it s supposed to. I created a total different project just with this side of the project(the bottom navigation ) and it works just fine. So in both places I have the same code (xml,classes,gradle,etc) but one of the is an app the other one is a library.

    https://imgur.com/a/MGDJpyA - the not working one

    https://imgur.com/a/NugPRq7 - how it s supposed to be

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

    Need some help with creating a loginform php sql

    Posted: 18 Mar 2020 06:55 AM PDT

    1. <?php
    2. $host="localhost";
    3. $user="root";
    4. $password="";
    5. $db="demo";
    6. mysql_connect($host,$user,$password);
    7. mysql_select_db($db);
    8. if(isset($_POST['username'])){
    9. $uname=$_POST['username'];
    10. $password=$_POST['password'];
    11. $sql="select * from loginform where user='".$uname."'AND Pass='".$password."' limit 1";
    12. $result=mysql_query($sql);
    13. if(mysql_num_rows($result)==1){
    14. echo " You Have Successfully Logged in";
    15. exit();
    16. }
    17. else{
    18. echo " You Have Entered Incorrect Password";
    19. exit();
    20. }
    21. }
    22. ?>

    My database is called demo, the table is called loginform. The columns are called ID, User and Pass. The stored data is admin and admin.

    Not sure what im doing wrong, I get an error message,I go on localhost:8080 and select the page but shouldnt my current iteration still work?

    A PHP Error was encountered

    Severity: 8192

    Message: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead

    Filename: views/home.php

    Line Number: 31

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

    Change Python's Tkinter Label based on event from other file

    Posted: 18 Mar 2020 05:57 AM PDT

    Hello everyone,
    I am trying to create a simple Tkinter window with only 2 Labels (2 text-boxes), but each Label's content-text will change based on an event (let's say user's input) in an other python file.
    I tried a lot of things but couldn't let's say bypass the Tkinter's mainloop and didn't really understand how to actually run code after this mainloop.
    Please see below a code sample I tried .

    The main concept of the script will be :

    1)there will be an open tkinter window

    2)the user types different words (not in the tkinter window)

    3)these words are automatically shown in 2 tkinter labels-textboxes (dn)

    4)the user presses a button and chooses one of them

    That is the idea. I don't know how to pass the words typed in an other window to the tkinter main window. The code you provided is perfect but I want to change the label based on user's input on another shell - window (after typing and pressing enter)!!!

    from tkinter import * from time import sleep root = Tk() var1 = StringVar() var1.set('hello') l1 = Label(root, textvariable=var1) l1.pack() var2 = StringVar() var2.set('hi') l2 = Label(root, textvariable=var2) l2.pack() while (True): x = input("Give an input") if x == "one": var1.set(x) root.update_idletasks() else: var2.set(x) root.update_idletasks() 
    submitted by /u/ppel123
    [link] [comments]

    When to implement a Lib vs Service? Context in the description.

    Posted: 18 Mar 2020 05:27 AM PDT

    At my company we have some services that make access to other services, for example, we have a service that interfaces Elastic Search. My doubt is the following, is this the right approach? Right now there we have a movement to decrease our operational cost, given this situation, what would be the pros and cons to make this service a Library(i.e package) instead of a service(i.e running in a server with N machines).

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

    What would you wish to make more time for?

    Posted: 18 Mar 2020 05:00 AM PDT

    As a successful programmer, what would you wish to make more time for in your life?

    submitted by /u/Rawad_Al-Kattan
    [link] [comments]

    No comments:

    Post a Comment