Advanced Search
Search Results
245 total results found
Spring boot command line arguments with Maven
Running application with Maven To run your application with Maven you just run the following command: mvn spring-boot:run Specifying profiles You can specify an active profile for you Spring boot application with the following command for mvn mvn spring-b...
Lambda expression in Java
How are lambda function done in Java Because Java likes everything to be under a class or an interface, so the prerequisite of writing a lambda function is that it must be written according to an interface. The specific interface must have one interface meth...
Public and Private key encryption/decryption
Cryptography 101 Asymmetric key encryption is key to many things, especially for TLS handshake in HTTPS protocol. How it works is that you first generate a pair of key, one is referred to the public key, and the other is referred to as the private key. Publi...
Checked vs Unchecked Exception
Exceptions In Java exceptions (which differs from the C exception) there are two types of exceptions. Checked exceptions Checked exceptions are exceptions that are checked at compile time. If some code in a method throws a checked exception, then the method...
Mockito how does it work?
Background So what is Mockito? It is framework that is used on top of testing framework library like JUnit test to provide mocking and stubbing capability of objects for your unit test or integration tests. "Mocking is the act of removing external dependenci...
Optional in Java
Optional Optional is an object that can be think of as a container to hold other objects. It can contain null or an instance of the class. Why is this object needed? Well there are many places in your code that can return the object or null, i.e. your custom...
Apache Kafka Introduction
What is Kafka? Kafka is a data streaming platform, just like Amazon Kinesis it is able to take in message and store messages durably for consumers to read in those messages. It is very scalable because of the three different components, producers, brokers, a...
Global variables with imports
Sharing global variables between modules If for whatever reason you need to share global variables you need to keep in mind that global variables in Python are global to a module, not across modules. Which is different than say static variable in C. To make ...
tr and cut command
tr The tr command is used to translate or delete characters that comes from the standard input. If say you would like to replace every character in a file with another character then you can just do something like: echo "hello world" | tr e z // Prints out ...
More about OAuth2.0 grant
What is a grant? When you sent a request to the authorization server you will sent a field that specify the type of grant that you would want: implicit authorization code client credentials password refresh token Think of the grant as the "method" t...
Unpacking operator in code and function header
Unpacking In Python you are allowed to do deconstruction similar to how you can do deconstruction assignment in JavaScript. You can take a list and then assign each of the elements individually to variables on the left hand. For example: (a, b, c) = (1, 2, 3...
How does inner, left, right, full join work?
When and what is a JOIN? Querying data in your database from only one table can only get you so far, sometimes one table just doesn't contain all the data you need. Your current table product may be referencing a foreign key in another table called user by an...
Little and Big Endian
Endianness Little and big endian are two ways of storing multibyte data-types into memory. For single byte data-types like a char, it doesn't matter what the endian because it is only one byte. Duh. Let's assume that an integer is 4 bytes in the 32 bit syste...
Compressed file vs Archived file
Archived file An archived file is basically a collection of files and directories stored into one file. You can extract the files and directories out from the archived file. It is one singular file that have all the archived files put into it. Do note that i...
Vim Cheatsheet
Mandatory get out of Vim joke Ughhh how do I escape Vim? # <ESC> :wq, write the changes to the file and quit # <ESC> :q, quit if there is no changes # <ESC> :q!, quit without saving Basics ^ k Hint: The h key is a...
Packages vs Modules
Preliminary Forget about the packages and modules that you know from Python, it is no related, yes it is about organizing files but not in the same way. Packages A package is made up of Go files that lives under the same directory. You can think about the d...
Import packages / modules
I have a helper file that I would like to use within the same project. If say your directory layout is like below: src main.go helper.go A very simple directory, you wrote some helper function in helper.go and you would like to use it in main.go. Now...
package, install, release, deploy phases
mvn package will construct your artifactory, i.e. a jar file and then place it in the current working directory mvn install will put your packaged maven project i.e. a jar file into the local repository, so that your other local application can use it as a ...
Lifecycle, Phases, goals, and Plugins?!
Maven Lifecycle Maven is a build automation tool at heart. It has three built-in lifecycle that clearly define how the project will be build. There are three built-in build lifecycles: default: handles the actual project compilation and deployment clean: ...