Posts

How to create step guides

Image
Flow to create step guide Screen annotation in Mac Flow to create step guide Most of the bloggers need to add stories to their blog posts. For tech bloggers, that is most probably the journey of clicks over browser, application and so on. However, the blogger has to capture the screen and record with the annotations. In this blog, I explain how to create step by step guide: graph TD A[Start walk through] --> B(Take screenshot) B --> C{more to go ?} C -->|Yes| B C -->|No| D[Annotate Screenshot] D --> E{more to annotate ?} E -->|Yes| D E -->|No| F[Create Guide] As shown in the above Flow chart, you have to annotate all the screenshots first, as explained in the below section. In the end, you have to add those screenshot to the editor like Typora Typora . You can use uPic integration of Typora to auto-upload pictures to cloud. You can write a complete step by step guide in the Typora. Screen annotation in Mac Step 1: Press Cmd...

Toolbox for bloggers

Image
CONTENTS Animated GIF for terminal recording Diagrams and Charts Write a blog post Math notations Create step guides Animated GIF for terminal recording The LICECap is nice free little tool good to create animated gif show your terminal for example. Fig 1: Python version on terminal It is hard to find the similar Diagrams and Charts Although there are few diagrams types and charts, I am very happy with mermaid . The advantage of using mermaid is its dependency only on browser: no need to access outside services to create chart or diagram. pie title Top 5 COVID-19 (31/05/2020) "USA" : 1815856 "Brazil" : 498440 "Russia" : 396575 "Spain": 286308 "Rest of the world":2879467 It is hard to find similar free tools. If anyone knows, please don't forget to share with me. Write a blog post If you are interesting how I write my blog posts, please read the Markdown blog write...

AngularJs Basics

Image
You can download the AngularJs to use via CDN. I am using doing my examples in Visual Studio Code (VSC) Live Server plugin for the VSC Angular application based on the model-view-controller pattern. The view is based on the DOM. The controllers are JavaScript classes and the model data is stored in object properties 1 . The model (line# 10) represent the current state of the application. view (line# 12) for display the data controllers manage the relationships of model and views. Here the simplest two way binding where UI is mapped to JavaScript properties. <!doctype html> <html ng-app> <head> <title>My AngularJS App</title> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.19/angular.min.js"></script> </head> <body> Value : <input type="text" ng-model="val" placeholder="cost" /> <p> This is your value: {{val}} </...

MAC shortcuts

Image
Here the simple mac shortcuts found from the difference sources such as 1 . Here the general tips: Mac keyboard shortcuts from Apple Support. run the caffeinate in the terminal to keep the computer wake unlimitedly 2 . Expand print dialog box by default: defaults write -g PMPrintingExpandedStateForPrint -bool TRUE Enable or disable character accent menu: // disable defaults write -g ApplePressAndHoldEnabled -bool false Add Dock space. defaults write com.apple.dock persistent-apps -array-add '{"tile-type"="spacer-tile";}' killall Dock Dock transition delay. defaults write com.apple.dock autohide-time-modifier -float 0 killall Dock Spotlight In the spotlight, once find the file, hold down the CMD key to show the location of the file bottom of the window if you press CMD+R, the file will be show in the file explorer. Browser Some important browser shortcuts Functionality Browser Key Combination To show th...

Calling AWS Services

To programmatically connect to the AWS Services, need to use endpoints. The AWS SDK and the CLI use the default endpoint of the region to access the service. The regional endpoint is protocol://service-code.region-code.amazonaws.com standard. But services such as IAM not support the region. Some example of calling 1 to AWS services via API calls. All CLI calls are signed by Signature version 4 2 . To list all the active regions: (if you want to sort add the | sort to the end. aws ssm get-parameters-by-path --path /aws/service/global-infrastructure/regions --query Parameters[].Name In the above command regions is the important word. This command will return the following: --------------------------------------------------------------- | GetParametersByPath | +-------------------------------------------------------------+ | /aws/service/global-infrastructure/regions/ap-northeast-1 | | /aws/service/global-infrastructure/regions/eu-c...

Java Collectors recipes

Java Collectors is a utility class with several reduction operations. Here a few of the example you can do with the Collectors class. For example, grouping functionality first. import java.util.stream.Collectors; import java.util.stream.Stream; // basic functionality of the collector Stream.of("one", "two", "three", "four", "five") .collect(Collectors.groupingBy(n -> n.length())); // = {3=[one, two], 4=[four, five], 5=[three]} In the above code, n -> n.length() is the classifier . The return type is Map<Integer, List<String>> in the line# 5 - 6. The grouping allows having a downstream collector which do the subsequent collection operation. For example, // basic functionality of the collector Stream.of("one", "two", "three", "four", "five") .collect(Collectors.groupingBy(n -> n.length() , Collectors.counting())); // = {3=2, 4=...

Parse the namespace based XML using Python

In this blog, I am considering how to parser and modify the xml file using python. For example, I need to parser the following xml 1 (slightly modified for this blog) and need to write the modified xml to out.xml file. Here the country.xml <?xml version="1.0"?> <actors xmlns:fictional="http://characters.example.com" xmlns="http://people.example.com"> <actor type='T1'> <name>John Cleese</name> <fictional:character>Lancelot</fictional:character> <fictional:character>Archie Leach</fictional:character> </actor> <actor type='T2'> <name>Eric Idle</name> <fictional:character>Sir Robin</fictional:character> <fictional:character>Gunther</fictional:character> <fictional:character>Commander Clement</fictional:character> </actor> </actors> In ...