Showing posts with label keynotes. Show all posts
Showing posts with label keynotes. Show all posts
Monday, November 25, 2019

TypeScript Recipe: Type Transformations in Practice

Compile-time errors are the best help to avoid mistakes during writing the code and prevent potential runtime-errors

So let's squeeze some juice from Ts Mapped types
Monday, March 6, 2017

Keynote: Quick Creation of Angular2 App

This article is about fast setup & start working on your ng2 application.


The process feels quite similar to Node modules creation through npm CLI commands, but here we will use Angular Command Line Interface (Angular-CLI).

Thursday, March 2, 2017

Keynote: Quick Creation of Node.js Module

This is short note about fast creation, publishing & using Node.js module via using Command Line Interface.
  • Use npm init to create package.json.
  • Run npm install --save to install dependency and save it to package.json.
When the code in the foo package does require('bar'), it will be loaded either foo/node_modules/bar or from core modules if it was installed as a global module via nmp install -g command.
Monday, February 27, 2017

Git tips & tricks: Merge vs Rebase (When to use?)

Keeping a clean history and smooth git workflow comes down to knowing the base use-cases & rules.
Rebases are how changes should pass from the top of hierarchy downwards and merges are how they flow back upwards.

  • Use git pull --rebase when pulling changes from origin.
  • Use git merge when merging feature branch changes back to master.
Rebasing Deletes Merge Commits! Never rebase master onto your feature branch!
see also –preserve-merges flag.
Using merge when pulling changes from origin ties two histories together creating interleaved messy thread of histories:
  • Interleaved history during merge: their feature X, my feature Y, their feature X, my feature Y...
  • Linear history during rebase: their feature X, their feature X, my feature Y, my feature Y...
Monday, January 16, 2017

Keynote: URL types

More or Less, everyone could imagine what is URL, cause most web browsers display it in the address bar.
At the same time, if we'll dig dipper, many of the software engineers are not aware of the all use cases or even URL types.
So, here are some short-notes to refresh your memory.
Wednesday, February 10, 2016

Keynotes: Derive JPA query from method name

JPA lookup

The JPA module supports defining a query or native query manually as String (using @NamedQuery/@NativeNamedQuery/@Query annotations) or have it being derived from the method name.

Default lookup strategy is CREATE_IF_NOT_FOUND, which combines combines CREATE and USE_DECLARED_QUERY ones. It looks up a declared query first, and if no declared query is found, it creates a custom method name-based query.
Spring Data repository query building mechanism allows quick query definition by method names & custom-tuning of it by introducing declared queries as needed.
Friday, October 30, 2015

Ketnote: AngularJS Filters

Angular JS


The Filters become handy first of all for the output formatting. Here are some regular angular filers:

  • lowercase/upercase {{ uppercase_expression | uppercase}}

    {{'london' | upercase}}   > LONDON

  • currency (Adds currency symbol)
    {{ currency_expression | currency : symbol : fractionSize}}

    {{amount | currency:"USD$"}}  > USD$350

  • number (Formats a number as text)
    {{ number_expression | number : fractionSize}}

    {{ 97.523 | number:2}}  > 97.52

  • date (Formats date by template)
    {{ date_expression | date : format : timezone}}

    {{'1288323623006' | date:"MM/dd/yyyy 'at' h:mma"}} 
    > 10/29/2010 at 6:40AM
    {{note.created | date:"'Created on a' EEEE 'in' MMMM"}} 
    > Created on a Friday in October

  • json (Converts a JavaScript object into JSON string)
    {{ json_expression | json : spacing}}

    {{ {'name':'value'} | json }}  > {"name": "value"}

Thursday, October 29, 2015

Keynote: AngularJS Services

Angular JS


To share the reusable logic & prevent duplication we've to use services:

  • Value (Used Often) - simplest recipes, that shares value through the app repeatedly.

  • Factory (Most Commonly Used) - shares methods and objects.

  • Service (Rarely Used) - shares instances of methods and objects.

  • Provider (Commonly Used like Configurable Factory) - shares methods & objects but allows configuration.

  • Constant (Commonly Used) - shares the constant values within app configuration.

Friday, October 23, 2015

Git Tips & Tricks: Make the current commit the only (initial) commit

Here is the brute-force approach, which also removes the configuration of the repository.

Keynote: Regexp Short Notes

Regular expressions

Regular expression is a pattern describing a certain amount of text. So, Regexps are quite useful whatever programming language u're using.
Tuesday, September 29, 2015

Keynote: AngularJS Less Backend

Angular JS


Take a look on the previous article to refresh your memory
  • Angular JS Basics shornotes.
  • Angular JS Do the regular things.
  • Angular JS Do the custom things.
  • Angular JS Routing.

Keynote: AngularJS Routing

Angular JS


Take a look on the previous article to refresh your memory
  • Angular JS Basics shornotes.
  • Angular JS Do the regular things.
  • Angular JS Do the custom things.
Friday, September 25, 2015

Keynote: Use Vagrant - forget "works on my machine" bugs

Vagrant


If you're a developer, Vagrant will isolate dependencies and their configuration within a single disposable, consistent environment, without sacrificing any of the tools you're used to working with (editors, browsers, debuggers, etc.). Once you or someone else creates a single Vagrantfile, you just need to vagrant up and everything is installed and configured for you to work. Other members of your team create their development environments from the same configuration, so whether you're working on Linux, Mac OS X, or Windows, all your team members are running code in the same environment, against the same dependencies, all configured the same way.
Say goodbye to "works on my machine" bugs.
Tuesday, September 22, 2015

Keynote: AngularJS do the custom things

Angular JS


Take a look on the previous article to refresh your memory
  • Angular JS Basics shornotes.
  • Angular JS Do the regular things.
Monday, September 21, 2015

Keynote: AngularJS do the regular things.

Angular JS


Take a look on the previous article to refresh your memory
Angular JS Basics shornotes.
Thursday, September 17, 2015

Keynote: AngularJS Basic Short Notes

Angular JS


Superheroic JavaScript MVW Google Framework.
Google framework popular for Single Page Applications building.
Angular is used worldwide especially as enterprise way of building powerful web apps.
The new 2.0 version of Angular is focused on ECMAScript 6 and probably won't be compatible with the 1.4
Angular is used by: youtube, lynda.com, netflix, etc.
Wednesday, June 17, 2015

Keynote: Java try-with-resources Statement

The try-with-resources statement ensures that each resource is closed
at the end of the statement.

Otherwords, in try-with-resources statement any catch or finally block is run after the resources declared have been closed.

*Resource - is an object that must be closed after the program is finished with it.
Closing a stream when it's no longer needed is very important to avoid serious resource leaks.
Use try-with-resources or close those in finally block to guarantee that both streams will be closed even if an error occurs.
Monday, May 18, 2015

Keynote: Threads like trains:)

Using the Threads leverage your application speed & flexibility:


A thread can be only in one of five states:
State Description
New When created but not started - not alive yet.
Runnable Eligible to run. either when start() method is invoked or returned or coming back from a blocked, waiting, or sleeping state - alive.
Running The scheduler chooses a thread from the runnable pool and it becomes the currently executing process.
Wait/blocking/sleeping The thread is still alive, but is currently not eligible to run. - considered alive.
Deads run() method completed - it's no longer a separate thread of execution and never be brought back to life! If you invoke start() on a dead Thread instance, you'll get a runtime exception. - not alive.
Monday, May 11, 2015

Keynote: Understand Java Collections

Collections API based on the following flavors:

Interface Description
Lists Lists of things ordered by index
Sets Groups of Unique things (without duplicates)
Maps Key-Value entries with unique Keys
Queues Items arranged by the order to be processed (FIFO/LIFO)

Notice, that Map-related collections do not implement java.util.Collection:
Tuesday, January 20, 2015

Keynote: Exceptions in Action

Preamble

The java.lang.Throwable class is the superclass of all errors and exceptions in the Java language.
It means that you can throw and catch only objects that inherit this class.

Catch or Specify Requirement

If you invoke some method that throws some Checked exception, you have to wrap it into try catch or add it to the method declaration! Otherwise - Compile Error!

*Checked exceptions - the class Exception and any subclasses that are not also subclasses of RuntimeException
  • So, Exception and its subclasses(checked exceptions), except RuntimeException, are under Catch or Specify Requirement!
  • Error, RuntimeException(unchecked exception) and their descendants are not under Catch or Specify Requirement!
If the runtime system exhaustively searches all the methods on the call stack
without finding an appropriate exception handler, the runtime system (and, consequently, the program) terminates!


So, Exception can be specified even in main method and forwarded out of application.
VM will exit in this case, if such exception happens.