• Breaking News

    Thursday, February 25, 2021

    What are other really good places for high quality programming discussion? Ask Programming

    What are other really good places for high quality programming discussion? Ask Programming


    What are other really good places for high quality programming discussion?

    Posted: 24 Feb 2021 02:44 PM PST

    This sub is phenomenal. It's a shame covid drove everyone to reddit.com and now programming discussion is kind of drowned out on Reddit more generally. Are there any places that kept that old Reddit spirit of meming XKCD and cracking nerdy jokes, while also posting genuinely insightful and groundbreaking links about software news?

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

    Have you ever experienced panic attacks caused by work issues too?

    Posted: 24 Feb 2021 08:12 PM PST

    I'm thinking on mental health lately. I've suffered this before, not always work related, but my mind was a mess and it indirectly affected my work as software developer. What techniques do you recommend to prevent or even solve a panic attack on spot? I would recommend to practice breathing techniques, but maybe you have better tools.

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

    What is it called when I use an integer to describe multiple options?

    Posted: 24 Feb 2021 06:27 PM PST

    I have no clue how to describe that search engine friendly. What I am referring to is something I found with permissions on Linux on my workstation and also in one of the old Quake3 server settings. What is that *thing* called, and if it doesn't have a proper name, how would I go about implementing this is pseudocode?

    (The examples below got longer than expected so my second question right away here: My guess is that this makes it a lot faster for low level languages to check an 'array of booleans'. Is that assumption correct?)

    Thanks in advance!

    The *thing*:

    Lets say I want to invite my friends to a party after Covid (lets just pretend I had enough friends to make this example (: )

    My (imaginary) friends:

    (1) Ada
    (2) Alan
    (3) John
    (4) Charles
    (5) Tim
    (6) Donald

    If I want my program to send out invites but I am also pretty lazy, I could give it an integer which is the sum of the 2^(number) for all my options. As I understand, I can imagine a byte and simply put a 1 for the peeps I want to hang out with a 0 for the ones I want to avoid:

    Ada, Alan and John: [00000111] -> integer: 7 (=1+2+4)
    John and Tim: [00010100] -> int: 20 (=4+16)

    On linux I saw this being done with permissions:

    (1) exec
    (2) write
    (3) read

    So to give permissions you can use

    0 -> nothing
    1 -> exec
    2 -> write
    3 -> exec + write
    4 -> read
    5 -> read+exec
    6 -> read+write
    7 -> read+write+exec

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

    Extracting a .DAT file from a game.

    Posted: 24 Feb 2021 10:36 PM PST

    Hello, to begin, I'll give a bit of context,
    The game in question is the 1995 Title Brain-Dead 13 by (the now defunct) ReadySoft INC.
    It's an animated movie game in the sense that you basically watch a movie play out and die if you don't press the right button in time/don't press anything at all, yada yada..

    I know barely ANYTHING about programming, but I do know how universal .dat files and the .dat file associated with said game, (It's the DOS/Win 95 port) Is the biggest file in the directory, at 506 MB, the folder being about 512.

    I know finding the original program would be a stroke of dumb luck, but I'm hoping I can somewhat find a program that is able to extract the files successfully,

    At the moment I've got a Hex editor open, and I don't want to post any of the numbers here yet, in case they end up being the wrong ones.

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

    how many TCP local and foreign addresses should be active?

    Posted: 24 Feb 2021 08:20 PM PST

    i did netstat and i'm established to A LOT of addresses... like 100. is that normal?

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

    Can't seem to figure out how to approach this question

    Posted: 25 Feb 2021 01:29 AM PST

    Can someone help me break this down and which commands to use? I am really new at r coding and don't really understand how to do this.

    Suppose that the current stock price of CompanyX is $100. Assume that each day, the stock price of CompanyX could go up $1, or go down by $1, or stay constant, all with equal probability. In other words, each day, the change to the stock price is a random draw from c(1,0,-1). You are asked to analyze the returns of your investment in 60 days under different trading strategies using R simulations.

    • Strategy A (Buy): You buy 1 share of CompanyX today. If the price of the stock in 60 days is $X , then the return to your investment is $ (X − 100). Note that returns can be negative.
    • Strategy B (Call Option 1): A call option is an agreement (contract) between you and a financial entity (e.g., a bank) that gives you the right, but not an obligation, to buy a stock at a pre-agreed price, called the strike price, at some date into the future, called the maturity date. You pay some money at the present to buy this option, called the option price. You bought a call option for CompanyX with the following details: The option price is $2.5, the strike price is $100 and the maturity date is 60 days.
      You calculate the return as follows: being rational, you would only exercise your option if the stock price, $X , in 60 days is above the strike price of $100. The return on your investment is then $(X − 100 − 2.5), i.e., the profit in 60 days minus the price of option. On the other hand if X < 100, you would not exercise the option, and your return is −$2.5.
    • Strategy C (Call Option 2): This is a different call option will the following details: The option price is $1.5, the strike price is $101 and the maturity date is 60 days.
    1. (a) Use the following R command
      SimX <- replicate(M, sample(c(1,0,-1), 60, replace = T)) to obtain M = 10000 simulations of the 60 days of stock price changes. Here, the ����replicate���� command repeats the ����sample���� command for M times, producing a matrix called SimX. How many rows and columns are there in SimX?
    2. (b) Using either the rowSums or the colSums command, generate a vector of length M , each entry of which represents a simulated stock price of CompanyX in 60 days.
    3. (c) What are (approximately) the probabilities of getting a positive return under Strate- gies A, B and C? You may find it helpful to use the pmax(vector,0) command (See its help documentation for more information).

    3

    1. (d) What is (approximately) the probability that Strategy C yields the highest return among the three strategies?
    2. (e) Are the returns under Strategies A, B and C linear in the stock price of CompanyX in 60 days? (You do not need R to answer this question.)
    3. (e) Are the returns under Strategies A, B, and C f getting a positive return under Strategies A, B, and C? You may find it helpful to use the pmax(vector,0) command (See its help documentation for more information). − 100 − 2.5), i.e., the profit in 60 days minus the price of the option. On the other hand if
    submitted by /u/Schoolishard333
    [link] [comments]

    Few simple questions

    Posted: 25 Feb 2021 01:11 AM PST

    I'm still a newbie when it comes to computer software, and I had 2 goals/apps in mind that I imagine should be simple enough to complete as my first official projects

    1) basic block-based notes app (refer to Google keep)

    2) simple tic tac toe game/website

    I'm assuming both can be done fully, and well with the same language (integration is different?) If so which one(s)

    Thanks for your time, attention, & efforts :)

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

    Why use Integer instead of int

    Posted: 24 Feb 2021 09:01 PM PST

    Thanks my dudes.

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

    Which of these Tenancy models is better?

    Posted: 24 Feb 2021 06:33 PM PST

    I'm architecting a tenancy model and I'd love to here your thoughts.

    In one version, I have separate folders that represent each tenant, and each folder\tenant has it's own SQLite database.

    In the other version, all tenants use the same MSSQL or Postgres Database.

    From a schema perspective, it's easier much easier to keep each tenants data separate, because they will ultimately have unique schemas.

    My really question is what are your thoughts on what would perform better under the same stress?

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

    Minecraft nether fortress/bastion remnant generation

    Posted: 25 Feb 2021 12:23 AM PST

    You might or might not have heard that minecraft speedrunning is quite popular these days. And I was wondering since nothing is truly random, if there is a way to determine rough estimation for possible nether fortress generation with the knowledge of the exact location of bastion remnant. It is known that these two structures affect each other, since only one can spawn per "quadrant (roughly a 400 block area with a small divider between each "quadrant")". I should mention one rule that is important: you cannot know the seed of the world during the run.

    Here is the code - this is not an official minecraft code, but it is pretty close to the original (it is a finder for all sorts of minecraft features).

    This is quite a school project of an question, so I understand if no one wants to do it, but I would greatly appreciate your help.

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

    Are there any online games like flexbox froggy that the reddit community likes for javascript?

    Posted: 24 Feb 2021 08:19 PM PST

    Hi there! I am trying to find some simple/basic online javascript questions for a friend that's learning how to code. Does anyone know of any online games like flexbox froggy but for javascript?

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

    [Android] How to save a text file with chooser?

    Posted: 25 Feb 2021 12:03 AM PST

    I'm trying to save a text file to a directory the user chooses. I can save a file with Intent.createChooser() but can't find out how to save the data to the file after it's created. Any help would be much appreciated.

    Here is what I have so far:

     Intent intent = new Intent(Intent.ACTION_CREATE_DOCUMENT); intent.addCategory(Intent.CATEGORY_DEFAULT); intent.setType("text/plain"); intent.putExtra(Intent.EXTRA_TITLE, fileName + ".txt"); activity.startActivityForResult(intent, REQUEST_CODE); 
    submitted by /u/dnlaua
    [link] [comments]

    about IHP and Redwood JS stickers

    Posted: 25 Feb 2021 12:00 AM PST

    Do IHP and Redwood send stickers to our address for free actually?? Like, are the delivery and rest charges also zero?? I want to confirm whether the entire thing is fully free or not.

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

    How to stay healthy as a programmer?

    Posted: 24 Feb 2021 02:51 AM PST

    I've started working remotely as a full time programmer for some weeks now, and noticed that I haven't being paying as much attention to my health as I did before. How do you think I can achieve a healthier work-life balance?

    EDIT: Thank you all for your comments, they are really helpful!

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

    Updating user data via PUT API call

    Posted: 24 Feb 2021 11:03 PM PST

    I am new to working with API and am not sure how to handle the following: I want to implement a PUT call to update user data(firstname, lastname, ..) Currently i call the GET call to get the users data. After that i check the user input and if it is not null than i set that value for the user i got via the GET API call.

    And here is what i am not sure if there maybe is another way to do this? Because i check all user inputs != null since the user maybe updates only one field. If it is null i take the value which the user already has.

    Is there any other way to do this? I am using a Java Springboot application with feign.

    submitted by /u/BizepsJoe--
    [link] [comments]

    Counting Operations - How many operators in a nested loop?

    Posted: 24 Feb 2021 10:05 PM PST

    I am currently doing a personal project on Big O, and how we can classify different algorithms using linear equations and so on. And since for this school project I want to put a heavy emphasis on what we learnt during class to bump my mark (quadratics and so on), finding how I can use math to find the Big O might be nice.

    From what I learnt, I start by counting the number of operators in our code. Then, depending on its time complexity, I would have to create an equation which satisfies our algorithm; for instance, if I had an algorithm that was O(n), my equation would be similar to y = mx+b.

    That's really easy, but with quadratics or algorithms with nested loops, it's harder... Let's say I have the following code...

    void printAllPairs() { int n = 5; for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { std::cout << i << "," << j << "\n"; } } } 

    I know this algorithm is O(n^2) and I also know it's bad practice to notate O(n^2) as O(n^2+ax+b) or O(n) as O(mx+b), but how can I represent this algorithm with a quadratic equation (ex x^2 + ax + b)? I know for a fact that I have two constants (the two assignment operators in line 3 and 5), but would the operator found in "int j = 0" also be considered constant or not? Since this is a nested loop, j = 0 would have to be run again everytime the second loop is being run, right?

    With O(n) equations, it's pretty simple since I can easily recongnize what operators are constants and coefficients, a.k.a. what operators are or not affected by n.

    Any help on how I can notate the printAllPairs() algorithm as a quadratic equation? Sorry if it seem may seem easy for y'all, but a fellow high schooler needs help here.

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

    MAC address Multicasting

    Posted: 24 Feb 2021 09:59 PM PST

    Hi can someone help me how to do MAC address multicasting just like UDP multicasting and i am using RAW socket with MAC address and interface name for communication.

    I have already programmed a MAC address communication using RAW and able to send a string of charecters and structure between 2 different PC's but now i need help in how to do multicast using the same idea.

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

    How would you build this? (Mobile app)

    Posted: 24 Feb 2021 09:33 PM PST

    I'm curious like technology wise/fastest implementation/economical.

    I come from the web dev side and trying to make something "for mobile" seems hacky if it's not coming directly from an app store whether by native or through something like React Native. I usually do PWA that works for me but to a "lay person" that's not technical/just expects it to work... seems off to be like "go to this site and add this to your home screen".

    These are the requirements pretty basic. This is not a job or something just something someone posted in a forum that they wished they had.

    • has auto filled date/location
    • persistent data store
    • search within data store
    • store some strings
    submitted by /u/post_hazanko
    [link] [comments]

    Do SAAS companies offer early access to new features?

    Posted: 24 Feb 2021 02:05 PM PST

    Do you generally see that SAAS Companies allow early access to a redesigned feature? Or do companies just provide documentation, then switch features for all users at the same time?

    I have definitely seen both scenarios, but with the large number of companies, I'm curious on what others have seen.

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

    Problem in coding

    Posted: 24 Feb 2021 07:56 PM PST

    I am making a simple covid coontact tracing website for my school and I came upon this problem. I keep getting these errors:

    Fatal error: Uncaught Error: Undefined class constant 'ERRMODE_EXCPETION' in C:\wamp64\www\useraccounts\config.php on line 8( ! ) Error: Undefined class constant 'ERRMODE_EXCPETION' in C:\wamp64\www\useraccounts\config.php on line 8

    If I removed the first <?php?> part the error goes away. What is wrong with it?

    <?php

    require_once('config.php');

    ?>

    <!DOCTYPE html>

    <html>

    <head>

    <title>SCT Contact Tracing</title> <link rel="stylesheet" type="text/css" href="css/bootstrap.min.css"> 

    </head>

    <body>

    <div>

    <?php if(isset($\_POST\['create'\])){ $firstname = $\_POST\['firstname'\]; $lastname = $\_POST\['lastname'\]; $contactnumber = $\_POST\['contactnumber'\]; $temperature = $\_POST\['temperature'\]; $address = $\_POST\['address'\]; $symptoms = $\_POST\['symptoms'\]; $travel = $\_POST\['travel'\]; $close = $\_POST\['close'\]; 

     $sql="INSERT INTO infos (firstname, lastname, contactnumber, temperature, address, symptoms, travel, close) VALUES(?,?,?,?,?,?,?,?)"; $stmtinsert = $db->prepare($sql); $result = $stmtinsert->execute(\[$firstname, $lastname, $contactnumber, $temperature, $address, $symptoms, $travel, $close\]); if ($result) { echo 'Succesfully Saved'; }else{ echo 'There were errors while saving the data'; } 

    } ?> 

    </div>

    <div>

    <form action="registration.php" method="post"> <div class="container"> 

     <div class="row"> 

    <div class="col-sm-3">

     <h1>Siena College of Taytay Contact Tracing</h1> <p>Fill up the form with correct information.</p> <hr class="mb-3"> <label for="firstname"><b>First Name</b></label> <input class="form-control" type="text" name="firstname" required> 

     <label for="lastname"><b>Last Name</b></label> <input class="form-control" type="text" name="lastname" required> 

     <label for="contactnumber"><b>Contact Number</b></label> <input class="form-control" type="text" name="contactnumber" required> 

     <label for="temperature"><b>Temperature</b></label> <input class="form-control" type="text" name="temperature" required> 

     <label for="address"><b>Home Address</b></label> <input class="form-control" type="text" name="address" required> 

     <label for="symptoms"><h2>Have you experienced fever, dry cough, shortness of breath in the past 14 days?</h2></label> <input type="radio" name="symptoms" value="yes">YES<br> <input type="radio" name="symptoms" value="no">NO<br> 

     <label for="travel"><h2>Have you travelled outside the country in the past 14 days?</h2></label> <input type="radio" name="travel" value="yes">YES<br> <input type="radio" name="travel" value="no">NO<br> 

     <label for="close"><h2>Have you ever been in close contact with a Covid Positive person in the past 14 days?</h2></label> <input type="radio" name="close" value="yes">YES<br> <input type="radio" name="close" value="no">NO<br> <hr class="mb-3"> <input class="btn btn-primary" type="submit" name="create" value="Sign Up"> 

    </div>

     </div> </div> </form> 

    </div>

    </body>

    </html>

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

    CRC-32 Implementations Depend on Endianness. But if Endianness Only Applies to Bytes, Why are the Polynomials Reversed Bit-By-Bit?

    Posted: 24 Feb 2021 01:50 PM PST

    I've been learning about CRC-32 and understand both the naive and Sarwate algorithms. But I'm confused about endianness here. I mean, I see how endianness is relevant and all. But the polynomials 0x04c11db7 (BE) and 0xedb88320 (LE) of the IEEE 802.3 standard are opposites if you reverse them bit-by-bit. On the other hand, I keep reading (fig1, fig2) that endianness only applies to bytes within a word and that bits don't really have endianness. So shouldn't the LE version of 0x04c11db7 be 0xb71dc104 (byte order changed, bytes themselves the same) instead of 0xedb88320?

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

    How do I compile this CPP program (Kinect Azure)

    Posted: 24 Feb 2021 02:14 PM PST

    Hi, I have a kinect azure and I want to try out a few programs to make modifications. I am primarily a python programmer and I have worked with C several years back, but I need something simple to get this program working:

    https://github.com/microsoft/Azure-Kinect-Sensor-SDK/tree/master/tests/Calibration

    The SDK that has the header files is here: http://download.microsoft.com/download/1/9/8/198048e8-63f2-45c6-8f96-1fd541d1b4bc/Azure%20Kinect%20SDK%201.2.0.msi

    What I have done so far: Downloaded the SDK, installed MinGW and tried to compile the program. I am having issues with the path to the header files in the SDK.

    What do I need to do to compile this? I would really appreciate some help.

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

    How to make this code block return the value and break out of the recursive loop when the answer is found

    Posted: 24 Feb 2021 02:13 PM PST

    ```

    import copy

    def determinant(matrix):
    mat_copy = copy.deepcopy(matrix)

    def submatrix(mat):
    # returns the value of a two by two matrix
    return (mat[0][0] * mat[1][1]) - (mat[0][1] * mat[1][0])

    def reduce(mat1, total=0):
    if mat1 == matrix and total != 0:
    return total
    if total != 0:
    return total
    if len(mat1) == 2:
    return submatrix(mat1)
    else:
    array = []
    for number in range(len(mat1)):
    print(number)
    total += ((-1) ** number * mat1[0][number] * reduce(res_matrix(mat1, number)))
    # print(array)
    return total

    def res_matrix(matrix, col):
    new_matrix = []
    for i in range(len(matrix)):
    new = []
    for j in range(len(matrix)):
    if i == 0:
    continue
    if j == col:
    continue
    new.append(matrix[i][j])
    new_matrix.append(new)
    new_matrix.pop(0)
    return new_matrix

    reduce(mat_copy)
    ```

    When I debug the above program to find the determinant of any system of equations, the correct answer is gotten at several steps during the computing but I am unable to make the program return it. Please help

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

    What can one line of code do? Show the most practical examples

    Posted: 24 Feb 2021 01:55 PM PST

    Career advice - feeling stagnant

    Posted: 24 Feb 2021 07:57 AM PST

    I graduated with a bachelor's in computer science two years ago and have been at the same job ever since. My concern is that this job has consistently, actively pushed me away from programming (despite my title being "programmer") to a degree where I know I've become a worse programmer over time. I want to go elsewhere but no longer have much confidence in the skills I developed as an undergrad.

    What would you recommend to help me rebuild confidence as a programmer? What would make me a desirable candidate for hire as a programmer? I'm looking for any suggestions: classes, certifications, general skills that are highly sought after, etc.

    Thank you in advance for your help!

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

    No comments:

    Post a Comment