Posts

Showing posts from 2019

Tips For Beginner Software Developer

Image
Becoming a software developer is not a dream job i would say, it is far from enjoyable, fun and rewarding. After years then i feel myself not enjoying it anymore, writing codes. The average people stay in tech world as software developer is less than 2 years, after that short period of time, they will get bored and looking for another company or even completely steer into different field outside of doing software development, because it is not fun anymore.

I don't enjoy this job myself, the only reason i stay working in a company is that i don't have any income outside this job, i wish this blog can give me some hope, but it doesn't. I am still feel underpaid after years of experiences in coding. After long hours of working on a computer, you supposed to get some relaxation, but you don't, you will keep doing that in the night, tomorrow and the next day and the next day, it's just intimidating.

Here i give you three powerful tips before you go deep into software d…

What is Computer CPU, Disk and Memory?

Image
If you are Windows user, then open task manager, you will see many processes running on your computer, each of the process has its own CPU, disk and memory usages. Sometimes it's using a lot of memory, sometimes it is using Disk or CPU. So what's that CPU, disk and Memory mean to us? Here's some little information i can provide.

1. CPU It's stands for central processor unit (CPU), in computer is like the brain of computer, it so important component of a computer, to do it's computing job. It handles basic instructions and allocates the more complicated tasks to other specific chips to get them to do what they do best. It’s the core of your PC, smartphone, or tablet. and it’s what makes the whole device run as it should.

The famous CPU you often heard is the AMD CPU and Intel CPU. Intel is more popular by their Intel Core I series, like Core I7 and the latest Intel Core I9.

2. Disk Disk storage is a general category of storage mechanisms where data is recorded by v…

CodeIgniter PHP Framework, Is It Worth to Learn?

Image
I've been doing PHP coding for my entire career as web based software developer, combined with Javascript it is the most easiest and faster way to achieve the goal of our projects. You know just doing front end web stuff, end some not very complicated business process with admin privileges, etc.

CodeIgniter is PHP framework for web based application, you can make business models, views and controller to be structured into what we called MVC framework. You can also do some URL routing, database transactions, form submit, etc. That's probably is the major reasons to use CodeIgniter, other than that, i think maybe the security is handled by CodeIgniter, file uploading, html form handling, but it is not the convenience way of doing html form. I think UI or form should be separated from the PHP codes, because if it is mixed together it's gonna looks really bad (unmaintainable).

Just for small project, if you know very well of PHP codes, Javascript and JQuery, you can do a lot …

Flutter AppBar, With Icon, Title and Actions Link

Image
It is very common to have AppBar in mobile apps, most mobile apps have app bar. AppBar or top App Bars is a collection of widget located at the top of the app, for wrapping our app's title, icon and action link. This app bar will work the same looks, style both in Android and IOS. Basically almost everything will work the same, Flutter is cross platform mobile app Framework.

Here's example code of AppBar in Flutter with icon, title and action:

import 'package:flutter/material.dart'; void main() { runApp(new MyApp()); } class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return new MaterialApp( title: 'Generated App', theme: new ThemeData( primarySwatch: Colors.blue, primaryColor: const Color(0xFF2196f3), accentColor: const Color(0xFF2196f3), canvasColor: const Color(0xFFfafafa), ), home: new MyHomePage(), ); } } class MyHomePage extends StatefulWidget { …

Intellij IDEA 2019.3, The Fastest Java IDE

Image
Starting from Intellij IDEA 2019.3, the start up experience has been really amazing, never been before the launching of IDEA is fast as this 2019.4 new version, I am really happy that this improvement is happening, I am a IDEA fan, this tools has been really helpful for writing Java codes, not only Java though, it also support many languages using plugin. But if you want to code in other language, for example PHP, there's PHPStorm, for Python you can use PyCharm.

Here's some new feature and improvement of Intellij IDEA version 2019.3:

Smoother mouse scrolling.Intention action doesn't disappear from the list of suggestions.Field Call Hierarchy.Find in path displays file extension of the search results.Better performance on importing a Gradle project.Improved Maven support.Timeline for GitHub Pull Requests.Reworked Clone dialog.Force addition to VCS a file from an ignore list.

And so many more changes for improvement of the IDEA, you can go here for the detail of the release …

Is Nox Player a Malware? Nox Android Emulator

Image
Yes it is Malware. After not using Nox for so long time, this time i try to install this Nox Player, and android emulator device for PC. After so long time i am not using it ,because my favorite android emulator is now BlueStack, today i try to install Nox again because i have have trouble in BlueStacks, it is surprising me that it turns out Nox has change radically its system, to become a malware program.

In the past, I've have quite experiences using Nox with no trouble, it run smoothly, no suspicious thing happens, all just working like normal android emulator. Then after i switch to BlueStacks because BlueStacks can not open some app that i installed, i decided to look another Android emulator, and Nox came to my mind, so i decided to install it.

After the installation of Nox, suddenly my Bluetooth mouse is not working. It is not that my mouse is broken, the viruses is damaging my Windows OS. The driver corespondent to Mouse is  working.

In the installation process, a typical…

Why Flutter? Beautiful, Natively Compiled Mobile App

Image
So recently I've been doing mobile app development using this framework made by Google, Flutter. To be honest, other than that it is a multi platform mobile app framework, for Android and IOS, i am really disappointed. I hate it because it is using this Dart language that look like Javascript but it is not Javascript, it looks like Java but it’s no Java. It’s confusing for even creating, adding a variable typed List. Do i need to do var myList? or List myList=new ArrayList()? But then, can i just myList[123] or myList.get(123)? It turns out that there’s so many things we need to learn about this Dart language alone, and Flutter is another different complex story.

Flutter is React like mobile app development framework. I’ve been doing React and have been really happy, enjoying so much, but it is not as flexible as pure as HTML, Javascript, JQuery and CSS. You can build more maintainable codes with React, but is that you want?

Now talk about why consider Flutter to be your mobile a…

Remove Duplicate String Array Elements Using PHP

Image
Just using for each loop, you can populate a new array, check if there's already an element with the same values, if is exists than skip that row. Look at this codes below for removing duplicate string array elements in PHP.

<?php function filter_duplicate($ori){ $result = array(); $labels= array(); $i=0; foreach ($ori as $row) { $label = $row['label']; if( !in_array($label, $labels) ){ $result[$i] = $row; $labels[$i] = $label; $i++; } } return $result; } $original_array=array( array( "name"=>"name1", "label"=>"name dup 1", ), array( "name"=>"name2", "label"=>"name dup 1", ), array( "name"=>"name3", "label"=>"name dup 3", ), array( "name"=>"name4", "label"=>"name dup 3", ) ); $no_duplicate = filter…

MySQL Database Pros and Cons, Why Is It Really Popular

Image
These are several MySQL pros and cons i listed, not that very much list but enough for just as an information, why people using MySQL over several database competitor, and also some contradictions why is it bad, and so you can decided to choose another DB system if you think MySQL is not the right choice for your type of project you are currently doing. I am not really an expert, it is just based on my experiences as software developer for many years (not that long though).
Pros - Free, you can download MySQL community edition, or the open source MariaDB, it is basically just an open source version of MySQL
- Easy to install, in operating system that has package manager, with just single install of command line, your mysql will be ready. In Windows, the installer is really straight forward
- Not so much heavy, meaning it will not cost your computer memory or CPU usage, MySQL don't need that much of your computer resources
- Big community, so many technical, non technical document…

How to Launch Android Emulator Using CMD

Image
Whenever you need an emulator either for development process of mobile app, or you just want to explore it. You can run mobile Android emulator from command line on windows, or terminal in Linux and Mac OS. Follow these steps below to launch mobile emulator from command line without opening Android Studio.

1. Make sure  ANDROID_SDK/emulator is in your environment path, this path contains emulator.exe

2. After adding the path, now open terminal and execute this commands
emulator -list-avds

Example output:
C:\Users\adam>emulator -list-avds Nexus_4_API_22
3. Now run the emulator with this command
emulator @Nexus_4_API_22

Note: Change according to your emulator name

Make sure you already have Android studio, it is already bundled with Android SDK, emulators and and the tools you need from creating a starter Android project (the project structure), writing your logic codes, designing the user interface, and compiling it to APK or AAB so you can upload and publish your app to Google PlayStore…

Cloud vs Dedicated Server Pros and Cons

Image
If you are not deciding yet what type of server you want to choose, either you want to use Cloud service like Google cloud platform, dedicated server like Dedicated server from Namecheap. You can see these points of pros and cons, so maybe it can help you decided what type of service you want to use, for your development or production server.

Cloud is virtualized type of server, shared with many other tenants. Dedicated server or dedicated server is single tenant, the hosting provider giving you access to all the computer resources for you only.

Cloud pros - No need to set up your own server, the cloud provider will give you ready to use infrastructure
- No cost of building or maintaining the server
- Storage can be added as needed instantly, no need physical upgrade that can took time
- Managing the server can be initiated from anywhere, whatever device that have browser.
- Usually the cloud provider silently backing up your data, if somehow you do something wrong, you can request a…

How to Embed PDF in HTML Using PDFObject

Image
Sometimes you have a PDF file that you need to display it to public, in modern browser like Google Chrome of course it have their default PDF reader, if you have a file contains PDF extension they will open it using PDF reader. But that reader is a full screen reader, meaning you can not put any of your HTML contents to display it side by side.

To just embed a PDF inside your HTML, you can do accomplished it by using PDFObject, you can see on this official website https://pdfobject.com/.

1. Create a container to hold your PDF<div id="example1" style="height: 80vh; width: 80vw;"></div>
2. Tell PDFObject which PDF to embed, and where to embed it<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfobject/2.1.1/pdfobject.min.js"></script> <script>PDFObject.embed("http://localhost/your-pdf.pdf", "#example1");</script>
Change the http://localhost/your-pdf.pdf with the location of your PDF file that you …

What is Bare Metal Server?

Image
Bare metal server is a term to refer a server that is not in virtualization, so the Operating System is talking directly to the hardware, not using any virtualization medium. It is just to distinguished it from Cloud or VPS. For example if one VPS is down, it will not affecting the entirety of the real computer, it will just shut down that VPS instances, but the other VPS instances in the same computer is separated and will not be affected by that.

To manage bare metal server means you talked directly to the real physical computer resources such as disk, memory, network, etc with no filter. Switching off means it will also switch off your real computer power. It shortly means straight to the hardware.

It is now common to have a cloud server rather than bare metal server. I think bare metal is something in the past but not very relevant in the future, unless you have a big company that you really need privacy of your data pool, or much control of your infrastructure. But if you just s…

Datatables Custom Column Render Example Code

Image
Column render in Datatables is use to display column data with special formatting, maybe you want to add some currency format, maybe you want to cut the string if it's too long, etc. If you are a fans of Datatables and don't know how to do custom column render, here's how.

$("#datatable").DataTable({ dom: "Bfrtip", buttons: [ "copy", "csv", "excel", "pdf", "print" ], "aoColumnDefs": [ { "render": function ( data, type, row ) { return data+ " - TEST" ; }, "targets": [4] } ], "processing": true, "serverSide": true, "ajax" : "http://localhost/data", });
So as you can see the codes above, aoColumnDefs property is the one responsible for column render. The render property will provide you with (data, type and row), you can d…

How to Make Money Online in 2020

Image
This 2019 almost ended, and start a new year 2020, if you have a resolution to make money from the internet, or using media internet, you can try some of this options of you to start making money from the internet. Here's some ways people do to make money, there's lot of ways, but i will ranked it from the easiest to hard.

1. Start Youtube Channel You can start by creating a Youtube channel. Youtube is the easiest yet an effective way for lot of people to make money online. Many YouTube can make thousands of dollar in very short period of time, it is not scam, it is been proven by so many people on YouTube.

All you need to do is creating a video that people want to watch, not a trash or over produce videos. You can start even with your phone camera, talk about something you like, then upload it on YouTube, it's easy and simple.

It is not gonna be easy in the beginning of your channel, but keep going, keep making contents, give some values in it, give some values that make…

ERROR 1418 (HY000) at line xx: This function has none of DETERMINISTIC

Image
This error occurred when you have to execute SQL file that contains function. i am trying to import SQL file using terminal like this:

mysql -u root -p1234 my_database < dump.sql

So there's many solution, when that error occurred. These 3 solutions for you solve this problem. I sometimes use the third one, because it do it permanently.

1. The first would be, when you dump into SQL file, please be always using command MYSQLDUMP, for example

mysqldump -u root -p1234 my_database > dump.sql

Always use that as the main dumping tool, using exporting tool for example from MySQL Workbench or Navicat, sometimes that dump file will not working in the importing process. Using MYSQLDUMP commands always work perfectly.

2. In the MySQL console, execute the following commands

SET GLOBAL log_bin_trust_function_creators = 1;

3. Edit the mysql.ini configuration file, and add this line, require MySQL restart

log_bin_trust_function_creators = 1;

That's all the three solutions i can provide.

How to Make Datatables Faster By Using Ajax

Image
Here's how you can make a Datatables not loading all the rows in one page load, but rather doing ajax call per table page.

<html> <head> <title>Datatable</title> <link href="//cdn.datatables.net/1.10.20/css/jquery.dataTables.min.css"/> <script src="//cdn.datatables.net/1.10.20/js/jquery.dataTables.min.js"></script> </head> <body> <table id ="datatable"></table> <script> $("#datatable").DataTable({ dom: "Bfrtip", processing: true, serverSide: true, ajax : "http://localhost/data", }); </script> </body> </html>
Just simple as that actually, the hard thing you gonna do is on the Server side. In PHP you can check whatever $_POST and $_GET being sent from Datatables, you can get that information to do table filtering, paging, sorting, etc.
In a web desktop based software, displaying tabular data is one thing that we do almo…

JS Format Money Examples

Image
Javascript don't have money formatting, while in fact almost all top languages don't have that kind of feature, even though this format is largely used in business software. Here's what i a usually use to do money formatting.

Number.prototype.format = function(n, x, s, c) { var re = '\\d(?=(\\d{' + (x || 3) + '})+' + (n > 0 ? '\\D' : '$') + ')', num = this.toFixed(Math.max(0, ~~n)); return (c ? num.replace('.', c) : num).replace(new RegExp(re, 'g'), '$&' + (s || ',')); };
To use it simply look at these examples:

(123000000).format(0, 3, ".", ","); //"123.000.000" (123000000).format(0, 3, ",", "."); //"123,000,000"(123000000).format(2, 3, ",", "."); //"123,000,000.00" (123000000.99).format(2, 3, ",", "."); // "123,000,000.99"
Problem with money format is that wh…

Call To Undefined Function curl_init() Error in PHP

Image
This error maybe only occur in PHP 5.x, the best thing you need to do, if you have free time, is to upgrade your PHP version to the latest, PHP 7.3 version. There's lot of improvement, bug fixing that has happens since version to version 7.

If you want to use older version of PHP, no need to bothering upgrade, and just want to tackle this error in PHP 5 anyway, follow this 3 simple steps.

1. In PHP.ini uncomment php_curl
2. Add c:/php and c:/php/ext to your environment path
3. Restart Apache

Doing remote connection like API calling in PHP is not hard, PHP is one of the easiest language to learn. To make a remote remote connection in PHP, you can use cURL library, cURL is the simplest way you can use. You can also use file_get_contents, but with cURL you can not just only do GET requests but you can also do POST request using cURL.

Please if any error still appear, don't hesitate to post a comment.

3 Ways To Make Money From Blog

Image
Making money from blog is really hard. You can't expect to make money from just your first hundreds of you blog posts, it could takes years with lot of contents from your blog to make your blog appear at least in Google Search page one, and that's how you get visitors to read your blog and clicking ads that appear on your blog, that's how most blogger make money from blogger.

But that's just traditional techniques,  you can also have some membership plans on your blog, maybe you have services you can offer to your visitors that willing to use and pay for your services.  There's so many variety of ways to monetized your blog to make money. These are just 3 common ways of how you can make money from blog.

1. Advertisement Space Google ads or any other internet advertising company need a lot of partner to publish their ads. You can allocate some spaces to place their ads on your blog. but remember don't put to much ads, it's gonna make your visitor sick. And a…

Create SQL Server Remote User Login Using SSMS

Image
Microsoft SQL Server is one of the best relational database system in the market. Even though from the beginning of installation it is not easy to do, even creating new user is challenging task to do for the first timer using SQL Server. The syntax of SQL they are using is so weird and different than many other database system like MySQL or PostgreSQL. I used SQL Server mostly for just in development process. And if your struggle to create new user in SQL Server.

Here's how you create a new SQL Server user using SSMS :

1. Login to using your existing SQL Server user
2. Object explorer > Security > Logins
3. Right click on Login and New login
4. Fill in the Login name with your desired login username
5. Choose SQL Server authentication
6. Enter desired Password and confirm the password, bot must be matched
7. Unchecked the Enforce password policy

8. On the left side Select a page Server roles

9. Checked all the roles
10. Then apply OK
11. Now try to Connect with that new user…

How To Unpublished Your Android App From Google PlayStore

Image
Maintaining a mobile app is not an easy task, you must be professional, dedicated your time fully on that, sometimes just once a week sometimes, it is daily, it can drains your energy, so those are the reasons to give up your mobile app and unpublished it.

Here's how to unpublished your Android app from Google Play store.

1. Go to Play store dashboard https://play.google.com/apps/publish
2. Select your app
3. Select menu Store Presence, then Pricing and Distribution
4. On App Availability, Select UNPUBLISH
5. And then Confirm

Now your App has been disabled and can not be found and installed by people. It is not permanent, you can just Publish that App again instantly.

Having your own App means you have responsibility about the contents or services you put on your mobile App, it must be accurate and satisfied your App users, not making your users mad or be misleads by the information you provided.

How Send An Email Using Google Mail / Gmail

Image
If you are never writing an email before, and your not familiar with emailing application, we will have a short tutorial on how to send an email to your acquaintances, friends, or business partner. Using Gmail, an email provided by Google.  And a web browser or mobile app. Web browser could be Google Chrome, Internet Explorer, Microsoft Edge, Mozilla Firefox or Opera Browser.

1. Open one of those browser, in the address bar type www.gmail.com and hit enter

2. And than Login using your existing Google account, if you don't have one, you can click this link and read that tutorial to create one

3. After successfully login to Gmail, on the top left of Gmail interface, click Compose


4. Then on the bottom right will appear a form


Fill that form with:
* To - is the email address of the person you want to send your email to, for example john.doe@gmail.com
* Subject - you can fill subject with topic of your email, for example, "Meeting me at Royal Hotel"

And below the Subject, ther…

What differences between Dependency and DevDependency in package.json

Image
Differences of devDependency and dependency are devDependency we use for just development process , dependency in the other hand will be included or transpired into the minification process Javascript files that were gonna deploy it for our run time application.

devDependency more into tools for make us easy on the development process of our application. For example some of command line tools such as angluar-cli or react-script. Also testing tools like Chai, Mocha, Enzyme.

Dependency will be included or transpiled, meanwhile devDependency is not.

Babel, ESLint is example of devDependency.

React, Redux, Express, and Axios is example of dependency that will be use on run-time.

I mean you don't need to learn that much serious about the differences, it's just tooling stuff, don't think about any of that too seriously, don't lead you into premature optimization. When i started coding i never thought any of that thing, i mean as long as you can start printing the traditiona…

How to Auto Page Break in Microsoft Word

Image
Whenever we are writing one long document, sometimes we must make a page break to make it clear for the reader that we want this paragraph is beginning of new topic, distinct from before, but  also sometimes it's just a way to make our documents look much more tidier and nicer.

So here's how we can achieve that, by creating a new Style, we can apply that Style to make our paragraph automatically started in a new page, no matter we add or delete lot of paragraph above that, it will always started in new page.
A. At specific paragraph We can create our own Style to force a page break whenever this style is applied to the first word in our paragraphs, look at this example below.

In the above example, a new paragraph Et tempor mauris..., started in new page even though there's enough space above it. Here's how we do that:

1. At the Styles tools on Home tab, click that More button
2. Then Create a style, then Modify
3. Click format at the bottom of dialog, and choose Paragr…

Login Layout In Flutter Example

Image
Developing mobile app is hard, it's even harder when you have to make your app to be run on both Android and iOS, of course  there are plenty of tools or frameworks out there to build multi platform mobile app by just one single code-base, like React Native, Flutter, etc.

Here's a simple login layout to begin your journey learning Flutter UI design:

import 'package:flutter/material.dart'; main() => runApp(MyApp()); class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Demo2', theme: new ThemeData( primarySwatch: Colors.blue, backgroundColor: Colors.black12 ), home: MyHomePage(title: 'Flutter Demo Home Page2'), ); } } class MyHomePage extends StatefulWidget { final String title; MyHomePage({Key key, this.title}) : super(key: key); @override _MyHomePageState createState() => _MyHomePageState(); } class _MyHomePag…

Converting Array To List and List To Array in Java

Image
Learning Java is not that easy especially because Java is statically typed language, it requires you to add a type of variable you created. Array is collection of objects, for example String[], Boolean[], or YourOwnObject[].

List  also just a collection of object, but it is wrapped inside ArrayList() class, this class has lot of methods you can use to work with your list, for example dynamic size, adds, removes, sorting, etc. So it is a recommended why to use List over Arrays. But if you somehow have to create Array first than you want to convert that array to List because it  is the right way, you can do something like this example below:

1. Convert String[] to ArrayList<String>import java.util.ArrayList; import java.util.Arrays; import java.util.List; public class TestClass { public static void main(String[] args) { String[] strings = new String[]{"Hello", "World"}; List stringList = new ArrayList<>(Arrays.asList(strings)); …