• Breaking News

    Saturday, January 30, 2021

    I want a job working on smallish programs like tooling, utility scripts, internal software. What do I look for on job sites? Ask Programming

    I want a job working on smallish programs like tooling, utility scripts, internal software. What do I look for on job sites? Ask Programming


    I want a job working on smallish programs like tooling, utility scripts, internal software. What do I look for on job sites?

    Posted: 30 Jan 2021 03:09 PM PST

    Getting stuck on javascript projects as a beginner

    Posted: 30 Jan 2021 09:18 AM PST

    Hey community I have been learning web development from around 3-4 months now and I'm pretty confident in html and css and although I know most of the javascript but I'm finding it difficult to make projects in javascript. I'm getting stuck and referring to tutorials for example building a calculator in javascript. Is it normal and how can I get better at javascript?

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

    When VPN was invented, how did early programmers discovered it existed? Is there research, white paper on VPN that was first published? What's the first-ever documentation regarding VPN.

    Posted: 30 Jan 2021 11:31 AM PST

    Uninstalling developer tools.

    Posted: 30 Jan 2021 04:47 PM PST

    Hello Everybody,

    So I am currently in a coding bootcamp and things are going ok. I recently bought a new mac mini with the m1 chip, main reason was because my Macbook pro was getting old and I want to use dual monitors. Anyway, when I try to set up my environment on my new m1 mac I keep having trouble, Im pretty sure that Im just loading things wrong and not using rosetta2 correctly. I don't really want to reset my entire mac back to factory setting and reinstall MacOS. Does anybody know how I can uninstall all the developer tools such as homebrew, Ruby, Node ect. I just want to be able to start from scratch, and try again.

    Thanks!

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

    Is there any method to detect a sound snippet in a mp4 file with python?

    Posted: 30 Jan 2021 11:55 AM PST

    I am working on a multimedia project in Python and Flask.

    The app uses a Flask app to deliver the video to the client.

    Some of the videos are videos with the same intro and outro, so it has always the same one parts in the video.

    The intros become annoying after a while, so I wanted to detect the timestamp of the sound in the video in that with a sample sound file made beforehand and skip that part of the video with the timestamp.

    Is there any method to do that with Python.

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

    What's the best way to learn from others when you work alone?

    Posted: 30 Jan 2021 06:58 PM PST

    If this has already been asked, then I apologize. (Please link me!)

    As a starting programmer, focused primarily on JavaScript/html/css, what's a good way to learn from other programmers?

    I'd really like to get a broader understanding of architectures and the why behind them. I can muddle through my own projects, and build simple things, generally in the way I've been taught, but I'd like to see how different levels of programmers tackle the same problems. I love going through Codewars and seeing how others solve problems. I've learned a lot doing that, but I find the problems there are singularly focused when projects tend to roll up and involve many problems.

    In a group setting, it would be easier to ask and work with other programmers, but I'm at this on my own.

    Is it as simple as finding projects on GitHub to look at and debug?

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

    React SPA - Using auth0 with nodejs backend + and existing session cookie logic

    Posted: 30 Jan 2021 11:13 AM PST

    I am interested in using auth0 to replace most of my home-grown authn logic. Mostly to help make SSO easier and not have to mess with passport.

    My backend and frontend are served on the same origin. No CORS needed.

    I started with express-openid-connect, and a traditional "web app" flow, where the backend serves as the OIDC client (not the SPA). This library mandates a "secret" as part of its initialization and appears to automatically create a session cookie (following a successful authentication)

    1) Can I ultimately redirect from auth0, to my backend, back to my frontend? Meaning can I use my backend as a "middle man" for the purpose of safely using the OIDC Authorization Code grant with my untrusted SPA? (Normally this grant type is not possible because there is nowhere to store a client secret on the frontend)

    2) If I want to use my own session cookie, with my own session store, and opaque session tokens, for security reasons should I just ignore the cookie auth0 creates, or even manually unset it before redirecting back to the frontend? This app needs explicit control over sessions, session tracking, force logout of all sessions etc. for security reasons.

    3) If I ignore or delete the cookie express-openid-connect creates automatically on login, will SSO cookies still work? I.e. the auth0 universal login screen still knows if you have recently logged in even if I drop whatever cookie auth0 automatically creates on my app domain after the login completes

    I am pretty new to most of this so please let me know if I can clarify anything

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

    How does Google Chrome work great on every device?

    Posted: 30 Jan 2021 11:04 AM PST

    At what point does indexing a map become more efficient than if/switch statements?

    Posted: 30 Jan 2021 10:47 AM PST

    Hi,

    As the title says. The code below is in Go, but the concept applies to any language with if statements and maps.

    If you need to check if x is equal to one of these: 3, 2, 1, you could do like so:

    if x == 3 { // code if x equals 3 } else if x == 2 { // code if x equals 2 } else if x == 1 { // code if x equals 1 } else { // code if x doesn't match any number } 

    Or, you could index a map of funcs to do the same thing, like so:

    numberMap = map[int]func(){ 3: func(){ // code if x equals 3 }, 2: func(){ // code if x equals 2 }, 1: func(){ // code if x equals 1 }, } if f, ok := numberMap[x]; ok { f() } else { // code if x doesn't match any number } 

    Both code examples above are identical in how they function, but one is more efficient than the other depending on how many numbers need to be checked.

    To my understanding, the map method is less efficient if you have only a small number of conditions, because storing the map for indexing comes at a cost. However, when actually indexing the map, it is quicker than having many if statements (or switch cases) checking the condition for each one.

    I would guess that this strongly depends on the language, but is there a general rule for how many if statements should be used before switching to map indexing instead? Is this something even worth thinking about when writing code?

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

    How Do I Properly Handle Authentication in a Micro-service Architecture?

    Posted: 30 Jan 2021 04:40 PM PST

    I am trying to design a web-app that uses spring boot micro-services. I want users to be able to log in with discord using OAuth2, but I want to build an account on top of their discord log in.

    So far, it seems like the proper way to structure authentication in a micro-service based application is to either

    1. Have the API gateway handle the authentication natively
    2. Build an authentication service that the gateway calls, which returns a JWT that the gateway can store.

    In both of the above situations, the API gateway would pass the JWT to services

    I plan to have services that require users to be authenticated to access, but don't necessarily have anything to do with accessing discord resources, so I don't think it makes sense to pass just the discord access token to services that don't need to get anything from the resource server.

    If I plan to make accounts that expand outside the scope of what discord provides with OAuth2, would it make the most sense to bundle the account service and the authentication service into one service or does it make more sense to split them into two services, one that handles authentication and then another that gets custom account properties (most likely just accessing the accounts by discord id)?

    The current authentication flow is in its own service, and it goes something like this:

    1. Authenticate with discord
    2. On successful authentication
      1. Try to pull an account with the same discord id from the database
      2. If one doesn't exist, create one

    My gut tells me that, no matter how the API gateway gets the JWT, the auth service should bundle the discord id into the payload, and then instead of passing the user id to the other services in a request parameter it just should get pulled from the JWT payload.

    I am wondering how people with experience with this have to say about how I should go about solving this problem.

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

    How do I structure an online multiplayer game for react-native

    Posted: 30 Jan 2021 10:11 AM PST

    Hi, apologies if this is a silly question.

    I would like to create an online card game for my friends and I to play. I'm using react-native on the front end but want updates of the game to be rendered in near real-time. To my mind, web sockets are the appropriate way. So I will learn SignalR as I'm comfortable with .netCore (though happy to do this with socket.io and learn some basic nodejs if required)

    Here's how I picture it working:

    1. a user "creates a game" is given a code, and that opens up a socket .
    2. anyone else who enters the code listens in on that game socket and joins the game.
    3. (Here's where I get a little confused) Where to handle the game logic?. I will write the game logic in TS, on every client. not in c# (even though I'm more comfortable writing it in c#). here's my thinking: When a user interacts with the front end, to make a move for example, it emits a message, the move is handled and then other users are updated because they're listening in on the socket for that message. Every user in the game will have a copy of the game's current state. So if user A moves, user A emits the message, user B listens and makes the same move on their local copy. I'm doing this because I dont want to overload the api with in-memory game management (on the off chance that a lot of my friends end up playing) and because I dont want to use a db because it doesn't need to have one. its a quick game. no scores etc etc.

    Is that ok? How would storing the game logic on the backend work anyway?

    Also, another concern of mine is what if a lot of people are playing, is opening one socket per game good practice or will that overload the api? (I will of course ensure that the socket is closed once the game is over)

    Many thanks for your time, have a great day.

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

    Partner Up for Learning

    Posted: 30 Jan 2021 04:05 PM PST

    Hello everyone, hope you doing well. I just wanted share the discord server for the people who search for learning partners. You can join server to find a partner for learning different programming languages or any topics you are interested in. Here is the link for the server:

    https://discord.gg/ayeGrsaSG2

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

    How hard would it be for someone to make an AI like Jarvis (from iron man)

    Posted: 30 Jan 2021 09:42 AM PST

    Need help, newbie programming student :>

    Posted: 30 Jan 2021 05:04 AM PST

    we currently use Java and C# in our class, can someone please recommend me some books (available for free download) about those 2 programming languages? Thankss! I really need it. hope someone can help

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

    Why don't people use C++ for machine learning?

    Posted: 30 Jan 2021 08:38 AM PST

    New to Linked List in C++

    Posted: 30 Jan 2021 04:44 AM PST

    I'm new to linked list and I'm still confused about how to use it. I was wondering how to create and traverse a node with multiple parameters. Does anyone have a link or tutorial video that can share with me about this topic? Thank you

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

    Is JavaScript one of the more difficult languages to master?

    Posted: 30 Jan 2021 04:40 AM PST

    I have covered the theory of HTML and CSS and found them a lot easier the JS. I have a few more languages like python and C++ coming up and I'm so worried I'll find them as challenging as JavaScript!

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

    How to open Excel sheet in a given directory after making a purchase?

    Posted: 30 Jan 2021 08:21 AM PST

    I am in the habit of storing all of my expenses in an Excel sheet. However, sometimes I forget, and I want to change that. My excel sheet titled "Expenses" is placed in a known, stationary directory.

    What I want to do is, every time I make a purchase on (say) Amazon, I want it to pop up on my screen.

    I wanted to ask, is there a way to perform this activity? I am primarily skilled in Python and Bash scripting. How would I go about developing such a workflow?

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

    Is this a valid example of OOP Dependency Inversion?

    Posted: 30 Jan 2021 07:53 AM PST

    Hello

    I was just wondering if SpringBoot enforces DIP and if it does, is this code a good example of DIP because instead of creating a new objects we inject the dependency, I am only unsure because I don't know if they share mutual abstractions.

    Thanks

    https://paste.ofcode.org/LA4ZK7tvSpJ7wXaFeE3rVf

    submitted by /u/Ambi-Phoenix1
    [link] [comments]

    When scraping a site using wget, does the site can get my IP address?

    Posted: 30 Jan 2021 07:18 AM PST

    If I scrape some site like example.com using wget, can the site example.com get my IP address or what information if any can it get?

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

    Professional coders, roughly what percentage of your main code library do you have committed to memory?

    Posted: 30 Jan 2021 12:06 AM PST

    No comments:

    Post a Comment