A place to breathe

Friday, May 1, 2020

AngularDart

I used to work in Angular 1.x . Not particularly pleasing, but it is one nice web development that allow us to do some form of JS-binding that make your website looks cool.

When Google came along, they introduce Angular 2 (and subsequent madness of release versions), which is a much improved version of Angular 1.x. What's not nice is that, your Angular 1.x app now no longer compatible with Angular 2. To migrate them, suffice to say, it's a pain.It's possible, but you might not want to do it. The effort is just monstrous.

OK, I still stick with Angular. But there's a new kid on the block called React, which is gaining traction. A lot of people like it, but I still don't quite appreciate it simply because I don't like coding my HTML/CSS into the JS file itself. I thought it's not very portable in case React doesn't see the light of the day one day.

Recently I got a hand of React, I kind of got a hang of it. Starting to like it myself. And then I also found a new development called AngularDart.

I was thinking AngularDart is the same like Angular but it's not.  They have some of their quirks. I am still getting along. I will post a few more things if I found it interesting.

Friday, April 24, 2020

Express JS tutorial

Hello Developers

I would like to share how to build a Node JS backend server that is the simplest. It is called ExpressJS.

1. Download Node JS (https://nodejs.org/en/)
2. Make sure you have a command line. If you are on Windows, I recommend you use Git Bash
(https://git-scm.com/downloads)
3. Download your favorite editor (Visual Studio/Sublime, etc)
4. Download a command called "Curl"here https://curl.haxx.se/
5. Create a directory where you want your server to reside anywhere in your computer. with command line, you type "mkdir "
6. Go to your directory - "cd "
7. Now, if you've installed node correctly, you should be able to type "node" in your terminal. If you got an error, make sure that the Path is set correctly. You can set it either in your .bash_profile (Linux/Mac) or Environment variables (Windows)
8. Create initial node files by running "npm init"
9. Create a file called server.js "server.js"
10. Copy and paste the following code into server.js

const express = require('express');
const app = express();

app.get('/', (req, res) => {
res.send({
message: "hello, world"
});
});

app.listen(5000, () => console.log(`Node server listening to port ${5000}`));
 

11. Modify your package.json to use node script to run:

"main": "server.js",
"scripts": {
"start": "node server.js",
"test": "test"
},

12. Now, run your server : npm start
13. You can test your server by running curl command : "curl -X GET http://localhost:5000/"
$ curl -X GET http://localhost:5000/
{"message":"hello, world"}

Now you're done!. You can write your own API server from now on.
Good luck !

Wednesday, May 8, 2019

Postgres Dump on windows 10

Recently I've been trying to do all my development on Windows 10. Fortunately, Windows Power Shell has been really cool and I kind of like it.

If you use Postgres for some reason, you might be wondering how the heck you want to dump the SQL database using PgAdmin 4.

Well, sorry to say, there hasn't been luck for me, and probably for you too.

Now, go ahead and launch your windows power shell, and type this:

PS C:\Program Files\PostgreSQL\11\bin> ./pg_dump.exe -U postgres -t   your_table_name your_database_name >> ~/my_table.sql 

You will find your SQL dump in the my_table.sql.

Have fun ! 

Monday, December 31, 2018

New Tech, faster, but same

Recently there are 2 programming languages that is trying to take over the Internet:

1. Typescript
2. Dart

Both languages share the same idea in that it is trying to "enhance" Javascript. In actual fact, it does have some characters to replace Javascript as the king of the Internet language.

But funnily enough, both compiles into Javascript, and then get translated by browsers. I think the future would be for the internet to have less defined widgets, and more for empty canvas loading and run it over some sort of graphics library.

This is basically the idea that game developers has always been familiar with, no matter what programming language, widgeteries, UI behaviors, etc.

It would be interesting to see the development of the 2 languages and see what they solve.

Happy New Year 2019!

Hi viewers

I would like to wish Happy New Year 2019 !
Wish you well, and happy holidays

Friday, August 24, 2018

Expressing Emotions : Machines v. Humans

Finally I have breathing space to catch my blog. As if I'm so busy!
As a matter of fact, I am.

Well, for the most part, i'm spending time talking to machines and people. There are differences between the two - machines don't understand your emotions, although I know some of you might be attached to your own machines as if they're alive. Please lah. Don't do that.

People on the other hand, understand emotions. However, some people don't express their emotions in words or body languages. Sometimes, they show it through actions as well. These are the things you can never experience if you talk to machines.

By talking to machines, I don't mean that I talk to my family or friends over the phone or Internet. I mean, by writing programming languages or some actions such as issuing commands, or just pressing restart button.

Ok, so what's a big deal? Well, wouldn't it be nice if the machines can understand your emotions such that when you're interacting with the machines, you trick yourself as if you're talking to a human being?

Yea. That's the stuff of the computer world right now. A lot of effort technology companies do to achieve this. Somehow humans are now more comfortable talking to machines like Alexa and Google Home than actually go over dinner with friends. So the IT space just ride the waves.

I mean, really? Do we really need it? That machines takes over human in terms of communications?
I predict that in the next few years, the machines could actually do reasonably well at that. I mean, look at what has it gobbled:
1. Alarm clock - better.
2. Letters - fast and cheap ( except receiving saman and bills, I don't get letters from my friends anymore. I wish I have).
3. Commerce.

Ok i don't need to go on and on.

However, what machines lacks are actually actions. Stuff like mechatronics and connects to its AI brains. I just don't think we can achieve things like human does when it comes to expressing their emotions through actions. This is the only thing that I think robots can't easily emulate for the next few hundred years.

That means, humans can survive as ... well, human being.
For the next hundreds of years.








Thursday, April 19, 2018

Surviving 2018

Hola

Welcome to 2018. Many things happening and I don't even have time to type !. Well, majority of the things are just learning. Many tech, and also non-tech.

One of the major decisions that  I have to make is to switch to Android from iPhone. This is a huge decision, but actually an easy one.

First of all, my beloved iPhone is still iPhone 4S. That's right my friend. The best phone ever. And the main issue is it keep dropping calls. Well after few years (about 5 years) using, I guess it's time.

Second, to purchase another iPhone is just too expensive. I was thinking of buying iPhone X but I figured that the price tag is just too much. So I decided to purchase a Samsung J+, which sadly, I misplaced it after a few days of purchase. Anyways, I'm still searching for it and hopefully will find it somewhere.

Another new cool discovery after Python is Phaser - a new game engine developed by Photon Storm. I mean, I manage to compile and got into my Phone with ease. The good news is it's running Javascript ! So I don't have to learn new things. Writing game in C++ is just too much. I mean, I'm not going to release a Quake here!

A sad new thing about gadgets is actually there's not much of a new thing. I remember when iPhone was released and we just can't wait for an SDK. Those days.. good times.

I'm toying of an idea of creating my own phone. But naaah.. too much effort for this. Too many phones that are good in the market anyway. Samsung,Oppo, Vivo, Xiaomi ... just choose.

But I think Javascript and Python has got some synergy there for many applications including app on the phones.. it's just that no one really package it in a nice way that they could work together seamlessly.

We'll see. Anyone got free time ? ;)




About Me

I'm currently a software engineer. My specific interest is games and networking. I'm running software company called Nusantara Software.