Random stuff and opinions
Weekend Read 1
Articles
- Thread pools in JVM
- CPU bound, Blocking and Non-blocking
- CPU bound should have threads at max equal to no of CPU
- Blocking IO operations should never be allowed on the CPU bound pool
- They need to go to separate pool
- Blocking IO operations should never be allowed on the CPU bound pool
- Async IO polls (non blocking) should be handled by very small number of fixed, pre-allocated threads
- These just sit idle asking kernel continually if any new async IO notification is available then forward to rest of application
- Never do any work on this thread pool. NEVER!
- Code convention: java comments
- Code block (note: this is not a javadoc comment) - snippet#1
- Single line comments - snippet#2
- Trailing comments - snippet#3
- End of line comments - snippet#4
- Java doc comments
- After
/**
the next line follows a one space indent to align all subsequent*
- These should NOT be placed inside contructors/methods
- Annotations supported in javadoc
- After
- Mockito verify cookbook
verify(x)
verify(x, y)
verifyZeroInteractions(x)
verifyNoMoreInteractions(x)
inOrder.verify(x)
- Git rebase explained visually
- Deep stubs in mockito
Mockito.RETURNS_DEFAULTS
- Reverse/foward proxies explained
- 10x engineer myth
- tl;dr such engineers ultimately slow company down and drags scalability.
- Genius checklist
- tl;dr no secret sauce just a list of good habits to help memory
- On time, money and health
- tl;dr an eye opener for those in the rat race. Shows value of time in ones short life.
- Software estimation 1
- It’s hard and not accurate but still do it
- Estimation gets better with time
- Size up tasks with apt. days required for each eg: {S:1, M:3, L:5, XL:10}
- Unertainty multiplier: {low:1.1, med:1.5, high:2.0, extreme:5.0}
- Software estimation 2
Code snippets
Snippet#1
…Favorite Finance Apps
Bank apps
- The banks own apps to manage accounts.
- For the purposes of checking statements. Basic banking.
CRED
- For tracking my credit cards and their due dates so that I don’t miss anything.
- It also gives a very nice visual of the statements for the billing cycles. The raw PDFs generated by banks are too unorganized and hard to read.
INDmoney
- Tracking all my assets and liabilities. All my investments, stocks, EPF, savings and insurances get tracked here.
- It also helps manage your goals and gives a projection of whether and when it will be attained.
Paytm Money
- This is the main app I use to invest in mutual funds and gold.
Money Mgr.
- This app is for tracking all my daily expenses and income. I make entries whenever there is a transaction.
- Helps give a bigger picture and spend habits over the weeks or months.
Kite
- This is where I tried to invest in Indian stocks.
- Not really keeping up though. Managing individual stocks needs dedication. Parking this for now.
Smallcase
- Just signed up. Seems like a pretty good app. This investment vehicle is like MFs but with more control over the individual equity.
TIL 1
Today I Learned a.k.a TIL
FactoryBean
An amazing way to instantiate your beans based on different situations or conditions.
Example use case: I want a specific implementation of an interface based on some launch date. I can define that in the factory.
public class MessageFactoryBean implements FactoryBean<MessageInterface> {
private MessageInterface postcard;
private MessageInterface letter;
public MessageInterface getObject() {
if (your condition here) {
return letter;
}
return postcard;
}
// other methods omitted
}
Where MessageInterface
is implemented by PostCard
and FormalLetter
.
Things I wish I learnt before getting a job
Disclaimer: there is only so much you can prepare in advance. You’ll mostly learn everything on the job itself but I think there are some learnings which can take off the load. Instead of trying to play catch up while on the job.
Most of the big tech companies have in-house tooling which is a beast in itself to learn (depending on the company and how much internal tools they own). Having to learn them while also trying to learn a new programming language or technology can greatly slow you from getting up to speed.
…First
Hello world
…