• Breaking News

    Monday, August 10, 2020

    Where's a good place to learn about how USB device drivers (for Windows) work, and how to write my own? Ask Programming

    Where's a good place to learn about how USB device drivers (for Windows) work, and how to write my own? Ask Programming


    Where's a good place to learn about how USB device drivers (for Windows) work, and how to write my own?

    Posted: 10 Aug 2020 08:08 AM PDT

    I've got a cheap little USB jog/shuttle control device with a few buttons on it that comes with some fiddly software and doesn't seem to achieve the kind of timing precision that it claims to, for no good reason that I can ascertain.

    As a project, I'm wondering if it would be possible for me to write my own driver for this device. A starting point would be to listen to what it sends to the computer when a button is pushed - assuming it doesn't need to have firmware pushed to it each time it connects. Do I need to replace the official driver, or can I just listen in to the port traffic alongside it?

    I'm running Windows 10, but could I be better off doing my investigations on Linux to start with? I wrote a program some years ago on Linux to communicate with some USB-connected scales, which was as simple as using open(...) and read(...) in C. Is USB in general really as simple as a stream of bytes in and a stream of bytes out?

    Can anyone recommended some good resources, tutorials, or software that would help me out?

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

    Javascript ForEach - Returning values and Breaking the loop

    Posted: 10 Aug 2020 10:06 PM PDT

    I'm doing exercises on FreeCodeCamp in Javascript, and wanted to try to use the forEach method. My plan was to search for a value and then return it once found. However I then realized that I was returning from the forEach callback function, which did nothing. So I created a variable at the scope of the outer function, and then and loaded the variable with the value once found. Then once the forEach is completed I check for this stored value and return it from the function. This seems like an odd workaround.

    My question: is there a better way to do this with forEach? Is there someway to use the return from the callback function of the forEach. Also, once I find the value in the forEach, I would like to stop searching. Can I call break on the forEach?? It's not regular loop so I assume that break isn't going to work. How do I stop the forEach from iterating further? Thanks.

    function lookUpProfile(name, prop){

    var nameFound = false;
    var returner = null;
    contacts.forEach(function(contact){
    if (contact["firstName"]==name){
    nameFound = true;
    if (contact.hasOwnProperty(prop))
    returner = contact[prop];
    }
    });
    if (returner)
    return returner;
    if (!nameFound){
    return "No such contact";
    }
    else{
    return "No such property";
    }
    }

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

    Unreal Engine vs Unity

    Posted: 10 Aug 2020 11:02 AM PDT

    I wanna start learning how to create games and was wondering which engine is the best to use. I know unity has a bit more coding in it as opposed to unreal which you bearly need to code at all in it. Im fine with coding, im after finishing a 4 year degree in software development so i have a good understanding of the basics of the software development, my only experience in creating a game was creating a crappy one using OpenGL for my final year project.

    the main thing that im looking for in an engine is that will be the best for rapid development.

    sorry if this question is a bit messy

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

    How best to do this: Authenticated Post/Update/Delete access in Mobile App Service / Azure SQL Database

    Posted: 10 Aug 2020 10:22 PM PDT

    I don't know what to do. I want to cry. Windows or Linux?

    Posted: 10 Aug 2020 06:24 PM PDT

    I am torn between Windows and Linux because my hardware just won't work well with Linux.

    I heard many programmers use Linux and MacOS because they are -nix based and they are miles better and stable than Windows. I can agree that MacOS is rock solid, but Linux? Whole different story for me.

    First, I cannot find a perfect Linux distro. Some distros lose icons after a reboot, some are bloated, some have different update cycles, etc. I currently use OpenSUSE because it is the only distro that I can install AMDGPU-PRO drivers for my RX 580. Redditors told me that I should use Davinci Resolve, and this is where my stress leads to.

    Second, all DMs present problems on this computer. Gnome is laggy like a pig, KDE keeps breaking(freezing, config files corrupt after a reboot, icons missing, etc), XFCE just returns a white screen, Sway does not show me windows when I try to open programs for some reason.

    Third, hardware support is finicky. I need Davinci Resolve because it is the best free video editing tool God can give to us, but these greedy corp motherfuckers don't support Radeon well. Because of this AMDGPU thingy, I cannot find a perfect distro!

    Forth, programs are inferior compared to Windows versions. Every program presents so many bugs to me. It makes me think that Windows programs are better for me. Even for something simple, for example a FLAC player, I think of Windows.

    So I want to say "Fuck it" and use Windows and Linux VM, but Redditors keep stressing me. I heard companies give you more pay if you use Linux or macOS. Apple subreddit discord said big companies only hire MacOS users for top-level jobs.

    I am wasting time right now because I keep trying to make Linux work for my computer.

    I am getting a new laptop soon so things might get better, but Davinci Resolve will still haunt me. People are reporting that this program will not even work on Intel GPU based systems. I just want to do some light editing on Resolve, and this is the biggest pain for me. I don't want to use alternatives like kdenlive! I also have the option of dual boot, but having just a single flow of ecosystem is very important to me.

    I don't want a macOS because of their restrictive nature, shitty repair policy, and ARM transition is near which means as soon as I buy a Mac it will be outdated within 5 years. I need 7 years at least.

    What should I do? I am going to comp sci in 1 or 2 years, and I want to start setting my workspace. I believe that a well-built workspace and ecosystem can make my life better.

    Please... Help... I want to stop this confusion and pain...

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

    What are good questions to measure JavaScript skills?

    Posted: 10 Aug 2020 07:07 PM PDT

    I've been doing this exercise in other programming languages I know...but my JS skills are pretty rudimentary.

    What are good questions to ask to gauge whether someone is skilled or mediocre at JS? How would you know they are pros vs n00bs?

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

    "Offline" version of Sql Server databases with ADO.NET C#

    Posted: 10 Aug 2020 06:42 AM PDT

    Hello, I'm a CS student and have been developing some applications for home use to help manage my finances / time / etc.
    Now the finance management one has proven to be very useful and I've been asked to make it for some aquintances of mine for a reasonable price. In the home version i use SQL Server running on my machine to host the database, and for the app to work the Server has to be running.
    Is there any way i can use an SQL databases without the need of running an SQL Server instance on the "clients" machine, or connecting it remotely to my machine witch would need port forwarding on my router and having my pc online 24/7.. ?

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

    Linking CSS to Multiple EJS Files on Node Server

    Posted: 10 Aug 2020 05:55 PM PDT

    Short sweet and to the point: Not using templates. Couldn't figure out how to dynamically change the linked css file for each view. Remade the project, plain ol' ejs, no layout. I have a main.css which I want to hold utility classes and general format stuff, and each view to have it's own css file. For my index.ejs file, all the css loads fine from main.css and index.css. In a different view, the main.css is not formatting anything. The pages load, so I'm assuming it's not a problem with my routing, but the css is not showing on any page other than index.ejs. Please help. I've been slamming my head and google is not helping. By the way, if it's a dumb answer, I'm a complete rookie and I've been doing this maybe 2 months.

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

    Continue to receive an error setting up MongoClient on windows.

    Posted: 10 Aug 2020 05:10 PM PDT

    I have imported pymongo using the "pip3 install pymongo" and am now trying to set up MongoClient as the next step. The command I give is "from pymongo import MongoClient" but I keep getting an error message that "from" isn't a recognized command. Is anyone familiar with this problem?

    submitted by /u/Wiseman-no
    [link] [comments]

    What should I avoid putting on GitHub?

    Posted: 10 Aug 2020 05:52 AM PDT

    I've just finished my BSc in CS, yet only just making a Github now.

    To keep me busy and don't lose all my coding skills I've been working through https://www.upgrad.com/blog/python-projects-ideas-topics-beginners/

    Is there any reason why I shouldn't post them all on Github? Any advice on what else I can work on to demonstrate my skills? Thanks in advance.

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

    Downloading a book in PDF or EPub. How could I alternate the text of the book is varied in a command?

    Posted: 10 Aug 2020 05:03 AM PDT

    "A in green text". "B in red text". Etc etc. For the whole alphabet and each letter in the file. What file type would be most easily altered in this way?

    Thanks for any help you may give.

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

    How do I link up to a vehicle and adjust the code in its computer?

    Posted: 10 Aug 2020 03:22 PM PDT

    I believe most vehicles run under C programming language and I would like to connect to a diesel Mitsubishi and delete the EGR system for off road use. I also would like to use this for other racing applications in gas vehicles. My question is how do I connect and alter through the OBDII port to my laptop.

    submitted by /u/the-official-review
    [link] [comments]

    About specific CLI tools

    Posted: 10 Aug 2020 03:19 PM PDT

    Anyone who has used Expo (expo.io) knows that on the CLI you end up at a point where you use the arrow keys to navigate different options when starting a new app(switch btwn blank, typescript etc). Does anyone know how they did that? Like what tools do they use to build CLI apps like that?

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

    Anyone wanna share online syllabus/courses pathway like degree planner?

    Posted: 10 Aug 2020 03:11 PM PDT

    With the abundance of online courses available on Youtube and edu sites like Coursera and Stanford, is there a good guideline on where to start in term of syllabus pathway for data science?

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

    How to accurately represent colors between monitors

    Posted: 10 Aug 2020 12:43 PM PDT

    Hello everyone. First of all sorry if this is not the best subreddit for my question but any kind of help or pointing to the right direction is welcome.

    Imagine you want to take a picture of someone's skin and send it to someone else so that they can mix some colors to make an accurate representation of the skin ( mixing the colors is not the concern ). How can I calibrate the monitors so that the skin color is the same?

    The image is taken with mobile phone and is seen in mobile phone. I want a method that is not hard to get result and accuracy of about 90 percent is acceptable.

    What if it's not a single color and there is a gradient of colors in the image.

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

    Typescript error with React Redux Middleware

    Posted: 10 Aug 2020 12:17 PM PDT

    I am trying to add middleware to an existing application that I have. I want to add debounce, thunk, and promise (from react-promise-middleware). But for some reason when I add them to the configureStoreOptions, I keep getting errors about type overlapping. Here is my code for my store.ts

    import { configureStore, ConfigureStoreOptions, AnyAction, } from "@reduxjs/toolkit"; import thunk from "redux-thunk"; import promise from "redux-promise-middleware"; import createDebounce from "redux-debounced"; import { rootReducer, StoreState } from "../reducers"; export default configureStore({ reducer: rootReducer, middleware: [createDebounce(), thunk, promise], } as ConfigureStoreOptions<StoreState, AnyAction>); 

    The error I am getting is: 'types of property 'reducer' is incompatible' and '...neither type sufficiently overlaps with the other...'

    Any idea what I might be doing wrong?

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

    Script Problem

    Posted: 10 Aug 2020 11:41 AM PDT

    I wrote a simple script with HotKeyNet that sends a key input to any pre selected tabs so that I can control multiple emulated games at once on my pc. I tested the script to see if it would work on multiple word docs and in multiple instances of games like Minecraft and it worked every time but when I attempt to use it to control my emulated games nothing happens. I am using DeSmuMe emulator if that matters. Anyone who could help would be much appreciated

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

    Should I get a help desk job?

    Posted: 10 Aug 2020 11:20 AM PDT

    I got my BA in computer science but I'm having a heck of a time finding jobs or getting people to respond to the applications I do put out. I want to build up some experience towards a coding job of some kind but I'm getting a bit desperate. Is call center stuff close enough to job experience?

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

    Need help programming python

    Posted: 10 Aug 2020 11:05 AM PDT

    I am very new to programming and have no idea how to well yet. I am trying to make a security alarm for my brothers birthday. Using a raspberry pi 3 and a hc-sr04 ultrasonic sensor. I am trying to code it in python using the thonny ide on mt pi 3, but have gotten nowhere. I am trying to figure out how to have the sensor continuously firing off at a certain distance, but when it detects a shorter distance it logs the time it happened.

    For example, the sensor is pointing at a wall 3 ft away and the distance shortens and is now 1 ft because something walked in front of it, it logs the time that happened.

    I was hoping somebody from here would be able to help me. Or at least give me good guides or references to something that could help.

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

    Mechanical Engineer looking to change career paths

    Posted: 10 Aug 2020 09:52 AM PDT

    I graduated with a degree in Mechanical Engineering about 6 years ago and am currently working as a mechanical designer. However, I absolutely dread what I do! I have always been very interested in programming and have always found ways to incorporate it into my otherwise very mechanical job.

    I have been heavily contemplating going back to school to get a formal education in Computer Science. However, I have had a lot of internal debate on whether I should attempt to go straight into a Master's degree or go back for a second Bachelor's.

    I am hesitant to go back for a Bachelor's because I feel a Master's would me much more advantageous for my career moving forward. That being said, I have no real formal training in Computer Science, and everything I have learned has been just based on my own self interest (games in Unity, raspberry pi, arduino, VBA in Excel).

    I was curious if someone with real world experience would be able to give some advice on if it is worth going back for a Bachelor's for a more formal CS education or if it would just be a waste of time.

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

    How to make a program packaged with PyInstaller compliant with the open-source licenses of its dependencies ?

    Posted: 10 Aug 2020 01:36 AM PDT

    Hi,

    My company has developed a small GUI app that we would like to distribute in binary form, however we are concerned that we may be violating the license terms of its software dependencies by doing so.

    The app is written in Python, it uses PyQt (GPLv3-licensed) for its interface and also depends on a bunch of other popular Python packages (under various flavors of open-source licenses). We use pyinstaller to bundle everything up into a single .exe file, which can then run on any Windows machine. We would like to distribute that .exe on our website, for free.

    If you are unfamiliar with pyinstaller, this tool "scans" all the dependencies required by a python program: not only Python packages, but also any dynamic library they require, and the Python interpreter itself. It then copies them all from the host system into a single self-extracting portable binary. However, it copies only the files it needs for the program to run, and completely ignores things like license files.

    Can we distribute that bundled exe "as is" ? I assume that at the very least, since some of the dependencies are GPL, were are going to need to open up the code and license our program under GPL as well (which we're fine with). Would that be enough ? Or do we also need to track down every single license used by our dependencies and include them in our binary distribution ?

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

    Everyone talks about problem solving like they're building a new solution. How do I solve production problems?

    Posted: 10 Aug 2020 02:10 PM PDT

    Whenever I see this question asked I see it asked in the context of building a new feature or solving a leet code problem.

    How do I improve solving production problems on a jira board? Whether it be vague error messages or bugs in the UI

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

    Trying to figure out the optimal selection based on a set of rules

    Posted: 10 Aug 2020 08:03 AM PDT

    This is actually a work story that I'm working on but I want to kick some ideas here.

    Background: We have software that displays different products to the user

    My Story: With a given set of rules, determine which is the primary product we should show the user. These are images. We are writing this in Python, but I don't think that matters.

    Rules:

    These don't really matter so I'm just going to abbreviate them. I can calculate a boolean return value for each of these. What matters is that some must match completely, some must match in an order of precedence.

    Rule Notes
    Rule_1 The image HAS to have this.
    Rule_2 The image HAS to have this.
    Rule_3 The image HAS to have this.
    Rule_4 (see the next two for actual rule) The image must match one of the following:
    Rule_4_a If image is this, use it
    Rule_4_b Otherwise, use this
    Rule_5 The image must match one of the following in order (descending preference)
    Rule_5a If this passes, then this image could be used
    Rule_5b If this is a different type, lets say a "front" image, use this
    Rule_5c If this is another type, "back" of the product image.
    Rule 6 This image must be at least this size

    What I'm thinking:

    I'm thinking of iterating through the list of images, and attaching a score to each one and then returning the highest score.

    Problem with that:

    I'm not sure how to handle the priority order (let me know if that is making sense). Best way I can state it is that some of these are && and some of these are ||, but I don't know how to do || in precedence like this.

    Let me know if there is a better subreddit for discussions like this.

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

    Is anyone aware of a methodology where I can permanently asribe each letter to a colour?

    Posted: 10 Aug 2020 12:07 AM PDT

    This may not be the best place to ask this however, this isn't homework. Career advice or anything similar.

    I'm attempting to recreate in my own way an experiment where participants read text where 13 letters had assigned letters for 30 minutes a day to develop a degree of synethesia.

    Here is a source where two experienced showed motivating success. And a better definition of synethesia than I can give.

    https://www.newscientist.com/article/dn26578-people-taught-synaesthesia-learn-to-read-in-colour/

    However, I am willing to do this for the rest of my life and for a significant number of my waking hours. And doing the whole alphabet instead of 13.

    In Linux or anything. Can I program so the display of the screen for a certain letter is "yellow," or "red," permanently. Not necessarily in printed text for word, but just seen by me? Thanks for any help. If this isn't the place I'll get out but if there's anywhere more suited please tell me.

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

    No comments:

    Post a Comment