• Breaking News

    Thursday, March 11, 2021

    What's something that they should teach in College that they don't or don't do enough in? Ask Programming

    What's something that they should teach in College that they don't or don't do enough in? Ask Programming


    What's something that they should teach in College that they don't or don't do enough in?

    Posted: 11 Mar 2021 01:34 PM PST

    IMO Git should be a must. They never showed us it.

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

    Hiring managers, do you look positively on tutoring as experience?

    Posted: 11 Mar 2021 11:58 AM PST

    Looking to pickup a summer job, and I've got an interview at a 'Code Ninjas' place an hour away. Financially it's basically an unpaid internship when you factor in how much it costs to own a car here, so is that experience worth it?

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

    I wanna self-teach myself to become a full stack Java developer, but I'm unsure where to start or even what resources to use.

    Posted: 11 Mar 2021 05:39 AM PST

    I graduated December with an Associate's of Applied Science, focusing in computer programming.

    My classes did allow to dip my feet into the programming world (which made me love it) but not so much on what to actually do. Because of that I wanna teach myself so I can go from there and possibly even get a job, but I'm unsure nowhere to even begin or what to use.

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

    Question about working in Software Industry

    Posted: 11 Mar 2021 09:41 PM PST

    I'm at a bit of a crossroads right now. I love programming but I don't want a job where I'm sitting at a desk all day.

    My question is, for a typical job in the Software Industry, will I be stuck at a desk all day?

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

    Beginners Guide To Error Correction Codes

    Posted: 11 Mar 2021 08:14 PM PST

    I am new to error correction codes and trying to get a general understanding of the difference between correction coding methods. Can someone tell me about the kinds of LDPC codes and the differences between them?

    I'm particularly confused about the usage of the term "turbo codes" and how they are different from LDPC codes. I am also trying to understand the relationship between irregular LDPC codes, irregular turbo codes, and IRA codes. My understanding is that all three are forms of LDPC codes but still have some differences between them.

    submitted by /u/Minute-Highlight-591
    [link] [comments]

    Radio buttons and the "value" attribute: is it OK to repeat it in different groups?

    Posted: 11 Mar 2021 02:32 PM PST

    I'm trying to understand what is the proper way to use the value attribute with radio buttons.

    Here is a quote from 2015 year from another site:

    The value property on a radio button is used server-side to determine which button was selected. It's important to set different values for radio buttons in the same group for server-side implementation - but you won't actually display or use this information in your HTML. Consider that you might also use this value in your CSS as a selector, if you wanted to add a special style for a particular button.

    (Source: https://teamtreehouse.com/community/what-is-the-value-attribute-doing-for-the-radio-buttons.)

    Now let me show some example code:

    <article> <h1>Saturday</h1> <p>Which color you prefer on Saturdays?</p> <input type="radio" name="saturday-color" id="color1" value="?"> <label for="color1">Red</label> <input type="radio" name="saturday-color" id="color2" value="?"> <label for="color2">Yellow</label> <input type="radio" name="saturday-color" id="color3" value="?"> <label for="color3">Green</label> </article> <article> <h1>Sunday</h1> <p>Which color you prefer on Sundays?</p> <input type="radio" name="sunday-color" id="color4" value="?"> <label for="color4">Red</label> <input type="radio" name="sunday-color" id="color5" value="?"> <label for="color5">Yellow</label> <input type="radio" name="sunday-color" id="color6" value="?"> <label for="color6">Green</label> </article> 

    As you see, the first and the second questions have the same variants of the answer.

    Is it weird/unwise to give the same set of values for the buttons in the first and the second groups? That is, the values in the first group would be as follows: Red, Yellow, Green; and the values in the second group would be the same.

    Or is it typically better to make them unique? That is:

    • the values in the 1st group would be as follows: red1, yellow1, green1; and
    • the values in the 2nd group would be as follows: red2, yellow2, green2
    submitted by /u/john_smith_007
    [link] [comments]

    Issue with CUDA code it seems no one can help with

    Posted: 11 Mar 2021 05:43 PM PST

    I was given this code by my professor:

    int i = threadIdx.y; int j = threadIdx.x; int c_ij = i * blockDim.x + j; int tempC = 0; int i_A = 0; int i_B = 0; for (int k = 0; k < widthA; k++) { i_A = i * widthA + k; i_B = k * widthB + j; tempC += a[i_A] * b[i_B]; } c[c_ij] = tempC; 

    I'm currently learning CUDA and have been given code meant to performing matrix multiplication in CUDA by my professor. I first perform the calculation in c++ so I can compare the result of the cuda code. It's supposed to do it by converting the 2D arrays to 1D arrays before passing to the kernel, but the code i've been given to actually calculate the result doesn't seem to work correctly, i've been stumped by it days. Here is the full code:

    #include "cuda_runtime.h" #include "device_launch_parameters.h" #include <stdio.h> __global__ void addKernel(int *c, const int *a, const int *b, const int widthA, const int widthB) { int i = threadIdx.y; int j = threadIdx.x; int c_ij = i * blockDim.x + j; int tempC = 0; for (int k = 0; k < widthA; k++) { int i_A = i * widthA + k; int i_B = k * widthB + j; tempC += a[i_A] * b[i_B]; } c[c_ij] = tempC; } int main() { const int heightA = 4; const int widthA = 3; const int heightB = 3; const int widthB = 2; const int arraySizeA = heightA * widthA; const int arraySizeB = heightB * widthB; const int arraySizeC = heightA * widthB; //Matrix multiplication in CPU const int a1[heightA][widthA] = { {1, 2, 3}, {4, 5, 6}, {7, 8, 9}, {10, 11, 12} }; const int b1[heightB][widthB] = { {6, 5}, {4, 3}, {2, 1} }; int c1[heightA][widthB] = { 0,0 }; for (int i = 0; i < heightA; i++) { for (int j = 0; j < widthB; j++) { for (int k = 0; k < heightB; k++) { c1[i][j] += a1[i][k] * b1[k][j]; } } } printf("Matrix multiplication in CPU (result):\n"); for (int i = 0; i < heightA; i++) { for (int j = 0; j < widthB; j++) { printf("%d ",c1[i][j]); } printf("\n"); } //Matrix multiplication with CUDA const int a[arraySizeA] = { 1,2,3,4,5,6,7,8,9,10,11,12 }; const int b[arraySizeB] = { 6,5,4,3,2,1 }; int c[arraySizeC] = { 0 }; int* dev_a = 0; int* dev_b = 0; int* dev_c = 0; cudaError_t cudaStatus; // Choose which GPU to run on, change this on a multi-GPU system. cudaStatus = cudaSetDevice(0); if (cudaStatus != cudaSuccess) { fprintf(stderr, "cudaSetDevice failed! Do you have a CUDA-capable GPU installed?"); goto Error; } // Allocate GPU buffers for three vectors (two input, one output) . cudaStatus = cudaMalloc((void**)&dev_c, arraySizeC * sizeof(int)); if (cudaStatus != cudaSuccess) { fprintf(stderr, "cudaMalloc failed!"); goto Error; } cudaStatus = cudaMalloc((void**)&dev_a, arraySizeA * sizeof(int)); if (cudaStatus != cudaSuccess) { fprintf(stderr, "cudaMalloc failed!"); goto Error; } cudaStatus = cudaMalloc((void**)&dev_b, arraySizeB * sizeof(int)); if (cudaStatus != cudaSuccess) { fprintf(stderr, "cudaMalloc failed!"); goto Error; } // Copy input vectors from host memory to GPU buffers. cudaStatus = cudaMemcpy(dev_a, a, arraySizeA * sizeof(int), cudaMemcpyHostToDevice); if (cudaStatus != cudaSuccess) { fprintf(stderr, "cudaMemcpy failed!"); goto Error; } cudaStatus = cudaMemcpy(dev_b, b, arraySizeB * sizeof(int), cudaMemcpyHostToDevice); if (cudaStatus != cudaSuccess) { fprintf(stderr, "cudaMemcpy failed!"); goto Error; } dim3 blockSize(heightA, widthB); // Launch a kernel on the GPU with one thread for each element. addKernel << <1, blockSize >> > (dev_c, dev_a, dev_b, widthA, widthB); // Check for any errors launching the kernel cudaStatus = cudaGetLastError(); if (cudaStatus != cudaSuccess) { fprintf(stderr, "addKernel launch failed: %s\n", cudaGetErrorString(cudaStatus)); goto Error; } // cudaDeviceSynchronize waits for the kernel to finish, and returns // any errors encountered during the launch. cudaStatus = cudaDeviceSynchronize(); if (cudaStatus != cudaSuccess) { fprintf(stderr, "cudaDeviceSynchronize returned error code %d after launching addKernel!\n", cudaStatus); goto Error; } // Copy output vector from GPU buffer to host memory. cudaStatus = cudaMemcpy(c, dev_c, arraySizeC * sizeof(int), cudaMemcpyDeviceToHost); if (cudaStatus != cudaSuccess) { fprintf(stderr, "cudaMemcpy failed!"); goto Error; } printf("\nMatrix multiplication with CUDA (result):\n"); int rowNum = 0; for (int i = 0; i < arraySizeC; i++) { if (rowNum == widthB) { printf("\n"); rowNum = 0; } rowNum++; printf("%d ",c[i]); } Error: cudaFree(dev_c); cudaFree(dev_a); cudaFree(dev_b); return 0; } 

    If you have any idea what could be wrong i'd appreciate the input, the results im getting are shown below, thanks so much in advance:

    Matrix multiplication in CPU (result): 20 14 56 41 92 68 128 95 Matrix multiplication with CUDA (result): 20 14 8 5 56 41 26 17 
    submitted by /u/HoooooWHO
    [link] [comments]

    Ask HN: How does Spotify manage API requests?

    Posted: 11 Mar 2021 05:05 PM PST

    My internet connection is really bad so I noticed something about Spotify. Whenever I load my 'Liked songs' playlist, whichever song I select will play for the first 10 seconds and then stop (due to my bad internet connection).

    That made me wonder: does Spotify loads the first 10 seconds of the perhaps first few songs from that list and then, as songs are played, make other requests to get songs in their entirety?

    Also, could WireShark be used to check how requests work? Not sure how to verify that traffic from a phone. I'm assuming checking for XHR requests in the browser would yield different results due to different design decisions.

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

    Project Setup Best Practices in 2021

    Posted: 11 Mar 2021 06:15 AM PST

    Due to the latest announcement from Microsoft regarding Blazor Apps finally having the option to be deployed as a Desktop App, I found myself in a little dilemma.

    We currently have a relatively big project, consisting of an ASP .NET server and a client, which is built using WPF. We manage these two projects separately, because the server is customized for each customer, using git forks. Therefore, we ran into the problem, that most of the models are duplicated in the server and the client.

    In addition, we are currently planning to develop an improved "2.0" version of the client and since during our first revision a lot of crunch time was included, we now want to improve the general project structure and get rid of those redundancies.

    So far, we have come up with three options (assume that whenever I say 'project' I automatically also mean a separate git repo):

    1. Create a separate Server and Client project in addition to another project for all the shared classes
    2. Merge everything into one big project and also fork the client for each customer
    3. Wait for further information regarding Blazor Apps

    Regarding the third point, I want to add something. It would be ideal if we could also move away from XAML pages and move on to Blazor pages (most of my colleagues are having an easier time with Razor pages, therefore this transition). In my eyes, this means, that the entire application is much more uniform, but I might miss something.

    Therefore to summarize this as a general question: What are current best practices for a Client/Server Application in .NET Core? Everything in one project, two separate projects with an additional "helper" project, or even something completely different?

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

    Layered architecture

    Posted: 11 Mar 2021 09:23 AM PST

    hi!! i have to do a C project and to split it into modules using layered architecture. I've used layered architecture in some Python projects before, but I still don't understand a thing - service layer. What is its purpose? When I had it in my python project, all that i did in the service layer was pretty much just to call functions from the repositories. I searched on google but every explanation seems kinda vague to me.

    submitted by /u/absolutely-notmyname
    [link] [comments]

    How do I grab a javascript link?

    Posted: 11 Mar 2021 12:44 PM PST

    f you hit "Download" a new bar appears and gives you the options: "1080p, 720p, 480p, 320p". I am trying to copy the link for 1080p.

    If you left click on 1080p it starts downloading regularly. If you right click on 1080p it's as if you right clicked anywhere on the page.

    Here is what it looks like.

    I opened up developer tools and looked thru the Elements & Network tabs but I cannot find any links.

    This is what Elements looks like.

    Once you actually hit 1080p a link appears but it disappears.

    This is what the url looks like.

    Can someone explain how I would capture this link?

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

    Is multiplying by a constant the fastest way to hash a number?

    Posted: 11 Mar 2021 06:41 AM PST

    I want to hash some 64-bit integers into some other 64-bit integers with good quality mixing. My first idea is to just multiply by a large 64-bit integer, modulo 264. Multiplying can be slow. Can I do better?

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

    [R] stacking columns 3 by 3

    Posted: 11 Mar 2021 06:18 AM PST

    hi all,

    I have a data frame of 540 columns, and want to stack these columns to have only 3 columns left.

    i want to stack them so that 1:3 are the first rows, then 4:6, 7:9, etc...

    The data of the columns that need to be stacked upon each other are the same, column names differ though. (see picture: https://imgur.com/a/UYd5GwY)

    Any advice would be appreciated!

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

    Is counter offering with a range that's over 200% the initial offer too bad in the situation I'm in (remote, non-American, outside US)?

    Posted: 11 Mar 2021 10:49 AM PST

    I'm non-American and live outside of the US in a developing country (Peru). I recently got an offer of $10,000 for a software engineering job that, if based in the US (but still remote) ranges from $45,000 to $80,000. That offer seems extremely low to me.

    I was hoping to counter with an expected range of $30,000-45,000 as that's what I was honestly expecting since I'm in a developing country.

    That's because I feel I am worth that. I studied at a really great University (known worldwide) and held jobs in first world countries (with good metrics to show), as well as started my own companies in Peru.

    However, I'm a bit afraid that I'm countering with too high a number I will blow the offer, and I certainly don't want that to happen. Maybe the employer hopes to hire more, cheaper workers for the price of one and if I present that range, he'll walk away immediately. I would like to figure out what's really the max they're hoping to pay for my work.

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

    Getting that next level

    Posted: 11 Mar 2021 10:28 AM PST

    Put I a tons of extra work as a software engineer but every performance review is shut down with "you're doing great, keep doing what you're doing." Like what else you want from me. And all those weekend, late nights, stressful demos... That all earns me a measly merit raise. How do you define the software position you want to be next and what you doing to get there

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

    Given a string of digits 0-9. Group the adjacent digits to form numbers, in such a way that their sum will equal a certain given total T. A digit may only belong to one number. I have been completely stumped please help thanks. I have been stumped please help i dont even know how i would attempt it.

    Posted: 11 Mar 2021 09:40 AM PST

    Creation of a CMD/Notepad Script for Website

    Posted: 11 Mar 2021 09:39 AM PST

    Hi all! :)

    Firstly, I would like to state that I have very limited knowledge on coding and programming (although I am currently learning)! I would like to know if it is possible to create a script for Command Prompt or a Notepad application that allows URLs to be launched... I'll explain what I mean:

    For example: let's say this website (www.mysuper123site.com/) has various pages and sub-pages, so I would like to go to a page listed as '/about' (www.mysuper123site.com/about). I am looking to make a Command Prompt script or Notepad application that would allow myself to enter the page name, as an example, where the prompt asks me to enter it. So, the script or application will prompt me with text to be entered - and I would enter: about. Once clicking enter, the script or application will take me to: www.mysuper123site.com/about. If I were to run it again and enter something else, such as: info, it will then take me to: www.mysuper123site.com/info. I have no idea if this is a possibility or not, but if someone is able to shed some light on the potential possibility of it, it would be much appreciated. :) Thank you!

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

    Distributed system architecture

    Posted: 11 Mar 2021 02:49 AM PST

    I have a system that consists of services communicating using a message queue:

    • A "Sender" service that sends messages to the queue consisting of some metadata and a set of image files
    • A "Worker" service that retrieves the messages, converts the images into formats it can use, perform a calculation on the converted files+the metadata, then puts the result on the queue
    • A "Retriever" service that stores the result in a database.

    This works quite well: a single sender instance can receive 1000 requests from an external source, put 1000 messages on the queue, and multiple worker instances can perform their work and then publish it to a single retriever instance. Very efficient, and it's really easy to scale since I can scale based on the number of messages on the queue.

    But I want to split up the image conversion workload of my worker into a separate "Converter" service. But I'm not really sure how.

    The simplest possible method is to not use a queue, and simply call the converter service using a blocking HTTP endpoint, like this:

    Sender -- queue message --> Worker --- queue message --> retriever | ^ http http v | Converter 

    But I would prefer if the communication between services continues to go through the queue system - as the worker will be suspended while it waits for the converter to do its job, and I don't want to lock up the worker instances.

    But I'm not sure how.

    Solution A (send along information; state remains suspended in the worker)

    The Worker service retrieves a WorkMessage = { metadata: Metadata, files: Array[Bytes]}, then publishes a new ConvertMessage = { metadata: Metadata, files: Array[Bytes]} and stops.

    The Converter service retrieves the ConvertMessage, performs the conversion, then publishes a ConvertResultMessage = { metadata: Metadata, converted_files: Array[Bytes]}

    The Worker service retrieves the ConvertResultMessage and performs its work, then publishes a final WorkResultMessage that the Retriever service consumes.

    This works, but the Converter would need to have and send along the Worker service's metadata - which is wrong, since the Converter should not be allowed to see the inner details of the Worker service. It also doesn't work if there's multiple different Worker services, that each has their own data - adding a new Worker service would require updating the Converter service.

    Solution B (use a database; state is stored in a database)

    Should I perhaps have the Worker store the incoming metadata in a database alongside a random lookup string that I send along to the converter, so that the worker instance handling the ConvertResultMessage can look up the metadata and continue running?

    That is,

    Worker: * Retrieve `WorkMessage { metadata, files }` * Save metada to a database, using random pk `work_id` * Publish `ConvertMessage { files = files, reference = work_id}` then stop execution Converter: * Retrieve ConvertMessage * Perform conversion * Publish `ConvertResultMessage { converted_files, reference }` Worker: * Retrieve `ConvertResultMessage` * Look up metadata using the ConvertResultMessage's reference field * Perform calculation on metadata+converted files and publish WorkResultMessage 

    I think this is better, but it means that all workers using the Converter service needs a database.


    Any ideas on a better architecture? What's the typical best practise for these kind of things?

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

    I'd like to make use of the GMAIL and ZOHO APIs to automate some of my work, please point me in the right direction

    Posted: 11 Mar 2021 04:33 AM PST

    Let me preface this by saying that I have never done anything similar and have zero idea where to even start. I do know some HTML, CSS, C, and have built static websites myself.

    How do I send calls? Where do I even write code which checks whenever a new email is received whether it contains the text I need, and then sends calls to a different webstore API?

    Do I need a server of my own? Do I host it on my PC? Is it better to host it somewhere else? Where?

    Just imagine your dad told you he wanted automate the process of sending an instruction to his webshop (change customer data, etc) when he receives an email containing certain keywords or having keywords in a subject. There's API documentation available for both. Where would you have him start, what does he need, where does he write his instruction in, what language etc.?

    Thanks a lot.

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

    Quit school and go look for internship

    Posted: 11 Mar 2021 01:14 PM PST

    Should I do this lol.

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

    how to chose the right programming language for you Project

    Posted: 11 Mar 2021 07:07 AM PST

    I'm building pos system with GUI working on mobile phone

    this project need to done multi this

    GUI / Desktop / Mobile android & IOS

    SQLite

    MySQL

    web API

    and I'm new to programing so started with one multi-purpose langue "python" but as I'm going in they all saying this not fit your project you need Flutter for GUI or need GO for more speed

    I want to learn one muIlti-purpose langue help me to do this

    why learning multi-language

    like if using pyqt is good and cross-platforms

    i think I will learn HTML and CSS and JS is better than Learn GO or Python?

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

    In Netflix show 'Chelsea', what software is used by the programming teacher?

    Posted: 11 Mar 2021 05:13 AM PST

    I liked that the teacher was able to mirror his screen to multiple computers to teach coding. I was wondering what software that was. Its on the second episode, Chelsea Does Silicon Valley.

    I was unable to find a short video of that precise moment unfortunately.

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

    can someone tell me the error

    Posted: 11 Mar 2021 04:56 AM PST

    hello i am new to programming, i have written this program is c language using devc++

    when i run the program only one part runs and part 2 doesn't even get executed, if someone can tell me why i would highly appreciate it. i have mentioned part 2 using a comment in program

    #include<stdio.h>

    int main()

    {

    char scale; int age,rp,years; printf("enter your scale="); scanf("%c", &scale); printf("enter your age="); scanf("%d", &age); printf("enter your experience in years="); scanf("%d", &years); printf("\\n\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* " ); printf(" \\nBASIC PAY\\n"); switch(scale) { case 'w': printf("basic salary=10000 \\n number of increments=%d\\n",years ); rp=10000+years\*700; printf("Running Pay=%d",rp); break; case 'x': printf("basic salary=12900 \\n number of increments=%d\\n",years ); rp=12900+years\*910; printf("Running Pay=%d",rp); break; case 'y': printf("basic salary=21700 \\n number of increments=%d\\n",years ); rp=21700+years\*1500; printf("Running Pay=%d",rp); break; case 'z': printf("basic salary=32600 \\n number of increments=%d\\n",years ); rp=32600+years\*2800; printf("Running Pay =%d",rp); break; default: printf("Invalid character"); 

    }

    //PART 2

    int hra,SSB,ARA;

    hra=rp*45/100;

    printf("House Rent Allowance=%c",hra);

    switch(scale)

    {

    case 'w': SSB=10000\*30/100; printf("Social Security Benefits=%d",SSB); break; case 'x': SSB=12900\*30/100; printf("Social Security Benefits=%d",SSB); break; case 'y': SSB=21700\*30/100; printf("Social Security Benefits=%d",SSB); break; case 'z': SSB=32600\*30/100; printf("Social Security Benefits=%d",SSB); break; default: printf("Invalid character"); 

    }

    if(scale=='w',age>40)

    {

    int ARA=3000; printf("Ad-hoc relief allowance=3000"); 

    }

    else

    {

    int ARA=1500; printf("Ad-hoc relief allowance=1500"); 

    }

    int gp;

    gp=rp+hra+SSB+ARA;

    printf("Gross Pay=%d",gp);

    return 0;

    }

    submitted by /u/Wonderful-Hour7018
    [link] [comments]

    How do you program 'creativity'?

    Posted: 11 Mar 2021 04:23 AM PST

    I know there is this ai called aiva which produces original songs and I was wondering how they did. Like what are the weights and what values do you plug in to get those original pieces of work?

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

    No comments:

    Post a Comment