• Breaking News

    Tuesday, June 29, 2021

    What have you been working on recently? Ask Programming

    What have you been working on recently? Ask Programming


    What have you been working on recently?

    Posted: 29 Jun 2021 12:11 PM PDT

    For work, and/or play?

    I work on an analytics product, in an SRE role at the moment. I've been embedding in other teams, creating self-healing functionality, implementing performance improvements, and computing/exporting metrics. We also have a custom monitoring solution that ensures customer data is being processed expediently which is kind of fun to work on.

    In my free time I've been dabbling with Keras and ML.

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

    [C++] I've been coding for 17 years, and I bombed a coding interview today. I need help reviewing a game engine's code.

    Posted: 29 Jun 2021 01:05 AM PDT

    I'm a largely self-taught game developer, but today I totally bombed an interview where the interviewers grilled me on a C++ program I submitted. This has shaken my confidence greatly, and I think I need help reviewing the code of a game engine that I'm developing for fun. It's almost like I'm reading my own code with new eyes now.

    https://github.com/Ratstail91/zelda-framework

    Like, even the main function, I think I read somewhere that wrapping everything in a try/catch block is a bad thing, yet my main function looks like this:

    #include "application.hpp" #include "SDL2/SDL.h" #include <iostream> #include <stdexcept> int main(int argc, char* argv[]) { std::cout << "Beginning " << argv[0] << std::endl; try { Application app; app.Init(argc, argv); app.Proc(); app.Quit(); } catch(std::exception& e) { std::cerr << "Fatal Error: " << e.what() << std::endl; return 1; } std::cout << "Clean exit from " << argv[0] << std::endl; return 0; } 

    Is this the right approach? I simply don't know anymore. There are little things like const string& arguments that I saw in a video recently that I didn't even think about, but makes perfect sense now that someone pointed it out to me.

    Hell, I'm building the zelda framework on top of SDL2, is it even technically worth the effort, since it's tied so closely to SDL2's functionality? SDL2 is supposed to be able to support multiple windows as well, yet my engine doesn't.

    I've got imgui implemented and working in one of the scenes, but haven't even done anything with it - yet I was also planning on adding lua scripting?

    Why isn't the camera a node? Why are transforms separate from nodes? Why am I passing pointers to everything?

    There are little inefficiencies that are scattered throughout the whole codebase that I can suddenly see, like branching or the wrong STL container used.

    It needs a full code review, but I don't really think I know what I'm doing anymore.

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

    should i build an MVC website or call an api

    Posted: 29 Jun 2021 05:47 PM PDT

    Hello, im learning java and spring and want to build a website, but i dont know if its better to build an mvc website or put the backend logic on an restful api/webservice. or maybe an mvc website that calls an api.

    any ideas/tips or resources for research into what is the best option?

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

    Why do migration systems use versioning? Why is it encouraged to add a new migration for a change instead of deleting an old one and creating a new file?

    Posted: 29 Jun 2021 03:30 PM PDT

    So, I don't understand why this is done this way. For example, lets say I created a migration for a table that missed a column. As far as I know the recommendation is to create a new migration to alter the table and add the column. But why do this?

    Why not just undo the migration, modify it and then apply it again?

    I'm assuming there is a good reason for this, but I've just never had to deal with it. Would appreciate if an explanation was given. Thanks in advance.

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

    [Git] updating child branch of feature branch of dev

    Posted: 29 Jun 2021 09:12 PM PDT

    I am wondering if I could get some help understanding git.

    There is a remote branch dev which the team all syncs to.

    In order to decrease merge conflicts, I sync my local dev with the origin dev, but I want to update these changes to the child branch that I am working off of. The child branch is a branch of a feature branch which is a branch of my local dev. Dev -> Feature -> child is branch topology

    (Note: I can update the feature branch by running git rebase dev while on feature branch- wondering what should be done to update the child branch)

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

    New programmer here ( learning Python)

    Posted: 29 Jun 2021 08:33 PM PDT

    Can you create programs such as antivirus or cleaning software with python? In general, what projects do people generally make with Python?

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

    An efficient way to upload and store recorded audio

    Posted: 29 Jun 2021 02:11 PM PDT

    I am looking for an efficient way to upload (and store) voice recordings. The audio files will be used for messages that can be sent between users.

    The client is built in react-native and JavaScript. I have been googling for a few days but I cannot seem to distinguish a clear method for storing/uploading.

    How would you suggest I do it? I have come across base64-encoding, blob storage etc, but it is all confusing.

    Can I send or upload audio files (.wav/.mp3) to a server in some way other than HTTP? I assume that client-side blob-uploading to azure blob storage could have some security issues since I'd have to include my connection string client-side. Am I wrong?

    If I were to use base64-encoding and HTTP-requests, why can I not just store the files as strings in a regular mongodb database? Is a blob-storage even necessary?

    Please, help a brother out. Just point me in a direction and I'll probably be able to figure it out myself. Thanks! ❤️

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

    Help with this prompt!!! javascript

    Posted: 29 Jun 2021 06:35 PM PDT

    Can anyone please guide me on how to solve with prompt (javascript)? and kindly explain every step of the way. I have been looking at the question for two days and have no idea. All I know is that the final location is c4

    note: this question was on an interview (which I totally bombed, but I am still stuck on the solution)

    Thank you in advance!!!

    //PROMPT

    Imagine you have a chess board of 8 x 8. On it's x axis, you have the numbers 1 - 8, and on the y axis, you have the letters A - H.You take a piece and place it at A1. You receive an array of moves, and you need to move the piece according to the moves.Give the final location of the piece.

    submitted by /u/Main-Science-8729
    [link] [comments]

    Would plain C or C-styled C++ be more ideal for game and game engine development?

    Posted: 29 Jun 2021 02:48 PM PDT

    Most of the libraries I use are C libraries that are cpp compatible, so that wouldn't be an issue, and I'm doing data oriented programming, which works for both languages. I've seen people use C and C-styled C++ (AKA C with classes and templates and stuff), but I'm honestly unsure. Right now I'm considering using C, but I've heard that some features of C++ would help, so, any thoughts?

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

    Curl Not Downloading Entire File

    Posted: 29 Jun 2021 06:07 PM PDT

    I have the following file saved to a website. I can use Safari, go to the link and the file downloads. Approximately 2 MB. https:/www.connorsllc.com/LTSvc.mpkg

    I am trying to use Curl on macOS to download the file. I am using the following command.

    curl -s -o /tmp/LTSvc.mpkg https://www.connorsllc.com/LTSvc.mpkg

    The download starts, but it only downloads 978 bytes and stops. I have absolutely no clue why. Any thoughts would be helpful.

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

    How to make a program not get detected by AV?

    Posted: 29 Jun 2021 11:58 AM PDT

    I've written a FOSS installer for a UEFI module that runs from Windows. As you can imagine, Windows Defender is not a fan, and refuses to run the installer.

    There actually are several problems: 1) the installer exe is not signed, 2) I have to use UAT which is a red flag for AV, 3) it modifies the EFI volume which looks hanky.

    I'm about to start on a new version, after a long time away from the project, and I'm thinking of ways to get my app to run successfully. My general plan is to write 2 apps, with the first hopefully not marked as malicious.

    1. Write a user app just for the GUI. No UAT, no backend changes to UEFI.
    2. Write a 2nd exe app that does the UEFI work and evokes UAT. The 1st app downloads and executes this 2nd app, and it communicates status back to the 1st app. (i.e. progress bar, error messages)
    3. Provide docs to users on how to temporarily disable defender for just these executables.
    4. First app will raise error to user if it detects defender running, before launching the 2nd UAT app. It will provide user with link to instructions (see #3)
    5. Buy an app signing certificate. It's not cheap and they aren't all that effective, but it may help.
    6. Provide detailed technical docs showing as best as practical that the apps are not malicious.

    Up until now I've relied on users to figure it out on their own. I don't know much about how to distribute apps that avoid AV detection. I'm not a bad guy; I'm just writing an app (installer) that does things that look suspicious.

    https://github.com/mikeslattery/tunic

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

    What's the next step as a programmer?

    Posted: 29 Jun 2021 11:49 AM PDT

    I've learned the basics of a programming language (C++), and created a project (a command-line calculator with support for variables): power-calc. I've also become comfortable with Python, and I'm going to start doing LeetCode starting 1st July.

    What path should I take next? My goal is to become a well-rounded programmer with more breadth than depth.

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

    What is a really good java project on github that has a bit of everything & modern practices?

    Posted: 29 Jun 2021 04:49 PM PDT

    Im asking about a java project on github trending that has async, APIs, routing, JSON etc

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

    Python Tkinter increase a value indexs by selecting buttons and output the final by clicking output button to a label text output filed

    Posted: 29 Jun 2021 04:42 PM PDT

    Python Tkinter increase a value indexs by selecting buttons and output the final by clicking output button to a label text output filed

    Hello,

    so lets say i have a value that = 000000000000000000000

    and i have alot of buttons and when i click a specific button it increase the value digit index(0) by 2 and another specfic button for index(1) you get the drill and they are kept in memory till i press the output button to output it into the window so the output results would be: 220000000000000000000

    the problem is i do not know how to make this function

    my app:

    https://i.imgur.com/pXVaaQZ.png

    Python3

    from tkinter import *

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

    Calculate all intersection points with an array of lines

    Posted: 29 Jun 2021 08:06 AM PDT

    Hello dear redditors, my task was to create a simulation for a PET Scan. If you dont know what that is I will try to explain it very simply: you have a scanner in the form of a 2d circle. Inside the plane there are points which emmit two objects (gamma photons) in exact opposite directions. When reaching the scanner the get detected. The scanner then knows that the object emmiting the two photons must be somewhere on the line. If you simulate this with more than 1 object you get an array of lines defined by four numbers [x1,y1, x2,y2] being the coordinates of two points on the line. If I now have lets say an array with 400 of these lines: what would be the fastest way to get an array with all the intersection points of each line? And if an intersection point appears more often than others it should get a higher "value" so that you can make a colour plot with it for example.

    Is there an algorithm for it that has a better runtime than O(n^2)?

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

    how to find remote job

    Posted: 29 Jun 2021 01:58 PM PDT

    i am fresh graduate computer enginner , i have learn many things , some of them by my self and durning internship, i know C/python/Html/CSS/Javascript/visual stuido .....etc , but i just really have intermatite level - intern 3 month with job 6 month only -and live in Cario(egypt) ,, how can i find remote font end developer job .... ppls from u experince ,, do comapnies in UK/eroupe ... hire people internationallly remotly , espeially if ther are jouinner , i am working hard and studying by myself , i can speak english pretty well ,,,,, just paid in egypt quite bad , looking for better way to mprove my paid .................................... and even in uk/Eroup compaines theyl ooking for which skills ??

    submitted by /u/Extreme-Main-8753
    [link] [comments]

    What skills/languages do I need, to create a real estate listing website like Zillow?

    Posted: 29 Jun 2021 09:04 AM PDT

    Hello guys, I'm new to programming and I would like to ask what languages do I need to learn to for example create a real estate listing site like Zillow with a map aside (but more simple from the beginning). And where should I start? Front-end (HTML, CSS, JAVASCRIPT) and then back-end (Python…and how do I store data about the house location, prices etc.)? Thanks!

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

    Where will I place my email in this contact form so that I can receive emails to my website email address? I was thinking here (<div class="bounce1"></div>) but am not sure.

    Posted: 29 Jun 2021 12:11 PM PDT

    <form name="contactForm" id="contactForm" method="post" action="" novalidate>

    <fieldset>

    <div class="form-field">

    <input name="contactName" type="text" id="contactName" placeholder="Your Name" value="" minlength="2" required aria-required="true" class="full-width">

    </div>

    <div class="form-field">

    <input name="contactEmail" type="email" id="contactEmail" placeholder="Your Email" value="" required aria-required="true" class="full-width">

    </div>

    <div class="form-field">

    <input name="contactSubject" type="text" id="contactSubject" placeholder="Subject" value="" class="full-width">

    </div>

    <div class="form-field">

    <textarea name="contactMessage" id="contactMessage" placeholder="Your Message" rows="10" cols="50" required aria-required="true" class="full-width"></textarea>

    </div>

    <div class="form-field">

    <button class="full-width btn--primary">Submit</button>

    <div class="submit-loader">

    <div class="text-loader">Sending...</div>

    <div class="s-loader">

    <div class="bounce1"></div>

    <div class="bounce2"></div>

    <div class="bounce3"></div>

    </div>

    </div>

    </div>

    </fieldset>

    </form>

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

    Java Help

    Posted: 29 Jun 2021 12:06 PM PDT

    Hello guys I need your help to revise below code in order to finish my assignment.

    Assignment is running the program should first ask the user for the number of starting pennies for each player, for example 10 or 15, and if the first player is "Even" or "Odd". For each round, the two players take turns: first player should be able choose "Heads" or "Tails" using a number for each (0 or 1). After the first player's choice, the second player should be able to choose one of the two options as well, using a random coin flip. You then must compare the choices and modify the number of pennies for each player accordingly. When one of the two players runs out of pennies, display who won each round and the final winner (First player or second player).

    Information about Matching Pennies Game from wikipedia:

    Matching pennies is the name for a simple game used in game theory. It is played between two players, Even and Odd. Each player has a penny and must secretly turn the penny to heads or tails. The players then reveal their choices simultaneously.. If the pennies match (both heads or both tails), then Even keeps both pennies, so wins one from Odd (+1 for Even, -1 for Odd). If the pennies do not match(one heads and one tails) Odd keeps both pennies, so receives one from Even (-1 for Even, +1 for Odd).

    public class CoinGame { public static void main(String[] args) {

    int HEADS = 0;

    int TAILS = 1; int face; face = (int)(Math.random()\*2); String faceName; if(face==HEADS) { faceName="Heads";} else{ faceName="Tails"; int WinnerPoint = 3; int count1 = 0, count2 = 0; 

    Coin coin1 = new Coin(); Coin coin2 = new Coin(); while (count1 < WinnerPoint && count2 < WinnerPoint) { coin1.flip(); coin2.flip(); 

    System.out.print ("Coin 1: " + coin1); System.out.println (" Coin 2: " + coin2); 

    count1 = (coin1.isHeads()) ? count1+1 : 0; count2 = (coin2.isHeads()) ? count2+1 : 0; } 

    if (count1 < WinnerPoint) System.out.println ("Coin 2 Wins!!!"); else if (count2 < WinnerPoint) System.out.println ("Coin 1 Wins!!!"); else System.out.println ("TIE!"); } 

    }}

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

    debugging an MPI application - breakpoints

    Posted: 29 Jun 2021 08:22 AM PDT

    Hi all,

    I am currently debugging a race condition in an MPI parallelized application. To do so, I would like to set breakpoints in calls to MPI functions in gdb (I use tmpi to open one gdb window per process). I have no interest in the internal mechanisms of those functions, I just want to see exactly when which processor calls which MPI function. Doing something like b MPI_Send() does not do the trick. Is there any way I can achieve something like this without manually setting breakpoints for each and every MPI call in an application of 10^6 lines?

    Thanks!

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

    How to create a private HTTP API on AWS API Gateway

    Posted: 29 Jun 2021 08:20 AM PDT

    Hi, I've been looking on how to create a private HTTP API on aws api gateway. The thing is that I have a Cloud Map namespace and some services registred, and this is integrated with my http api created in the api gateway console. The thing is that it is public and I want it to be accessible only within the VPC. Everytime I foun an article about this it uses the REST API but it wont work for me since I cant integrate with Cloud Map.

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

    I need help deciding on how to make a web and monile app

    Posted: 29 Jun 2021 03:39 AM PDT

    I jave this task. To create an website and an android app for it. I want to create the website in laravel and the app maybe in flutter. It is a good choice? Is there any framework which will automatically port my app on mobile (as an google play app) and as a website? Or it is better to create them separately?

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

    How would I create a small python IDE inside a mobile app?

    Posted: 29 Jun 2021 06:06 AM PDT

    I want to create my own python IDE as a mobile app that can run code. How do I do this? Is it possible to use react native?

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

    Which stack to use for business app?

    Posted: 29 Jun 2021 12:44 AM PDT

    I'm creating a business application that is a remediation flow process, it will be:

    1. Handed between multiple steps containing different users.
    2. Each user has a checklist and inputs different company details.
    3. Write to a database.
    4. It would be deployed locally / shared internal server.

    Which stack / framework would be most applicable for this?

    I know some Django (have built one webapp), but wouldn't be averse to learning Javascript or JS frameworks if they would fit better. (and for future career prospects)

    I also know SQL, Python, R, HTML/CSS, VBA.

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

    No comments:

    Post a Comment