Thursday, December 31, 2020

U Mobile: Failed To Claim The Free 1Gb Data

U Mobile: Failed To Claim The Free 1Gb Data

Still unable to claim the free 1Gb data through SMS, till the last day of 2020.

SMS: Send FREE1GB to 28111

Couldn't find it available on the U Mobile app as well.

Thursday, December 24, 2020

Citibank Malaysia, are you kidding? 2020

Citibank Malaysia, are you kidding? 2020

Use the Citibank credit card for an online purchasing. Received an SMS:

"Citibank: Thank you for being a loyal customer..."

That is bullshit from the bank. Citibank never values their loyal customers. Newly join members get more benefits, as a loyal customer for more than 20 years with Citibank, I get nothing, except that Citibank sent me a new credit card a few years ago.

Many years ago, not many people had credit cards. A credit card gives the members some privileges, that shows you have some credit to spend. Now almost everyone has one (or more) credit card. Not much benefit offers from Citibank.

Users started to use eWallet because eWallet has more offer, more convenient to use, no need to pay for annual fees. Maybe credit cards are just used to top up the eWallet account. Banks or credit card companies don't know the spending details.

Credit card companies, banks, Visa, Master, please wake up!!!

I believe Citibank Malaysia will collect the annual fees from the members next year 2021. More users will give up the cards.

Thursday, November 26, 2020

U Mobile: How To Claim Free Daily 1Gb data 2020

U Mobile: How To Claim Free Daily 1Gb data 2020

Government/MCMC requested all mobile network to provide free 1gb daily to their users, during the COVID-19 time, until 31 December 2020.

Started from 26 November 2020, U Mobile need users to claim the free daily 1gb data manually via SMS or MyUMobile App.

SMS: Send FREE1GB to 28111

MyUMobile App: Add-Ons > Bonus > Free 1Gb/24hours (available soon)

The free data is available for 24 hours from the time of redemption.

Seems like users need to redeem the free data manually everyday. Earlier it is automatically debit into U Mobile account. I am not sure why, this is just 1 step backward.

Refer to the FAQ.

U Mobile Free 1Gb High-Speed Data COVID-19

U Mobile Free 1Gb High-Speed Data COVID-19

Government/MCMC requested all mobile networks to provide 1Gb of mobile data to all users free of charge during COVID-19 period, until the end of December 2020.

There are 2 things I want to talk about regarding the free 1Gb high-speed data availability for the U Mobile network. I received an SMS today from U Mobile, they required the users to claim the free 1Gb through U Mobile App, just like what Maxis are doing. This was required starting from 26 November 2020. (refer here)

Currently the free 1Gb data will be credited to the U Mobile network users account automatically. I give U mobile a LIKE for this feature (after compare with Maxis). Too bad, U Mobile now joined Maxis move.

I can understand that mobile network operators encourage all users to use their mobile app, but not all users are familiar with the app especially the seniors. If the mobile app is easy to use, for sure more people will use it. Why make it so difficult for the users to do an extra step everyday?

The other thing that I want to complain about is the priority using the mobile network data. I have my monthly quota and the free 1Gb data everyday. The system should use the high-speed data that expires daily as priority, rather than using my monthly data. It makes no sense for the free 1Gb high-speed data.

Wednesday, November 11, 2020

Python Lambda Function

Python Lambda Function


What is a Lambda function?


Lambda function is an anonymous function with 1 line expression.


format: lambda <parameters> : expression


A simple example:
> lambda x : x
⇒ function lambda


This function is same as:

def same(x):
    return x

This function just return the parameter pass in to the function.

Access lambda function without a function name:
> (lambda x:x)(5) ⇒ 5

Exercise


How to convert the following function to lambda?

def square(n):
    return n*n

> square= lambda n : ???
> square(5) ⇒ 25

List order with lambda


> fruits=[('apple',3),('orange',2),('lemon',1)]
> sorted(fruits)
⇒ [('apple', 3), ('lemon', 1), ('orange', 2)]

How to sort by order of the id at the back?

> sorted(fruits,key=fruit_order)
def fruit_order(item):
    return item[1]  # return the id of the fruit

Can use a lambda function to replace the fruit_order() function.

> sorted(fruits,key=lambda x:x[1])
⇒ [('lemon', 1), ('orange', 2), ('apple', 3)]

Wednesday, November 04, 2020

Python and Growl

Python and Growl



Growl is an open source notification software for Mac OS, long before Mac OS has its own Notification Center. When Growl was put on the App Store, it was not free anymore. It is now free for download again, most likely Mac OS already has a Notification Center, Growl is not important anymore.

Since Growl has been around the market for quite some time, the protocol is simple but useful. Other than C, Java library for Growl, Python has a library support to send notification messages to Growl as well. You can forward the message from Growl to Notification Center.

This is how you can send notification message from Python
$ pip install gntp # gntp, Growl Notification Transfer Protocol

If you have python 2 and 3 installed, and you want to use Python3:
$ pip3 instaall gntp
$ python3 -m gntp.notifier # testing

You should see the message displayed. If not, start the growl app and try again.

Thursday, September 10, 2020

How to Stop U Mobile Auto-renew Service

How to Stop U Mobile Auto-renew Service

After subscribing to U mobile add-on services, the services normally will be auto renewed. To stop the auto review, use UMB *118*3*6#, choose 5:

5 Stop auto renewal

1 GT30
2 V20/30
Choose 1 to stop GT30 auto renewal. Wait for the confirmation message.

To break down each steps:
118 ⇒ account balance and other options
3 ⇒ Internet/Services
6 ⇒ unlimited calls
5 ⇒ stop auto renewal
1 ⇒ GT30

Wednesday, July 22, 2020

GIT Jumpstart Tutorial For Beginners

GIT Jumpstart Tutorial For Beginners


Introduction


This is an incomplete tutorial for beginners. The tutorial is a quick jumpstart for user who want to learn GIT. This tutorial just cover the very basic things about GIT, it is incomplete.

SVN and CVS



Before you start with GIT, you should know a little bit about CVS or SVN. Basic command like check in (commit) and check out.

$ svn list file:///usr/local/svn/hello
branches/
tags/
trunk/

The trunk is the main repository.
$ svn co file:///usr/local/svn/hello/trunk hello

A hello/README
Note: co is the short form of checkout.

$ svn commit -m "add in description for beginners" README

$ cd hello
$ rm NEWS
$ svn update NEWS (retrieve back news)

The difference between SVN and CVS


CVS. Each file has its own version. SVN, few files may share the same revision number. SVN use atomic commit, eg. commit a few files together, either all success or fail.

GIT vs CVS/SVN


Git is a distributed version-control system, it has its own local repository (can do offline commit/check in). Synchronize with other repositories when the network is available.

Git has 3 stages (server/repository, local/working/untracked and staged/tracked/indexed). CVS and SVN have 2 stages, local/working and the remote repository.

GIT Tutorial


GIT configuration


$ git --version
git version 1.9.5 (Apple Git-50.3) # MacOS Mavericks 10.9
git version 2.20.1 (Apple Git-117) # macOS Mojave 10.14

example:
$ git config --global user.name "fuyichin" (commit with this name)
$ git config --global user.email fuyichin@gmail.com
$ git config --list (shows config)
user.email=fuyichin@gmail.com
user.name=fuyichin
$ git config --global core.editor "vi"

Git init

Create a (local) repository.

$ mkdir hello; cd hello
hello $ git init

create a .git repository at the local directory.

Git status


Create an empty file README.

hello$ touch README
$ git status README

Untracked files:
(use "git add <file>..." to include in what will be committed)

README



Git add


Remember there are 3 stages 1. local/untracked 2. tracked/staged/indexed 3. repository in Git. Add files move the file from untracked to tracked (or indexed). Only tracked/indexed files will be committed.

$ git add README; git status README

Changes to be committed:
new file: README

Git commit


$ git commit -m "initial commit" # this commit is a empty README
1 file changed, 0 insertions(+), 0 deletions(-)

Modified the file (the empty file) wit content hello world:
$ echo "Hello, world." > README

$ git status README

modified: README


$ git add README # tracked/indexed hello world
(local change to Hello, John.)

$ git status README

Changes to be committed:
modified: README (Hello, world. tracked)

Changes to the local (untracked) file to "Hello, John":
$ echo "Hello, John." > README
$ git status README

Changes to be committed:
modified: README (Hello, world. tracked)

Changes not staged for commit:
modified: README (Hello, John. local copy, untracked)

When I commit, "Hello, world." will be committed, not "Hello, John". To commit "Hello, John", use git add <file>, this will make local copy to tracked/staged/indexed copy.
$ git commit -m "hello world"

To commit "Hello, John"
$ git add README # add to tracked/staged/indexed
$ git commit -m "hello john"

Git edit last commit


Use Git amend
$ git commit --amend

Git use the EDITOR environment variable or the editor set in 'git config core.editor'.

Git log


Show history
$ git log
$ git log --oneline # easier to read

09d72a7 (HEAD -> master) hello john (amended)
3a0fa58 hello world
7522dee initial commit

What is HEAD and master? HEAD refers to the last commit, master is the master branch. The commit code in-front could be different.

Remove commit


Git commit can be removed or reset before synchronizing to another repository.
09d72a7 (HEAD -> master) hello john # HEAD
3a0fa58 hello world (amended) # HEAD~1, or HEAD^
7522dee initial commit # HEADE~2, or HEADE^^

$ git reset --hard HEAD~1 # 1 commit before HEAD, or
$ git reset --hard 3a0fa58 # this is the commit code
SVN uses revision number, git use commit code as the version identifier.

$ git log --oneline
# 09d72a7 (HEAD -> master) hello john # not displayed
3a0fa58 hello world (amended)
7522dee initial commit

You still can reset back to the original HEAD
$ git reset --hard 09d72a7

$ git log --oneline
09d72a7 (HEAD -> master) hello john
3a0fa58 hello world (amended)
7522dee initial commit

Git configuration: .gitignore


Ignore all the object files, binary files.
$ cat .gitignore
*.o
*.class
a.out

when $ git add * or $ git status, those files listed in .gitignore will be ignored.

Git checkout (files)


Git checkout likes svn update, to retrieve back from the previous copy. The previous copy is either the tracked copy, or from the repository.

$ git checkout [-f] <filename> # or git checkout -- <filename>, or
$ git checkout HEAD <filename> # update from last commit
Note: switch branch use git checkout as well.

Git clone


When you retrieve (a remote) repository, eg. from a server, use git clone. It makes a copy of the repository, including all the history changes to the local working directory.

format: git clone [--depth nn] <repository>

If the git repository is too big, just download the last or last few commit, $ git clone --depth 1 <repository>

Git pull/push


Any commit of changes are updated to the local repository. Use git push to update to the remote repositories. Use git pull to retrieve changes from remote repositories.

Show remote
$ git remote [-v]

Push to remote
$ git push [ origin master]
Push master branch to remote origin. (origin is remote, master is branch)

Working with branch


Working with Git branch is light-weight (compare with CVS, SVN) and easy.

Create branch


Checkout with -b
$ git checkout -b branch1
(This will create branch name branch1 and switch to branch1)

$ git branch [--list?]
Master
* branch1

To switch between master and <branch1>
$ git checkout master
*Master
branch1
$ git checkout branch1

Merge to main branch master.


$ git checkout master
Switched to branch 'master'
Merge
$ git merge branch1

You can delete the branch after it merges to master.
$ git branch -d branch1
This is a safe delete, if the branch code is not merged, git will give a warning. Force delete use -D.

Wednesday, July 08, 2020

Canon CanoScan LiDE Scanner

Canon CanoScan LiDE 20 Scanner



I get a Canon scanner from a friend. It is a very old scanner, but still working. It is a model CanoScan LiDE 20. You can check the specs from CNET here.

When I plugin to my Mac OS X system, it doesn't work, the system is unable to detect the scanner. It is working if you use the VueScan software.

I read from the web, install the Sane software may works. From the supported device lists. The CanoScan LiDE 20 or 30 are supported. (here).

The Sane is an open source project. For Mac package, you can download from http://www.ellert.se/twain-sane/. Too bad I still can't get it works on my Mac system.

Luckily it works on my Linux system, just plug and play!

Just found a CD for the scanner, will try it next time. If you are having the same problem like me, may be you can try the driver from Canon website.

Another software available from CNET Download, here.

Wednesday, July 01, 2020

macOS Switch Input Method With Splash Display

macOS Switch Input Method With Splash Display



This has been bodering me for awhile after I upgraded to macOS Mojave 10.14. The splash display to show different input method is not there anymore.

I like the the splash display to show all the input methods at the center of the display, is large and clear. I don't have to move my eyes to see which input method that I am using now on the menubar, and I can switch between English and Chinese input method easily.

I keep thinking it was a feature included in the third party Chinese Input method that I installed previously, but I can't remember what is the name of the Chinese Input software. Finally I found it, it is Open Vanilla (https://openvanilla.org).

I am still unable to get the splash display to change the input method, even after I installed the Open Vanilla.

Seems like the feature is not from the Open Vanilla. Just enable "Select the previous input source" from Keyboard Shortcut:

macOS > System Preferences > Keyboard > Shortcuts (tab) > Input Sources > (x) "Select the previous input source"


Not I can switch between English and Chinese Input easily.

Wednesday, June 24, 2020

Learn Python 2020

Learn Python 2020




If you don't know which programming language to learn, Python will be a good choice to start. Python is one of the top 3 programming languages these few years.

Check this video Most Popular Programming Languages 1965 - 2019.

Python can last for another few more years, so is a good investment to learn Python.

Python is easy to learn, even for beginners.

For examples: Hello world

> print('Hello, world.')
⇒ Hello, world.

It has an interactive environment, users can observed the results immediately. No need to compile, no need to go through the complicated process to output the result. This is important for many beginners.

Python is dynamic data type:

> a= 'Hello, world.'
⇒ Hello, world.

> a= 200+300
⇒ 500

The variable 'a' can be a string or a number, easy and flexible.

This is just a preview. You should look for a proper tutorial to learn Python. Trust me, is not that difficult for beginners.

Wednesday, June 17, 2020

Willow Movie 1988 and Game 1980s

Willow Movie 1988 and Game 1980s




Just watched the movie Willow (1988) for the first time.

Willow is a movie produced by Lucas Film. The story by George Lucas. It is a very old movie, the story is classic and normal, the special effects used in the movie are being considered as advanced, during the time in 1980s.

Willow also release as a game for DOS. You can watch the game play here.


Wednesday, June 10, 2020

Mini vMac Macintosh Classic

Mini vMac Macintosh Classic




Mini vMac


Mini vMac is an open source emulator for the original Macintosh series (from Mac 128k to Mac Classic, up to 4Mb ram). It is a fork of vMac.

Install Mini vMac


You can download the software from https://www.gryphel.com/c/minivmac/download.html, available for Mac, Windows and Linux system.

For Mac, is easier to install using home-brew:

$ brew cask install mini-vmac

To run mini-vmac, you need 1. the ROM file and 2. Classic Mac OS System. I will show you how to do it.

History of Original Macintosh


Macintosh 128k


The original Macintosh was introduced by Steve Jobs in 1984, it has 128k ram, 7.8336Mhz Motorola 68000 cpu. The display's 9-inches size with resolution was fixed to 512x342 pixels, 72 dpi (to match with the Apple ImageWriter 144 dpi resolution?).

The Macintosh 512x342 pixels remained that size till 1990-1993 Macintosh Classic and Macintosh Classic II (Classic Mono).

Macintosh Classic


The first low cost Macintosh sold below USD1,000, expandable to 4Mb ram, using the old 68000 cpu, and the original Macintosh 128k design. Macintosh Classic can run Mac OS System 6-7.5.5.

Macintosh Classic was introduced in the year 1990, later succeeded by Macintosh Classic II.

Using Mini vMac


1. Macintosh ROM file


Macintosh ROM is owned by Apple. According to wikipedia, vMac accept "Gemulator ROM board from Emulators Inc.".

gryphel.com ask user to copy the ROM from a real Macintosh machine using utility eg. CopyRom. Refer here https://www.gryphel.com/c/minivmac/start.html.

A vMac.rom is available from https://sites.google.com/site/minivmacapplicationsv6/disk-images-and-roms.

2. Classic Mac OS


Classic Mac OS System 7.5.5 is available to be downloaded from https://sites.google.com/site/minivmacapplicationsv6/systems-os.

Mini vMac Application




Need a Macintosh ROM file

Load the ROM file from Mini vMac > File > open, or just drag the file to Mini vMac.

This this to auto load the rom file, rename vmac.rom to vMac.ROM and place it same directory as the mini-vMac application.



Need to load a system

Load the OS system file from Mini vMac > File > open, or just drag the file to Mini vMac.



System 5



System 7. Text Edit.



Aldus PageMaker



MacPascal

Import and export files


Import files into vMac using ImportFI, and export files using ExportFI.

*.DSK, *.IMG can be mounted by Mac OS system, just drag the file to vMac.

*.sit is compress file by Stuffit. Use Stuffit Lite or Stuffit Expander to extract the file.

There are many old application and games can be downloaded from macintosh repository website here.



Wednesday, June 03, 2020

Add to iTunes as Spoken Track (OSStatus error -1743.)

Add to iTunes as Spoken Track (OSStatus error -1743.)




Add spoken track to iTunes (macOS Mojave)


macOS text to speech


You can highlight a text in macOS application (eg. Safari, Text Edit), convert the text to audio and add it to iTunes:

Safari > Services > Add to iTunes as a Spoken Track
or
Right click > Services > Add to iTunes as a Spoken Track

If you don't get the services, enable it in System Preferences:



Enable add to iTunes as a Spoken Track

System Preferences > Keyboard > Shortcuts > Services > Text (x) Add to iTunes as a Spoken Track

“Import Audio Files” error: (OSStatus error -1743.)


I am getting an error, every time I try to convert the text to speech in preview application:

The action “Import Audio Files” encountered an error: “The operation couldn’t be completed. (OSStatus error -1743.)”

I know why I am getting this, because I choose "Don't Allow" when I choose text to iTunes audio track when I first use the function.



I choose "Don't Allow", but I want to change it later.

Now I want to use the text to iTunes audio track, I need to enable it. It takes me some time to get it back. It is here:



Allow Preview application to access iTunes

System Preferences > Security & Privacy > Privacy tab > Automation > Preview (x) iTunes.

Now I can add audio track to iTunes from Preview application, without the error.

Wednesday, May 27, 2020

Compile libgrowl Java 2020

Compile libgrowl Java version




Introduction


Notification is an important software system.

libgrowl is a Java library to send notifications to Growl, there is a C implement libgrowl as well. libgrowl is an open source library.

If you do not have a Growl installed, you can install Growl for Windows, Growl 1.3.x for Mac OS. Growl 2.x is not free anymore, it was selling USD3.99 on macOS App Store.(Is now available free on App Store again). If you don't want to pay for it, you can install the binary from third party (check here), or try to compile one for yourself.

Refer to this blog to download the pre-compile binary http://blogs.umb.edu/michaelbazzinott001/2014/09/21/growl/

libgrowl on Sourceforge and Github


libgrowl sends notification to Growl through network connection, the GNTP network protocol. libgrowl was first hosted on sourceforge.net (by bananewazen) https://sourceforge.net/projects/libgrowl/, later it was mirrored to different Github repositories.

https://github.com/feilimb/libgrowl some said this is the original mirror.
https://github.com/sbower/libgrowl this was modified with maven build.

To compile the libgrowl is a very good practice for Java beginners.

Compile


libgrowl (feilimb)



$ git clone https://github.com/feilimb/libgrowl
$ tree libgrowl
libgrowl
├── build
│ ├── build.xml
│ └── libgrowl.jar
└── src
└── net
└── sf
└── libgrowl
├── Application.java
├── GrowlConnector.java

$ cd build


ant compile and ant jar will do the job

What if you don't have ant and want to do it manually?


$ cd libgrowl/build
$ javac ../src/net/sf/libgrowl/internal/*.java ../src/net/sf/libgrowl/*.java
⇒ no class files?


No class files? class files were generated in the source directory.

$ cd ../src/net/sf/libgrowl
$ java GrowlConnector
Error: Could not find or load main class GrowlConnector

$ java net.sf.libgrowl.GrowlConnector
Error: Could not find or load main class net.sf.libgrowl.GrowlConnector

What happen???

There are many ways to solve the above issue. This is how I do it.
$ cd libgrowl/build
$ javac -d . ../src/net/sf/libgrowl/*.java ../src/net/sf/libgrowl/internal/*.java
⇒ net/sf/libgrowl net/sf/libgrowl/internal
$ java net.sf.libgrowl.GrowlConnector localhost "libgrowl" "libgrowl" "Test" "Hello, world."
(Show Growl notification)

libgrowl (maven)


Maven is a software to build software lifecycle, it will download the necessary dependency from the Internet. It is supposed to make it easier to compile a bigger project, might not be in this case.

Note: The maven software lifecycle $ mvn clean compile test package

I am compiling on macOS Mojave.

$ git clone https://github.com/sbower/libgrowl
$ cd libgrowl
$ mvn compile
⇒ error

I am using Java 8. Compile with deprecated warning, but still able to generate 1.5 binary
$ javac -source 1.5 -target 1.5 HelloWorld.java
⇒ with warning.

But the maven 3.6.3 doesn't support 1.5 binary. My lazy quick fix, change the version in the pom file.

$ edit pom.xml
Change compiler source and target from 1.5 to 1.8

<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>

$ maven package
⇒ error, test not pass.

I just remove all the test cases. After successfully compile, try test the new compiled software following the testing session below.

Testing


Test Growl


You must have the Growl software installed to test. Optional: you can use the command line growlnotify to send notification to Growl.

If you are on macOS, you can install the growlnotify using homebrew.

$ brew install growlnotify

Test libgrowl


$ java -cp ./target/libgrowl.jar net.sf.libgrowl.GrowlConnector "host" "app name" "notification name" "title" "message"

$ java -cp ./target/libgrowl.jar net.sf.libgrowl.GrowlConnector localhost "libgrowl" "libgrowl" "Test" "Hello, world."
or
$ java -cp libgrowl.jar net.sf.libgrowl.GrowlConnector localhost "libgrowl" "libgrowl" "Test" "Hello, world."


Wednesday, May 20, 2020

Hardware Growler Fork Notification Software 2020

Hardware Growler Fork Notification Software 2020




Introduction


Growl is a notification software for macOS (Mac OS X), it looks nice and configurable eg. display location, duration stay on the screen. Growl is available on Windows systems as well. With Growl, you can have a universal notification system for application.

Growl started when there was no good notification system on Mac OS systems. Notification Center was included in Mac OS X 10.8 Mountain Lion in 2012. Growl can send notifications to macOS Notification Center.

Early days of Growl. A few Mac OS software bundle Growl with their software, eg. Adium, Dropbox, Adobe CS5 etc. Some users are angry because these software just install Growl on their system without them knowing it. Later Adobe made an announcement about it, here, https://blogs.adobe.com/deployment/2010/05/growl_installation_with_adobe.html.

Hardware Growler



Hardware Growler is a software that sends notifications (to Growler) when users plug in or unplug a device in the system.

Growl 2.0


Growl started as a free, open source notification software, but it started to charge USD3.99 on macOS App Store with version 2.0. Growl is licensed under BSD, so it can be used for commercial and close source.

Growl and Hardware Growler fork


Since Growl (and Hardware Growler) is open source, someone has mirror and fok the software. Now it can be found here:

https://github.com/pranav-prakash/HardwareGrowler-NC

I am not sure how to compile the above software. When I load it with Xcode (10.13.1), it warn me about 32 bit, so it may not works with macOS 10.5 Catalina.

This following Hardware Growler has been modified to send notification direct to macOS Notification Center. This software is small and easy to compile. https://github.com/cirrusj/HardwareGrowler. I have tried it on Mojave + Xcode 10.13.1.


$ git clone https://github.com/cirrusj/HardwareGrowler
$ cd HardwareGrowler
$ make
⇒ build/Debug/HardwareGrowler.app


Then run the HardwareGrowler.app, you can move/copy to /Application[/Utilities] folder.
I tried this on macOS 10.14 Mojave, it works.

If you just want the binary for Growl 2.0, you can check the blog here http://blogs.umb.edu/michaelbazzinott001/2014/09/21/growl/

Sunday, May 10, 2020

The Incomplete Jump Start VS Code Tutorial 1

The Incomplete Jump Start VS Code Tutorial for Beginners

Part 1: General



Introduction


This is a tutorial guide for beginners, a jump start to learn VS Code. It is based on an older version of VS Code, to be installed on older machines and software, eg. Mac OS X 10.9 Mavericks and 32bits Linux system.

VS Code (Visual Studio Code) is a lightweight programming editor. VS Code is positioned between a text editor and an IDE (Integrated Development Editor).

VS Code is an open source software developed by Microsoft! Written in TypeScript (JavaScript), available for Windows, Mac, Linux, all the 3 major platforms.

VS Code is getting popular recently (these few years), as an alternative to Eclipse.

Installation


Users can download the latest version from VS Code website https://code.visualstudio.com/Download, or older version from updates.

OS X 10.9 Mavericks


The working version is 1.35.1, it can be downloaded from https://code.visualstudio.com/updates/v1_35, direct link for Mac.

Linux (Debian)


Raspberry Pi Desktop, 32 bits only. Download the 32 bits deb file from here (https://update.code.visualstudio.com/1.35.1/linux-deb-ia32/stable). To install

$ sudo dpkg -i code_1.35.1-nnn_i386.deb

You can load VS Code from RPi > Programming > Visual Studio Code, or from shell command
$ code

Configuration


Disable update


The first thing I do after the download is disable the auto-update. The later or the latest updates doesn't work on my older system. The auto-updates just download and didn't check if the update version works on the system.

Code/File > Preferences > Settings > (search "update mode") > update: mode (v) none

Note: disable internet connection before configure, to prevent auto-update.

General Usage


Command Palette


You may need this command palette to issue commands, eg. restart VS Code. The shortcut is (Cmd/Ctrl+Shift+p). Or from menu, Code > View > Command Palette.

Restart VS Code


Exit the software and relaunch, or use Command Palette: [Developer: Reload Window], to restart the application.

The Layout



Sidebar

On the left side, there is a sidebar with icons. From top down, the icons are Explorer(files), Search, Version control (Git), Debug, Extensions. The bottom is the Manage icon.


Explorer

Beside the sidebar, on the top is the workspace, directory and files.


Files editor

Upper right is (file) content display.


Output

Lower right is output and error messages.

Sidebar



Explorer Icon.To access workspace, folder and files.


Search, this is very common icon.


Source Control, the default is Git.


Extensions. Install extra extensions here.

The bottom left icon is Manage, can access "Command Palette" here.

Working with VS Code


Workspace


The workspace in VS Code is virtual. A workspace is a collection of your working projects, you can add in different project folders into the workspace, save the workspace as a file.

Searching in the workspace goes through all the files in the workspace, even if they are located in different project folders. You can always remove the project folder if you are not working with it.

Create a project


You can try with python, php, C or Java. I am using Java as an examples here. The easiest way for me is to create a project folder from the terminal, and add the project folder in VS Code workspace.

$ mkdir test_java

In VS Code, click on Explorer icon (sidebar), right click on the workspace area, add folder to workspace. Choose the test_java folder.

Create a new file HelloWorld.java under test_java folder, edit the file, and save it:

public class HelloWorld {
    public static void main(String[] args) {
        System.out.println("Hello, world!");
    }
}

Install extension: code runner



Extensions: Search code runner

Install Java Extensions Pack by Red Hat, Java Extensions Pack by Microsoft or just simply use the code runner extension.

Click on Extensions icon (sidebar), search "Code Runner", and install.

After installed, restart VS Code.

1. Normal exit and relaunch VS Code, or
2. Command Palette (Cmd/Ctrl+Shift+p), search [Reload Window].

Right click on the HelloWorld.java, "Run Code". Results will be displayed at output.


Output

Part 1 end. To be continue...