teleren/devto huggingface dataset:
Eclipse RCP Testing tools before your code goes to LIVE
Tags: Eclipse, testing, build
Published: 2020-05-12 03:54:55

Use these **Eclipse RCP** Testing tools before your code goes to LIVE
Testing is most important part of any software development lifecycle. There are different type of testing required before **Eclipse RCP** tool is released to productions.


Eclipse RCP is very easy to test with the these testing tools:

## UI Testing:

### [RCP Testing Tool](https://www.eclipse.org/rcptt/)

RCP Testing Tool is a project for GUI testing automation of Eclipse-based applications. RCPTT is fully aware about Eclipse Platform's internals, hiding this complexity from end users and allowing QA engineers to create highly reliable UI tests at great pace.



### [SWT Bot](https://www.eclipse.org/swtbot/)

**SWTBot** is an open-source Java based UI/functional testing tool for testing SWT, Eclipse and GEF based applications. 

SWTBot provides APIs that are simple to read and write. The APIs also hide the complexities involved with SWT and Eclipse. This makes it suitable for UI/functional testing by everyone, not just developers. SWTBot also provides its own set of assertions that are useful for SWT. You can also use your own assertion framework with SWTBot.



### [Jubula](http://www.rcp-vision.com/test-automatici-jubula/)

Eclipse Jubula is a new addition to the Eclipse universe. It's a functional UI testing tool that allows you to specify and run tests. Jubula consists of plug-ins for an IDE and a standalone RCP application.


## Unit Testing

### [JUnit](https://junit.org/junit5/)

JUnit 5 is the next generation of JUnit. The goal is to create an up-to-date foundation for developer-side testing on the JVM. This includes focusing on Java 8 and above, as well as enabling many different styles of testing.

### [Mockito](https://site.mockito.org/)

Tasty mocking framework for unit tests in Java.

Mockito is a mocking framework that tastes really good. It lets you write beautiful tests with a clean & simple API. Mockito doesn’t give you hangover because the tests are very readable and they produce clean verification errors.



## Build Tool

### [Tycho](https://www.eclipse.org/tycho/)

Tycho is focused on a Maven-centric, manifest-first approach to building Eclipse plug-ins, features, update sites, RCP applications and OSGi bundles. Tycho is a set of Maven plugins and extensions for building Eclipse plugins and OSGi bundles with Maven. Eclipse plugins and OSGi bundles have their own metadata for expressing dependencies, source folder locations, etc. that are normally found in a Maven POM. Tycho uses native metadata for Eclipse plugins and OSGi bundles and uses the POM to configure and drive the build. Tycho supports bundles, fragments, features, update site projects and RCP applications. Tycho also knows how to run JUnit test plugins using OSGi runtime and there is also support for sharing build results using Maven artifact repositories.
Setting Up A Job System
Published: 2020-05-12 03:30:19

#What's the problem?

Long story short; we have too much going on. Long story long; games require a lot of computing power, everything you see on screen is the visual representation of a bunch of math, and just like the rest of us, CPU's tend to slow down when exposed to too much math.

#Whats the Solution?

Multi-threading! instead of forcing a single CPU core to do all the math, we're going to have to delegate it to other cores. That'll make it so that our main thread can really chill out and find itself while it draws all the pretty shapes that we end up seeing in the game, all while the other lesser liked threads gruel away on boring math (don't worry they like it).

#Whats the better solution?#

A Job system! A job system is going to let us dynamically start new threads as we need them. A video game isn't going to be mathematically intensive every single second. Sometimes you get some chill moments that let both you and the CPU relax and have a nice sip of tea (please don't pour tea into your CPU), and during these times, you don't really need a lot of threads to render everything. Other times you have way too much happened on-screen, and you feel like you need to step away so that you can call a friend and have them assure you that there are enough threads to handle all that math! What I'm trying to say is that a Job system is a way to queue up a bunch of function pointers that you send off into their own threads so that they can do their jobs in peace. This system allows us to really up the amount of math the CPU can do at once, this way the game doesn't have to wait for the Physics to calculate how far the character flies away so that it can make sure the sky is still blue.

By Ahmed Fayez
Facilitando o entendimento da arrow function no PHP
Tags: php, functional
Published: 2020-05-12 03:01:54

Se você já estudou um pouco sobre programação funcional, provavelmente já ouviu falar sobre a função que nomeia este artigo. E além disso, se estudou Javascript, possivelmente já estudou muito sobre esse conceito.

Trago neste artigo uma dica rápida de como aplicar este conceito tão popular na programação funcional (amplamente popularizado pelo Javascript) dentro do PHP.

### Arrow function

As _arrow functions_ foram introduzidas no PHP a partir da versão 7.4 da linguagem, e tem como principais missões dar produtividade ao desenvolvedor e facilitar o trabalho com escopo.

Vamos ver um exemplo de código sem usar _arrow function_:
```php
    $valorDoEmprestimo = 30000;
    $taxaDeJuros = 18.63;

    function calcularJuros($emprestimo, $taxa) {
        return $emprestimo * ($taxa/100);
    }

    var_dump(calcularJuros($valorDoEmprestimo, $taxaDeJuros));
```

Vamos supor que essa taxa é fixa e não precisa ser passada como parâmetro:
```php
    $valorDoEmprestimo = 30000;
    $taxaDeJuros = 18.63;

    function calcularJuros($emprestimo) {
        return $emprestimo * ($taxaDeJuros/100);
    }

    var_dump(calcularJuros($valorDoEmprestimo));
```

Nesse caso, vamos receber um erro:
```
Undefined variable: taxaDeJuros
```

Porque a variável `$taxaDeJuros` foi declarada fora da função `calcularJuros` e por conta do escopo, ela não é enxergada dentro da função. Aí que entra a _arrow function_.

Antes, vamos ver o mesmo exemplo de código com uma função anônima:

```php
    $valorDoEmprestimo = 30000;
    $taxaDeJuros = 18.63;

    $jurosCalculados = function ($emprestimo) use ($taxaDeJuros) {
        return $emprestimo * ($taxaDeJuros/100);
    };

    var_dump($jurosCalculados($valorDoEmprestimo));
```

Bom, resolvemos em parte o nosso problema. O `use` nos permite "herdar" variáveis do escopo pai. Não precisamos passar como parâmetro na função, mas ainda assim precisamos referenciar.

Agora, o mesmo exemplo de código usando _arrow function_:

```php
    $valorDoEmprestimo = 30000;
    $taxaDeJuros = 18.63;

    $jurosCalculados = fn ($emprestimo) => $emprestimo * ($taxaDeJuros/100);

    var_dump($jurosCalculados($valorDoEmprestimo));
```

Muito mais conciso, não é? Mas o que mudou? Vamos enumerar:
1. Redução da palavra _function_ para apenas _fn_
2. Substituição do par de chaves `{ }` pela _arrow_ `=>`
3. Supressão do `return`
4. E, finalmente, não foi preciso referenciar a variável `$taxaDeJuros` em lugar nenhum. Ela simplesmente foi reconhecida por ser do escopo pai.

Fácil, né?

Se ficou alguma dúvida ou gostaria de dar um feedback, deixa um comentário. :)

No próximo artigo vou trazer outros conceitos da programação funcional usando as funções `map`, `filter` e `reduce` no PHP.
Cyber Security 
Tags: security, cyber
Published: 2020-05-12 02:57:03

I have just completed a course on cybersecurity, it was for a beginner but, there were many things I learned that enhance our vulnerability and we do those things on daily basis without knowing that it could lead to big problems in future and I learned many new things as we can check whether our emails are attacked or not on this site  https://haveibeenpwned.com/ and I came to know about shodan it is like google a search engine but it is very powerful.

I also came to know about a website which can help us find the right anti-virus
suitable for us    https://www.av-test.org/en/antivirus/home-windows/  .

One more website that I came to know about is https://www.grc.com/intro.htm
and it helps to check the security of your browser.

there were also tips related to spam emails and we should check the links are genuine or not by moving the cursor on the link it shows the real link
and use of a VPN is also a must as it hides your IP address which enhances your security.

I know many of this we already knew these things but we ignore this in real-time
so my intention was to share my knowledge and make people more alert.


Any feedback will be a blessing to me.
CMD Commands
Tags: computerscience, cmd, Terminal
Published: 2020-05-12 02:12:56

When I started Learning Development one of the Courses i Took during my enrolment in the full stack nano degree program offered by Udacity was Command Line and how to use it, Command Line is the CLI (Command Line Interface) Version of how to deal with computer, on the mac it's called Terminal but for windows it's called shell, let's say your trying to create a new Directory you have two option press right click and choose create new folder from the menu(GUI Version)or type "mkdir" command in the Terminal (CLI Version),the GUI version was developed because it doesn't make any sense for normal users to type bunch of commands in a black screen to create a folder or to view a photo or to delete a file, in this article i will show a bunch of Commands which comes in Handy.

 Basic Commands :- 

.Command: mkdir "FolderName" 
Create a new Directory called FolderName, the mkdir abbreviation stands for (make directory )

.Command : cd FolderName 
Change your current location to be on Folder, the cd abbreviation stands 
for (Change Directory)

.Command : ls 
List the Files inside the current Directory you're in, ls abbreviation 
stands for List 

.Command: pwd 
output the path you're currently in, pwd abbreviation stands for print 
working directory 

.Command: cd ../ 
 Redirect you to the previous directory 

.Command: rm File.pdf
 Remove File.pdf from the computer (you won't find it in the trash)


Extra's :

 if develop in python and want to download any module or library you can 
 install and use pip a package installer for python

 Command : pip install ModuleName

 you can also code in python in the Terminal by typing python in the 
 Terminal if python is installed on your machine 

 you can use HomeBrew to install any package installer you want 
 Brew install Packagename
Grails 3.3.10 to 4.0.2 Postmortem
Tags: grails, groovy
Published: 2020-05-12 02:04:32

The Grails 3 to 4 upgrade was nowhere near as daunting as upgrading from 2.5.x. However, I thought I would do a postmortem for the upgrade just the same. This is for a project that has about 80,000 lines of Groovy/Grails, and 40,000 lines of GSP, which is quickly becoming deprecated for Angular.

Tasks:
* Custom password salt implementation finding temp workaround then replacing, with bcrypt.
* Removing a duplicate class wonder why this didn't cause issues before
* Removed a class that was just a script, which means it had a main method which caused errors
* Fixed unit test the fall back for the mixins didn't seem to work anymore
* Gorm/HQL had to replace all ? params with positional ?0,?1,..., etc.
* Had to add enabled = true to war task
* groovy.json.internal.LazyMap was being used with instanceof had to update to org.apache.groovy.json.internal.LazyMap
* Many instances where hibernate proxies were not being unwrapped. Fixed with GrailsHibernateUtil.unwrapIfProxy or fetch:'join' depending on circumstances
* DB migration plugin no longer has access to system properties so I had to add a fallback candidate to the config.
* Actuators and h2 console changed so I had to update the security around them
* Had to move where I defined the sourceSets for the resources for the db migrations
* Had to exclude old converters from grails-datastore-rest-client, which we should upgrade
* Had to fix spring security ldap:
https://www.baeldung.com/spring-boot-security-autoconfiguration
spring.autoconfigure.exclude=['org.springframework.boot.autoconfigure.ldap.LdapAutoConfiguration', 'org.springframework.boot.actuate.autoconfigure.security.servlet.ManagementWebSecurityAutoConfiguration']

Other resources:
* https://dev.to/erichelgeson/grails-4-upgrade-notes-3cja
* https://docs.grails.org/snapshot/guide/upgrading.html
* http://gorm.grails.org/7.0.x/hibernate/manual/index.html#upgradeNotes
* https://www.youtube.com/watch?v=i-zSKRsI2FA
* https://medium.com/agorapulse-stories/how-to-benefit-from-grails-4-upgrade-e4f4aae4a9d
Difference between i++ and ++i
Tags: javascript, operator
Published: 2020-05-12 01:42:02

Both prefix and postfix operators are used to mutate and update values. And both `i++` and `++i` alone does the same thing, increment the value of i by 1. This can sometimes be confusing for some beginners.

The difference can be found when assigned to other variables. For example:
```
let i = 0;
let j = i++; // first assigns to j then increments i by 1
console.log(j); // 0
let k = ++i; // first increments i by 1 then assigns to k
console.log(k); // 2
```
SOLID: O "S" de SRP.
Tags: oop, csharp, javascript, java
Published: 2020-05-12 01:29:55

Quando ouvimos o termo "SOLID", muitas vezes achamos que é algo do outro mundo, ou até mesmo algo difícil de ser dominado. Porém é mais simples do que podemos imaginar. O conceito que irei abordar nessa publicação é o "S" do solid que significa: "Single Responsablity Principe", que significa Príncipio da responsabilidade.

                    Trabalhando com o conceito de SRP: 
   Single Responsablity Principe(Princípio da Responsabilidade única). 

Temos uma classe chamado "Cliente", nesta classe está dentro do arquivo "Entities" e sabemos a função desta classe, armazenar informações pertinentes ao cliente. E se transformassemos essa classe "Cliente" em uma classe que fará leitura e escrita de um dados em CSV? Estranho não é? Sim! Muito! O príncipio da Responsabilidade única traduz em a classe fazer o seu único papel! Então deveríamos criar um arquivo chamado de "Repositories" e assim criar uma classe chamada "ClienteRepository" como exemplo. E esta classe faria a função que salvaria o arquivo csv em uma pasta no seu computador ou ler o conteúdo deste arquivo, e não necessariamente criar um monte de responsabilidade para aquela classes desnecessariamente.

                   SOLID É UNIVERSAL!

Qualquer pessoa da parte do mundo, que estiver contato com seu código entenderá o que está se passando através dele. Lembre-se, que no SOLID cada papel tem sua responsabilidade, não é sua cama cheio de bagunça em cima, e você tem que revirar as roupas para encontrar suas meias(...). Ele é um guarda-roupas com todas as gavetas organizadas. Gavetas de meias, gavetas de blusas, gavetas de calças, e assim por diante. Qualidade do seu código se tornará melhor, e assim você entenderá uma parte do livro chamado "Clean Code". Boas práticas e código limpo.
Leia o livro "Clean code" ajudará se tornar um desenvolvedor melhor.


                      Oportunidades de emprego

Cada vez mais, as empresas tem deixado de lado o dresscode do desenvolvedor, e se importando com a qualidade dos seus produtos. Então você como desenvolvedor, tem responsabilidade de desenvolvedor sistemas complexos com padrões de escritas melhores, e com qualidade! Você tornará a empresa muito mais produtiva, mais rentável e poderá ajudar outros colegas que pegará no seu código, e tentar entender o que você fez. 


Espero ter ajudado neste artigo!!!
Explain Open Source Software Licenses Like I'm Five
Tags: explainlikeimfive, opensource, linux, software
Published: 2020-05-12 01:29:32

Hi! 👋🏼 I know this isn't a simple subject, but wanted to give it a shot.

I did some research on Google 🙄 but I couldn't find a good #explainlikeimfive post.

Thank you! 😁
Which physical book to learn JavaScript from for absolute beginners who only know HTML and CSS?
Tags: javascript, books, beginners, webdev
Published: 2020-05-12 00:39:35


Hi. I am new. I know HTML/CSS and now trying to learn JavaScript. It would be my first ever "real" programming language. I would like some suggestions of books that teach from bottom-up, from the basics all the way up to more advanced things.

I searched up beginner books but many of them seem to assume one or more of (A) You know the basics of JavaScript (B) You are a programmer coming to JavaScript from some other language (C) You know the fundamentals of programming. Some books for instance that operate under these assumptions or are too terse for me are Eloquent JavaScript, The Good Parts, You Don't Know JS, Speaking JS, The Definitive Guide. My aim is to be able to learn React/Angular after learning JS and be able to build web apps and websites.

What physical print book recommendation would you thus give to a complete novice to programming and JavaScript (I don't know the fundamentals of programming and don't know any programming language or JavaScript) who only has HTML/CSS basics down? The book should start from the absolute fundamentals/basics of JavaScript and follow ES6 or later and thus published after June 2015 (recent) when ES6 was finalized.
wtf are dot env files?
Tags: ruby, rails, beginners, heroku
Published: 2020-05-12 00:34:55

![Deploy code](https://media.giphy.com/media/LmNwrBhejkK9EFP504/giphy.gif)

A Rails app with customers deploys to a minimum of three environments: development, staging and production.

**Development** - local environment of the app on your machine
**Staging** - a pit stop on the way to production; ensure code changes are functional before proceeding to production
**Production** - where your users interact with the app

Here's a contrived example - **you wouldn't use the same Stripe API key for development and production.** That would mix dummy data on your local machine with real user data! Separation of concerns doesn't just apply to software, ya know.

If only there's a way to allow the environment to determine the value..

```ruby
Stripe.api_key = ENV["STRIPE_API_KEY"]
```

```bash
# .env
STRIPE_API_KEY=xxxx-xxxxxxxxxxx
```

You can include a library like [dotenv from Github](https://github.com/bkeepers/dotenv) to your project. `ENV["STRIPE_API_KEY"]` reads from `.env` that you can create in the root of your project directory. If `.env` sees `STRIPE_API_KEY` set, that's the value it'll use in your local development environment.

When deploying to staging and production, Heroku has a mechanism to get and set keys as well.

```bash
$ heroku config -r staging
=> ... list of ENVs for staging
```

This prints out a list of environment variables for staging separated by new lines. You could pass in production as a remote as well and get production variables.

Write it once and your code can read from the environment :ok:

BONUS: If a default value is of interesting to you, implementing it is simple! `ENV` is a hash *(more or less)*. Therefore, you can ask it `Hash#fetch` which allows a default.

```ruby
ENV.fetch("STRIPE_API_KEY", "default_api_key")
```

*Notice the use of parenthesis when allowing a default.*
Speed up the home page
Tags: angular, html, javascript
Published: 2020-05-12 00:31:33

Hi everyone!
I am a web developer of a company using angular. My recent task is to speed up the home page of our company. Google insights tool says that our home page loading speed is too low. I tried to apply angular universal on our website already, and now the score for our website is only 36 for mobile and 76 for desktop.
After angular universal, the size of home page itself is only 500k, but the Google insights tool will still wait for loading the entire application before score the page.
Is there any way for me to make the website even quicker except angular universal or lazy loading (after lazy loading still 1.5MB for main.js)?

Thanks for you all!
Java Versioning
Tags: java
Published: 2020-05-12 00:01:38

Oracle has changed how new versions of Java is going to be released. This write-up explains the new versioning process and how Java updates had been getting released lately.

**<h4>Earlier Java Releases:</h4>**
* Java versions earlier than JDK 8 used to follow more of a “Waterfall” development approach.

* At the beginning of a release cycle, a list of new features that are going to be included in the upcoming version of Java are decided and the new version is not released until all features are complete.

* Earlier versions of Java used to be released every 2 to 3 years.

**<h4>Recent Releases:</h4>**
* Lately Java has moved to 6 months cycle - updates are now released March and September of every year.

* Releases are following more of an “Agile” approach meaning all features that are complete will make it to the release. Release will not be delayed due to incomplete features. Incomplete features will be part of future versions.

* As promised, Java versions have been getting released every six months with the latest version of version 14 released recently.

**<h4>Licensing, Support and Bug Fixes:</h4>**
* Oracle JDK (from JDK 11) can only be used in production with a commercial support contract.

* The only free JDK 11 and later will be Open JDK binaries.

* Free updates for Open JDK versions would be available until next release that is typically every 6 months.

* JDK 8 provided by Oracle can be used indefinitely for free.

* Public updates of JDK 8 for commercial use are supported until Jan, 2019. Personal use updates are extended until 2020.

* If commercial applications need stability, need to move on to paid version of Java.

* Only certain releases are marked as long-term support releases with security updates and bug fixes available for more than 6 months.

* There will be an LTS release roughly every 3 years.

**<h4>Deprecation and Clean-ups:</h4>**
Java has been in development for 24 years. There are about 4,000 public classes in JDK 8. In order to keep the codebase clean, Oracle has announced that older/unused features would be deprecated and cleaned up more often than it used to be.

**<h4>Conclusion:</h4>**
Java has been moving faster with versioning changes. Enterprise applications using Java, should move along faster with Java upgrades to keep up with these release changes.
How 'me' became 'us'
Tags: javascript, node, backend
Published: 2020-05-11 23:51:23

Hi! I'm Ian and I build apps that help entrepreneurs succeed. 

I started programming at age 12 with simple game development using a visual programming language known as MMF2. It taught me the basics but the language is juvenile compared to most others so I eventually graduated to Java where I honed my skills a bit more. 

I built nothing of note until I picked up web technologies (JS, HTML, CSS) and eventually Node.js where I began building my first successful project [Somiibo](https://somiibo.com): a social media automation platform. Somiibo was launched on November 20th, 2017, and would change everything for me. 

The project **took off** with *tens of thousands* of signups and a *few thousand* paying users in just the first few months. I decided it was time to get serious so I started a company called [ITW Creative Works](https://itwcreativeworks.com) to act as the parent company to Somiibo as well as all future projects. 

After that, our company began building a diverse set of apps and tools including:

[SoundGrail](https://app.soundgrail.com): A toolkit for musicians and DJs
[Slapform](https://slapform.com): A form backend for web developers
[Proxifly](https://proxifly.com): A free https proxy API
[Socialetto](https://socialetto.com): An influencer search engine and database

I now run the company as my full-time job and manage the development of all of the above projects. At our company, we are constantly innovating and creating new things that make the world a better place and we have **so** much fun doing it!

Thanks for taking a second to hear my story and I hope we inspire you to build something great too!