Advanced Search
Search Results
245 total results found
Structs exported fields
Exported structs and fields Like functions if you would like to export a struct from a package for another package or module to use then the first letter of the struct name must be capitalized, otherwise it is not exported and cannot be used. type ComplexNum...
Fun Annotation Notes
@ComponentScan + @Component During Spring initialization the class that is marked with @ComponentScan will have it's package and it's subpackage scanned for any class that's marked with @Component. If any @Component class is found then it will add them to the...
Upstream vs Downstresam API
All this discussion is relative based on an API that uses another API and that API is being used by another API. Upstream API You refer to API that your API uses as upstream if it produces data that YOUR API consumes in the middle. Downstream API You ref...
Spring Injection Order
First of all don't mix and match injection for your fields If you are going to let Spring do your dependency injections for you, just stick to one method. Constructor, setter, or field injections. However, if you're curious on the order of the evaluation her...
Introduction: Hello World, values, and variables
Go code layouts A Go project is also called a module. A module is just a collection of packages. A package is just a group of related .go files. You would declare the .go files that belong in the same package with the line package <package name> For exampl...
If/else
If/else If else is very similar to C except you just take out the parenthesis. func main() { x := 10 if x > 10 { fmt.Println("It is greater than 10") } else if x < 10 { fmt.Println("It is less than 10") } else { fmt.Println("It is equal t...
Embed Modules
Embed Module This module is a super duper cool module in the sense that you are able to pack static files into your binary, rather than having your program relying on the actual file being present in your filesystem when it is ran. Normally when you do deplo...
Select Statement
The Select Statement Depending on the DBMS, the select statement can pack in it a lot of optional keywords. For example: for MySQL SELECT [ALL | DISTINCT | DISTINCTROW ] [HIGH_PRIORITY] [STRAIGHT_JOIN] [SQL_SMALL_RESULT] [SQL_BIG_RESULT] ...
Aspect Oriented Programming
What the heck is AOP? Aspect oriented programming is a programming technique just like object oriented programming where you group codes and software designs into objects rather than keeping it as separate functions and logic. AOP aim to help mitigate and so...
Compile time and runtime dependency
Problem There was bunch of dependency that older version of spring-boot includes as compile time dependency, meaning in your project without you explicitly including those as a dependency in your pom.xml you can use them in your code. However, if you upgrade...
AWS CloudWatch Metrics
Metric A metric is just a time-ordered set of data points being sent to CloudWatch so that you can get a nice graph on those time. A metric is identified under three things: A namespace A metric name And 0 or more dimensions Dimensions A dimension i...
Java Nested Class
exec form vs shell form PT.2
shell form The PID 1 is the shell, which will spawn the process that the program it is actually running. Any environment variable referenced will be resolved to it's actual value. ENTRYPOINT ./run.sh "$PATH" If the shell script run.sh just echos out the pa...
Switch Statement
Switch Statement Switch in Go is pretty nice, it function similar to the switch statement in C but better. x := 20 switch x { case 10, 20: fmt.Println("It is either 10 or 20") default: fmt.Println("It is not 10 and is not 20") } You can ...
Arry and Slices
Array An array can be declared with the following syntax: var <arr_name> [length]type For example if I want to create a list of array with length of 5: var a [5]int The array is initialized with zero value of the type. So since it is integer it will be in...
make vs new
DynamoDB Simple
Before We Begin AWS actually offers a local DynamoDB that you can set up and you can use the --endpoint-url http://localhost:8000 to run the command rather than paying the money and hosting it on AWS. Instructions curl -O https://s3-us-west-2.amazonaws.co...
DynamoDB Complex
Creating Table with Composite Key To create a table with composite key, it is the same process, except you will be adding an additional field to the key-schema flag: aws dynamodb create-table \ --table-name UserOrdersTable \ --attribute-definitions...
Quoting and Not Quoting Arguments
Word splitting Bash shell and zsh shell will scan results of Parameter expansion: $PATH Command substitution: $(echo hi) Arithmetic expansion: $((x += 1)) For word splitting if they DO NOT occur within double quotes. Basically with word splitting the...
dumb-init for script
Problem So you got your command that you would like to run it using a docker container, problem is once you got your program running using whatever mean possible, you see that it is running, but when you want the program to finish because it is say a web serv...