• Breaking News

    Thursday, September 26, 2019

    My hands are frozen at work every day. What finger less gloves do you recommend for being able to type and keep the hands warm? Ask Programming

    My hands are frozen at work every day. What finger less gloves do you recommend for being able to type and keep the hands warm? Ask Programming


    My hands are frozen at work every day. What finger less gloves do you recommend for being able to type and keep the hands warm?

    Posted: 26 Sep 2019 11:09 AM PDT

    EDIT: I ended up ordering a pair from amazon.

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

    I'm looking for a blog post about how the entire world is relying on incomprehensible spaghetti code that has been written since the 1950s.

    Posted: 26 Sep 2019 01:05 PM PDT

    It's long and dreadful. It talks about banks and airlines etc and how it could all collapse at any second. I read it years ago but can't remember the name of it or author, and I really want to find it. If anyone knows what I'm talking about, or could point me to a better place to ask the question, it would be greatly appreciated. Thank you.

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

    Can someone help me understand Android Documentation?

    Posted: 26 Sep 2019 03:23 PM PDT

    This is ridiculous. Let's say I'm trying to figure out what R.id class does, where am I supposed to get the information for context of use, if android itself doesn't provide that. Am I doing something wrong? How am I supposed to figure out what all these classes do?

    https://developer.android.com/reference/android/R.id#button2

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

    Verbally communicating pointers/nodes in a linked list

    Posted: 26 Sep 2019 02:37 PM PDT

    Hello /r/AskProgramming,

    This may seem like a bit of an odd topic, but I was just wondering if someone could help me with my verbal communication of what I should be saying "pointer" vs. "node". English is not my native language and pointers are new to me, but I want to be verbally correct when talking to other programmers.

    Let me give an example. Here is the problem of adding two numbers represented as linked lists. The main algorithm just uses stacks and pops them back out.

    Input: (7 -> 2 -> 4 -> 3) + (5 -> 6 -> 4)

    Output: 7 -> 8 -> 0 -> 7

    The algorithm part isn't what's import to me, but I just thought I'd explain with an example. Here is the full code:

    /** * Definition for singly-linked list. * public class ListNode { * int val; * ListNode next; * ListNode(int x) { val = x; } * } */ class Solution { public ListNode addTwoNumbers(ListNode l1, ListNode l2) { Deque<ListNode> stack1 = new ArrayDeque<>(); Deque<ListNode> stack2 = new ArrayDeque<>(); while(l1 != null) { stack1.addFirst(l1); l1 = l1.next; } while(l2 != null) { stack2.addFirst(l2); l2 = l2.next; } ListNode node = new ListNode(0); int sum = 0; while(!stack1.isEmpty() || !stack2.isEmpty()) { if(!stack1.isEmpty()) sum += stack1.removeFirst().val; if(!stack2.isEmpty()) sum += stack2.removeFirst().val; node.val = sum % 10; ListNode head = new ListNode(sum / 10); head.next = node; node = head; sum /= 10; } return node.val == 0 ? node.next : node; } } 

    So, I am just having trouble verbally communicating what is what. In particular, what is a pointer and what is not for each of these example lines:

    Example 1

    public ListNode addTwoNumbers(ListNode l1, ListNode l2) 

    Would it be more grammatically correct to say:

    "We are being given in the head node of each one of these linked lists"

    OR

    "We are being given two pointers representing the head nodes of each linked list"

    Example 2

    ListNode node = new ListNode(0); 

    Would it be more grammatically correct to say:

    "We create a new node that will keep the current digit"

    OR

    "We create a new pointer to a node that will keep the current digit"

    Example 3

    head.next = node; 

    How would you describe this operation verbally?

    Any other tips you have the could help me with my pronunciation with this pointer concept would be greatly appreciated, thanks!

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

    How do you make a terminal command?

    Posted: 26 Sep 2019 07:36 PM PDT

    I'm making a programming language, and having to type out python language.py file.txt to run a script feels very unofficial. How do I make it so that I can just type language file.txt? btw I'm completely unqualified to be writing a programming language in case you couldn't tell

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

    Hello. I need help with my high school turtle python simple game project. It’s like a snake game. It’s not complete yet because I don’t know how to complete it and I don’t know why after the turtle draw the ( “food and snake home”) everything just disappear and no error showed

    Posted: 26 Sep 2019 06:40 AM PDT

    from turtle import *

    screen = Screen()

    jen = Turtle()

    jen.speed(100)

    jen.pd()

    jen.width(20)

    &#x200B;

    j = Turtle()

    j.pd()

    j.width(20)

    for _ in range (5):

    j.pu() j.fd(20) [j.lt](https://j.lt)(30) j.fd(50) j.rt(56) j.fd(60) j.pd() j.fd(30) [j.lt](https://j.lt)(60) j.fd(100) [j.lt](https://j.lt)(45) j.fd(85) 

    &#x200B;

    for _ in range (10):

    jen.pu() jen.fd(30) [jen.lt](https://jen.lt)(60) for i in range (15): jen.pu() jen.bk(100) jen.pd() jen.rt(i \* 2) jen.fd(i) 

    &#x200B;

    for i in range (15):

    jen.pu() jen.bk(100) jen.right(36) for i in range (15): jen.pu() jen.bk(160) jen.pd() jen.rt(i \* 2) jen.fd(10) 

    &#x200B;

    t = Turtle()

    def move():

    t.forward(10)

    &#x200B;

    if t.distance(square) < 2:

     jen.reset() 

    screen.onkey(lambda: turtle.left(45), 'Left')

    screen.onkey(lambda: turtle.right(45), 'Right')

    screen.onkey(move, 'Up')

    &#x200B;

    screen.listen()

    screen.mainloop()

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

    Umm?

    Posted: 26 Sep 2019 06:03 PM PDT

    How do I ask a question about my code if I cant send a photo? Am I supposed to type in 100 lines of code?

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

    Can someone please help me out with this problem?

    Posted: 26 Sep 2019 04:11 AM PDT

    So a few days ago a friend of mine was asked to code this pattern:

    2

    4 6

    6 10 8

    8 16 18 10

    10 20 26 46 12

    .....goes on infinitely

    They couldn't and then they asked me to do the same later. Now, I'm generally alright with patterns but this one is driving me mad at this point. I just can't figure it out. At first, I thought it was a weird pascal triangle of sorts but that fails on the 5th line.

    Can anyone spot any pattern here?

    Edit: For anyone looking for any answer kindly refer to this post: https://www.reddit.com/r/learnprogramming/comments/d9iaid/can_someone_please_help_me_with_this_pattern/?utm_medium=android_app&utm_source=share :)

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

    HTML5: Multiple audio files or one large one?

    Posted: 26 Sep 2019 12:44 PM PDT

    I have a page with multiple audio files. The user can click on one (one a at time) and play it. I'm wondering if it's best practice to have an audio file for each element or have one large audio file with all the sounds cut together in one track where JavaScript jumps to the correct time when the user clicks.

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

    Where can I learn programming, but not the "coding" part?

    Posted: 26 Sep 2019 03:43 PM PDT

    Sorry if this doesn't really make sense, but I'm trying to understand how everything interacts in terms of .dll's and solutions and how I should be debugging large projects in visual studio. Right now I'm writing scripts in C# (self taught) for a pretty big software suite. I'm struggling to understand the terminology and what I should be looking into when it comes to programming and not writing the actual code. I've recently gotten a decent grasp on git and want to understand more about things like bamboo/build machines, and how everything actually relates. Sorry I wish I could ask this question better but I'm struggling to figure out what else I should be learning.

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

    Magic Mirror Module doesn't work

    Posted: 26 Sep 2019 03:08 PM PDT

    Hi,

    I'm a total beginner to this and have only installed 3 modules previous to this one. When I try to add this new one (MMM-SL-PublicTransport) the magicmirror displays the message 'Please create a config file.'

    If anyone could help me out I would be very grateful ! I posted the code in this forum (couldn't figure out the formatting on reddit) including the module above it (MMM-Screencast, which works fine):

    https://forum.magicmirror.builders/topic/11229/transportation-module-doesn-t-work

    Thanks in advance

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

    How to make my own API for a website? (That doesn't belong to me)

    Posted: 26 Sep 2019 08:21 AM PDT

    How do I make an API for another website? The website can show the information, but the company doesn't want to make/publish the API. How can I make an API for it? (Let's assume that the website is not going to update)

    submitted by /u/nom-_-mon
    [link] [comments]

    Native GUI Toolkits, in all the languages

    Posted: 26 Sep 2019 01:09 PM PDT

    I hope this is the correct reddit for this. I am investigating various GUI toolkits for a language written in the language itself. This is not a production-related project, but mostly for fun and learning.

    I want to know which programming languages come with its own GUI toolkit written in the language itself. I have so far :

    C : GTK+

    C++: QT

    Java : SWT

    d : DLangUI

    PYthon : Toga

    Delphi : I dont know the name but it comes with its GUI toolkit - at least the Lazarus version

    TCL : Tk

    What other languages come with their own GUI toolkit written natively in the same language, not a wrapper to QT/GTK etc.

    Looking forward to read your answers. Thank you.

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

    How do I bind to desktops remote address?

    Posted: 26 Sep 2019 12:15 PM PDT

    Im currently following a course on networks. We make webservers and chatroom server/clients. All of the labs are done with localhost, but whatever I google, I can't seem to find a way to actually make a program that allows other desktops from around the world able to connect to my pc. Every example is making use of localhost and only works when ran locally. We're working with the python socket module.

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

    MathJax

    Posted: 25 Sep 2019 10:29 PM PDT

    Hello programmers of Reddit!

    I am making a website that uses MathJax, but everytime i convert to MathJax i have to reload the page. Is there a way without updating the page everytime?

    submitted by /u/nom-_-mon
    [link] [comments]

    Help with robot.txt

    Posted: 26 Sep 2019 09:38 AM PDT

    I need help with robot.txt URL are dynamic, example www.test.com/abbc?somethingbla3fcrk. I want to disallow URL that have something in it. What is best way to to this? Thanks Here is my example but I don't know if its right User-agent: * Disallow: /*something

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

    How to use a random value more than once? [DrRacket]

    Posted: 26 Sep 2019 09:13 AM PDT

    The problem with this function is that each time (+ base (random random-upper)) is called, it returns a different value, but I need to refer to the same sum 3 times. How can I make the helper function? I tried making it, but I am still getting different numbers.

    ; loki : PosInt PosInt PosInt PosInt -> Boolean

    ; Determines if the base, plus a random number in a bound, is even and within a threshold

    (define (loki base random-upper too-small too-big)

    (and (even? (+ base (random random-upper)))

    (> (+ base (random random-upper)) too-small)

    (< (+ base (random random-upper)) too-big)))

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

    How can I find out what job suits me?

    Posted: 26 Sep 2019 04:46 AM PDT

    I currently work in automotive industry and I want to change things up. How can I find what suits me?

    I think I would love to try out something that involves graphics. I'm more of a visual guy, I like working on small details. Something that you have to create from scratch, from the way it looks to how it works. Where do you guys think I should start?

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

    Spacing issue when writing code in VIM and pushing to GitHub

    Posted: 25 Sep 2019 11:54 PM PDT

    Hi there, When I write code in vim, it looks something like this: Message(const string &athr, // author const string &sbjct, // subject const string &bdy); // body When I upload my code to GitHub or another text editor like Gedit, it looks like this: Message(const string &athr, // author const string &sbjct, // subject const string &bdy); // body I saw that the default tab spacing is set to 8 and when I manually change the GitHub editor's tab spacing to 4, it reverts back to what I would want

    Is there a work around to help keep the spacing consistent for all editors? I am a student taking an Intro to Computer Science course and I'm getting points taken off for inconsistent spacing.

    Thanks for taking the time to read this.

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

    No comments:

    Post a Comment