• Breaking News

    Monday, October 26, 2020

    I just failed my first coding interview and realized I need a deeper understanding of algorithms. Which resources would you recommend? learn programming

    I just failed my first coding interview and realized I need a deeper understanding of algorithms. Which resources would you recommend? learn programming


    I just failed my first coding interview and realized I need a deeper understanding of algorithms. Which resources would you recommend?

    Posted: 25 Oct 2020 07:30 AM PDT

    TLDR: Tittle + should I focus on basic algorithms resources or go straight for interview focused stuff?

    Background: I'm a civil engineer transitioning to IT, I finished some intro courses + a web dev bootcamp-style course. My career plan right now involves looking for a junior position as a developer and eventually start a MS in computer science or software engineering, while also getting on the job experience.

    On Friday I had my first programming assessment sent to me. I had 2.5hs to solve 2 problems using Python, one involving string manipulation and the other defining a class with several methods. The first one was super simple, but took me way too long. I couldn't finish the second one, in part because I wasn't very familiar with Python's class syntax and in part because I'm still not very comfortable with OOP. If I had an extra hour, I could have finished it, but it wasn't the case.

    I'm very proud of getting as far as I did, but I realized I don't have a good grasp of algorithms fundamentals and that I'm definitely lacking practice in these time-constrained exercises.

    In general I'm the kind of person that likes to learn fundamentals before application. So I ask you guys: Do you think I should focus on basic algorithms bibliography or should I go straight to stuff like "Cracking the Coding Interview"? In any case, what books/courses/etc. would you recommend for someone in my situation?

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

    To those who are good at Googling for answers to your problems, can you share your process with an example?

    Posted: 25 Oct 2020 06:42 PM PDT

    Some of the challenges of programming is finding the right answer when Googling. Error messages are typically "easier" to find, one can usually just copy and paste the error. But other specific problems can take hours.

    Perhaps you could share how you Google. Maybe have an example of a problem you struggled with, how you broke that down, and what helped you come up with key phrases to be used in Google.

    That would be helpful! :)

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

    Online bootcamp Reviews?

    Posted: 25 Oct 2020 10:20 PM PDT

    I've been searching extensively on this sub and others for Reviews and experience with Online bootcamps. I've seen some passive recommendations but nothing substantial that has convinced me to chose one or the other. So which online bootcamps should be avoided and which did you have a good experience with? Personally I'm looking for fullstack web development but Id like to know everyone's experience with whichever one you chose. It's a hell of an investment, and I don't trust any of these other biased bullshit reviews on these websites that get paid to promote them.

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

    How to learn advanced memory management in C++, creating global heap allocators, custom stack-based allocators, pool-based allocators?

    Posted: 26 Oct 2020 12:06 AM PDT

    Hi,

    I just wanted to start this off by saying that the last thing I wanted to do was make a post about my problem as I've tried going on StackOverflow but was met with harsh responses so I did my best to avoid doing this again. However, I am stumped at this point so I came here, but made sure to do research to the best of my ability on my problem, I read the "read me" to this site, I read the faq and the rules, and honestly, I am sorry if this is too long or anything I don't mean to add bad posts to this subreddit. I noticed that this is extremely long compared to any other question on the subreddit however I just want to give as much detail as I can to help. I am sorry if I don't write a good question as I did on StackOverflow and if this is too long the questions sections are bolded and italicized, but here I go.

    Some Background: I am trying to write my own game engine using C++. Some might say I shouldn't do this as a learner but this is what I am passionate about so I will continue on this path. While I was reading Jason Gregory's book on Game Engine Architecture I read about custom memory allocators. I've been using new and delete for a while now but never realized how slow they were. The book recommends making your own memory allocator especially if the game was to be deployed to a console (mine is probably gonna stay on PC for a long while) however I found the subject extremely interesting and wanted to learn more. Plus it said I can avoid context switching to the OS this way. The book mentioned many different types of custom allocators like global heap allocators that should allow deallocation and be able to defragment their memory, stack-based allocators, double-ended stack allocators, and pool-based allocators. I have so many questions about these things I actually feel bad about asking so much. Its description of a pool allocator states that a very large block of memory should be allocated using malloc then "allocate" memory by incrementing a pointer, the block of memory is split into equal-sized chunks which will allow for deallocation while avoiding fragmentation. Obviously, this means that data allocated must all be the same size. According to the book, a stack allocator allocates a large block of memory using malloc and "allocates" memory by incrementing a pointer. Memory is allocated and freed in LIFO order. I was actually able to implement my own double-ended stack allocator which mostly worked (I say mostly because allocating certain kinds of data made it crash with an access violation error like a b2World from Box2D) however I got extremely confused when I got to the part about how every custom allocator should support allocating memory "aligned". This is the main thing that stumped me. I read about data alignment and I am pretty sure I understand it in the context that it is usually taught however I get very confused in the context of custom allocators since I believed that the compiler pads structs and classes on its own. I'll ask the important questions then since I have a lot and also feel free to answer whichever ones you want, doesn't have to be all of them. I appreciate any response anyone gives honestly. If you can give me a link to where I can learn about advanced memory without getting a headache that would be amazing too. I asked the question I really really want to be answered below (although I need help with all of them) just in case I am only allowed to ask one question.

    My research: I don't know if I need to write this portion, however, I will just in case. I had my questions downvoted on SO so I really want to avoid that here too. My research consisted of reading over the book multiple times and reading as many related sections as I could so I am definitely sure I can't find help from the book anymore. I looked at multiple online sources too such as https://developer.ibm.com/technologies/systems/tutorials/au-memorymanager/ this however just scrolling through it to see what it was about made me even more confused and lost. I read about https://www.ea.com/frostbite/news/scope-stack-allocation this too which is EA's scope stack allocation which helped me understand it more a bit however it didn't talk about data alignment at all. I even commented on many youtube videos and couldn't find help. Everything I could find on custom memory allocators was about std::allocator, or creating hooks for the standard library's containers. I don't want this, I am talking about a completely custom allocator.

    Terms: I usually get answers that aren't about what I was talking about so I will add this to help with the confusion. What I mean by a custom allocator is using malloc to allocate a large block of memory, then using the pointer to "allocate" memory that way to avoid context switching to the OS. This is what I mean when I say a custom allocator, I don't mean std::allocator or any of the hooks for that. Sorry for the confusion if there was any :)

    The question I really really want to be answered: What is memory alignment in the context of custom memory allocators? Again, I really didn't want to post a bad question and get downvoted like SO so I did as much research as I could but all I get are data alignment in the context of the compiler and organizing data in classes and structs. How does this relate to custom allocators? Why do I have to adjust memory alignment if the compiler does it on its own? Why am I in control of this? The book provides some code which maybe you can use to help answer. I read it but I can't figure out how it works and the point of it. How is it accessing a negative index where it says pAlignedMem[-1]? What's the point of calculating this alignment again if the compiler adds padding to the structs on its own? I guess if you want me to get to the point what I am trying to ask is, Why do I have to execute the code below if the compiler adds padding and alignment on its own? Or does it not do that and I am wrong in assuming this?

    EDIT: I tried turning it into code however it messes it up I don't know why it just turns into this and adds backslashes, sorry I tried fixing it.

    The function that says "allocateUnaligned" is just incrementing the pointer that was initially allocated using malloc, by adding "expandedSize_bytes" to the pointer, i.e. buffer = static_cast<char\*>(buffer) + expandedSize_bytes;

    void* allocateAligned(size_t size_bytes, size_t alignment) {

    assert((alignment & (alignment - 1)) == 0); // pwr of 2 

    // Determine total amount of memory to allocate. size\_t expandedSize\_bytes = size\_bytes + alignment; 

    // Allocate unaligned block & convert address to uintptr\_t. uintptr\_t rawAddress = reinterpret\_cast<uintptr\_t>(allocateUnaligned(expandedSize\_bytes)); 

    // Calculate the adjustment by masking of the lower bits // of the address, to determine how "misaligned" it is. size\_t mask = (alignment - 1); uintptr\_t misalignment = (rawAddress & mask); ptrdiff\_t adjustment = alignment - misalignment; 

    // Calculate the adjusted address, return as a pointer. uintptr\_t alignedAddress = rawAddress + adjustment; 

    // Store the adjustment in the byte immediately preceding the adjusted address assert(adjustment < 256); U8\* pAlignedMem = reinterpret\_cast<U8\*>(alignedAddress); pAlignedmem\[-1\] = static\_cast<U8>(adjustment); 

    return static\_cast<void\*>(alignedAddress); 

    }

    The Other Questions (I honestly really need help with these too however I don't know if I can ask so many): How is a global heap allocator meant to be made? I tried so much even attempting to make it on my own but I can't figure it out. Every time I try to implement it I end up having a linear search through all of the free memory which is probably close to the worst thing I can do. What are the basics of making one? Another question I had is about pool allocators, the book mentioned that when using a pool allocator your code should make sure resources are designed with "chunkiness" in mind, what does this mean? The book gives an example that a large contiguous data structure must be avoided and shouldn't require contiguous RAM like a linked list. Why? Can't I just "split" the block of memory into a bunch of large chunks that could fit the large data structure?

    Why I think this is helpful to others: Again, don't know if I should add this but here I go again. I can't find many resources about custom allocators and the ones I do find are about std::allocator, and about making your own allocator hooks for the standard library's containers. Maybe this post will help shine some light on custom memory allocation for game engines and their resources.

    I just wanted to add again, that I apologize if this is a bad post, I honestly don't mean to do anything bad! I just need help with this and I can't find help anywhere else.

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

    A question regarding Unity?

    Posted: 25 Oct 2020 11:57 PM PDT

    Hi,

    Is there any website/book/article/any tutorials on youtube in which I can find all the syntax which can possibly be used in Unity(Unity uses C#) and an example with it.

    Thanks in Advance.

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

    Can I stop script or descale worker to 0 from python script?

    Posted: 25 Oct 2020 11:44 PM PDT

    I have made a fast API script and want it to stop running if an event happens so it can stop the Heroku app completely. How do I do this from Python script?

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

    Send Data from Backend without Frontend waiting for it

    Posted: 25 Oct 2020 11:40 PM PDT

    Basically I need to send Data from my backend without a request from the Frontend. Once a Day the Backend will get new Data and should update the Frontend. Is there a method I can go without a Socket connection. Would WebRTC be possible. What other solutions are there for this use case?

    Thanks in advance.

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

    What programming language do you think will be around the longest?

    Posted: 25 Oct 2020 11:37 PM PDT

    Im a slow learner, but i really love programming. I am all over the place and want to learn ONE language to start. Invest in books, courses, etc. Since i am a slow learner and will take me longer.. i am wondering what language yall think may be around the longest?

    Im asking because there is new languages and changes all the time and i dont want to spend two years learning a language, and then it dies.

    Some of you may ask "well it depends what you want to do" but honestly i just like programming. Its more of an achievement for me than anything, as i dont think im really smart enough to grasp it. But if i can take a year or two to slowly learn, then i want a language that maybe i can use for awhile.

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

    C programming float type question

    Posted: 25 Oct 2020 11:32 PM PDT

    //code

    #include<stdio.h>

    void main ( ) {

    float a;

    a = 123.456789;

    printf("a = %f ", a); }

    //output

    a = 123.456787

    //question

    Why is the output not 123.456789? is it because when it is converted into IEEE-754 standard

    the mantissa part has overflowed?

    Your help would be appreciated !

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

    Why git pull when on a feature branch?

    Posted: 25 Oct 2020 11:30 PM PDT

    As you are usually the only one working on your feature branch what is the purpose of git pulling?

    One thing I've thought of is reverse merging master into your feature branch pre-emptively. That way you can clear merge conflicts ahead of doing a pull request from feature to master.

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

    Best way to learn job-ready phyton skills?

    Posted: 25 Oct 2020 11:09 PM PDT

    Hello

    Thanks for reading this guys. I am in need of some help, I plan on learning programming for the last two years. I started learning on couple different platforms (datacamp was my favourit then but i see that it is not as deep as it should be to get job-ready skills)and i was happy every time while not getting burnt out or bored . But i had real life problems or better to say stuff that occured (one of them birth of my child) so i stoped BUT this time is different since all puzzles are combined and i found 2-4h period every day to learn and i would like best possible path/way to learn to be job-ready programmer skills. So i ask for your help and to tell me your expirience,how you started and how to get job-ready in your opinion(from scratch)

    Tnx for your time :)

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

    Where do I start with "backend"

    Posted: 25 Oct 2020 07:00 PM PDT

    So I know I want to be a back end developer seeing as I have absolutely 0 knack for visual aesthetics. I've currently been learning C# through making little games in unity so I'd like to stick with C#. I have very basic understandings of what back-end even is and implies. I don't know what projects or whatever to start with or even how to google how to start.

    submitted by /u/Aspiring-Loser
    [link] [comments]

    Python Question

    Posted: 25 Oct 2020 10:35 PM PDT

    def make_increase_by(increment): def increase(x): return x + increment return increase f = make_increase_by(1000) print(f(3.1415)) 

    In this program, I'm kind of confused about how it's exactly working. For example when it returns the function "increase" what is it actually returning. Also the last line of code how is it going back into the "increase" function

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

    An Error in Javascript regarding adding images to variables?

    Posted: 25 Oct 2020 10:21 PM PDT

    Hi,

    I tried to add Images to variables which i have declared before.

    The error is Uncaught TypeError: Cannot read property 'loadImage' of undefined (sketch: line 6)

    var fruit1,fruit2,fruit3,fruit4,alien1,alien2;

    var fruit1image,fruit2image,fruit3image;

    var fruit4image,alien1image,alien2image;

    function preload(){

    fruit1image.loadImage("fruit1.png")

    fruit2image.loadImage("fruit2.png")

    fruit3image.loadImage("fruit3.png")

    fruit4image.loadImage("fruit4.png")

    alien1image.loadImage("alien1.png")

    alien2image.loadImage("alien2.png")

    }

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

    Can you have a compound proposition made of two compound propositions?

    Posted: 25 Oct 2020 10:06 PM PDT

    If I had a compound proposition of "A and B", and A is a compound proposition and so is B itself, could I build a compound proposition of two compound propositions?

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

    Regex Help

    Posted: 25 Oct 2020 10:05 PM PDT

    I'm trying to look for strings that start with "You find a" or "You find some" and then end with "inside.". Between the two strings there can be multiple words but they will only contain lowercase letters.

    So "You find a spoiled orange inside." and "You find some spoiled oranges inside." should both match.

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

    Can you actually become an expert software developer?

    Posted: 25 Oct 2020 09:46 PM PDT

    I have been in the industry for about 10 years. I feel like I am getting better at software development in general. Using better designs and writing cleaner code. But the thing is the industry is changing so much. Each language is continually updated, Java 11 is much different than Java 6, as well as tools, new languages and so on. It feels like when I master one language I am forced to use another or it changes. Furthermore I am always being put on new code base's filled with hard to understand code that needs major refactoring, or uses some new reinventing the wheel frameworks and so on.

    With all the changes in the industry and how common spaghetti code is it actually possible to become an expert in software engineering such that your far better than the average developer?

    I don't tend to see many older people developing and it seems like the only way to stay decent at developing is putting in lots of extra time indefinitely.

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

    C++ function wont read array size

    Posted: 25 Oct 2020 09:36 PM PDT

    So I'm trying to write a function that determines the length of an array (see below). The piece of code that actually reads an array and determines its size works (sizeof(array)...), if it stands alone inside the main function, but once I try to place it into it's own function, it just returns a 1 regardless of array size, when called from main. Am I invalidly specifying the array in the function call? Please help!

    #include <iostream>

    using namespace std;

    int array_size(int array[]) {

    int s = (sizeof(array))/(sizeof(array[0]));

    return s;

    }

    int main () {

    int a[] = {1,2}; //random example

    int b[] = {4,5,6,7}; // "

    cout << "size of array a is " << array_size(a) << endl;

    cout << "size of array b is " << array_size(b) << endl;

    return 0;

    }

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

    Having an issue with CodeBlocks that I can't quite explain in the title. Please help

    Posted: 25 Oct 2020 09:30 PM PDT

    Whenever I open codeblocks it shows me on the taskbar that it is running but I can see no window and no matter how many times I click on the icon in the taskbar or relaunch the program it just doesn't display on screen.

    I can't quite explain properly what's happening so I made a video (apologies for the 4:3 aspect ratio): Imgur link

    So I installed CodeBlocks about a month ago and that went almost perfect (apart from the included mingw compiler not working for some reason which I solved by downloading and using TDM-GCC compiler).

    I uninstalled it because one of my friends who is new to CS was having trouble downloading and configuring code blocks so I thought I'll make a short video explaining how to do it but now I'm facing this issue and I don't know how to fix it. Can any one of you please help? Thanks.

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

    Coding an autoclicker

    Posted: 25 Oct 2020 09:29 PM PDT

    Hey coders of reddit! I had a question about coding in c#. If I were to code a bot to press on (a) certain button(s) at specific times, how would I go about doing this? I use visual studio 2019 as an IDE and I was just curious about coding an autoclicker. Any advice would be greatly appreciated. I'm fairly new to coding overall but once again, any help would be greatly appreciated. Thank you.

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

    Course for 68k assembly, for someone with no programming knowledge?

    Posted: 25 Oct 2020 09:26 PM PDT

    As the title states, I want to learn 68k assembly language. I have no programming experience at all to get in the way. I am looking for a Linear, start from square 1 lesson or course to be able to learn to create programs and environments with 68000 assembly language. Is there such a thing that I may start as a complete novice and learn? I would assume that assembly, being the most basic of languages, besides binary, would be best to learn without having fancy new programming languages to get in the way within my brain when learning. If anyone here is a teacher and wishes to extend their services, I would gladly pay to take your course. Thank you in advance, and I apologize for interrupting your guys' forum.

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

    I want to learn assembly but I’d have no use for it, is it worth it?

    Posted: 25 Oct 2020 08:24 PM PDT

    I barely know anything about programming but I always love looking at assembly code in old games. I know it's very primitive and I wouldn't have a use for it but I still want to learn it, is it worth it? Another language that interests me is python, though I haven't looked into it much, should I learn that instead of assembly?

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

    best cross platform framework for doing both web and mobile?

    Posted: 25 Oct 2020 08:22 PM PDT

    Hi, I want to start a small business my self alone and I need web and mobile apps for it. they will almost be identical but for more accessibility of my future customers I want to have both.

    at first I was thinking of learning react for web and react native for mobile but since I am doing it alone I thought it would be quite cumbersome and I want to have just one code base that can run on everywhere (web, android, iOS).

    looks like there are options like react native web, ionic react, pwa and so on but I'm not sure which would best fit my situation. I want to hear your opinions. thank you very much for reading.

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

    No comments:

    Post a Comment