• Breaking News

    Sunday, November 1, 2020

    WFH workstation monitors: multi-monitor, ultrawide, or one huge screen? Ask Programming

    WFH workstation monitors: multi-monitor, ultrawide, or one huge screen? Ask Programming


    WFH workstation monitors: multi-monitor, ultrawide, or one huge screen?

    Posted: 01 Nov 2020 11:51 AM PST

    Want to upgrade my WFH setup, which is currently my 15in mbp + a 27in HD 1920 x 1080 monitor.

    Should I go with two 4k 27in, or one ultrawide 4k, or a huge 40in or so screen and why?

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

    Do you use the same account for developing on cloud platforms as you do your personal account? (Amazon, Google, Microsoft cloud)

    Posted: 01 Nov 2020 09:41 PM PST

    Since the accounts have many other services tied to them, is it good to separate it out?

    And the same question for their ad platforms, and APIs.

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

    Cannot color text black (only black)

    Posted: 01 Nov 2020 04:20 PM PST

    I am at a loss, I have no idea why I can color text all over the place any color I want but black seems to be the only one I cannot color. I am putting text over an image and I need two of the images black. Here is my relevant code:

    const textLightBg = { color: "black", fontWeight: "bold", }; ... <Carousel.Caption> 

    <h5 style={textLightBg}>
    Some Text Here
    </h5>
    </Carousel.Caption>

    For some reason I can color it 'red', 'blue', any color code I want. But whenever it needs to be black, it won't let me change it and it defaults to white. Any idea what I might be doing wrong?

    My code is using React Js, I am making a carousel using react-bootstrap.

    edit: just solved it, I feel like such an idiot. I am using "DarkReader" on my browser and its making it impossible to see. I am leaving this post of shame here in case anyone else runs into this issue like idiot me.

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

    How would you test a garbage collector

    Posted: 01 Nov 2020 04:37 AM PST

    As an educational project, I've written a simple, precise, mark and sweep garbage collector in C. Until now, I've tested it manually with a few allocation patterns. That's far from sufficient, I'm not even testing that all features are working at least in one program.

    Now, I'd like to improve the testing done. But I'm somewhat at lost how to make automated test for a GC without having the testing code more complex than the tested code. I can increase the number of testing programs and add automation to compare a dump of information with expected dumps (with the issue that I'd have to take ASLR into account in my dumps). But that's not scalable. Randomly generated tests would be a good application. But here comes my issue of keeping the testing code simpler than the tested one (which is just about 500 lines of C).

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

    Where is MS Access used in practice?

    Posted: 01 Nov 2020 09:41 PM PST

    I hope that this is a good forum. I've been a professional software engineer for around 5 years, and have worked extensively with Python and .net, and Postgres, Redshift, MySQL and Sqlite. I've worked mostly for IoT and SAAS companies, who sell services to other companies. I've also done a little government contracting.

    I know that MS Access is an SQL compatible database that is installed with many Office installations - particularly by businesses. I know that it has VBA. I know that it's not touched by the majority of people who purchase Office, who forget that it's on their computer.

    I also know that it's frankly tough to integrate with, and (seems to be) very client-side.

    Who actually uses it? As a software engineer, I've never* touched it - as Postgres (or for lighter things, Sqlite) are just there and integrate super well with any scripting I want to do in Python, or application I want to write in .net. I can't imagine that writing SQL and using relational data is really in the expertise of most office-type people, who I've seen do horrid things in Excel that really should be a database. Who is the market for this tool, and how is it actually used in practice?

    * well, once. It was whilst I was still a Law student, and got a client who had a computer in a shed in the country, with zero connectivity, that they wanted to manage their machinery maintenance - and it still felt wrong.

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

    Why is my code running an extra psuedo-scanf without me telling it to? (confused by that? Me too, I'll explain what little I do know, full program at the bottom)

    Posted: 01 Nov 2020 09:17 PM PST

    A little background: I'm doing this assignment for a dual-credit class. The program needs to collect 2 integer values from the user (this program is in C, btw), then print a list of available operations to the user, each with a corresponding number. The user then inputs the number of the operation they want, and then the program has to use a switch statement to determine which operation to perform, then output the correct calculation. The whole process should then repeat until a value to terminate the program is entered. As far as I'm aware, my code should accomplish this.

    However, when I run the program, during the first iteration, despite there being only 2 scanfs before the instruction to print the operation selection menu, the code will not continue until I enter 3 values. Then the third scanf runs, requiring a fourth input, which should determine which operation to perform. However, for some reason, the program uses the three numbers collected before the menu is printed, and disregards the fourth one.

    Here's where it gets even weirder: after the first iteration, only 2 integers are collected from the first set of scanfs, as intended, and a third is collected after the menu is printed. However, the program now uses the fourth input from the previous iteration as the first integer, the first input from the second iteration as the second, and the second from the second iteration as the operation. The third input in the second iteration is discarded. This pattern repeats, with the most recent value always being discarded, and the three most recent values before that are used for calculation.

    While testing this, I found that if I broke off the while loop after the first 2 scanfs, three values are still recorded, but the operation selection variable is not updated. Somehow, it only updates after the third scanf, but it updates to the wrong value.

    Does anyone know what's going on here? I asked my professor, but his response was, I kid you not, "Does your program have a default case to catch invalid operators?" I understand he's trying to help, but it doesn't relate to my issue, so I don't know where else to turn.

    Here is my full program:

    // Assignment 4: Using switch to select operations

    #include <stdio.h>

    int main (void) {

    // declare variables

    int var1; // 1

    int var2; // 2

    int command = 0;

    int output;

    // start loop

    while (command != 9) { // check if terminate loop command has been given

    printf("Enter 2 integers:\\n"); // prompt user for integers scanf("%d", &var1); scanf("%d\\n", &var2); printf("Enter the number of the operation you'd\\n"); printf("like to perform on these integers: \\n"); printf(" 1. Add\\n 2. Subtract\\n 3. Multiply\\n 4. Divide\\n 5. Remainder\\n"); printf(" 9. Exit Program\\n"); // prompt user for operation printf("var1: %d var2: %d command: %d\\n", var1, var2, command); // for testing scanf("%d\\n", &command); printf("command: %d\\n", command); // for testing switch (command) { 

     case 1: // check for addition output = var1 + var2; // add the 2 inputs printf("%d + %d = %d\\n", var1, var2, output); break; // exit switch 

     case 2: // check for subtraction output = var1 - var2; // subtract input 2 from input 1 printf("%d - %d = %d\\n", var1, var2, output); break; // exit switch 

     case 3: // check for multiplication output = var1 \* var2; // multiply the 2 inputs printf("%d \* %d = %d\\n", var1, var2, output); break; // exit switch 

     case 4: // check for division output = var1 / var2; // divide input 1 by input 2 printf("%d / %d = %d\\n", var1, var2, output); break; // exit switch 

     case 5: // check for remainder output = var1 % var2; // add the 2 inputs printf("%d % %d = %d\\n", var1, var2, output); break; // exit switch 

     case 9: // check for terminate command break; 

     case '\\n': break; 

     default: // check for other characters printf("Incorrect input. Please enter the number in front of\\n"); printf("the operator you wish to perform.\\n"); // display ERR message printf("%d\\n", command); command = 0; // protect against non-integer entries break; 

    } // end switch 

    } // end while

    printf("%d %d %d\n", var1, var2, command);

    } // end main

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

    What was your biggest “it’s not a bug, it’s a feature” moment?

    Posted: 01 Nov 2020 09:14 PM PST

    Trying to Understand Stack Voodoo with Multithreading and/or Async/Await [.NET]

    Posted: 01 Nov 2020 04:13 PM PST

    I marked this as .NET, but it could, theoretically apply to any managed language.

    Normally, tutorials that cover "Value Types vs. Reference Types" describe the stack as, well, a stack of plates where the oldest items are at the bottom and the newest items are at the top. As function calls are made, new items are added to the top; when the function exits, all its plates are removed from the top of the stack.

    This naïve sample is fine for most demonstrations, but it starts to get a bit wonky once you start thinking about multi-threaded applications and those that use async and await operators (which, if I understand things correctly, don't actually create threads).

    This specific scenario has been bothering me for a few days. What does the stack actually look like when multiple threads or one or more calls to async methods are involved?

    For example:

    1. Main creates a local int variable foo.
    2. Main calls an async method Bar.
      1. async method bar opens a data file.
      2. An int variable sum is allocated to represent the total sales.
      3. For each line in the file:
        1. A variable is allocated to represent the sales amount.
        2. The line is parsed into an array.
        3. sum is increment with the sales amount from the array.
      4. async method Bar returns the value of sum.
    3. Main stores the return value from Bar in foo.
    4. Main creates local List<string> variable baz
    5. Main calls async method Bazzer.
      1. async method Bazzer returns a list of strings the results of another web service without allocating any new local variables.
    6. Main stores the result of Bazzer in baz.

    What makes this more complex than the standard examples would have you believe is that you don't know the order in which variables will be allocated or which method they will be allocated from. For this reason, a simple Stack<T> is not satisfactory as a solution for the stack.

    The Question

    Can anyone who truly understands the stack, the runtime, maybe IL, async/await, and multithreading, explain what really happens with the stack and how it is managed when multiple threads or async operations are at play?

    Thanks!

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

    As a developer, Xamarin or PowerApps?

    Posted: 01 Nov 2020 12:01 PM PST

    I understand that powerapps, is low-code/no-code and Xamarin requires C# development. I wish to make small apps, which connects to some azure tables or otter databases, for my company, but think that powerapps have become very expensive.

    I have little experience with c#(i am mainly python), but I wish to be better at C#, so I dont mind putting in the hours.

    Is it at all possible to deploy apps to coworkers through using xamarin, as it is in PowerApps?

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

    Create XSLT code for this XML document to create this HTML table

    Posted: 01 Nov 2020 03:44 PM PST

    <?xml version="1.0" encoding="UTF-8"?>

    <interface id="PController">

     <package>java.interface</package> <extends> 

    <from>Remote</from>

     </extends> <import>java.rmi.Remote</import> <import>java.rmi.RemoteException</import> <import>[java.net](https://java.net).\*</import> <abstract\_method name="authenticateUser"> 

    <access\_level>public</access\_level>

    <arguments>

    <parameter type="String">user</parameter>

    <parameter type="String">password</parameter>

    </arguments>

    <throws>

    <exception>RemoteException</exception>

    <exception>SecurityException</exception>

    </throws>

    <return>boolean</return>

     </abstract\_method> <abstract\_method name="activateUser"> 

    <access\_level>public</access\_level>

    <arguments>

    <parameter type="URL">link</parameter>

    </arguments>

    <return>void</return>

    </abstract\_method>

    </interface>

    HTML table:

    https://gyazo.com/dc1bac2b8e5d54b7682df22bb3b5f26e

    I have no idea on how display the values on this one. Any hints? or resources that would help?

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

    Looking for a specific website that has a small snippet of code in every language.

    Posted: 01 Nov 2020 02:52 PM PST

    I used to use this website that shows basic syntax of every language by presenting you an easy to understand snippet of code in that language to get the gist of it, I can't for the life of me find the website though.

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

    Genetic Algorithm

    Posted: 01 Nov 2020 02:21 PM PST

    If in Genetic Algorithm, fitness function= Root mean squared error.

    Then how to calculate fitness values ?

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

    Data import /export from different sources in an Enterprise setting

    Posted: 01 Nov 2020 01:54 PM PST

    Generally when offering software to enterprises there are many different sources of data (CSV, external tools, API, etc. when provisioning your system or exporting from your system. Which is your preferred way of handling these imports? Are there any common denominators, open source software that helps out with this?

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

    Project help For Alice Programming

    Posted: 01 Nov 2020 01:38 PM PST

    So I have a project and I have to control a ride. I decided to use a remote that has a green button and a red button. I have the green button programed but I can't figure out how to stop it with the red button.

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

    Any way to get the Instagram profile picture full size as InstaDP does?

    Posted: 01 Nov 2020 12:51 PM PST

    What about https://www.instadp.com/? They've got some pretty quality images but I can't figure out from which endpoint they're making requests.

    All I could do was get a 320x320 image with low quality and I've been searching for a week straight. Help!

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

    Making a gdb script to automatically run a C program

    Posted: 01 Nov 2020 10:45 AM PST

    This is for a school project. I've been assigned a binary "bomb" that requires a certain input to be defused, otherwise upon being run it will "explode." The bomb is given in the form of an executable compiled from a C file. The intended way to find the password is to use gdb to look through the assembly code for the bomb, but I wanted to try and create a gdb script that would automatically give different inputs until the explode_bomb function isn't called.

    Here's my naive prototype based on googling stuff:

    break explode_bomb command 1 # write new values to input.txt run <input.txt end run <input.txt #run it the first time quit 

    The idea is that if the explode_bomb function is called, the program will be rerun with new input values (we're assuming I know the correct input format). Otherwise, it will pass over break explode_bomb and quit. The input.txt file will now contain the correct input to diffuse the bomb.

    My question: how do I actually do this? Most specifically, is there a way to have gdb write specific values to a file, instead of just logging to a file?

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

    What’s the right way to import Github libraries into Xcode?

    Posted: 01 Nov 2020 06:34 AM PST

    I've found a library written in C on Github which includes a makefile. I want to use functionality in the library in a C++ project. Currently I copy-paste all the code from each file into files of the same name in my project then group them together.

    This works fine if there are 6 or so files to copy-paste but clearly this doesn't scale.

    I could download a zip of the project, then copy it into my project, unpacking folders. I could learn enough Git to do this task just with terminal and then find a way to flatten the file structure?

    Is there a better way? Is there a key shortcut in Xcode, where I'm prompted for a URL which I type in and the library is downloaded or included in my project?

    Each of these solutions have something eyebrow-raising about them. What tool am I looking for?

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

    Why Microsoft's Windows Script Host (WSH) and HTML Application (HTA) didn't succeed?

    Posted: 01 Nov 2020 10:04 AM PST

    I have recently moved from University, where I pretty much had full control over my computer, to an industry where I almost have no admin privileges on my Windows machine. I did manage to install much software in portable mode, including Python, WxMaxima, FreeCAD, Gimp, Inkscape... but very soon I realized that if I want to share files with my colleagues I need to use the software they already have. I can't do calculations in Python and expect hundreds around me to go through the trouble of installing the portable version, and I don't want to waste my time with Excel!

    So I started further learning CMD/Batch programming, which I hadn't touch very much from the DOS era, and PowerShell. And then I discovered JScript and VBScript. Starting from those I dug into the rabbit holes of Windows Script Host (WSH) and HTML Application (HTA). For those of you who most probably have never heard of these, and don't know what they are, in layman terms:

    • JScript is Microsoft's implementation of the ECMAScript standard, very similar to JavaScript.
    • cscript.exe and wscript.exe come preinstalled in almost all Windows machines out there. You could compare them to NodeJS, though people wouldn't probably appreciate that.
    • WSH's .wsf files are XML structures where you can mix JScript, VBScript, and a bunch of other scripting languages.
    • HTAs can be compared to ElectronJS, where you can create Desktop apps with HTML, JScript, VBScript... they are treated as executables by the operating system.

    I was amazed at how powerful they really are and what Windows users could really do with them. However the more I wandered around the forums the more I saw people mocking Microsoft and hating these technologies. I understand that at the time these were introduced they caused a great deal of security issues, like Adobe's FLASH did. Though that's because they come preinstalled in all Windows machines out there, and they don't seem to have more destructive power than other programming languages.

    Now my questions are

    • why WHS didn't really catch up?
    • Why JScript wasn't as successful as NodJS?
    • and why we don't see HTA apps as Electron ones are sweeping across the GUI design world?
    submitted by /u/foadsf
    [link] [comments]

    If I come up with an algorithm to tell which is the 737287473723th prime number, how long it will take till the internet is shut down?

    Posted: 01 Nov 2020 02:27 PM PST

    Hello,

    I was wondering, if tomorrow someone gets the formula to calculate the prime number on any given X position in their consecutive list, how long it will take for hackers to decrypt all the TLS encryption?

    Or else, what would be the overall impact on the current cryptographic algorithms such a formula?

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

    How to make the bot send random gif each time.

    Posted: 01 Nov 2020 08:08 AM PST

    I'm new to discord.js and I'm coding a bot I'm trying to make it send a random gif from my pat command I made. I have 5 different pat gifs but it only sends 1 if I add the other pat gif's to the coding then it would just send all 5 at the same time need help.

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

    Does a programmer need to know HTML and CSS first?

    Posted: 01 Nov 2020 08:08 AM PST

    Hi, I want to be a very good programer who knows how to do a lot what are the tips you can give to know how to program and know it well. I also need guidance so I can learn the correct language. I already know HTML and CSS but I don't want to be a web developer I want to be a software engineer do I still need to continue with HTML and CSS.

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

    Simple Item Order System (CRUD Feature) Using C

    Posted: 01 Nov 2020 06:10 AM PST

    Hi, I am a freshman from college. I am taking a programming course online and we're still on the basics. We are tasked to create a simple CRUD program. My idea is to make an ordering system where the user could pick from a certain list of items they can buy. I also plan in recording transactions or doing something where the user can cancel the purchase or add more items whenever they want to. Is it possible? because this is only for around 2 weeks and we are only two students doing it. If so, maybe you could help me with some tips or ideas how to begin with it if it's allowed. I find it difficult because CRUD feature isn't taught yet, and I rely on the internet. More suggestions are appreciated. Thank you.

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

    Flask/Flask-Mail help

    Posted: 01 Nov 2020 02:45 AM PST

    I have been trying to create a Flask server recently however, I realised that I need to be able to send emails. Naturally, I turned to Flask-Mail. Now usually I run my server from a server.py file. But then the different routes I have split into different files for organisation and they are accessed through blueprints. The issue I have now is that I cannot seem to find a way to actually send emails from these other servers as the flask app is initialised in server.py and therefore when using Flask-Mail I can't use the "mail" variable that is created on initialisation.

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

    Do you know of any work done on the topic of "Recording interaction of programmers with documentation" or something along those lines?

    Posted: 01 Nov 2020 02:30 AM PST

    Good day,

    for a project in my university I want to record the interaction of programmers with documentation to get results about how they use it, when they use it and how it influences their code. The implementation itself is already done as it is a part of a larger eclipse-plugin used to record all kinds of interactions with the IDE.

    Now I am trying to find out about research that has been done in this particular field as my professor wants me to add more background about other work that has been done and which I can use to back my work or to point out where I did it in another way and why I did it.

    I have a hard time finding research on this particular topic.

    What I found so far are these papers:

    https://ieeexplore.ieee.org/document/1241364 (How software engineers use documentation: the state of the practice)

    https://ieeexplore.ieee.org/document/7140676 (How API Documentation Fails)

    https://ieeexplore.ieee.org/document/6958422 (The Value of Software Documentation Quality)

    https://dl.acm.org/doi/10.1145/2622669 (On the Comprehension of Program Comprehension)

    Do you know about any work that points in this direction? It would be greatly appreciated!

    I am also very thankful for pointers in which direction I should look (maybe I am just used the wrong terms?)

    Thank you so much in advance and stay healthy!

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

    No comments:

    Post a Comment