• Breaking News

    Tuesday, April 20, 2021

    Back in the mid-00s, Google advertised Java jobs requiring Python knowledge, reasoning that anybody who knew such a then-esoteric language clearly is both willing and able to learn "on the side". What language would fill the same role today? Ask Programming

    Back in the mid-00s, Google advertised Java jobs requiring Python knowledge, reasoning that anybody who knew such a then-esoteric language clearly is both willing and able to learn "on the side". What language would fill the same role today? Ask Programming


    Back in the mid-00s, Google advertised Java jobs requiring Python knowledge, reasoning that anybody who knew such a then-esoteric language clearly is both willing and able to learn "on the side". What language would fill the same role today?

    Posted: 20 Apr 2021 12:59 PM PDT

    Edit to add: I think "esoteric" was the wrong word, because it means something in language design. What I'm looking for here is a language that (1) isn't common as a teaching language in schools and (2) isn't common in industry. In other words, if you know the language, I should be pretty sure you taught yourself just for fun.

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

    Looking for a explanation of this recursive anagram generating code

    Posted: 20 Apr 2021 08:36 PM PDT

    Hello Reddit,

    I am working on a programming assignment and just couldn't figure it out. I used the online programming guide associated with the work in order to understand the assignment.

    The assignment is to generate the anagrams of a given string using recursion.

    Here is the video in question (uploaded by the official account): https://vimeo.com/367315277 @ 5:09

    Here is the code written out:

    Private void completeAnagrams(String start, String end) { if (end.length <= 1) { anagrams.add(start + end); } else { for (int i =0; i < end.length(); i++) { String ns = start + end.charAt(i); String ne = end.substring(0, i) + end.substring(i + 1); completeAnagrams(ns, ne); } } } 

    I am completely lost on how this works. I tried tracing it to no luck. I don't understand how ns and ne work with the recursive and the for loop, and how this is able to generate all possible combinations.

    The narrator seems to write the code and explain it in 1 to 2 sentences, which isn't very helpful. I am new to Java myself.

    How does it start with T, and then pick every letter combination after that. Then it goes to E, and picks every combination off of that?

    submitted by /u/One-Speed7920
    [link] [comments]

    Twitter API / Project Help

    Posted: 20 Apr 2021 08:28 PM PDT

    Hi all! I'm a newbie to coding and I'm trying to build out a few projects for my portfolio. I'm trying to build a REACT app using Express, NodeJS, and the Twitter API. I built the front end easily but struggling to implement the back end and API. I've seen a million tutorials on how to connect an express back end to react, but not sure what the best / most modern way to go about it is. Do I do separate repos or just do it all in one? Any advice or resources would be so appreciated, thanks all!

    Context - I just want to render a feed of recent tweets with specific phrases. I don't actually need to save anything anywhere.

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

    Best 4K monitor for coding/programming?

    Posted: 20 Apr 2021 08:14 PM PDT

    Currently, I have a MacBook Pro 16" on which I work 8 hours daily at my employer's offices. Wen I go back home, I usually plug that laptop into a DELL 27" full HD monitor. Every time I do that, it strikes me how different the resolutions of the two devices are! On my laptop, I see the text on the code editor well defined and sharp. On the full HD monitor, I see the individual pixels that create the text, making it blurry and "undefined".

    Does anyone know a good 4K monitor to use for coding (and maybe some content creation in the future)? I need to replace my full HD DELL with something more like my laptop's screen, but bigger.

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

    Turing Machine

    Posted: 20 Apr 2021 10:27 PM PDT

    Turing machine which accepts the language L = {ai) (bj) (ck) | i,j,k > = 0 | here, either i=j or i=k. Design and Explain the Turing Machine.

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

    Why does my CPP professor force us not to use ide but only gedit and the terminal?

    Posted: 20 Apr 2021 12:58 AM PDT

    Question about compiler optimization

    Posted: 20 Apr 2021 01:29 PM PDT

    Suppose I have this code:

    #include <stdio.h> int main() { int arr[5] = { 34, 65, 34, 76, 10 }; int max; for (int i = 0; i < 5; ++i) { if (i == 0) { max = arr[i]; } else { if (arr[i] > max) { max = arr[i]; } } } printf("Biggest element: %d\n", max); return 0; } 

    and this code:

    #include <stdio.h> int main() { int arr[5] = { 34, 65, 34, 76, 10 }; int max = arr[0]; for (int i = 1; i < 5; ++i) { if (arr[i] > max) { max = arr[i]; } } printf("Biggest element: %d\n", max); return 0; } 

    They do the same thing, but the first one has to check if i == 0 every iteration. I know this is a broad question, but would a compiler convert the first code into the second? Or implement some other optimization? I tried on godbolt and it didn't see to do it, but I don't know if I have to enable optimizations and my assembly isn't the best.

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

    QuickSort question

    Posted: 20 Apr 2021 05:21 PM PDT

    If I were to input an already sorted array into quicksort, I read that this is the worst-case scenario and be very inefficient, but I want to question if inputting an already sorted array will give the least amount of swaps if the first element was the pivot point.

    My guess is that the number of swaps occurring will be 0? is that correct?

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

    [HTML beginner question] Start tag and end tag issues. What am I doing wrong??

    Posted: 20 Apr 2021 05:11 PM PDT

    I just started learning how to program in HTML and I have no idea what I'm doing, but I'm especially confused about start/end tags, also about when and which tags I should use. Any help is appreciated, ty. https://imgur.com/a/H36tr1V

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

    Looking for ideas on how to elaborate a back-end architecture

    Posted: 20 Apr 2021 04:44 PM PDT

    I am new here and would like to collect opinion from the community. I started studying Web Development and Dev Ops fundamentals two years ago and I've received a problem and would like your help. The problem is as follows:

    Let's assume that there are three large external databases that organize our information. The first one, which we call Base A, is extremely sensitive and must be protected with the highest levels of security, but access to this data does not have to be as performative. The second is Base B, which also has critical data, but unlike Base A, its access needs to be a little faster. Another feature of Base B is that in addition to queries it is used for data extraction through machine learning algorithms. The last base is Base C, which has no critical data, but needs extremely fast access.

    What kind of technology or architectures come to mind for this problem? I would also love to receive some info on how to approach this problem.

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

    How to tell client when a back-end async is finished ? Junior/low-mid question

    Posted: 20 Apr 2021 03:51 PM PDT

    I have a c# application.

    I run a function from page A that creates new data and inserts it into a new database table.

    The function redirects to page B with the new inserted data.

    The view/client displays this data in a grid.

    I now have a requirement where I have to add several more grids to that page and the user can cycle through the different grids. All the new grids need new generated data.

    I would like to generate the data for grid 1, load page 2 with grid 1 data, and asynchronously save the other data and load it to grid 2, 3, 4 etc when that data is ready.

    How could this be done? Is there a way to send a ping to the client/view to say the data is ready. Should i periodically make calls to the server to see if the data is ready?

    I create the grids and they're hidden until the user clicks on them and data has been pushed into them. I just want to concurrently fill them when the data is ready

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

    Problem with assumedly GitHub and my Discord bot.

    Posted: 20 Apr 2021 11:26 AM PDT

    I have programmed a bot using Python and the Discord.py module. I am using the free hosting spot on Heroku to run my bot continuously, and of course I'm hosting the source code on GitHub.

    One function of the bot I made was a bot that would parse a specific subreddit using the asyncpraw API, store many attributes of each post, and sequentially post them in a Discord text chat based off of the number of upvotes, as a discussion starter.

    The problem I'm running into is specifically how I am assuming GitHub or Heroku runs the bot and storing persistent data. I can store previously posted titles in a list to make sure the same post is not repeated, but eventually I'm assuming Heroku stops the program for just a second, or something enough to wipe the current data being held.

    I've tried storing them in text files or using pickle but while it works when I run it on my own computer, when I run it using Heroku it goes back to the same problem and doesn't fix. I'm assuming I'm ignorant to something related to Heroku or GitHub that would fix this.

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

    Is it possible to implement google 2fa, into a C# desktop application

    Posted: 20 Apr 2021 11:05 AM PDT

    So I'm making an desktop application in C# and would like to add google 2FA, but I can't really find anything on how to add this to a non web application. Is it even possible? If this is not possible, does anyone have some tips or links on how to add 2FA to an desktop application? Thanks in advance

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

    React Vs JQuery?

    Posted: 20 Apr 2021 02:37 PM PDT

    I know that this is a noob question, so I apologize for showing my noob-ness, but I was talking to a gent who stated that it's better to learn jQuery for entry level job vs react which many jobs require that you have a year's worth of experience for. I wonder if it is worth learning JQuery because I read that jQuery is dying and React is essentially replacing that. Is it true that it is better to learn jQuery over React

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

    Basic error in Ajax

    Posted: 20 Apr 2021 10:40 AM PDT

    I have a button, which calls the function changeText() on click. However, in the function it does not work as expected i.e. it does not put the contents of "test.txt" to the div with id="main_content" because it does not enter the if statement => this.readState is not equal to 4 and this.status is not equal to 200.

    I'm running the script locally and this is the most basic syntax. I can't understand why it doesn't work. Please help

    ```

    function changeText() {

    var xhttp = new XMLHttpRequest();

    xhttp.onreadystatechange = function(){

    if(this.readyState==4 && this.status==200){

    document.getElementById("main_content").innerHTML = this.responseText;

    }

    };

    xhttp.open("POST", "test.txt", true);

    xhttp.send();

    }

    ```

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

    Running javascript in separate sheet

    Posted: 20 Apr 2021 11:20 AM PDT

    I'm new to coding and just now linking what I know about HTML, CSS, and Javascript together.

    I've got my project set up with separate files for HTML, CSS, Javascript. They're all in the same directory. They seem to be linked correctly, as the javascript I've written does change the html page in the DOM. I've also used the javascript to find the font-size of an element defined on the separate CSS file and displayed the number I found in a div on the HTML page.

    I'm working in VS Code.

    The problem:

    DOCUMENT IS NOT DEFINED.

    It seems that I can reference the document just fine, but I can't run my javascript and see what happens in the terminal. It just gets to document and throws an error.

    I understand that within VS code document doesn't exist. If I were running my javascript sheet in a browser it might. But this just leads to me writing code blindly. I can't use console.log() anywhere in my Javascript in VS code to find out if the info I've extracted from the HTML and CSS files is in a certain format or what have you. It doesn't output anything as long as i'm using document.whatever anywhere in the code.

    Can anyone advise how to get past this so I can run my javascript and use its output while i'm working with information extracted from a separate HTML file?

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

    How to read a file in Javascript?

    Posted: 20 Apr 2021 11:15 AM PDT

    I want a pre-determined file to be read by my script. I do not want to select the file in html/drag-drop etc. Is there something equivalent to the following in Javascript:

    ```

    var file_contents = read(path_to_file);

    ```

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

    How to store one single key-value pair that needs to be updated/retrieved every ~hour?

    Posted: 20 Apr 2021 10:01 AM PDT

    As the title says, I need to store one single piece of data for a simple flask app that I'm building and deploying on GCP Cloud Run. In a nutshell, I have a sync of data running, and I want to store and update the time the sync last occurred successfully (so that the next time it syncs it can pick it up from that time).

    I wanted to avoid using any external dependencies (outside of GCP) or having to spin up a whole DB for that single piece of data.

    Thanks in advance!

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

    Anyone made a portfolio site, without any front end skills?

    Posted: 20 Apr 2021 09:45 AM PDT

    what types of things would one put on a portfolio if you suck at front end?

    I've made game prototypes (eg quadtree destructable terrain) and dnd tools (dice rollers, note taking apps) but they all look like garbage.. (programmer art ect.)

    any employers who could tell me what you'd look for ?

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

    Teachers code doesn't work and he is long-term ill and i can't figure out how to make a reset in c

    Posted: 20 Apr 2021 11:47 AM PDT

    Project clock on lcd display 16x2

    Problem secondes reset to zero doesn't work properly. It sometimes resets to radom number. And reset secondes affects minutes

    Code

    While(1);

    {

    ms teller+1 every 0.001 seconders

    tempmsteller = msTeller - (setup_seconden1000) + (setup_minuten60000) + (setup_uren*3600000);

    int_seconden = ((tempmsteller/1000)%60);

    int_minuten = ((tempmsteller/60000)%60);

    int_uren = ((tempmsteller/3600000)%24);

    //gets reset when these are executed when button is pressed and. Happen individually.

    setup_uren++;

    setup_minuten++;

    setup_seconden = ((msTeller/1000)%60);

    }

    Please help i don't know why its bugged and i don't have classmates because I'm new to the class

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

    What does a realistic day in your life look like?

    Posted: 20 Apr 2021 07:59 AM PDT

    I watched a lot of YouTube videos about Day in the Life of a software engineer or developer, but they mostly tend to focus on what they had for breakfast and catered lunches. Then I came across this excellent post on a bullet journal subreddit which was more aligned with the information I was looking for. It made me wonder if I can get detailed insights into other developers' workdays. Would you mind sharing what a day in your life looks like?

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

    Problem with Huffman tree. Please help if possible.

    Posted: 20 Apr 2021 01:55 AM PDT

    Trying to write a program that can encode a message via Huffman tree and then decode it using the tree sent with the message.

    Basically the first part of the message are bits representing the tree. A 0 represents a leaf which is followed by 16 bits that encode a character. An internal node is represented by a 1, followed by its structure to the left, then its structure to the right.

    All of this is then followed by the encoded message, this time encoded using the Huffman prefixes (and not the 16 bit encoding).

    My question is, how can I know when the programming has reached the end of the Huffman tree part of the code, and is now working on the encoded message?

    Still pretty new at this, please let me know if I can clarify. This is all in Scala if that's important.

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

    No comments:

    Post a Comment