One fast trick: to search one string in history o git. Feasible:
In recent post i talk about some decorators in Python. Now, we show how to use another decorators. The first example is with static method decorator. This decorator is very easy and represent one static method in you class:
Recently, we need changes all version in pom file. But, there are a little problem: the are more than 70 modules in project. Ok, you can do replace for all files using Notepad++ or another tool. But, the maven provides one manner more easy:
Decorators in Python is basically metaprogramming. To understand decorators in Python, some things will be clear:
- function are high-order objects
- you can pass funcions as arguments
- you can declare inner functions
Do you want download videos of Youtube in sequence? In Python this task is very simple. I add one retry, because the videos are downloaded in high resolution, so, sometimes, the Youtube can fail. To treat this, i add one retry.
Did you know that it is possible to run Python code with Async/Await? Since Python 3x it’s possible. Follow the code, it’s very simple:
I use Youtube to watch many video. But, most of videos i like watch faster. By default, Youtube provides 2x speed, but to go faster, just:
When the resource translate pages of Google Chrome was used the CSS page can broken. To avoid this, if you available i18n, you can do this:
Recently, i needed generated one csv with until 50k rows. One theses fields was an date. Optmizing the iteration in collection:
Certainly you know use callbacks in JavaScripts, right. Or maybe pass one pointer to function in C, for example. Ok, but, since Java 8 and method references and lambdas we can callbacks in Java. For example:
Recently, i need call another services with XML. And, using JAXB, i had the following problem:
Recently, i had needed of found the first time that one code appeared in project. So, in git it’s very simple, just:
There are many types of BarCodes. In the below examples i was created QRCodes with zxing one library of Google.
In more recently times the Java had receive new lauched more frequently. One these features it’s the records. With record now it’s possible create “class” more easily and that transport datas.
Sometimes it’s interesting using virtual environments to develop. One different version of version installed in SO is enough. In Python exists the virtualenv. In these virtual environment it’s possible use the version by project independent of SO.
Do you use the library called OpenCSV? With this library generate any csv file is more easy.
Recently, i had that unzip files very huge. The file had 17GB. So, i was tried unzip and i was not success.
The Brazil Public Transparency has available one API to search all public data. You can search about anything relationship Governorment and costs.
Lambda calculus it’s not a new. Alonzo Church formalized this calculus in 1930’s.
Are you like or need learn a new programming language? What if it’s possible with mentoring, do you believe?
Recently, I learned that the
init
method in Python is not a constructor.Recently, I needed to create mappers in Java using ModelMapper.
Do you know how to log in Python? Maybe you used a logger in another languages. But how about in Python?
Do you know Rest API? Certainly, yes. How about in Python? Follow this example to build two endpoints with Python and Flask.
Certainly, you must be used to “while” and “else”. However, Python has one structure called while/else. For example:
Git is a powerful version manager control. However, it does have many details. Recently, I’ve had problems with git clone:
Asdf is an extensible version manager via plugin. Asdf evaluate manager many CLI to multiple languages. For example Java, Node, Go, Haskell and much more.
The lib matplotlib is widely used in Python and Machine Learning. The good news is that using this lib is very easy. First of all, we will be installing the dependencies needed:
To use Redis with NodeJS is more simple. In this example, we will use Docker to obtain an instance of Redis. Follow the example:
node-cron is a possible solution for scheduling in NodeJS. It’s very simple to use.
O PIP é o gerenciador de pacotes do Python. Com ele é possível instalar, remover e pesquisar pacotes python.
O Java 8 trouxe muitas novidades, uma delas foram as interfaces funcionais e o lambda. É importante pensar em lambda como uma função, uma função anônima. Podemos usar um exemplo simples. Pense na seguinte expressão matemática:
O Telegram é um aplicativo fantástico, isso é fato. E criar bots para ele é fácil e ele mesmo ajuda a criação de bots com seu @BotFather. Para tanto, inicialmente invoque o @BotFather com /start e siga os passos. Ao fim destes passos, guarde o token informado. Aqui, o mesmo foi criado como variável de ambiente com:
Recentemente precisei pesquisar em arquivos .gz. O detalhe é que haviam vários arquivos, e não sabia exatamente em qual encontrar. Para tanto, basta realizar o seguinte: