Skip to main content

Posts

Six Principles for Making New Things

Here it is: I like to find (a) simple solutions (b) to overlooked problems (c) that actually need to be solved, and (d) deliver them as informally as possible, (e) starting with a very crude version 1, then (f) iterating rapidly
http://josephmcohen.com/post/71536977591/toyota-manufacturing-principles Toyota Manufacturing Principles HEART 2 NOTES Throughout its history, Toyota has made a habit of labeling its business concepts and guiding values. In learning more about the company, I’ve picked up a few useful concepts from their manufacturing vocabulary: Jidoka:   Automation with a Human Touch The idea of  jidoka  is that humans should work with machines to produce the best possible outcome, leveraging the execution ability of a machine and the judgement of a human. I learned this term on a tour of Toyota’s Nagoya factory, where  jidoka  is a guiding principle. The concept originally comes from Sakichi Toyoda’s invention of the automatic loop in 1896, back when Toyota was in the textile business. Jidoka will become increasingly relevant as computers continue to do more and more work that humans have historically done. The concept has been ported to English under the name ...

Sheesh kebab recipe

Serving : 4 Lamb    : 1.5 lb Yogurt  : 1 cup Black pepper: 1 tsp Olive oil       : 3 tbsp Kothmir       : 3 tbsp Garlic          : 2 cloves Salt              : 1 tsp Onion          : 1 Oregano      : Red pepper flakes : 2 tsp 6 garlic cloves, crushed 3 tablespoons extra-virgin olive oil, plus more for brushing 3 tablespoons fresh lemon juice 1 teaspoon kosher salt 1 teaspoon freshly ground pepper 1 teaspoon dried mint 1 teaspoon dried oregano 1 1/2 pounds trimmed boneless leg of lamb, cut into 1 1/2-inch cubes 1 small bunch of fresh mint 1 large red onion, cut into 2-inch pieces 1 large yellow bell pepper, cut into 2-inch pieces 1 large green bell pepper, cut into 2-inch pieces Vegetable oil, for the grill

Java Transactions

ACID: Atomicity: Either should commit all rollback all of its updates in a single unit of work. Consistency: database should never be left in inconsistent state Isolation: How protected is uncommitted changes from other transactions, isolation decreases concurrency. Durability: changes are permanent. interfaces UserTransaction begin(), commit(), rollback(), getStatus() TransactionManager suspend(), resume(), setRollbackOnly(), Status ACTIVE, COMMITTED, COMMITING, MARKED_ROLLBACK, NO_TRANSACTION, PREPARED, PREPARING, ROLLEDBACK, ROLLING_BACK, UNKNOWN. Transaction Models 1. Local 2. Programatic 3. Declarative Local Transaction Model: Resource manager manages transactions. Developer manages connections. e.g. conn.setAutoCommit(false); try {   stmt.executeUpdate(sql1);   stmt.executeUpdate(sql1);   conn.commit() } catch (Exception e) {   conn.rollback(); } Programatic Transaction Model Uses JTA, developer uses UserTransaction begin(), com...

JVM internals

JRE has JVM, Garbage collector, JIT compiler JVM - young generation, old generation, permanent generation (metaspace). Garbage collector - Serial, Multithreaded, CMS, G1 Serial           - single threaded stop the world young generation collector           - single threaded stop the world old generation collector Throughput/Parallel/Multithreaded -          - Multithreaded stop the world young generation collector          - Single/multi threaded stop the world old generation collector CMS        - Server class machine default collector        - Multithreaded young & old generation collector        - 2 GB        - 2 Virtual CPU's        - One exception is on Windows 32 bit the default is the serial collector. G1      - Supported as of Java HotSpot...

Dynamic configurations on remote clients

Strategy 1:Use server to provide configuration: Every client will have to use this configuration. No per client configuration option. Requires setting jvm params Strategy 2: Send configuration file to client on default location. Per client configuration possible Strategy requires transmitting file to client. Requires setting jvm params Strategy 3: Build client handler looking for flags. Per client configuration possible Strategy requires building handler. Not easy to add features later on. Doesn't require jvm params Key design rights: Passing bits to individual client is key rather server side Use the build-in logback handler is better rather building one. Rationally: passing logger:level is the possible, handler will look if logger are set and will use if found. handler will reset all previous configuration. Best solution: Key is pass the file. This will be future proof Works per client Requires setting jvm params

Logback know how-to

What is logback? Logback is intended as a successor to the popular log4j project. It was designed by Ceki Gülcü, log4j's founder.  package chapters . introduction ; import org . slf4j . Logger ; import org . slf4j . LoggerFactory ; public class HelloWorld1 {   public static void main ( String [] args ) {     Logger logger = LoggerFactory . getLogger ( "chapters.introduction.HelloWorld1" );     logger . debug ( "Hello world." );   } } Logger, Appenders and Layouts Logback is built upon three main classes:  Logger ,  Appender  and  Layout . These three types of components work together to enable developers to log messages according to message type and level, and to control at runtime how these messages are formatted and where they are reported. The  Logger  class is part of the logback-classic module. On the other hand, the  Appender  and  Layout  interfaces are p...