• Breaking News

    Thursday, August 26, 2021

    How About a Subreddit Hackathon? learn programming

    How About a Subreddit Hackathon? learn programming


    How About a Subreddit Hackathon?

    Posted: 25 Aug 2021 10:47 AM PDT

    Dear Mods,

    I was thinking it might be pretty cool if this subreddit somehow hosted a beginner friendly virtual hackathon. It could boost engagement on the sub, help a lot of people learn, and be a good source of networking. At the end of the event, final projects could be linked on the sub, and most upvotes wins.

    If that is logistically improbable or cost prohibitive, then does anybody know of any upcoming hackathons that are beginner friendly?

    submitted by /u/pre-tend-ed
    [link] [comments]

    Which is better to learn? Mongo DB or MYSQL

    Posted: 25 Aug 2021 09:32 AM PDT

    Currently learning front end development. My learning track is Bootstrap > React &Redux > React Native > MongoDB or MYSQL > AWS

    What data management tool would you recommend and why? Criticisms on my learning track are welcomed

    submitted by /u/Top-Peach6302
    [link] [comments]

    Why’s coding fun to do but so boring to learn?

    Posted: 25 Aug 2021 04:53 PM PDT

    I generally enjoy it but I hate learning it especially the tutorial videos.those videos put me right to sleep.How do you guys get through the learning phase without procrastinating it so much?

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

    Hi, noob here. What languages are best for what?

    Posted: 25 Aug 2021 10:13 AM PDT

    I'm not really sure where to start. All i know is that i want to build a website that is a mix of twitch and youtube, but i'm not sure what language to even begin to learn for something like that. i know youtube uses a lot of python so i was wondering if that would be a good starting place or if i should focus on another

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

    How Do You Actually Progress In Programming?

    Posted: 25 Aug 2021 07:26 AM PDT

    The current programming language which I use and know of is Python. I've also coded in Visual Basic but that was required for my university's assignment. Java was my first programming language and I dropped it because I was overwhelmed and felt completely demotivated from it, After several months, I picked up Python and decided to start off fresh. That has been over a year now... I've done several basic projects and I always keep refactoring my code whenever I see an improvement that needs to be made. I spent so much time on writing "good code" and try to follow all the "good practices" of Python that I've only progressed to Python classes, though I've touched on OOP but just the very basic of it. It just seems like I am in this loop where I will just keep learning the same thing repeatedly and I really want to progress and learn some Python frameworks, and maybe database as well. It's possible but it may be overwhelming which I totally understand if I were to learn so many things at once. I need advice on how to get off this (not sure what it's called) loop of learning the same things over and over because I feel like if I don't learn them, then I might miss out on even the most basic knowledge. Also, I'd gladly welcome tips on learning effectively at programming because my way of learning to code seems to be very ineffective and inefficient...

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

    Introducing children to programing?

    Posted: 25 Aug 2021 09:33 AM PDT

    This is a bit of a different question.

    I want to introduce my 4 year old to the early basics of programming. Is it too early? Are there any good resources out there? I see some of these systems that are more hands on and work with an iPad but none of those are cheap and they feel gimmicky.

    Anyone here gone through introducing their kids to programing? how did you do it?

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

    Is multi-tasking actually running many things at once, or it just switches very rapidly between them?

    Posted: 25 Aug 2021 10:03 PM PDT

    Im a bit confused about the subject, at first i thought that it runs many things at once but then i read that it just switches between programs by putting the running one to sleep, then run another, then put to sleep the other, run the first again etc etc

    Is this correct? And what is the difference with multi-threading? Simply that in multi-tasking the programs use different memory but in multi-threading they use the same?

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

    Can someone explains how this Hashing things size boundaries mean?

    Posted: 25 Aug 2021 11:11 PM PDT

    The hash value is calculated with the hashCode method that each object has. Then modulo (remainder of division operation) is used for ensuring that the index stays within the size boundaries of the internal array.

    Even though I have studied here and there how hashing function is done and the factors that are considered important in a hashing function I can't really understand what is size boundaries. Is it making the size twice of the original array size as mentioned in hyperskill ?

    The mooc.fi above which mentioned that the index stays within the size boundaries of the internal array but really I can't comprehend the above paragraph at all.

    Can someone explains things to me ? tks.

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

    Hello! Could someone help me understand this odd looking for loop. Thanks!

    Posted: 25 Aug 2021 10:20 PM PDT

    for (int i(0), mark; i<q; ++i)

    Entire code below:

    _____________________

    int main()

    { int q, type;

    cin >> q;

    map<string,int> clas; string name;

    for (int i(0), mark; i<q; ++i)

    { cin >> type >> name; if (type == 1)

    { cin >> mark; clas[name] += mark; }

    else if (type == 2)

    clas.erase(name);

    else cout << clas[name] << "\n"; }

    return 0;

    }

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

    How to learn arduino programming ?

    Posted: 25 Aug 2021 08:35 AM PDT

    Hi amazing people ! I will be pursuing my bachelors in mechatronics and automation , so thats why i recently got an arduino , + i did a really basic course on C , C ++ and python ( they taught me till loops and other basic stuff) it was good as i hadn't programmed since grade 8 ( that too only basic HTML ) , then i followed a pdf with instructions and code on some projects on arduino, i could follow what the code meant by reading the comments but when the pdf was over i couldn't do anything, thats why i have decided to learn a programming language first. Can you tell me which language should i learn + the roadmap and resources i should follow( i get really confused with this) + i would like to thank this community for what you guys are doing is amazing.

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

    Professional coders, does anyone actually code programs from scratch anymore? Details in description.

    Posted: 25 Aug 2021 09:48 PM PDT

    I've been working dev integration for a few years now, essentially making sure apps work with IT. And while I don't consider myself a programmer per se, I have definitely deployed scripts and application edits in that time.

    My general feeling on the matter is that if I have an integration problem that requires a script or app solution, it's best to look to git, give credit to the author and then use already discovered solutions and libraries.

    I know this is kind of a grey area of programming that isn't discussed too much so I wanted thoughts.

    I also know I may catch flak, but for efficiency sake, why do we continue to reinvent the wheel if someone else already has a viable solution, publicly available?

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

    What's the difference between the book "Automate the Boring Stuff With Python" and its corresponding udemy course?

    Posted: 25 Aug 2021 09:43 PM PDT

    If I have and am working through the book, is there any point in the udemy course?

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

    What do these question marks mean in documentation?

    Posted: 26 Aug 2021 01:11 AM PDT

    So I am getting into computer science and have been learning about data structures. While learning about arrayLists, I found the Array.BinarySearch Method in the .NET docs. The constructor example for the method is shown in the docs as public static int BinarySearch (Array array, object? value);.

    My question is why is there a question mark after the object syntax. I first believed that this was because it was optional but that is clearly not the case. I feel kinda silly asking this as I feel like this should be obvious. Any help is appreciated!

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

    How can I grep this (escaping special character)?

    Posted: 26 Aug 2021 01:08 AM PDT

    Hi,

    MB, nice guy here. Linux terminal.

    Trying to grep this line:

    begin: $3188.2 (Wed 25 07:4

    Using this grep:

    grep -o -P '(?<=begin:).*(?=Wed)'

    Generates this output:

    $3188.2 (

    Desired output is:

    3188.2

    How can I put $ and ( into the grep without having grep misinterpret the special characters?

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

    I'd like to work on a personal project that would rank starting poker hands but I have no idea where to start.

    Posted: 25 Aug 2021 03:07 PM PDT

    I'm interested in the game of Pot Limit Omaha, where you start with 4 cards instead of the usual 2 in No Limit Hold 'em.

    What I would like to do is take all possible starting hands, a total of 270,725, and test them against random hands and random board runouts to test how often the starting hands wins. With this I would see statistically which starting hands have the best chance of winning and rank them accordingly.

    I get the feeling this would be a long process but it's something I'm willing to put time in to.

    If I'm not making any sense, please let me know and I'll be happy to clarify and edit my post. Thanks to anyone who can point me in the right direction

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

    Need help with Python class constructors

    Posted: 26 Aug 2021 12:49 AM PDT

    So I am refreshing my knowledge of python and I have made the following code:

    class Point: x_coord = None y_coord = None def __init__(self, x, y): self.x_coord = x self.y_coord = y def __init__(self): return def set_x(self, x): self.x_coord = x def set_y(self, y): self.y_coord = y def get_x(self): return self.x_coord def get_y(self): return self.y_coord def get_coords(self): return self.x_coord, self.y_coord point = Point(10, 20) point2 = Point() print(f'{point.x_coord}:{point.y_coord}') print(f'{point2.x_coord}:{point2.y_coord}') 

    It's throwing me an error about "__init__() takes 1 positional argument but 3 were given".
    Is it not possible to have a default and a custom constructor?

    As a disclaimer, I would prefer very basic answer to this please. I'd rather not see responses that remind me of the pissing contest that is stackoverflow. XD

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

    Extremely confused in life

    Posted: 25 Aug 2021 08:45 PM PDT

    So, I started programming about 1.5 years ago, I've tried learning flutter, javascript/react, c/cpp, python but what concerns me is that I am switching too fast, I have never really mastered one language. I'm yet to start my computer science degree from next month onwards and they use python in their first semester. Now, if I were to go deep into one language, what language would you recommend? I was thinking about javascript just because of the various popular frameworks it has but then my other part says do python because my university is going to use python.

    submitted by /u/rick-the-roll
    [link] [comments]

    contains duplicates Leetcode, what is constant vs linear in space?

    Posted: 25 Aug 2021 06:19 PM PDT

    Hi, I am a confused as to what it means for a solution to be constant vs linear in space. Lets take

    https://leetcode.com/problems/contains-duplicate/ as an example.

    Is there any difference in time and/or space ?

    My intuition:

    • Solution 1:
      • constant in space because of no additional collection created?
      • proportional to n * log(n) because Arrays.sort is n * log(n)
    • Solution 2:
      • linear in space?
      • linear in time? although processing array twice as fast?
    • Solution 3:
      • linear in space?
      • linear in time

    Solution 1:

    class Solution { public boolean containsDuplicate(int[] nums) { Arrays.sort(nums); for(int i = 0; i< nums.length-1; i++){ if (nums[i] == nums[i+1]) return true; } return false; } } 

    Solution 2:

    class Solution { public boolean containsDuplicate(int[] nums) { Set<Integer> set = new HashSet<>(); int lastPos = nums.length - 1; int firstPos = 0; while (lastPos > firstPos){ if (set.contains(nums[firstPos]) || set.contains(nums[lastPos]) || nums[firstPos] == nums[lastPos]) return true; set.add(nums[firstPos]); set.add(nums[lastPos]); lastPos--; firstPos++; } return false; } } 

    Solution 3:

    class Solution { public boolean containsDuplicate(int[] nums) { Set<Integer> set = new HashSet<>(); for(int i = 0; i < nums.length; i++){ if(set.contains(nums[i])) return true; set.add(nums[i]); } return false; } } 
    submitted by /u/theprogrammingsteak
    [link] [comments]

    Error while using LFS GIT to commit and push larger files than normal Github File limit

    Posted: 25 Aug 2021 07:59 PM PDT

    Hello pretty much the title here is everything I did and got this error.

    AllCustoms MINGW64 ~ $ cd Simple_5e_LMOP AllCustomsMINGW64 ~/Simple_5e_LMOP (main) $ git lfs install Updated git hooks. Git LFS initialized. AllCustoms MINGW64 ~/Simple_5e_LMOP (main) $ git lfs track "*.cmpgn" "*.cmpgn" already supported AllCustoms MINGW64 ~/Simple_5e_LMOP (main) $ git add .gitattributes AllCustoms MINGW64 ~/Simple_5e_LMOP (main) $ git add . AllCustoms MINGW64 ~/Simple_5e_LMOP (main) $ git commit -m "Added Campaign file" [main 8f81c55] Added Campaign file 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 Simple_5e_LMOP_v1.0/New Bitmap Image.bmp AllCustoms MINGW64 ~/Simple_5e_LMOP (main) $ git push origin Uploading LFS objects: 100% (1/1), 162 MB | 0 B/s, done. Enumerating objects: 17, done. Counting objects: 100% (17/17), done. Delta compression using up to 4 threads Compressing objects: 100% (14/14), done. Writing objects: 100% (16/16), 154.31 MiB | 28.36 MiB/s, done. Total 16 (delta 2), reused 0 (delta 0), pack-reused 0 remote: Resolving deltas: 100% (2/2), done. remote: error: Trace: bf79c70bdf189f3804746f0120fdb5bc6c8c9daade83b8b3023a585fea7c9ef0 remote: error: See http://git.io/iEPt8g for more information. remote: error: File Simple_5e_LMOP_v1.0/Simple_5e_LMOP_v1.0.cmpgn is 154.39 MB; this exceeds GitHub's file size limit of 100.00 MB remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com. To https://github.com/AllCustoms/Simple_5e_LMOP.git ! [remote rejected] main -> main (pre-receive hook declined) error: failed to push some refs to 'https://github.com/AllCustoms/Simple_5e_LMOP.git' 
    submitted by /u/AllCustoms
    [link] [comments]

    How do you start advanced projects without having any clue how they work and with little resources that help you?

    Posted: 25 Aug 2021 12:54 PM PDT

    I always enjoy building full scale projects for fun. But some projects, have little resources on how they work.

    For example, a JS Framework, or a game engine, etc…

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

    Can anyone suggest some good tutorial for socket programming in c?

    Posted: 25 Aug 2021 11:25 PM PDT

    So that I'll be able to do such problems:

    1.Implement a port scanner using socket programming. The port scanner checksa number of ports (for instance, from 1 to 1026) to see if they are open (aserver is listening on that port number) or closed (a server is not listening onthat port number).

    2.Implement the following using TCP socket:When the server receives a message from a client, it simply converts themessage by using following rule " If a character is a letter or a digit, it will be replaced with the next characterin the character set, except that Z will be replaced by A, z by a and 9 by 0.Thus i becomes j, C becomes D, p becomes q and so on. Any character otherthan a letter or a digit will be replaced by a period(.)"and sends back the same to the client. This sending and receiving messageshould be done repeatedly until client and server send BYEBYE message.

    3.Assume that there two servers, A and B, which store a 10MB file that is splitinto 10 parts. Client 1 requests the file to server A which replies to client 1with 5 chunks of the requested file, which are randomly selected. Later on,client 1 identifies the missing chunks and it requests the missing chunks (andonly them) to server B. Moreover, the Client 1 can request 1 piece of chunk atthe same. Once all the chunks are received, Client 1 sends the THANKSmessage to both of the servers.

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

    Why aren’t there many PERN stack tutorials?

    Posted: 25 Aug 2021 05:20 PM PDT

    Especially courses and articles

    submitted by /u/Significant-Ant-2498
    [link] [comments]

    Issues running HTML and CSS code simultaneously in Visual Studio Editor.

    Posted: 25 Aug 2021 11:13 PM PDT

    (I am trying to build a multi-page website for shits and giggles)

    This question probably has a very simple answer.

    I started coding a few hours ago, I have figured out how to code ( very rudimentary ofc) HTML, and CSS... the two codes work fine together in a codepen... but I can not figure out how to get it to work in "Microsoft's visual studio code" (VSC)

    I was learning on code pen but want to continue on a more substantial editor... furthermore, I have had luck, not perfect, implementing CSS code directly into the HTML, but I would rather have separate files so I can have a single CSS dictate the laws of style.

    I was very excited (to show where I am at knowledge-wise) when I got my first HTML single text code to open up in a chrome tab.

    SO when I run the HTML and CSS code in parallel with each other on Codepen... it works swimmingly... it only loads the HTML content and not my CSS code when on VSC

    any help would be greatly appreciated

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

    Help - What are the various C++ STL containers' equivalent data structures in JavaScript?

    Posted: 25 Aug 2021 11:07 PM PDT

    I'm new to javascript but I have a fair bit of coding experience with C++ STL mainly through solving problems on hackerrank. I'm looking for something similar to this for javascript.

    Thanks for your inputs.

    submitted by /u/8EF922136FD98
    [link] [comments]

    No comments:

    Post a Comment