I made a site that randomly generates python practice programs to teach reading fluency (update) learn programming |
- I made a site that randomly generates python practice programs to teach reading fluency (update)
- Extensive use of Foo Bar in examples
- Shopify Interview Question using OOP
- One year into programming, I now understand why we should write comments like it will be read by millions of people without full knowledge about the project.
- How do you deal with tutorial FOMO and decide which guide you want to follow?
- How to scrape websites based on dynamic user input in real time?
- what is the best remote pair programming app?
- Best editor to develop HTML and CSS that shows changes side by side or live?
- Should I continue learning Python?
- Do you prefer full words over abbreviations as variable names?
- RESTful API in node js
- Why the below program outputs 'Nothing' ? It is really a good question.
- Book recommendations for CS major?
- ELI5, designer trying to understand Github, is it like a portfolio?
- It took me over a week to understand constructors in Java and I feel stupid
- [C++] I can't figure this out, what am I doing wrong?.
- Trying to pick a resource to start out in software engineering/programming?
- Help me visualize referencing
- [c#] how to convert the first 8 bits or 16 bits of a block byte[] into float?
- Do you feel sick when you see a large number of lines in one script?
- [PHP + MySQL] Using CONCAT works in MySQL, but not PHP
- How can I code this maths fucntion as a c++ function?
- Can anyone explain why the below program outputs 11,11 instead of 10,11. Newbie to C programming, and it's my first programming language. Don't punish me for asking may some silly questions in the post, this really confuse me. ("Pointer, pointer everywhere (in C), but not a drop I understand")
- Why does this sizeof return size of array of 2 in the function and return 1 in main function?C++
I made a site that randomly generates python practice programs to teach reading fluency (update) Posted: 29 Mar 2021 05:23 AM PDT I've been a programming tutor for about 7 years. From this, I've learned that beginners' writing ability is often heavily limited by their reading ability, so I made a site to randomly generate python programs for the user to read and figure out the output. The quizzes can be customized for your ability level and what topic you want to focus on. I posted it here a while ago and you all seemed to like it, so since then I've made some additions. I've added an account system so that you can sign up to track your scores so that you can tell whether you're getting faster. Before each quiz you'll see your current personal best so that you know what to aim for to beat your record. You'll also see a graph of your progress after each quiz and all of your graphs on your user dashboard. Here's the link to the control flow exercise: https://trprt.io/python-practice-problems-ifs-loops-control-flow Let me know if this helps you! [link] [comments] |
Extensive use of Foo Bar in examples Posted: 29 Mar 2021 05:23 AM PDT I understand that my opinion might be in the minority but I just wanted to let this out and see what the community feels about this trendy thing. Using foo / bar in your code is a very trendy thing to do. It's a fun catchphrase ("fu\*ed up beyond all recognition")* that has gained massive popularity across all programming languages. In fact, there are clubs, online challenges, quizzes, conferences, websites and a lot more with this name. However, I've often seen in code examples online an excessive use of foo-bar as metasyntactic variables and placeholder names. These could be class names, attribute names, variables, functions, commands, module names, config verbs - basically whatever you want. Take a look at the following code example:
I'm sure there are many people who find it fun and easy to use foo bar for lots of examples. But as a beginner I feel that the problem is that the name "foobar" doesn't tell you anything about the concept. Consider this. While looking through the examples, as they become more complex you are forced to do the following:
And I feel like that's the problem! You are already juggling multiple concepts as a beginner and the last thing you want to have to memorize what the name stands for (is it a constructor? A variable? A method?). Instead, I feel it's better to use a meaningful name instead of foo/bar. It's a good practice towards keeping meaningful names (which you will find out is very important when you work on large projects). It also helps make concepts more familiar. For example, if we changed the earlier example like this:
As a beginner this second style makes a world of difference to me. I don't mean to piss on the use of foo/bar but I'm just saying that learning would be a whole lot easier if we use meaningful names instead of foo / bar. What do you feel? [link] [comments] |
Shopify Interview Question using OOP Posted: 29 Mar 2021 06:21 PM PDT Hi, I bombed my interview after I got this OOP question from Shopify. Can one of you experts help solve this using Python? I had used switch cases (a dictionary in python which mimics a switch case in other languages) to solve this problem without OOP . But apparently the interviewer wasn't too happy and as a follow up asked me to solve the problem using OOP.
[link] [comments] |
Posted: 29 Mar 2021 10:56 PM PDT Sometimes we fail to understand parts of our own code few days after writing it. It happens to everyone. The reason is simple: when you write code you concentrate on the logic of the module you are working on, it's short-term memory. Our mind works like a scope lens. When we design, we are at the top-level scope, we see modularities, we see interfaces, we see connections. Moving on to a specific module, the scope lens zooms in, top-level overview fades away and we focus on the design of a specific module, or zooming in even further to focus on a function's logic. As your project gets bigger, memory gets hazy, without comments you forget why you wrote this part of code this way, what this code does, what tricky problem this awful block of code solves in exchange for readability. We need comments, simply for our own sake. Bad comments = bad project, it renders your project unmaintainable. Comments are not auxiliary to code. It must be treated as serious as code itself, just like code it requires refactoring and optimization as you move on. I first found it hard, I always thought to myself: "now I have changed this code, huh, improve the comments too? Nah, they are clear enough, if not, just read the code." Nope, after weeks, if not days, I need some serious recalling to understand why I did what I did to the code, not only I wasted time but I felt frustrated - "I should have written why I did it" Write comments like it will be read by millions of people without full knowledge about your project. Also, write a ARCHITECTURE.md when you find your project starts to get complicated. [link] [comments] |
How do you deal with tutorial FOMO and decide which guide you want to follow? Posted: 29 Mar 2021 08:53 PM PDT I feel like starting is the problem. I have all tutorials bookmarked. But which tutorial or course to pick? There are too many tutorials and many good resources. How do you choose the right one when all of them seem equally good? Whether it's YouTube with Traversy Media or NetNinja or Udemy or many good books. How do you decide which one you should pick? [link] [comments] |
How to scrape websites based on dynamic user input in real time? Posted: 29 Mar 2021 10:04 PM PDT So let me give a little bit of a background, I want to build a very simple job search website where the user can give his skills and I display job results based on the keywords and location from other job portals and job aggregating sites. I've been able to code it manually in python for now with selenium and beautifulsoup, where it pulls data from indeed and monster based on those keywords right after user gives the input. However, I quickly realised this cannot be scaled well and I'd have to write individual codes for many many sites. Now, is there a much efficient way to do this? Or even a paid scraping tool for that matter, where, once the keywords are obtained from website, I modify the url for maybe about 15-20 job sites to match the keywords and pass only these input URLs and then display 10 job opportunities from each site on my website for the user to go through. I'm really sorry for my English, I'm not a native speaker. Thanks in advance, I'd really appreciate if someone can help me out. [link] [comments] |
what is the best remote pair programming app? Posted: 29 Mar 2021 07:43 PM PDT people on twitter and in slacks have been recommending tuple.app a lot. it looks great, i think the founders have creds + are developing it actively. but what if some peers don't run mac os (i think tuple is mac-only for now)? any other great os-agnostic apps for remote pair programming? coscreen has come up in search and recs, but their offering seems "broader" than just remote pair programming. any thoughts welcome 🙇♂️ [link] [comments] |
Best editor to develop HTML and CSS that shows changes side by side or live? Posted: 29 Mar 2021 07:00 PM PDT Is there any editor where you can see the html being rendered as you code, so you don't have to tab into your browser and press F5 everytime you want to see the change There was this thread https://stackoverflow.com/questions/9447216/is-there-an-html-css-js-editor-that-immediately-shows-changes but it is 8 years old. https://html-online.com/editor/ is great but looking for something offline to build a website [link] [comments] |
Should I continue learning Python? Posted: 29 Mar 2021 07:42 AM PDT Hi everyone! Im 28, and for the last year or so i've been learning Python on my own. I have done some proyects following guides and then started creating some of my own mainly with Flask (using Bootstrap templates) or pyQT and basic databases. Recently a friend told me to stop working on backend and start learning JS and Java and its frameworks, because its gonna be more usefull in the future when i try to get a job/produce better apps. So basically, should i keep diving in Python (i feel i have SO much to learn still) or should i stop now and start from scratch with Java? Sorry if this been asked a million times! I guess its normal to feel lost in this huge world of programming right? [link] [comments] |
Do you prefer full words over abbreviations as variable names? Posted: 29 Mar 2021 11:05 PM PDT I am not talking about the obvious ones like:
But short words like the following gives me a headache, the full words are really not that long:
[link] [comments] |
Posted: 29 Mar 2021 11:05 PM PDT I am trying to create a RESTful API in node js for a university project. I am seriously struggling and my due date is approaching swiftly can someone offer some help or recommend the best place to get help for this. Thanks [link] [comments] |
Why the below program outputs 'Nothing' ? It is really a good question. Posted: 29 Mar 2021 10:37 PM PDT [link] [comments] |
Book recommendations for CS major? Posted: 29 Mar 2021 10:33 PM PDT Hello! I am not studying computer science, but someone close to me is. I am looking for book recommendations to purchase as a gift They are focused on C++, but I am open to any good resources. After some Googling I have a couple books in my Amazon cart: Robert C. Martin Clean Code: A Handbook of Agile Software Craftsmanship Bjarne Stroustrup Programming: Principles and Practice Using C++ (2nd Edition) I am wondering if anyone has any thoughts on these, and if anyone has any different/better recommendations. Thanks in advance! [link] [comments] |
ELI5, designer trying to understand Github, is it like a portfolio? Posted: 29 Mar 2021 10:28 PM PDT I'm an artist and designer learning computer programming from the ground up. I still don't fully understand what Github is. Can anyone with the design world analogize it (and I guess similar services and resources in the coding world) to tools and platforms that we might have in the design world? Is Github like Behance? A portfolio to show to a client or employer, but you can also share your code with others for their use? How do you keep credit for what you wrote? If you wrote it from scratch, but the code is similar or identical to someone else's, do you have to find theirs and cite it? Is there truly any original code anymore? If I were to build a website from scratch, like full stack for a final project for a course, is Github the place where I would publish it if I want to be recognized by a potential client or company? Can I build a website, application, or program by splicing together code that has been shared on Github, and then publish the finished product on Github? Do you have to cite every single chunk, and if so, in a specific way? If I don't publish it to Github but say, I do publish the website for use, does it still have to be heavily cited? Are there consequences for not citing code like there are for literary plagiarism? From what I understand, Github is also a place to store previous versions of programs, or code that you're currently working on, so that if you mess up or you want to step back, you can quickly access your older versions. Don't most IDEs have that function? Why would I store code on Github rather than on my computer, drive, or cloud? Is Github more like Figma? Where you can publish your finished work, that other people can also take, use, copy, and manipulate for themselves, but that isn't its primary purpose. Mostly, it's for building your own design mockups whether that's UI/UX, graphic design, website design, etc. What exactly is Github and why should I be using it! [link] [comments] |
It took me over a week to understand constructors in Java and I feel stupid Posted: 29 Mar 2021 08:04 AM PDT So I didn't understand constructors at all for a week. Now looking back it's pretty simple and I can't believe it took me so long to understand a single concept. I feel pretty stupid and worried I'll run into this problem more and more later on until eventually I get so far behind I fail. :( [link] [comments] |
[C++] I can't figure this out, what am I doing wrong?. Posted: 29 Mar 2021 05:56 PM PDT I'm supposed to do this: Write a program that reads a file name from the user, opens the file for input, uses getline to read the contents of the file, line by line, and displays the number of lines in the file. if the file does not exist then the program should display a suitable error message. I have managed to do this: Am I supposed to create a separate file in the directory folder?, I am also getting getline as undefined, what am I doing wrong?. [link] [comments] |
Trying to pick a resource to start out in software engineering/programming? Posted: 29 Mar 2021 05:54 PM PDT Hello, I am trying to get started into software engineering, and I decided to go with Java since it is a little easier than C/C++ and easier to transition to Python later aka not too easy where I'd struggle heavily later on to transition to other languages from what I was told. Do you guys recommend Codecademy as a great start? There are so many that it is overwhelming to select one. Thank you! [link] [comments] |
Posted: 29 Mar 2021 09:20 PM PDT int y = 20: int &x = y; Referencing is like creating an alias for the l value: y, but why? & is also called as address of, if we were to apply this terms into these it would result into int address of x is equals to l value of y, which doesn't make any sense. [link] [comments] |
[c#] how to convert the first 8 bits or 16 bits of a block byte[] into float? Posted: 29 Mar 2021 09:09 PM PDT Hi,
for instance
https://docs.unity3d.com/ScriptReference/Texture2D.GetRawTextureData.html tried these none of these above right seem correct. most outputs are same output with although each individual member data in for RG16 , two channel are used. so how to access these 3 type data properly? thank you so much [link] [comments] |
Do you feel sick when you see a large number of lines in one script? Posted: 29 Mar 2021 08:57 PM PDT I have done some shitty coding for my first few projects, more than 1000 lines of code in every scripts, functions are linked together and did not extract those who behave the same into a global function, or a static class. Now I am very aware of making my code clean, less and simple, but still there are cases that I have to write a few more functions for one behavior. (I.e Animation control by code in Unity, like delay 1s to do a, then delay another 2s to do b and so on) And when I see it is somehow reaching more than 500 lines, I feel anxious or maybe the feeling is, oh shit, so much code here. Although I know this isn't that much and sometimes just unavoidable, how many of you have the save feelings? Or do you prefer to have multiple scripts or classes instead of doing something in one script. (idk, maybe extract the nested class or sth) [link] [comments] |
[PHP + MySQL] Using CONCAT works in MySQL, but not PHP Posted: 29 Mar 2021 07:58 PM PDT I'm going to explain my problem as best as I can, but I'm so tired and burned out, so please forgive me if I'm not being very clear. So, here's my problem: when I run a SQL query in phpMyAdmin, the query works flawlessly. When I try to use that EXACT same query in my PHP function, NOTHING is added into the database. Here's the EXACT query that works in phpMyAdmin: In the database, I have a table titled "tickets" with a text field named "comments". I'm just trying to add string(s) to the end of the existing data in the "comments" field for a specific ticket ID. Here's how the function looks in my PHP file: I'm really new to PHP, so I'm sure I'm just missing something. I just can't see why the query statement works in phpMyAdmin, but not when I'm trying to run my PHP file. There's no errors when I run the function, it acts like everything went correctly, but the comment isn't added to the database. [link] [comments] |
How can I code this maths fucntion as a c++ function? Posted: 29 Mar 2021 07:51 PM PDT Here is the Bézier curves maths function: https://cdn.discordapp.com/attachments/326138772477575180/826269598315839499/22358fab145b312bea913902d39db6b2.png [link] [comments] |
Posted: 29 Mar 2021 07:50 PM PDT [link] [comments] |
Why does this sizeof return size of array of 2 in the function and return 1 in main function?C++ Posted: 29 Mar 2021 07:35 PM PDT Hello im very confused as to why c++ checking for array size works in main but doesnt work in the function? using namespace std; bool check_min_heap(int array1[]){ int size=sizeof(array1)/sizeof(array1[0]); cout<<size; int lastindex=size-1; int truecheck=0; if(size<=1){ return 0; } for(int i=0; i<=lastindex;i++){ if(array1[i]<=array1[(2i)+1]&&array1[i]<=array1[(2i)+2]){ truecheck=1; } else{ truecheck=0; } } if(truecheck==1){ return true; } else{ return false; } } bool check_max_heap(int array[]){ int size=sizeof(array)/sizeof(array[0]); int lastindex=size-1; int truecheck=0; cout<<size; if(size<=1){ return truecheck; } for(int i=0; i<=lastindex;i++){ if(array[i]>=array[(2i)+1]&&array[i]>=array[(2i)+2]){ truecheck=1; } else{ truecheck=0; } } if(truecheck==1){ return true; } else{ return false; } } int heap[1]={0}; int main(){ cout<<sizeof(heap)/sizeof(heap[0])<<endl; cout<<check_max_heap(heap)<<endl; cout<<check_min_heap(heap)<<endl; } oh yeah this is my effort understanding min heap and max heap regardless of the correctness of the min heap and max heap why is size returning size the array as 2 in the function but in main the array is 1? [link] [comments] |
You are subscribed to email updates from learn programming. To stop receiving these emails, you may unsubscribe now. | Email delivery powered by Google |
Google, 1600 Amphitheatre Parkway, Mountain View, CA 94043, United States |
No comments:
Post a Comment