• Breaking News

    Monday, June 28, 2021

    Is git mandatory, If one know how to pull, push, add, commit etc but does not know to resolve when conflict arises, does it make him bad programmer? Ask Programming

    Is git mandatory, If one know how to pull, push, add, commit etc but does not know to resolve when conflict arises, does it make him bad programmer? Ask Programming


    Is git mandatory, If one know how to pull, push, add, commit etc but does not know to resolve when conflict arises, does it make him bad programmer?

    Posted: 28 Jun 2021 08:41 AM PDT

    Is git mandatory, If one know how to pull, push, add, commit etc but does not know to resolve when conflict arises, does it make him bad programmer?

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

    How should I approach this time series data

    Posted: 28 Jun 2021 08:15 PM PDT

    I'm not exactly sure if I'm using right terms, but I have a text file looking like this:

    [00:00:21] <tempID1> Pog

    [00:00:55] <tempID2> hi

    [00:01:01] <tempID2> Pog

    [00:01:03] <tempID3> never been this early

    [00:01:12] <tempID4> wth is this Pog

    [00:01:17] <tempID4> Pog

    [00:01:32] <tempID5> he got some moves

    I am trying to use python to count the number of words used by each minute, so from this example to count the number of word 'Pog', from the first minute (0~1) the count would be 1, the next minute (1~2) would be 3. Counting the word itself wasn't an issue as I could just count line by line, but I am having trouble separating the count into each minute segment. What could be a good approach?

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

    Using the Transactional Outbox Pattern, what would be the downsides of removing messages after successful delivery, as opposed to keeping a copy and marking as "dispatched"?

    Posted: 28 Jun 2021 04:15 PM PDT

    I understand that to achieve idempotency on the consumer (where idempotence needs to be explicitly handled), processed messages should be tracked (usually by unique identifier, GUID in my specific implementation)...

    ...but I'm wondering if a system that's going to end up processing a gargantuan amount of commands of the same type won't eventually suffer from ID lookups, as the number of consumed messages grows.

    I'm currently leaning towards deleting messages from the outbox immediately after successfully appending to queue, as well as deleting last N tracked message IDs on the consumer side (because at some point, there's no possibility of receiving duplicates of past messages, no?), to mitigate lookup costs.

    What risks do I open doors to if I go ahead and delete like I've described?

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

    SMC certification

    Posted: 28 Jun 2021 07:56 PM PDT

    Is the SMC certification recognized?

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

    What makes a labyrinth hard?

    Posted: 28 Jun 2021 03:30 PM PDT

    How might one write a program that generates a difficult labyrinth of side length N?

    For low N, you can just use brute force to find some random shape that takes A* pathfinding a long time to crack. For larger N, you could make a neural network that generates images of labyrinths and uses the travel time of an A* pathfinder as a cost function?

    But that wouldn't give you much of an insight into what makes a labyrinth difficult

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

    A task I don't even know how to BEGIN to approach: Reusing portions of a Yaml file

    Posted: 28 Jun 2021 01:04 PM PDT

    You can skip to the bolded tldr if you don't want the context, but its kind of important for understanding the problem.

    The first week on the job as a new programmer, my boss tasked me with the following assignment: one of our API's has a yaml file that represents the specifications of the api. Without going into too much detail about the stuff included in this yaml file, it includes all the different numerous parameters of certain tissue samples. Donor name, tissue type, etc. Its a very very long document and gets like 6 layers deep in places. In 3 places in this document, it includes an enum list with some info (types of organs for example). That enum list ALSO exists in a different document in another api on a different repository. He didn't want redundant information, so i was tasked with creating a "template" version of that specifications document that replaces the enumerated list with a link to the OTHER document where that info exists. I then wrote a script that would read in the template yaml doc i made, scan through it, look for the urls (there were 3 of them), then locate the data at those urls, read THOSE yaml docs in, find the relevant info, replace that info in the original template file, then write out a new yaml file that looks identical to the file i started with.

    Seems like a lot of work to have a file that ends up identical to how it started, but now when changes are made to those lists elsewhere in different repositories, we simply run my script and the info is updated.

    However, now my boss begins talking about how "each api(or microservice) we have has a specifications document similar to the one you already worked on. It would be nice if we could tweak the script and template you did, and make it so that it pulls all the info these specification docs have in common, and references where that common info is so that we don't have redundant info.

    He then went on vacation for a week, and I have no idea what do do while he's gone. Its the only task he gave me, and he barely gave any detail. it was more of a passing thought than a formal assignment. Now i have to spend my second week ever as a developer working on an abstract idea my boss had. I can't just do NOTHING while he's gone ("what the hell did you do all week while i was gone") and I don't have nearly enough details to ACTUALLY do this thing he wanted me to do. So i'm hoping I can spend the week at least setting up the ground work for this, researching possible solutions and at least STARTING something.

    TL;DR So here's the problem I'm having: these "specifications" yaml docs have extremely little in common. We're talking about fewer than 10 shared lines. And they're almost all "top level" entries in this yaml doc (you know how yaml docs can be nested etc). But even if I only look at the top level entries, they aren't ALL exactly the same. of the 4 specifications docs, they have like 10 top level entries, and about 75% of those entries they all share, but the rest are unique to just one or 2 of them.

    Also, changing a single low level entry in a yaml doc is kinda easy (if it was a tree, these low level entries would be the branches). But replacing a top level 1 seems... almost impossible.

    I'd basically have to programmatically rewrite the entire document from scratch. All to make sure that like, 10 lines or so aren't repeated elsewhere? We're creating so much more possible locations of error just by trying to save some redundancy.

    Do you think i'm like... MASSIVELY misunderstanding what it was my boss wanted? Or can you think of a solution to this poorly described program?

    I can't give even a little bit more detail as this project has some sensitive info in it.

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

    How do you create data for your tests?

    Posted: 28 Jun 2021 06:13 PM PDT

    When I write tests I feel I spend more time setting up the data than actually writing the code needed to test the logic I want.
    Have you optimized this somehow? Should I be writing individual data for each test?

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

    Stalled out on packed string search algo, looking for feedback and ideas on how to move forward.

    Posted: 28 Jun 2021 09:49 AM PDT

    First and foremost I'm interested in what you think about my algorithm.

    Second, if you have time I'd love it if you ripped it apart. I've stalled out on ways to make it better or move forward with it. I feel like it has potential but maybe I'm not the guy to find that potential.

    About the algorithm. It packs text into an integer and uses bitwise operations to check it against a pattern en mass. It's not horribly clever, but it is a bit original. There's no SIMD, which most other approaches seem to use. I make use of uint64_t and a fair amount of "original" bit twiddling hacks. But in essence I've just optimized a naive search algorithm quite a bit.

    Here's the github. The algorithm is in "stable_packedfilter.h" if you'd like to take a peek.

    It should run out of the box with gcc.

    This is a hobby for me, I'm not a professional. It is more often than not an obsessive project that I've stalled out on. I genuinely would like to hear your opinion even if it's that the algorithm is shit.

    Cheers!

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

    How do I create an LLVM project in Visual Studio?

    Posted: 28 Jun 2021 08:54 AM PDT

    I'm able to build the LLVM source thanks to http://www.justiceadams.com/blog/2019/8/26/a-guide-to-hacking-on-llvmclang-with-visual-studio-windows-2019-edition, but I don't know how to include it in a project that's in an external directory, since I'm a cmake/visual studio noob. Ultimately, I want to be able to compile my external project and the llvm dependencies into one executable.

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

    Printing output into discrete columns

    Posted: 28 Jun 2021 12:30 PM PDT

    This is in Python. Basically, I want to print 4 separate columns of my data. I am sort of getting columns of data now, but they are oddly aligned and the output in general is messy. My print statement as it stands is

    print(ax.bins[i],"\t",ay.rdf[i],"\t",az.rdf[i],"\t",ba.rdf[i],file=ofile)

    ofile.close()

    But this isn't giving what I need. Any advice is appreciated.

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

    Is there a way to stream XHTML instead of text using SSE?

    Posted: 28 Jun 2021 11:53 AM PDT

    I have an express-server (node.js) that communicates with a client that expects to be served XHTML-data. The communication is done by setting the Content-Type to "application/xhtml+xml" in the header (by the server).

    Now, I would like the server to communicate continuously with the client, using Server-Sent Events (SSE).

    However, the content-type needs to be "text/event-stream" in order for the stream to work, which serves text-data instead of XHTML.

    My question is:
    Is there a way to stream XHTML to the client with SSE? If not, is there a different way to stream XHTML?

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

    SDL2: How to manipulate volume on data array?

    Posted: 28 Jun 2021 11:01 AM PDT

    SDL_LoadWAV(config_file.input_file_path.c_str(), &wavSpec, &wavBuffer, &wavLength); SDL_AudioDeviceID deviceId = SDL_OpenAudioDevice(NULL, 0, &wavSpec, NULL, 0); int success = SDL_QueueAudio(deviceId, wavBuffer, wavLength); SDL_PauseAudioDevice(deviceId, 0); SDL_PauseAudio(0); 

    Hey,

    I have a construct like this. In the wavBuffer Array is my audio data which is played by an audio device.

    Now, inside my program I want to lower the volume by multiplying a value <1 to the data. Can I do it somehow without stopping the playback?

    I thought about stopping the playback, lower the amplitude of the entire array and start playing it again, but this doesn't work.

    Thx for any ideas

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

    Updating GUI Between Devices

    Posted: 28 Jun 2021 09:10 AM PDT

    Hello, I have been given the optional task of creating some program that updates a GUI between devices and syncs between multiple devices. I am in college and i'm not entirely sure the best way to approach this problem and I was wondering if I could get some advice on where I should start. I know python and could make GUI's with tkinter or pysimplegui. I could also potentially make a web app that would update between devices. Any advice helps!

    Its essentially a restaurant table tracker to know if its seated, needs to be cleaned, reserved or not, open to communal seating.

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

    Need help verifying my solutions

    Posted: 28 Jun 2021 03:19 AM PDT

    I solved chapter 2 linked lists of Cracking the Coding Interview, I want any improvement suggestions for my solutions

    https://github.com/kirtipalve/CTCI-cpp-solutions/tree/master/chapter-2-linked-lists

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

    Python Tkinter Dynamic Text Editing

    Posted: 28 Jun 2021 05:21 AM PDT

    I'm working on a program in tkinter that takes a user input text and depending on certain buttons being pressed, then modifies the font of certain words/phrases in said text and displays it in a text box.

    For example, if the user inputs a text and presses button 'X', the display box should display the full text with all x's highlighted.

    I'm trying to figure out the best way to modify the text in this way. My current plan is to make a note of the relevant indices in the text and then recompile the full text while highlighting those indices (if that makes sense), but I was wondering if there's an easier way of doing it.

    Thanks!

    submitted by /u/Korki-Bucek
    [link] [comments]

    How to get feedback on an App idea

    Posted: 28 Jun 2021 02:15 AM PDT

    I have a specific web application in mind that I'd like to create but not entirely sure how to get to the end product. It is using an Amazon Web Service API and integrating it with another web application that I know governments use for permit tracking.

    The permit tracking software allows for developers to integrate rest APIs into their platform.

    How do I go about discussing with a more experienced programmer without them stealing my idea and doing it on their own?

    I've done quite a bit of research on the AWS API and know quite a bit about the permit tracking software. But I'm not sure what kind of software or website I need to build to get the two things to talk to each other.

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

    Regex Quick brown fox hello world lorem ipsum?

    Posted: 28 Jun 2021 01:26 AM PDT

    Is there anything like the quick brown fox sentence or the hello world program or lorem ipsum or a star algorithm, but for regex?

    I mean a quick way to see all or most of the main features of the regex of a programming language just by looking at 1 line of regex that has the same output for each language?

    Anything like that?

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

    No comments:

    Post a Comment