TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #76 · 27 апр.

Ранее я делал серию постов про битовые операторы. Вот вам ещё один наглядный пример как это используется в Python в модуле re. Чтобы указать флаг для компилятора нам надо указать его после передаваемой строки. Например, добавляем флаг для игнорирования переноса строки. pattern = re.compile(r"(\w+)+") words = pattern.search(text, re.DOTALL) А как указать несколько флагов? Ведь явно будут ситуации когда нам потребуется больше одного. Кто читал посты по битовые операторы уже понял как. pattern.search(text, re.DOTALL | re.VERBOSE) А теперь смотрим исходники, что находится в этих атрибутах? Не удивительно, степени двойки. Почему? Потому что каждое следующее значение это сдвиг единицы влево. >>> for n in [1, 2, 4, 8, 16, 32, 64, 128, 256]: >>> print(bin(n)) 0b1 0b10 0b100 0b1000 0b10000 0b100000 0b1000000 0b10000000 0b100000000 Чтобы было понятней, давайте напишем тоже самое но иначе, добавим ведущие нули: 000000001 000000010 000000100 000001000 000010000 000100000 001000000 010000000 100000000 Не понятно что тут происходит? Читай три поста про битовые операторы начиная с этого ➡️https://t.me/pythonotes/45 В общем, это пример применения побитовых операций в самом Python. Теперь вы знаете Python еще немного лучше) #tricks#regex#libs

Резултати

Пронајдени 18 слични објави

Пребарај: #basics

当前筛选 #basics清除筛选
Go

@golang · Post #67 · 20.07.2018 г., 18:47

Generally I don’t like aliases but in some cases they might be helpful 😀 #development#basics https://codeburst.io/learn-how-to-create-custom-bash-commands-in-less-than-4-minutes-6d4ceadd9590

Go

@golang · Post #26 · 27.01.2018 г., 16:15

In the GoLang we use interfaces everywhere. But we also should understand the rules and idioms how GoLang interfaces works. Let’s read about them 😉; part one: #development#basics https://medium.com/golangspec/interfaces-in-go-part-i-4ae53a97479c

Go

@golang · Post #69 · 24.08.2018 г., 10:05

A good reading list with a knowledge base about Golang, based on blog posts and Golang books. Inside of the link: - 3 categories of stages: Beginner, Intermediate, Advanced; - Common questions like “Why should you learn Go?” and “How to Write Go Code” - Web, Concurrency, Code style, Testing and other GoLang related topics. #language#development#basics Add to bookmarks and enjoy the reading! https://github.com/enocom/gopher-reading-list

Go

@golang · Post #46 · 05.03.2018 г., 20:39

Simple and good for understanding tutorial about Golang’s channels. It can help beginners to meet with them and learn to use it without problems 🙂 Keys of the article: - What is a channel, goals, and functions of it; - Deadlocks and other problems; - Channel ranging and closing. When, why and how? #development#basics#language http://guzalexander.com/2013/12/06/golang-channels-tutorial.html

Go

@golang · Post #52 · 22.03.2018 г., 14:57

How to work and use field tags in GoLang? Inside of this article Michał Łowicki from Opera company explains basics and features of tagging; include examples and best practices 🙂 #development#practice#basics https://medium.com/golangspec/tags-in-golang-3e5db0b8ef3e

Go

@golang · Post #47 · 07.03.2018 г., 07:42

One of popularly questions is: How to handle errors correctly? GoLang best practices on the Medium will help with it. Of course, code examples are included 🙂 #development#practice#basics https://medium.com/@sebdah/go-best-practices-error-handling-2d15e1f0c5ee?source=linkShare-b636419a57de-1520408380

Go

@golang · Post #61 · 21.05.2018 г., 19:17

Hi 👋 there! This article is meant for those who’re new to Go and want to start learning about Go’s concurrency primitives: go routines and channels. #development#manual#basics https://medium.com/@trevor4e/learning-gos-concurrency-through-illustrations-8c4aff603b3

Go

@golang · Post #27 · 28.01.2018 г., 12:44

Everybody use dependencies and third-party packages but what is the best way to use it? GopherAcademy helps to understand best practice for the vendor folder organization. Of course, code examples and theory points are included 🙂 #development#basics#manual https://blog.gopheracademy.com/advent-2015/vendor-folder/

Go

@golang · Post #34 · 05.02.2018 г., 08:41

New post about concurrency problems and solutions. Main points with examples: - Blocking Channels; - Blocking Channels Buffer; - Wait Group (run multiple async tasks and wait for them execution); #development#basics#algorithms https://hackernoon.com/concurrency-how-it-can-help-you-and-how-you-can-use-golang-to-reach-it-easily-ae3e070b3d2c

Go

@golang · Post #49 · 11.03.2018 г., 11:39

Top GoLang features that you don’t know or don’t hear so much 🙂 If you want some main points of this article they are here: - GoDoc; - Static code analysis; - Built-in testing and profiling framework; - Race condition detection; - Learning curve; - Reflection; - Opinionatedness; - Culture. #manual#development#basics#language https://medium.freecodecamp.org/here-are-some-amazing-advantages-of-go-that-you-dont-hear-much-about-1af99de3b23a?source=linkShare-b636419a57de-1520768034

12
ПретходнаСтраница 1 од 2Следна