From Passion to Profession
  • Home
  • Notes
  • Projects
  • Resources
    • Discovery Log
    • Books I Read
    • Blogs I Visit
    • Tools I Use
  • Home
  • Notes
  • Projects
  • Resources
    • Discovery Log
    • Books I Read
    • Blogs I Visit
    • Tools I Use

Temporal Collection

5/25/2020

0 Comments

 

overview

A temporal collection is a simple way to implement a Temporal Property or a Temporal Object.
​

A temporal instance (either a Temporal Property or Temporal Object), when going through a series of amendments, the property itself or the properties the object references change over time. Each version of the temporal instance captures the state of the instance that will last for some period of time until the instance changes again with another amendment.​

implementation

Temporal Collection

The basic representation and interface for a temporal collection provides get and put operations that use a date as an index:
TemporalCollection Interface

    

Read More
0 Comments

Data Transfer Object Design Pattern

5/19/2020

0 Comments

 

overview

Data Transfer Object (DTO) is an object used to pass data with multiple items in one shot between client and server, to avoid client from issuing multiple calls to a remote server to get each item in separate calls.

Optionally, we can make use of a DTO Assembler class as some sort of a mapper in between DomainObject and DataTransferObject to map from one side to another in either direction. That is, to create a serializable DTO object given a Domain Object, or to update a Domain Object given a DTO object.
Picture

Read More
0 Comments

Inversion of Control / Dependency Injection Pattern

3/20/2020

0 Comments

 
People who just started to learn Spring framework is often confused by the term "Inversion of Control" (IoC) which can be achieved through "Dependency Injection" (DI).

DI is a way of providing the dependencies (e.g. creating objects and its dependencies), wiring components into application. In Spring, those objects defined and instantiated by Spring containers then inject into application are called Spring Beans.

IoC is a concept, it means to create instances of dependencies first, the concept is usually achieved by using metadata-driven approach to assemble instances at runtime. IoC is the end result of DI. However, DI is not the only way to achieve IoC. For example, Workday's XpressO is a great example of metadata-driven development to achieve IoC.

Here are some more good explanations:
Inversion of Control (IoC) means to create instances of dependencies first and latter instance of a class (optionally injecting them through constructor), instead of creating an instance of the class first and then the class instance creating instances of dependencies. Thus, inversion of control inverts the flow of control of the program. Instead of the callee controlling the flow of control (while creating dependencies), the caller controls the flow of control of the program.

​~
https://stackoverflow.com/questions/3058/what-is-inversion-of-control
IoC is a programming technique, expressed here in terms of object-oriented programming, in which object coupling is bound at run time by an assembler object and is typically not known at compile time using static analysis.

​~
http://en.wikipedia.org/wiki/Inversion_of_control
IoC is a common pattern in the Java community that helps wire lightweight containers or assemble components from different projects into a cohesive application.
~
http://www.martinfowler.com/articles/injection.html (reworded)
Spring helps in the creation of loosely coupled applications because of Dependency Injection. 

​In Spring, objects define their associations (dependencies) and do not worry about how they will get those dependencies. It is the responsibility of Spring to provide the required dependencies for creating objects.

-https://stackoverflow.com/questions/9403155/what-is-dependency-injection-and-inversion-of-control-in-spring-framework

Read More
0 Comments

Coin Change Problem

4/3/2018

0 Comments

 
Given coins of different denominations and a total amount of money, find the number of combinations that makes up that amount. ​For example, given unlimited coins in 1, 2, 4 denominations, how many combinations are there to make up the amount of 12?

Thought Process

Given coins in different denominations, we'd solve this problem by breaking it into sub-problems which means given coins in less different denominations. The answer to the problem of given coins in n different denominations is based on solving the problem of given coins in (n-1) different denominations, and the answer to the problem of coins in (n-1) different denominations is based on solving the problem of coins in (n-2) different denominations.

We can use an array named combination to store the number of combinations that make up the amount. For example, the number of combinations to make up the amount of 1 is stored combination[1], and the combinations to make up the amount of 12 is stored in combination [12].

The number of combinations to make up a given amount is equal to the number of combinations before a coin denomination is added to the picture, plus the number of combinations after such a coin denomination is added to the picture for the amount of "amount - coin". 

When adding the first coin to the picture, we'd calculate this array - combination. When adding the 2nd coin to the picture, the same combination[amount] is being calculated based on the following pseudocode:   
Code Editor

    

Read More
0 Comments

Where Binary Heap is Used

3/2/2018

0 Comments

 

definitions

A full binary tree (sometimes referred to as a proper binary tree or plane binary tree) is a tree in which every node other than the leaves has two children. In other words, each node has either 0 child or 2 children. 

A complete binary tree is a binary tree in which every level, except possibly the last, is completely filled, and all nodes are as far left as possible.

A perfect binary tree is a binary tree with all leaf nodes at the same depth. All internal nodes have degree 2.
Picture
Picture
Perfect Tree
A Binary Heap is a binary tree with following 2 properties:
​
  1. A complete tree.
  2. A Min Heap or Max Heap. In a Min Binary Heap, the key at root must be minimum among all keys present in Binary Heap. The same property must be recursively true for all nodes in Binary Tree. Max Binary Heap is similar to Min Heap.



Read More
0 Comments

Java 1.8 Lambda & Method Reference

2/25/2018

0 Comments

 
One way to create thread is to pass a object that implements Runnable Interface to a Thread constructor as mentioned in Java Multithreading Approaches (Java Concurrency - Part 1):
​public class MyRunnable implements Runnable{
  // this method is called when a runnable thread starts
  public void run(){
    printMessage();
  }
}

public class ThreadDemo{
  public static void main(String args[]){
    Thread t1 = new Thread(new MyRunnable); 
    Thread t2 = new Thread(new MyRunnable);
    Thread t3 = new Thread(new MyRunnable);
    t1.start();    
    t2.start();
    t3.start();

  }

  public static void printMessage(){
    System.out.println("Hello");
  }
}


Read More
0 Comments

Technical Product Manager Skills

12/28/2017

0 Comments

 
A product manager does many things. A product manager is like a CEO with all responsibilities except any of the authority.

Here's a list of skills that tech companies look for in product managers:


Technical Skills - Coding level knowledge. Some companies prefer software development as a prerequisite for product managers, Some don't. A good technical understanding will never hurt​.

​People Skills - Build communication and trust from your development team.

Research Skills

Management Skills


User-centricity

Data-driven Analytics - Use SQL, Excel, etc. to make data-driven decisions. Put product investments in the areas that will produce the best return on investment.

Strategic Thinking - Product go-to-market strategy. Game theory.

Good Design-sense - Markup/wireframe.

Experimentation Mindset - A/B testing.

Read More
0 Comments

Sales Copy Framework

3/13/2017

0 Comments

 
Copywriting is using words to get people to give up their money in exchange for services or products. In other words, it is “salesmanship in print.” as defined by John E. Kennedy back in 1904.

The copywriting should be all about the consumers so the copywriter have to talk about them, talk about the problem, the promise, the proof, and the proposal to solve the problem. The copy must be useful and valuable. No copy is too long, too short, only too boring. Write about the preponderance of proof so the consumer have to make a decision.

Here's a six-part framework (PASTOR) for writing better sales copy that Ray Edwards mentioned:

P = person, problem, pain.
A = amplify the consequence of not solving the problem.
S = story, solution , system.
T = transformation, testimony
O = offer
​R = response
0 Comments

Position Yourself for Products in Competitions

11/8/2016

0 Comments

 
Picture
You want to stand out when the competition is already there when entering a market. Think about three things:

  1. Form your own personality for your identity: Clone a service offer by a guru won't make you a guru. You want to have the content come out your personality, yourself. Clients respond to what you like. It's too risky to be a me-too.
  2. Find out from the customers to identify the REAL problems.
  3. Create a single superpower to tackle one of most identified problem.

Once the company is positioned, then, move on to design irresistible products. 

Read More
0 Comments

Flyweight Design Pattern Principle

6/15/2016

0 Comments

 
Flyweight pattern is a structural pattern in GoF as it supports large numbers of fine-grained objects efficiently. Since each fine-grained object (e.g. a character in an editor application) may incur overhead that adds up. This pattern shares objects in a pool (Flyweight Factory) to minimize memory use.
Picture
source: GoF

Read More
0 Comments
<<Previous

    Categories

    All
    Algorithm
    Concurrency
    CQ
    Data Structure
    Design Pattern
    Developer Tool
    Dynamic Programming
    Entrepreneur
    Functional Programming
    IDE
    Java
    JMX
    Marketing
    Marklogic
    Memory
    OSGI
    Performance
    Product
    Product Management
    Security
    Services
    Sling
    Social Media Programming
    Software Development

    Feed Widget

    Archives

    May 2020
    March 2020
    April 2018
    March 2018
    February 2018
    December 2017
    March 2017
    November 2016
    June 2016
    May 2016
    April 2016
    October 2015
    September 2015
    August 2015
    September 2014
    July 2014
    June 2014
    May 2014
    March 2014
    January 2014
    December 2013
    November 2013
    October 2013
    September 2013
    August 2013
    July 2013
    June 2013

    RSS Feed

in loving memory of my mother  and my 4th aunt
Photos from net_efekt, schani, visnup, Dan Zen, gadl, bobbigmac, Susana López-Urrutia, jwalsh, Philippe Put, michael pollak, oskay, Creative Tools, Violentz, Kyknoord, mobilyazilar