Ideas for successful software projects

This article describes some ideas on getting a successful software development process. A successful project: Depends on the expertise of the team. Don’t try to push many new technologies into a project. It will be difficult for the team to get acquainted with them and deliver a good quality project. Small steps are the best. Depends on the level of communication among the participants. Enforce communication among the team members.

Storing MySQL credentials on a file

MySQL allows you to store credentials in a file called ~/.my.cnf. The contents can look like this: [mysqldump] user=myuser password=mypassword We have to modify the file permissions and give read/write permissions to the owner only: chmod 600 ~/.my.cnf And done. We can now use it: mysqldump mydatabase mysqldump is going to read the credentials from that file.

Why you should not initialize a random generator with a static number

The following examples use random generated numbers initialized with a static seed. Never do it like this. Run the following examples multiple times to understand why it is important to have a good seed. PHP version: #!/usr/bin/php <?php srand(2); echo rand(0,10)."\n"; echo rand(0,5)."\n"; echo rand(0,4)."\n"; echo rand(0,6)."\n"; Java version: import java.util.*; /** * @see https://docs.oracle.com/javase/7/docs/api/java/util/Random.html */ public class RandomDemo { public static void main( String args[] ){ Random r = new Random(2); System.

Common tasks when working with MySQL

How to install MySQL server in Ubuntu It’s pretty simple: sudo apt-get install mysql-server How to connect to MySQL using Java This is a useful and simple snippet: import java.sql.Connection; import java.sql.DriverManager; public class Test { public static void main(String[] args) { try { Class.forName("com.mysql.jdbc.Driver"); Connection c = DriverManager.getConnection( "jdbc:mysql://localhost/?user=root&password="); c.close(); System.out.println("Success"); } catch (Exception e) { e.printStackTrace(); } } } How to connect to MySQL using C# Go to http://www.

Akka Actors

The Play Framework is built upon Akka actors, but does everything so that you don’t really need to use them. Despite this, actors are easy to integrate with Play, precisely because it is built on them (there is already an actor system for you to use) A few exceptions are: websockets handling (doing that using actors is a breeze) scheduling tasks for doing daily or weekly jobs Akka actors use messages to communicate between among them.

Inspirational videos

This article contains a series of curated inspirational videos from different users. “It will make you rich”. What poor people don’t know about making money

Videos from UKspreadbetting

This article contains a series of inspirational videos from user UKspreadbetting which I consider very important. Why trading forex is so difficult Is trading the road to great rewards and richness? Trade entries and exits Institutional traders versus private traders

Recommended libraries for Java

This article lists a curated list of Java libraries that I have used over the years for different projects. They are all well documented, and for most of them, plenty of examples can be found on the web. Apache Commons Email Commons Email Commons Email aims to provide a API for sending email. It is built on top of the Java Mail API, which it aims to simplify. User Guide Apache Commons StringUtils <dependency> <groupId>org.

Check multiple option values in Scala

Two main approaches for doing this, the second one being for me the most appropriate. Check values using regular if conditions: if (opt1.isDefined && opt2.isDefined && opt3.isDefined) // do something Check values using match: (opt1, opt2, opt3) match { case(Some(val1), Some(val2), Some(val3)) => ??? case _ => ??? }

Creating and validating JWT JSON web tokens

This article goes through the process of creating and validating JWT’s (JSON web tokens) using Scala. Our implementation uses the awesome io.jsonwebtoken library, and can be added to a sbt project like this: libraryDependencies ++= Seq("io.jsonwebtoken" % "jjwt" % "0.9.1") Creating a token We are going to use Scala’s apply/unapply functions for this implementation. This will allow us to use matchers for checking JWT’s. import java.time.Instant import java.util.{Date, UUID} import io.