• Breaking News

    Sunday, September 1, 2019

    Is writing your own libraries from scratch really as bad as many programmers say? What's your stance? Ask Programming

    AskProgramming

    Is writing your own libraries from scratch really as bad as many programmers say? What's your stance? Ask Programming


    Is writing your own libraries from scratch really as bad as many programmers say? What's your stance?

    Posted: 01 Sep 2019 07:36 PM PDT

    I've been programming for around nine years now. For the vast majority of that time, I've rarely ever used public libraries or frameworks unless absolutely necessary in favor of writing my own from scratch. However, this mentality seems to be a bit controversial within the industry. Why is that?

    As for me, my reasoning was that it is often easier to develop a solution which is very specific to my needs without going through the hassle of trying to decrypt someone else's code. What's your stance and why?

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

    Automate data sending through a device connected to a USB port.

    Posted: 01 Sep 2019 01:09 PM PDT

    In my work, we are selling GPS tracking solutions. The GPS tracking device will be connected to a USB port and will be configured using a third-party software provided to us. This third party software just sets the settings on the devices such as: the IP address to send data to, SMS username and passwords, etc.

    The device configuration process is very simple:

    • Plug in the GPS device into the USB port.
    • Select a preset setting to be used for the device.
    • Click the "send" button in the software to send the setings to the device.
    • Wait for some time for the sending to finish.
    • Disconnect the device.

    This gets very tedious as we need to configure hundreds of devices every day. I want to learn a way to automate this process. I want to build a program that will automatically send the configuration to the device every time it gets connected to the port.

    I have an assumption on how this can be done.

    • Somehow capture the data (probably with a USB analyzer/sniffing software) being sent to the device while using the third party software.
    • Use the captured data to somehow programmatically send the data to the device.

    I am already knowledgeable in JavaScript/NodeJS, but if you have any knowledge how to do this in other languages, please don't hesitate to share.

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

    What techniques offer the least benefit when applied less than expertly?

    Posted: 01 Sep 2019 02:25 PM PDT

    I just read Sandi Metz's Breaking Up the Behemoth post and keep thinking about this diagram asserting that introducing OO in a simple program adds more burden than it relieves. In the post, she gives heuristics for recognizing the complexity inflection point, but doesn't address the question "what if OO is applied without the right abstractions?". This question can be applied to all programming techniques, tools, features, paradigms, etc, not just OO (e.g. hungarian, purity, immutability, futures, callbacks, TDD, inheritance, etc).

    Please answer from your preferred paradigm to avoid interparadigm holy wars.

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

    Web scraping articles? Is it legal/possible?

    Posted: 01 Sep 2019 03:27 PM PDT

    Hey all,

    Quite new to coding and I've got a project idea which would more than likely require from what i understand something called web scraping. How do they work? Is it legal to get an article from a website and republish it? (Would still 100% give credits)

    Thanks.

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

    [C] I can't get the factorial of numbers greater than 34.

    Posted: 01 Sep 2019 01:52 PM PDT

    first of all sorry for my english.

    I am studying programming and they asked me for a calculator with the function to get factorials included.

    The point is that from number 35 the factorials result in 1.#INF00

    Any solution to this? Thanks.

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

    A little help with this regex

    Posted: 01 Sep 2019 01:00 PM PDT

    I hope this is okay to post here, I haven't been able to find something similar to this online so I was wondering if someone could give me a hand.

    Just to clarify, I'm an SE student and I don't work in the development team for my company, I work as part time customer service assistant. I'm writing this app not for the company but to challenge myself, and it may come in useful at some point in my job but I'm stuck on the regex expression I need.

    I'm writing an JavaScript tool which takes a stockroom location and gives a "check character" (a letter A to Z which is said alongside the location to verify our voice system has picked up the location correctly. I've already written the algorithm for this.

    A location can only contain a-zA-Z0-9 except the last character which can be either alphanumeric or be + or -. For for example;

    03AV is valid 09A+ is valid +09A is invalid ABCD is valid AB#D is invalid

    When the user begins typing, and characters which aren't allowed are removed automatically so you can't add a space, special character etc. This is done by a jQuery input event where all illegal characters are removed.

    I was wondering if someone could help with a regex which would only allow the last character in the string to be +, - or alphanumeric and all characters before it alphanumeric only. As the expression is run every time a character changes the location might not be 4 characters long.

    The closest I've got so far is

    /[a-zA-Z0-9]+[a-zA-Z0-9+-]$/g

    But it doesn't seem to be working. I've tried quite a few different ways too but none of them seem to be working.

    Thanks in advance and sorry for the slightly longer than expected explanation.

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

    Getting a weird seg fault

    Posted: 01 Sep 2019 08:17 PM PDT

    I have tried to create the same behavior in a more minimal program and have not been able to - basically, I have a function that takes a 3 component vector (glm::vec3) as one of it's input arguments. This function is called with a glm::vec3 that was initialized in the calling function. But in my project, I am getting a seg fault then when trying to access any of the components of the vector. In the more minimal program, I am not getting the same behavior. Quick video showing the issue, with some annotations given as comments.

    submitted by /u/0xBAMA
    [link] [comments]

    New programmer in need of homework help ASAP

    Posted: 01 Sep 2019 07:11 PM PDT

    Hello,

    I am working on an assignment for my CMIS 141 class and I am stuck. We are working in Java and I am coming up with an error that I am not sure what to do with. I have attached the copy of the code. Any help would be greatly appreciated.

    public class Homework1TestCase {
    private static Scanner Scannerln;
    public static void main(String [] args) {

    // Declare the variables
    long EMPLID;
    int quiz1;
    int quiz2;
    int quiz3;
    int ageMonths = 0;
    int celsius;
    // Program will use Scanner class to collect data
    Scanner scannerIn = new Scanner(System.in);
    // Student will input date
    System.out.println("Enter your Student EMPLID: ");
    // The nextLong() method scans the next long value
    EMPLID = Scannerln.nextLong();
    // Student will input date
    System.out.println("Enter your quiz 1 percentage score (0.0-100.0): ");
    // The nextInt() method scans the next short value
    quiz1 = Scannerln.nextInt();
    // Student will input date
    System.out.println("Enter your quiz 2 percentage score (0.0-100.0): ");
    // The nextInt() method scans the next short value
    quiz2 = Scannerln.nextInt();
    // Student will input date
    System.out.println("Enter your quiz 3 percentage score (0.0-100.0): ");
    // The nextInt() method scans the next short value
    quiz3 = Scannerln.nextInt();
    // Student will input date
    System.out.println("Enter the current temperature in degrees Celsius: ");
    // The nextInt() method scans the next short value
    celsius = Scannerln.nextInt();
    // Display the Student EMPLID
    System.out.println("Student EMPLID:" + EMPLID);
    // Display each of the grades from quiz 1, 2, and 3
    System.out.println("Quiz 1 Score:" + quiz1);
    System.out.println("Quiz 2 Score:" + quiz2);
    System.out.println("Quiz 3 Score:" + quiz3);
    // Average all grades together
    System.out.println("Average quiz score: " + ((quiz1 + quiz2 + quiz3)/3));
    // Display age in months
    System.out.println("Age in months: " + ageMonths);
    // Display age in years
    System.out.println("Age in years: " + (ageMonths/12));
    // Display temperature in Celsius
    System.out.println("Temperature in Celsius: " + celsius);
    // Display temperature in Farenheit
    System.out.println("Temperature in Farenheit: " + ((celsius * 9/5) + 32));
    }

    }

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

    Simulating color blindness

    Posted: 01 Sep 2019 02:36 PM PDT

    How would I go about simulating color blindness to test my applications? I know there are browser extensions for this but those can mess up in odd ways, can break page layouts, and only work for web applications.

    Is there an equivalent of Flux for color blindness? I've found a Java program for this but it breaks when running multiple monitors.

    Edit: Windows does have color filters but those don't seem to produce the same results as using a browser extension so I don't think those necessarily give the most accurate view for development purposes (that or the browser extensions are wrong, I am not an expert on this so I can't really tell).

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

    Best coding interview tips.

    Posted: 01 Sep 2019 02:10 PM PDT

    What is your best coding interview tips besides practice.

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

    stuck with c++ circular includes

    Posted: 01 Sep 2019 01:27 PM PDT

    I started to build an interpreter for a simple language in c++ which I didn't touch for more than a year. I'm having trouble with circular includes hopefully someone can point on design changes or tell me if there is something in c++ that can solve it.

    So these are the classes that causing me the problem :

    Parser, StatementHandler (acts as strategy design pattern) , Statement , Statement derived classes

    Parser.h

    #ifndef INTERPETER_PARSER_H
    #define INTERPETER_PARSER_H

    No comments:

    Post a Comment