"Automate the Boring Stuff with Python" Udemy course is free to sign up for the next 72 hours: DEC2019FREE learn programming |
- "Automate the Boring Stuff with Python" Udemy course is free to sign up for the next 72 hours: DEC2019FREE
- How can I improve and work on my Python?
- Advent of Code 2019 starts today!
- Game development in C?
- What's a good resource for learning the trade-offs between various database solutions?
- [Python] Various tips from my PMs
- How should I start a project
- How do I study for my CS exams?
- Ideas for data structure projects
- Which framework to choose for node.js + apollo-server + graphql
- What are the skills and knowledge one should have as a front-end developer?
- React-select "required" doesn't work?
- Looking for resources on smart pointers and Linked Lists in c++
- Building a game engine using C with a more higher level one for scripting?
- [Visual Basic] Need to Show Values switching without Clicking (every time, and more)
- Complete Noob
- How do I use react on a C# application ?
- I have a react/redux and .net core application ready to put on a server soon and have users use it. But how can I secure it?
- Just started programming
- (Java) Trying to change Swing text box to variable.
- RevHacks - a day long event of fun challenges
- [python] Sum of the first nth term of Series
- Could SQL BLOB be described as a "persistence raw type"?
- How to insert a variable inside a post request in python to an api?
Posted: 01 Dec 2019 07:03 PM PST You can use this code to sign up for the Udemy "Automate the Boring Stuff with Python" course for free: https://www.udemy.com/course/automate/?couponCode=DEC2019FREE During the month of December, you can also use DEC2019 to sign up for $14 instead of the usual $50: https://www.udemy.com/course/automate/?couponCode=DEC2019 Due to the way Udemy now does promotions, I'm limited in how many discount codes I can make each month, so there's no way for me to make more after the 72 hour period, which ends roughly Wednesday night 7pm Pacific time. I'll have the second edition of the book in HTML format online, uh, soon. I've had some delays getting it ready. The online course follows the 1st edition, and I won't be able to update it until probably mid-2020. I'll write up a blog post about what exactly is new in the 2nd edition soon too. Go ahead and get started: the Udemy course is still useful. The 1st edition is free online under a Creative Commons license, but if you want to buy a print copy of the book, I recommend getting it directly from the publisher instead of Amazon; you get DRM-free ebook copies in PDF, Kindle, and epub formats for free with the print book: https://nostarch.com/automatestuff2 [link] [comments] |
How can I improve and work on my Python? Posted: 01 Dec 2019 09:45 AM PST So currently I'm 13 years old and I just recently got into programming and the first language I'm on is Python. I just finished syntax and the basics up to classes in OOP. I'm really interested in getting into ML and AI but I know I need to know Python pretty well so what are some ways I can learn new things and practice? [link] [comments] |
Advent of Code 2019 starts today! Posted: 01 Dec 2019 01:21 PM PST I don't think this was posted already but I might be wrong. In case you don't know about it, advent of code features 25 coding exercises for all levels starting today until Christmas: https://adventofcode.com/ [link] [comments] |
Posted: 01 Dec 2019 10:50 AM PST I'm learning C in uni and I wanted to get into game development with C but I can't find any good video tutorials on YouTube. Do you have anything to suggest? [link] [comments] |
What's a good resource for learning the trade-offs between various database solutions? Posted: 01 Dec 2019 10:22 AM PST I'm curious as to why someone elects to go with PostGres vs. MySQL. When is using ElasticSearch a good idea? How about GraphQL? There are so many DB options but I really don't understand when one choice is more optimal than another. [link] [comments] |
[Python] Various tips from my PMs Posted: 01 Dec 2019 07:11 AM PST After a recent AskReddit thread I received random tips for Python with people curious as to what I had received. After PMing the mods and getting the go ahead I've decided to post the tips. Most of these go over my head. These are just the PMs, there were plenty of other comments as replies to this comment. There are also a few in this thread too. You can have a else block for for/while loop that gets executed if your loop does NOT get terminated by a break statement within that loop. Super helpful. Mypy does gradual type checking so you can make sure you don't put a string where an int is supposed to go. 2to3 is very useful when porting python2 code to python3 Ternary operators https://book.pythontips.com/en/latest/ternary_operators.html Idle is the best IDE for python3. If you zip two different length lists, it'll stop returning tuples once one list runs out of items. Don't do it. In Python, mutable values are passed to functions by value, while immutable ones are passed by reference. Black your code Don't forget about list and dict comprehensions, they are fucking lit. There is a suppress context in contextlib that lets you catch/pass exceptions: Use deque instead of list if you're going to be adding and/or removing things from the ends very often. It took me a pretty long time to figure out that the function urlopen() from urllib changed from being in the base urllib package in Python2, to being in urllib3.requests in Python3. It took me even longer to figure out that the package 'Requests' is better than urllib in every way (although it isn't included in base Python I don't think). Requests is great for fetching a website's HTML. You can then parse and search it easily using 'BeautifulSoup4' (I recommend the lxml parser). You can use bs4 to search the HTML and return an array of a certain element/tag. Super useful. Turtles suck. Turtles can go fuck themselves. Don't use Turtles. https://github.com/ajalt/fuckitpy/blob/master/README.md Perhaps you are already familiar, if not, however, then fuckit.
To view the Zen of python. new python programmers tend to write something that is cobbled together and works, but lacking elegance that makes python truly special. Iteration in python can get ugly with a ton for loops nested even if u only need to go through things once. Lookat generators aka infinite iterators. You've used them b4: the range function is actually a generator. This is a bad example, but u get the point. Generators spit out values which can only be consumed once, but also don't take up space. This is bc they are lazy. In a function header you can add * as a parameter to force all following parameters to be passed as keyword arguments. Example:
Then Python 3.7 added dataclasses. Now you don't have to write a long-ass constructor that just sets all the arguments as class members. (e.g. "self.name = name") Use jupyter hub and join the python discord! :) use Hey, did you know you can concisely create and manipulate lists using a List Comprehension? ;D Not really a tip, but a weird interaction: The += operator in Python actually mutates instead of reassignment. So,
As opposed to
As far as I know, this is the only way the += operator is different than just writing out what it supposedly stands for. Also, here's a genuine tip: If you ever want to write a tuple of length 1, you might have a problem. Suppose I want a tuple just with the number 4 in it.
Because (4) evaluates to 4 which is obviously an int.
If you add a comma, python knows that you mean for it to be a tuple. Not a python3 so much as general python, but this is important. It's dumb that ** is used for exponentiation. It makes code harder to read, and no other major language uses that operator. Python does allow you to operator-overload "^". You might think you're clever for turning that into the exponentiation operator. DO NOT DO THIS. The caret operator has lower precedence than the addition operator, and so your order-of-operations will be totally fucked. Sadly, we are stuck with ** for exponentiation. tip - if you build websites, check out CherryPy. its a woefully underappreciated framework that blew my socks off! Let's say you have an iterable x You can create an iterator of it with iter(x) You can create N references to the same iterator with [iter(x)] * x Hence you can get tuples of N elements of x with zip(*[iter(x)] * N) you probably already know this but remember to use functions and classes so your code is organised, easily readable and code isn't unnecessarily repeated. flask is amazing for python powered web dev. https://realpython.com/python-type-checking/ It almost makes python fun again. No python tips I have can live up to the things my old roommate would figure out, such as this: https://www.reddit.com/r/shittyprogramming/comments/cmdsno/how_to_do_autoimports_in_python/ In order to make your code more concise if you optimize your if statements. So instead of doing you can do which is much better. You may have already heard this one. Make sure you're running the latest version (and the right one). I spent at least an hour and a half yesterday trying to get tensorflow working cause I was on python 32 bit. Good luck with your programming endeavours! It's fairly common knowledge that this works: but you can do the same thing with classes! u can declare return type, good for readability, def foo() -> None: [link] [comments] |
Posted: 01 Dec 2019 09:26 PM PST Hi I'm new to coding and been learning python for the past couple weeks. the one thing I keep hearing is work on projects, but I don't know if I should code for a couple more weeks or just work on it now. Is there a certain workflow I should follow or is this just apart of the learing process, just code and learn the workflow. thanks in advance! [link] [comments] |
How do I study for my CS exams? Posted: 01 Dec 2019 11:43 AM PST We don't get any practice questions, previous exams, anything to practice with in university and I was hoping you guys can answer some questions for me (I'm taking a 2nd year university OOP course with C++) 1) Why do we have to define any of the big 5 when apparently there are compile provided ones?? Can I get a quick summary on when to use each one? 2) Is the only difference between copy constructor and copy assignment that for copy you just use {} and for assignment you use = ? If you know you will exclusively use one way, do you have to code for the other? 3) what's the best way I can practice concepts like decorator pattern, observer pattern, iterator, etc.. because I keep reading my notes over and over, but since we aren't given practice questions it's really hard to remember and understand it without practice Thanks! [link] [comments] |
Ideas for data structure projects Posted: 01 Dec 2019 09:08 AM PST I need help thinking up a project for data Structures in c++. I'm still learning DS so it shouldn't be too complicated. I've thought of making a text encoder and decoder and a dictionary but they seem a bit simple especially the dictionary one so any help is welcome. [link] [comments] |
Which framework to choose for node.js + apollo-server + graphql Posted: 01 Dec 2019 09:58 PM PST This is my first time working with node.js, apollo-server, graphql. And now I also choose a framework. What to choose and why? [link] [comments] |
What are the skills and knowledge one should have as a front-end developer? Posted: 01 Dec 2019 02:23 PM PST What are the concepts and tools that someone must have to be successful as front-end developer? [link] [comments] |
React-select "required" doesn't work? Posted: 01 Dec 2019 12:25 PM PST I've got a select dropdown in a form using React and Bootstrap, and I'd like to require the select element to submit the form. However, I can't seem to find anything on this in the react-select docs, and it seems to still be an open issue based on GitHub. I figured I could simply add the "required" attribute to the element like in vanilla HTML, but it doesn't work. For the meantime, I've followed others' lead on GitHub by adding an invisible input element below the select element, made it required, passed the select element's value in as a prop to the input value, and used CSS to make the "required" popup appear directly over the target select element when the user tries to submit without filling it in. I've already checked out the following links and other similar pages (some of which I've followed for the above approach), but I'm wondering… is there an easier way that I'm just not seeing?? https://github.com/JedWatson/react-select/issues/3140 https://codesandbox.io/s/react-select-v2-required-input-3xvvb?fontsize=14 [link] [comments] |
Looking for resources on smart pointers and Linked Lists in c++ Posted: 01 Dec 2019 06:15 PM PST Anyone recommend any particular videos, books or websites? Most resources I found use unique pointers but I can't find much on shared pointers. Thanks. [link] [comments] |
Building a game engine using C with a more higher level one for scripting? Posted: 01 Dec 2019 08:22 PM PST Is it possible to write a game engine using pure C (not C++) for things like graphics rendering, physics, hardware access while using a higher level language such as C# or Python for game logic. [link] [comments] |
[Visual Basic] Need to Show Values switching without Clicking (every time, and more) Posted: 01 Dec 2019 12:24 PM PST Hey guys, I am a complete newbie... I would like to learn how to make this function in VB: Text Box with start Value001 (example) Button name = Start When start, Value001 start changing to fixed values (I need to enter manually) Example: Text box will show: Value007, then Value512, Value251 Button name (during the process) becomes = Stop If clicked, action stops. Beside this, I also need a Timer (I assume) for Value switching speed. Last option that I need is when user press Start and don't want to press Stop At one moment, process will be stopped by itself, changing the button text to 3rd text (so no Start or Stop, but Text3) Perhaps I am one very stupid guy, but I was not able to find enough of info to make this, 2 days already. Please help me if you can... sorry for poor English and task explanation. Pls help if this is not hard for you to explain. [link] [comments] |
Posted: 01 Dec 2019 11:37 PM PST Hey all, My boyfriend is a programmer and seeing him using his computer in such a cool way has peaked my interest. I was thinking maybe I could start to learn a bit so that we could have another thing to bond over. Any good tips for a complete noob? (I did read into the FAQs of this subreddit, so I do have some good references, just thought I'd ask for separate tips post). [link] [comments] |
How do I use react on a C# application ? Posted: 01 Dec 2019 11:29 PM PST I have this texttospeech application that someone built using AzureCognitive Service at my internship, The UI is simple, an input box with 2 views, one for text input and the other also for input but with SSML syntax the user can tweak the output of the voice generated, for example pitch, voice etc. [link] [comments] |
Posted: 01 Dec 2019 10:53 PM PST tl;dr: Nooby dev has front end and back end working locally. But is scared about putting it to production and isn't sure how to secure it up properly :x So I know it's not much, but I fully expect potentially hundreds of users to this website I have built. Some of them will for sure try and break it, hack it, etc. So how can I make sure my application is as secure as possible? Like I have a .net core backend that communicates to a react-redux front end. How can I make this as iron clad as possible? I've got the API points done out like tutorials show, but I am not sure how to properly secure them like this :x [link] [comments] |
Posted: 01 Dec 2019 10:50 PM PST I recently started coding in general and my first language is java and I am struggling in my classes because they way they teach the curriculum and i was wondering if there are any tools that will help me understand coding better so that i could better my understanding of coding and Java [link] [comments] |
(Java) Trying to change Swing text box to variable. Posted: 01 Dec 2019 12:09 PM PST I have a line that goes {textField.setText(String.valueOf(timesClicked));} and I cant read any of my error messages because the terminal closes right after it sprays them all over the screen. Any help would be appreciated. [link] [comments] |
RevHacks - a day long event of fun challenges Posted: 01 Dec 2019 10:42 PM PST Reverie Language Technologies is organizing a #Hackathon on Indic Languages, in partnership with Nasscom on 18th January 2020, to bring language equality on the internet.The event will include challenges to be brainstormed by all product makers who love building innovative products to provide solutions for Indian language internet users.Join #RevHacks at #Nasscom Bangalore, as we work through a series of challenges, learning and some fun! competing in teams of up to 4 people. Along with delicious food, fun diversions and prizes, you will also get some expert guidance in house.This event is open to Startups, IT professionals, Makers, Growth Hackers, Innovation experts and students studying in Bangalore and select nearby cities. Winners of this Hackathon will walk away with a cash prize of Rs 1 Lac. Well, this is not it!! there are many other perks for the participants. Register today and become a part of the change. Last date to register 05th January 2020. Free tickets available only on - RevHack [link] [comments] |
[python] Sum of the first nth term of Series Posted: 01 Dec 2019 10:38 PM PST I was working on codewars and I solved the problem that I was working on BUT after looking at the more elegant solutions I don't actually understand one particular detail. If possible I would like some help understanding that particular part. I am going to lay out my ugly solution as well as the elegant solution, and point out the specific part that I don't understand. Question: Your task is to write a function which returns the sum of following series upto nth term(parameter). Series: 1 + 1/4 + 1/7 + 1/10 + 1/13 + 1/16 +... my ugly solution: Now i realize that i should have set sumz=0 and made the range as "range(n)" instead of "range(1,n)" but anyway, you ca see that i HARDCODED it to return "0.00" if n==0. Elegant solution: so, what I do NOT understand is how does that return "0.00" when n==0? I broke it down into steps when n=5, and I got: So, I know that range starts with 0 as default, so that "1.0" output is from i=0. This makes sense because 1/(1+ 3*0) = 1. However, I don't understand how if THAT i=0 gives us "1.00" as an output that having a given range(0) doesn't output anything. Does that input just "pass" or something and go right to the returning the nonexistent sum as a string? TLDR: Why does series_sum(0) return "0.00"? [link] [comments] |
Could SQL BLOB be described as a "persistence raw type"? Posted: 01 Dec 2019 10:32 PM PST I read BLOB is a collection of "binary data" and someone in this subreddit told me that:
This sounds like raw types in java. Could you say that storing something in a BLOB is like List<> name_list = new ArrayList<>()? If that is the case, why should I want to store something as INT or VARCHAR when I can store it as BLOB? I know why I would want a Dog stored in a reference value of Canine as opposed to Animal, but I don't have that understanding in SQL. [link] [comments] |
How to insert a variable inside a post request in python to an api? Posted: 01 Dec 2019 10:41 AM PST I have a variable named image and i want to insert its value in url which is then used in post in python data = '{"inputs": [{"data": {"image": {"url": "https://i.imgur.com/dlMjqQe.jpg"\\n }\n }\n }\n ]\n }' [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