Skip to main content

Posts

Showing posts with the label hello world

The first taste of Rust - A simple you tube downloader

Recently, I just learnt Rust and using it to write a simple youtube downloader with reference from node-ytdl . In this blog, I would like to share the code and how did I make it. You can find the full source code here . Install development environment I am using Windows 10 and scoop package manager. Therefore, I use the following commands. Run scoop install rustup-msvc to install rustup . Run setx "%path%;%USERPROFILE%\\scoop\\persist\\rustup\\.cargo\\bin" to add rustup to the path. Restart termial (git-bash in my case) and check the installation with rustup --version; rustc --version; cargo --version Export custom RUST_HOME : export RUSTUP_HOME=$HOME/scoop/persist/rustup/.cargo/bin/rustup Install a toolchain for rustup : rustup toolchain install stable-x86_64-pc-windows-msvc Setup project Run cargo new simple_rust_youtube_downloader --bin && cd simple_rust_youtube_downloader to create and navigate to the project. Add these dependencies to ...

Try Haskell

I have zero experience of Haskell but I have heard about it a lot. Therefore, today I started learning Haskell by going to tryHaskell site and found out that it is pretty concise and nice to use, especially when the site is very beginner friendly. - ninjahoahong

Blogger Post Template

The easiest way to start using a template is that you visit your own typical blog and change to HTML tag and copy the blog to the Settings --> Post, comments, and sharing --> Post Template. Then remove the real text and replace it with the template text. For example, this blog's template is: Reference: https://support.google.com/blogger/answer/154172?visit_id=1-636349071961278260-2951406294&rd=1 - ninjahoahong

How does virtual reality (VR) work?

Today, I learned a basic of how VR works and want to share you my short summary: VR feel can be achieved by using head mounted displays to show different 2D pictures (different angles, depth) to each of a user' eyes to immerse the feeling of staying in a 3D world to the user. The immersion can be increased by increasing the field of view (typical field of view is 100 to 110 degree).  FPS requires at least 60fps for the user to feel okay. Different trackings such as head tracking, motion tracking, and eye tracking decide when to show which pictures provide more complete VR experience. After learning this basic, I am interested in making some experiments with VR application for Android phones and tablets. I will share those learning experience after the experiments. References: http://www.androidauthority.com/virtual-reality-work-702049/ https://www.wareable.com/vr/how-does-vr-work-explained

Bash script: "Hello world!"

Bash script is very nice and important if one is using Unix system. Planning on using bash scripts as much as posible, I would like to share a quick and easy example to start using it: Create a shell call  hello.sh Add the lines to the file: #!/bin/bash echo "Hello world!" Go to the folder contains the file. Type  bash hello.sh . The echo command will print out  Hello world! your terminal

Try out Jekyll

Today, I decided to try jekyll to write my blog. It works out quite well. Faster and simpler than wordpress for writing a static site. And trying something new is very exciting as well. Let’s review what I have done: Open terminal:  Install rvm.  \curl -sSL https://get.rvm.io | bash -s stable --ruby Install jekyll gem:  gem install jekyll Create new repository name  ninjahoahong.github.io  on github jekyll new ninjahoahong Add origin remote with  git remote add origin ...  (… for you to fill your repo) Commit and push to master of the origin You can try the same to get a simple page. Updated in 2017: I am now using blogger to instead of Jekyll and move all the blogs here.