• Breaking News

    Thursday, December 16, 2021

    Are You Afraid of Your Software? Ask Programming

    Are You Afraid of Your Software? Ask Programming


    Are You Afraid of Your Software?

    Posted: 15 Dec 2021 02:45 PM PST

    I'm curious to know what other software developers think of this.


    Twice in my career I've worked for companies that (apparently) were afraid of their own software. By their own software, I mean key components that they had developed themselves.

    The first time I was using a toolkit that my company wrote as a basis for several of its software products. I told the architect that I had fixed a memory leak in that toolkit and wanted to check it in.

    Instead of reviewing my change, his eyes went wide and he said, "NO! That toolkit is perfect! We've had so many problems getting it to work. Just leave it alone!" He sounded both angry and frightened.

    It was a rather simple fix, so I was puzzled by his response.

    This was early in my career and it was the first time I had seen a reaction like this.

    The second time this happened I was tasked with implementing a communication system between two apps. The main app contained our database, but the secondary app needed access to that database.

    I suggested that instead of the communication system, I factor the database code out into a common library that both apps could link against.

    "NO!" I was told. "The database code isn't thread safe -- that won't work!"

    It turned out that our database had been created by someone who no longer worked at the company, and that no one currently working there understood it. My task was basically a workaround to this problem. Apparently this company spent a lot of time on workarounds to deal with the problems with it's database.

    I offered to look into the root problem, but I was told "NO! Just leave it alone!"

    I saw that same fear and anger I had seen before, so I let it go.


    I will confess, in both cases I felt a moderate level of disgust. I think software companies should be comfortable with what they produce.

    Do other people experience this?

    Does it bother you like it bothers me?

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

    First ever python script runs only with random input inserted in the code

    Posted: 16 Dec 2021 04:54 AM PST

    SOLVED

    I did some basic programming many years ago. Today, I tried python for the first time. My code only outputs stuff, when I have a input command inserted for some reason. I'm stumped.

    import math n = 2 # compileinteger compiles an integer 123456......n-1 n n-1 n-2...........654321 # probably not the best code ever, but I don't need this optimized. The bottleneck # is with the prime test anyway. def compileinteger(n): integerfront = 1 integerback = 1 for x in range (2, n + 1, 1): integerfront = int(str(integerfront)+str(x)) if x != 2: integerback = int(str(x-1)+str(integerback)) return int(str(integerfront)+str(integerback)) # modified prime tester. I don't need to test for 1,2,3 because the smallest number tested is 121 def isprime(num): print(f"prime test for {num}") print(f"will require a maximum of {int(math.sqrt(num)) + 2} tests") for i in range(3, int(math.sqrt(num)) + 2, 2): if num % i == 0: print(f"{num} is divisible by {i}") return False return True while True: #Keep looping, looking for ever bigger primes currentnumber = compileinteger(n) #Compile next number input("Press enter") if isprime(currentnumber) == True: #Check for prime print(f"{currentnumber} is prime") n += 1 #Add 1 to check next cycle 

    The 4th line from the bottom, needs user input to continue. I added this to easily fix some bugs. Now, my program seems to work, I deleted the line. And the application didn't do anything anymore. Even when I changed input to print, I get no output.

    Why is this?

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

    Oop design patterns

    Posted: 16 Dec 2021 04:45 AM PST

    I have a program I found on git I need to analyze. It's a very small program but I have a hard time identifying and recognize usages of patterns. I know all the patterns by hearth but I'm afraid I'm missing something obvious. Anyone has a tip or are anyone willing to help me identify? I've been sitting for days

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

    How do you copy multiple variables to multiple clipboards?

    Posted: 16 Dec 2021 04:01 AM PST

    Macro pads can use multiple clipboards and can paste several different clipboards at once. Some programming languages (such as MATLAB's clipboard function and Python's pyperclip) can automatically save a string variable to a single clipboard, is it possible to create a script that saves different string variables to different clipboards individually?

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

    Where do POST requests go?

    Posted: 16 Dec 2021 02:51 AM PST

    I've written a webserver. Data comes in on a network. It does some file I/O. Data goes out on the network.

    For GET requests, the file I/O bit is obvious. You just send an HTTP response header followed by the bytes of the file.

    For POST requests, it's less obvious. Application/x-www-form-urlencoded data comes in. What should the server do with it? Should it be saved to a file? Should it be parsed by the server in a standard way?

    I'm asking about the webserver program itself. Clearly there will be other programs that look at data output to files by the server like MySQL.

    How do Apache and NginX process and redirect application/x-www-form-urlencoded data?

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

    How this dfs graph have backedge when there is no real edge in real graph

    Posted: 15 Dec 2021 11:01 PM PST

    Image of the graph

    My question is why there is backedge between 1 and 4 in graph B when is no real edge between 1 and 4 in graph A.

    Also from the solution they(means textbook) vertex 3 and 4 are denoted as articulation point. So for them vertex 2 is not an articulation point.

    So based on the given articulation point, can i say that they meant to put real edge between vertex 1 and 4 in graph A but somehow they messed up printing that graph A

    submitted by /u/dark-horse-1402
    [link] [comments]

    Which software to quickly generate a website should I use?

    Posted: 16 Dec 2021 02:08 AM PST

    We have this project in my CS class, where we have to make a website based on some wireframes we created before. I am looking for a (drag and drop, probably) software that allows you to quickly generate a website. I have heard of WordPress.org, but I have to pay for hosting as I understand. Is there an alternative? My main needs are that I have no budget, and the easier to generate most of the website the better. Thanks in advance.

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

    Expecting a Function as a parameter. How to define it? Any Language.

    Posted: 16 Dec 2021 01:36 AM PST

    Hello,

    I would like to know how the definition in different languages is for Functions that expect other Functions as Parameters, like the callbacks from javascript.

    In Javascript it is easy, as there are no defined types, but how can I do it in other languages?
    Also how can I make it so that it accepts Lambdas?

    I usually use C#, C++, Java, Javascript as programming languages and would be thankfull for answeres in these languages, but also for how to do it in other languages.

    submitted by /u/SoulB-oss
    [link] [comments]

    How to make Bot that will register to a website through a link I provide multiple times. will provide random emails and type random password 2 times and will select a random username and will click and verify im not a robot and will hit submit.

    Posted: 16 Dec 2021 01:32 AM PST

    Do research web crawler programs exist?

    Posted: 15 Dec 2021 07:22 PM PST

    This may be a stupid question, but bare with me.

    I'm trying to automate tasks at work, and much of that work is web research - sorting/reading through public documents, govt websites, etc and create memos for my boss and our clients to read over. This work is extremely tedious and much of my time is spent just searching for the information. So, I feel like there has to be a program that can help me skip the searching portion and just review the results.

    My question is:

    Are there consumer programs available that use a web crawler (or some equivalent mechanism) to automate an advanced keyword search, and compile the results in a Word Doc template?

    If not, how many hours would it take an average developer to create such a program?

    I know very little about programming, but I feel like there has to be some sort of tech out there that can scrape data for me so I don't have to.

    Work smarter, not harder. Amirite?

    Thanks in advance.

    submitted by /u/oliver--cromwell
    [link] [comments]

    What is the easiest way to capture network activity from chrome using an Android phone?

    Posted: 15 Dec 2021 08:17 PM PST

    Edit: Solved. It seems I just need to toggle the device toolbar in devtools on pc.

    There is a function from a website that only works on a mobile browser. I'm trying to capture some Imgs from it once I get that function working on my mobile chrome browser, however I'm only familiar with using developer tools in chrome on my PC.

    Apologies if any terms I've used doesn't make sense, I've tried to explain my situation as accurate as I can understand from my knowledge in programming.

    TIA :)

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

    How to write tests for an existing codebase?

    Posted: 15 Dec 2021 05:29 PM PST

    I've written a really nice react-node stack template using microservices. It works like a charm... But I didn't write any tests. Or rather, I didn't write automated tests; all testing was manual (habit of a gamedev).

    To improve the whole thing for others to use, I'd like to write tests for it. I don't really know much about testing, so any help is greatly appreciated.

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

    What is the best way to structure git my repo(s) in this project?

    Posted: 15 Dec 2021 04:32 PM PST

    The directory structure of my project is depicted below.

    I am creating a multiplayer pong game in the multiplayer-pong directory.

    There is a server in the server directory.

    There are multiple front-end clients, each written in a different language. These are the js-pong, rust-pong, and py-pong directories. They are all stored in a clients directory.

    The clients directory also has a shared assets directory that the front-end clients use.

    As of right now, only multiplayer-pong is a git repo. However, I would like server, js-pong, rust-pong, and py-pong to be considered seperate git repos and have their own histories while still being children of clients when looking at the repo in github.

    At first, I was thinking of git submodules, but from reading git book submodules section, they seem more for using one project from another. In my case, server, js-pong, rust-pong, and py-pong are all completely separate projects.

    What is the best way to do this?

    multiplayer-pong/ | .git | server/ | clients/ | assets/ | js-pong/ | rust-pong/ | py-pong/

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

    Simpler alternatives to google maps

    Posted: 15 Dec 2021 08:29 AM PST

    I was just trying out google maps but then wonder if there are better alternatives to it. All I need for my application is to put markers on the map according to given coordinates. It's like having a globe in hand, with the ability to zoom in and see details of the area around each marker, to have an approximate idea of where the marker is. I hope using it is much simpler than google maps. As simple as html5 maybe. Wil be implementing it on html/bootstrap.

    submitted by /u/Chips-more
    [link] [comments]

    A bit confused on why the bifurcation graph for my map isn't working.

    Posted: 15 Dec 2021 03:36 PM PST

    I have a MATLAB code here that creates a bifurcation diagram for chaotic maps, but I it's not giving me the graphs I'd like and I'm not fluent enough in coding languages to be able to diagnose the error. Can anyone give any advice or corrections please?

    function Adv = Bif2(a,b)

    N = 5000;

    M = 5000;

    x(N,M) = 0;

    a = (0.2:3.8/(N-1):4)';

    b=0.4;

    for n = 1:N

    x(n,1) = 1/3;

    y(n,1) = 2/3;

    for m = 1:M-1

    x(n,m+1) = (1 - a(n)*abs(x(n,m)) - y(n,m));

    y(n,m+1) = (b*x(n,m));

    end

    end

    plot(a,x(:,M-500:M),'.');

    set(gca,'FontSize',20);

    title('Bifurcation')

    xlabel('x', 'Color','k')

    ylabel('a','Color','k')

    Essentially, I'm just trying to change the parameter a within the maps x(n+1) and y(n+1) with random values of my choice witha fixed b value. I'm not sure where the error in the code is that gives me bizarre and unusual bifurcation diagrams. It works for the logistic map (which is what I have adapted it from) but not this one. Can anyone help? Thanks.

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

    Best language and tools if I want to write a program to read modify and save ebooks

    Posted: 15 Dec 2021 10:59 AM PST

    No please don't link me to a tool that already does this, people don't build boats in the garage because they can't buy a boat, this is a personal project

    Most of my experiences within c++ as that's how I've made my living most of my career, but I'm looking in it seems like python might be a good option for this and I might already be some libraries for reading and writing ebooks but I'm not sure

    Looking for people's experience on what's already out there thank you

    submitted by /u/12jonboy12
    [link] [comments]

    What is geodmachservicebridge?

    Posted: 15 Dec 2021 02:36 PM PST

    I work in fraud detection for a gaming company. I believe I have found someone who is using remote access software for advantageous play. The one process that stood out to me that I have never seen run before is geodmachservicebridge. I googled it and the only thing I found is that it's commonly associated with users who have been remotely hacked. Does anyone know exactly what this process is?

    MAC OS X v12.0.1 Monterey Running safari 15.1

    Thank you!

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

    Automatically change the shortcut file location

    Posted: 15 Dec 2021 12:44 PM PST

    My USB drive has the label F:/ when i change to a different computer that label changes, in my drive i have shortcuts and those shotcuts stop working when ever i change computers because of the label. How do i change that label automatically without manually changing that one letter? Im not sure where to post this so i chose this subreddit :/

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

    Unittesting Constructors

    Posted: 15 Dec 2021 07:35 AM PST

    Hey gang,

    this is really less of a what's wrong, what's right question and probabably boils down to preference.
    But I'd love to see the general consensus and maybe even reasoning on why do what for that topic.

    Let's say you've got a constructor for a class, Foo.
    The constructor has a parameter of an object Bar.

    Foo has 5 properties which all come from Bar in one form or another.

    How would you unittest this.
    I've seen the approach of using 5 tests with one assert each, one test for each property
    Or maybe 1 singular tests with 5 asserts, one assert for each property

    Maybe you don't need to test constructors? Who knows!

    What's you idea on that.

    I'd argue it's easier to see which property is affected when you have 5 separate tests. But then again, 5 tests is alot of copy paste and if the implementation is a little bit more complex you may need to fake a lot of stuff and do that every time. But then again, redudant unittests might not even be the worst thing to happen and boilerplate in unittests might not even be a problem in the first place

    Well maybe if you have to fake it extensively you've written the constructor in a bad way to begin with, but that sometimes can't be helped with an old code base.

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

    Deciding between a Dell and an LG monitor. I don't know what features I should be paying attention to as a programmer

    Posted: 15 Dec 2021 07:01 AM PST

    This site shows a comparison (the two first monitors) https://www.bhphotovideo.com/c/compare/Dell_U2722D_vs_LG_27UL650-W_vs_ASUS_PA278QV_vs_BenQ_PD2700U/BHitems/1645578-REG_1457457-REG_1562006-REG_1436761-REG but I'm still unsure why the Dell is pricier - is this just the brand? The LG one seems to have the best config.

    But the real question here is I don't know which things matter for a programmer. I've had the LG before. It's 4k, but I won't really use the 4k resolution as things get too small for me to see. So I just change resolution to make things look bigger. I'm wondering if essentially this would be the same as using the Dell which is not a 4k?

    But then I come to the ppi question. LG is 164 vs 108 Dell. Will this matter a lot? Does the image look better or not because of ppi?

    Then there's Dot Pitch. I think LG wins here (small is better right?) with 0.1554 x 0.1554 mm vs 0.2331 x 0.2331 mm Dell.

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

    A networking question: IPv6 + connect + link-local addresses + Linux requires sin6_scope_id for TCP connect() but not for UDP sendto()

    Posted: 15 Dec 2021 06:58 AM PST

    Why is sin6_scope_id item of sockaddr_in6 needed on Linux, when connecting to a link-local address ?

    I mean:

    IPv6, UDP packets: sendto works on Linux/Windows without specifying sin6_scope_id.

    IPv6, TCP connections: sin6_scope_id is required (on Linux), without it connect returns error 22 (for this guy on Ubuntu, or for me on CentOS 7.4).

    I would understand if it was needed for both TCP/UDP. But why only TCP? Or does UDP send actually send a packet to all interfaces having? I'll be thankful for any explanation or a reference to it :)

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

    Is there any tutorial or does someone know how to implement the transformer model for text generation?

    Posted: 15 Dec 2021 01:44 AM PST

    I know GPT2 is based on transformer but where is the code for it, can we run the code and train it on a dataset in google colab? I can only find LSTM and RNN..

    Anyone?

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

    Potential tutoring session on Friday - Would anyone potentially be available then, to go through a quick exercise?

    Posted: 15 Dec 2021 05:23 AM PST

    Hi everyone,
    I'm learning programming (self taught) and wanted to work on an exercise this Friday morning, ideally with an experienced programmer to share any advice/guidance. Could be in any language - ideally Python or Java, but any language really as long as it also has object oriented capabilities.

    Would anyone potentially be available then (Friday morning, 9-12pm GMT) to go through a quick exercise? I would reimburse you for your time as well. Not sure if this is the right place to look, if there's a different sub for 1-1 help I'd love to be pointed towards it.

    Thank you

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

    Why is Electron so huge?

    Posted: 14 Dec 2021 11:11 AM PST

    Electron is headless Chrome/Blink, no? If it was meant for that purpose, why have they not trimmed some of the fluff in terms of size and performance?

    Every time someone develops something in Electron, the first gripe is that it is huge and not performative. Just wondering why this hasn't been solved yet, or if it is even possible to solve.

    EDIT - Before this gets too far, by poor performance I am actually referring to high resource usage.

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

    File System Fuse

    Posted: 15 Dec 2021 02:31 AM PST

    Is there anyone who knows how to build a file system by using FUSE?

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

    No comments:

    Post a Comment