Posts

Showing posts from 2019

ERROR 1348 Column Password Is Not Updatable When Updating MySQL Root Password

Image
When trying to update my root password database, either MySQL or MariaDB, i get this following error:

ERROR 1348 (HY000): Column 'Password' is not updatable
This is because i use this SQL command to update my root password, and it is wrong:

UPDATE mysql.user SET Password=PASSWORD('1234') WHERE User='root';
So you can't update a user password using Update commands, to update the password, use ALTER commands instead. like the following:

ALTER USER 'root'@'localhost' IDENTIFIED BY '1234';
And then using flush privileges to commit that command into the system, like this:

flush privileges;
So now you have your root with password 1234.

MySQL or MariaDB is one of My favorite database system for either developing or even i use it for my production services. It is easier to install and to manage than any other competitor database system out there.

I love MySQL, it is fast, and using SQL dialect that lot of peoples uses, so in case i got trouble …

How To Install MySQL or MariaDB Services From Zip Archive

Image
MySQL and MariaDB is one of those popular database system currently revolving on the back end system of major websites, or any other computer application, offline or online. It is not only for just a development tools, it is capable of handling real production system, million of transactions i think it can handle.

Here is how you can setup MySQL or Maria Db on windows machine manually from zip file not using installer that you've been downloaded from their official website. Without further ado Starigth away open Windows command line using administrator privilege.

A. MariaDB Simply run inside bin directory will install MySQL with default installation parameters.

mysql_install_db.exe

B. MYSQL In MySQL, instead of running mysql_install_db.exe we run :

mysqld --initialize-insecure --user=mysql

It work the same, to initialize data directory and first MySQL user.

C. Start MySQL from console To test our MySQL can be run or not, we can starting it from console:

mysqld --console

Start MySQL …

How To Install Apache, PHP and MySQL Manually On Windows

Image
If you are a web developer, using Apache, PHP and MySQL is the most easiest way you can do. You can start your website stuff in just few minutes. If you are using windows, there's program called XAMPP, it gives you a bundle of Apache, PHP and MySQL altogether, by just following Next and Next button, you can start your web development journey right away.

But if you want have lot of control over your Server stack, you can do install manually. By installing them separately, you can switch between version of Apache and PHP much more easier. So here's how you can server stack for your web development manually.

Before you start the steps, it is important that you need to have Visual C++ (VC) run time exactly the same for your PHP binary build, and Apache binary build, the newest VC ++ is version 15,17,19.

1. Download the VC run time 15,17 and 19

From this link: https://aka.ms/vs/16/release/vc_redist.x64.exe

Visual C++ 2015, 2017 and 2019 is compatible with each other. Unlike the pre…

What Services Created By SQL Server Installation

Image
Microsoft SQL server is one of the best database system in the business. This short post only gonna show you what services, how many of them are SQL server Express is created during the installation process. Here's list of SQL server express services:

SQL Server
The core of SQL server

SQL Server Agent
Schedules jobs and handles other automated tasks.

SQL Server Browser
Listens for incoming requests for Microsoft SQL Server resources and provides information about SQL Server instances installed on the computer

SQL Server CEIP service
CEIP - Customer Experience Improvement Program is a program designed to collects your computer statistics information and how people use SQL server, useful for Microsoft to improve SQL server n the future and solving the problem if the SQL server somehow not working or crash. It is running automatically when our computer started,

SQL Server VSS Writter
Backup and restore of SQL Server through the Volume Shadow Copy Service framework. It is running automati…

The Worst App Ranked

Image
Mobile apps has been probably the most attraction thing for today's people around the world play with, it ranges from Productivity, like taking photos, Recording video, making notes to just bad as Phone is just another toy for adult to spend their times, like Social media, watching silly entertainment Youtube videos, etc.

And here's the worst app ranked personally by me, i don't have broad list ranges of apps, but the app that is listed below is the very popular app yet it can impact me in negative way rather than it's being useful and help me to be better in life. So because the impact of these apps is for me make me worst, i decided to not using it, i used to playing with it but now i don't, i completely avoid them because it is not just useless but also it din't help me in any kind of solving any of my problems.

1. Facebook, twitter, Instagram or any kind of social media
Social media for me is the worst invention of the internet, if you think it deeply, the…

How to Add MySQL JDBC Driver To Wildfly

Image
Wildfly is one of the best application server for Java, it is implementing Java EE, so if you are doing Java EE application development, you can use Wildfly either as your main production server or just for development process. It has a lot of documentation out there, so if you got into trouble, it is not that hard to find the solution.

Here's how to add MySQL JDBC driver to Wildfly, currently i am using Wildfly 12.x, and MySQL connector 8.x.

Using Terminal  Try creating the Module itself using the   jboss-cli.sh command rather than manually writing the module.xml file. This is because when we use some text editors, they might append some hidden chars to our files. (Specially when we do a copy & paste in such editors)

[standalone@localhost:9990 /]  module add --name=com.mysql.driver  --dependencies=javax.api,javax.transaction.api --resources=/PATH/TO/mysql-connector-java-5.1.35.jar

[standalone@localhost:9990 /] :reload
{
    "outcome" => "success",
    …

Windows 10 Runtime Broker

Image
As a Windows 10 user, i am really impressed how much this OS is helping me in a lot of situation, for me it is probably the best OS in the world, it is fast and have many pre-installed program so that i do not need to search online for program some basic use case like browsing the internet, playing music and video, taking screenshots, and many more. But still the OS has so many downside. One of annoying things on Windows 10 is, for me there are some background process that i don't really know but they consume a lot of my computer resources like RAM, CPU or Disk. Windows Run-time broker is one of that annoying background process.

What is Runtime Broker? It is a Windows process to helps manage some permissions on our program that we installed them either from Microsoft Store or directly download installer from the internet. So basically this process will run if only we installed some buggy apps to our computer. It is not 100% Windows fault.

Should i disabled it? Again, the problem …

The Worst Website Ranked

Image
I don't think anybody can ranked the worst website single handedly, because the reason is obvious, there's to many website, millions of them, circulating the internet right now. It requires lot of times and professionals who's have tens of years of experiences surfing the internet to actually ranked list of the worst website. And again, it's still gonna be impossible, because bad and good is kind of relative, some may find one website is useful and they love, some may don't and hate it.

Here's i try to list for you in my opinion as I've been surfing in the internet for years on the internet. But it's not gonna be a really good list, again it's kind of biased, without further ado here we go:

1. Buzzfeed.com

This website mainly focus on weird stuff that targeted some lazy nerd browsing the internet, for example What Type of Sandwich Are You,  Your Pizza Options Will Reveal How Many Children You’ll Have, and many nonsense quizzes on there, and if you r…

How To Create Phpinfo to List What PHP Configuration Have

Image
PHP is programming language mainly used by Web developer to develop their web application. It is actually one of my first programming language that i learnt in the past. It is a simple easy to start programming language to do a web development. Capable of doing database transaction, JSON parsing, file operation, etc.

Sometimes when you develop your web application and in the middle of your activity you find a problem with your codes, and you need to now detail about your PHP configuration for example, whether MySQL module is enabled, XML parser enable, etc. You can check all that information by using a single PHP function.

You can use phpinfo() function, to enumerate all your PHP configuration have. You simply only need to create a file, let's give it a name 'phpinfo.php' and the content of the file is this one single line PHP code:

<?php phpinfo(); ?>
Now open the browser and locate to that file, for example if you are developing your app on your local computer, you…

Disable Auto Save Code in Intellij IDE

Image
Intellij has been really the best and my favorite Java IDE so far, I know it is a paid IDE, it is not free, well they have a free version, but has limited capability and features. The thing that makes this IDE so great is that its code completion and bunch of plugins that can be really helpful to develop our Java program.

To do disable auto-save code in Intellij, here's the simple steps:

1. Hit the File menu and choose Settings


2. On the left pane, Appearance & Behavior, choose System Settings
3. On the pane of System Settings
- Unchecked the Save file automatically if application is idle
- Unchecked the Save file on frame deactivation

Now whenever your file is modified, it won't be automatically saved, we need to mark which files is not saved.

4. Still on Settings, on the left pane, choose Editor > General > Editor tabs


5. Check the Mark modified (*)
6. And also increased the Tab limit from default 10 to 50, or whatever based on your need

Now Click Apply and OK, no …

How To Extract Audio From Video Using FFMPEG

Image
FFMPEG stands for Fast Forward MPEG (Motion Picture Experts Group), it is a cool tools to do video editing with command line, you run ffmpeg from command line, powershell or terminal, i believe it's multi-platform, it's available for Windows, Linux and MacOS. To download FFMPEG, go to their official web, download the archived file, extract it to your desired location, and add the bin path to your OS system path.

To extract audio from mp4 video format, here is the example command:

ffmpeg -i input.mp4  -acodec copy -ss 00:00:00 -to 00:03:41 output-audio.aac

Replace the input.mp4 with video file you want to extract its audio.

The output audio file is in aac format, but it's still playable audio, if you are using Windows 10, you don't need any other program or tool to play it, there's already Groove music player preinstalled, i don't if it's older version of Windows, or other OS other than Windows, usually if a file can't be open, you just need a special pr…

Create A Maven Java Project On Eclipse IDE

Image
Eclipse is one of the popular Java IDE out there, many people still considered Eclipse as their main integrated development tools for developing Java based project. It is because Eclipse has capability of syntax highlighting, code completion, running, debugging and compiling Java project.

In this tutorial, we are gonna discuss how to create a Java project using Maven build tool. Maven is in my opinion the best build tool for Java project, i couldn't explain in detail in this post, because there is gonna be a long list of good and bad about Maven, so it will be discuss on the upcoming post.

To create a new maven project:

1. Click File on top menu, and then New and then Project

2. On new Project wizard, choose Maven Project, and then Next

3. On Project location, just click Next

4. On Wizard select archetype, also click Next

5. For testing purpose, you can just fill the group and artifact id with "test", but you can make it whatever as you want

6. Then click Finish and then…

How To Delete Windows Services Using CMD

Image
Windows services is usually used for program to be running automatically when our computer started. You can manage windows service using command line as an administrator. So make sure you are account use to login have an administrator privilege.

To delete an existing Windows service, first you need to open to "Services" program, just search and open it, then locate the service you want to delete and double click on it, now you can see the service name.



Now search cmd and Run as administrator, then run this command, to delete the service :

sc delete MyWindowsService

Note that the service you want to delete is not instantly removed, it will be deleted after you sign out and then sign in again, so do that and check if the service is completely removed, and you are done.

JavaFX Email Validation using Jfoenix Textfield

Image
I encourage you to use Jfoenix material UI for developing JavaFX GUI, I've been using it for a while and been really happy, it's cool library, more people should use it so this cool project will continue to alive, this project been so slow in progress lately. You can use this library, put in your pom.xml dependencies tag.

<!-- https://mvnrepository.com/artifact/com.jfoenix/jfoenix -->
<dependency>
    <groupId>com.jfoenix</groupId>
    <artifactId>jfoenix</artifactId>
    <version>8.0.1</version>
</dependency>

Use the right version, that version above is for Java 8 and below, if you use 9 and above use this :
<!-- https://mvnrepository.com/artifact/com.jfoenix/jfoenix --> <dependency>     <groupId>com.jfoenix</groupId>     <artifactId>jfoenix</artifactId>     <version>9.0.9</version> </dependency>
What we're gonna do is using to make a box that if the user is input the wrong em…

Convert MKV Video to MP4 Format with FFMPEG

Image
FFMPEG is A complete, cross-platform solution to record, convert and stream audio and video. I have been using it for a while, many kinds of work I've been doing, it works really great, if you want to play around with video editing, you don't need to install software, just download the FFMPEG archived file, extract to your desire location, put FFMPEG on your Path system, and start playing around with your command line.

Here's one of easy way to convert video with MKV format to MP4, because mp4 is really popular, you can play it almost anywhere, but i think this day MKV also has grown, but to be safe, i think if you have MKV video you can just convert it to MP4, using this command line.

ffmpeg -i video.mkv -c:v copy -c:a copy -acodec ac3 output.mp4

If you don't have the FFMPEG on your system, download it from this official website ffmpeg.org.

JavaFX Dialog Material Design

Image
Jfoenix is a library to build JavaFX application using Material design principal. One of my favorite library and always use it whenever i program desktop application. You can get the library from this official website www.jfoenix.com, read the documentation for further use, or just put this to your Maven pom.xml :

<dependency>
    <groupId>com.jfoenix</groupId>
    <artifactId>jfoenix</artifactId>
    <version>8.0.9</version>
</dependency>


And this is about showing dialog in JavaFX, it has modern look with shadowing and animation when it showing and closing. This is full example on how to create a dialog with Jfoenix JfxDialog:
import com.jfoenix.controls.JFXButton; import com.jfoenix.controls.JFXDialog; import com.jfoenix.controls.JFXDialogLayout; import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.control.Label; import javafx.scene.layout.BorderPane; import javafx.scene.layout.HBox; import javafx.scene.layou…

JavaFX Alert Dialog Example With Pictures

Image
JavaFX has 5 different alert types, each have their own different icon button, and functionality. You can specify an alert based on what your application need. For example if you want to have and alert to indicate user input error, you can then use an alert then specifying the alert type with  Alert.AlertType.ERROR.

And  these are 5 different types of JavaFX alert dialog:

1. Error Alert - usually to indicate an error

Alert alert = new Alert(Alert.AlertType.ERROR); alert.setContentText("Alert Message"); alert.show();
2. Info Alert - usually use for information

Alert alert = new Alert(Alert.AlertType.INFORMATION); alert.setContentText("Alert Message"); alert.show();
3. Confirmation Alert

Alert alert = new Alert(Alert.AlertType.CONFIRMATION); alert.setContentText("Alert Message"); alert.show();
4. Warning Alert

Alert alert = new Alert(Alert.AlertType.WARNING); alert.setContentText("Alert Message"); alert.show();
5. Empty Alert - an empty alert you can c…

JavaFX Combo Box with Search Autocomplete

Image
JavaFX is a java framework for building cross-platform desktop application under the Java Platform, i have been doing JavaFX programming for the last couples of months and been feel really happy.

It's good practice to build a desktop application UI, instead of web-based UI, i mean, and the thing that it's under Java, it has lot of supporting tools and libraries. Yeah Java has been sucks on the UI, even me as I've been doing web for years, i feel really frustrated doing UI programming for the first time in Java.

It is hard to find for example a library to support a combo box with search functionality, you can find it a lot's of lots library in Javascript, but Java, i'd say none, i should implement it myself, and it's been really difficult as i don't think i have enough experiences in JavaFX.

So here's a simple implementation of JavaFX combo box with search autocomplete. Create a class name it AutoCompleteBox.java:
import javafx.application.Platform; impor…

Registration Form Example Using JavaFX

Image
This is a simplest form for JavaFX registration layout, you can modify it whatever based on your need.

import javafx.application.Application; import javafx.geometry.Insets; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.control.Label; import javafx.scene.control.PasswordField; import javafx.scene.control.TextField; import javafx.scene.layout.StackPane; import javafx.scene.layout.VBox; import javafx.stage.Stage; public class App extends Application { private StackPane root = new StackPane(); private Stage stage; @Override public void init() { Button button = new Button("OPEN"); VBox vBox = new VBox(); vBox.setSpacing(8); vBox.setPadding(new Insets(10,10,10,10)); vBox.getChildren().addAll( new Label("Your Name"), new TextField(), new Label("Your Username"), new TextField(), new Label(&…

JavaFX Login Example Codes

Image
This is example of a login form created using JavaFX

import javafx.application.Application; import javafx.geometry.Insets; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.control.Label; import javafx.scene.control.PasswordField; import javafx.scene.control.TextField; import javafx.scene.layout.StackPane; import javafx.scene.layout.VBox; import javafx.stage.Stage; public class App extends Application { private StackPane root = new StackPane(); private Stage stage; @Override public void init() { Button button = new Button("OPEN"); VBox vBox = new VBox(); vBox.setSpacing(8); vBox.setPadding(new Insets(10,10,10,10)); vBox.getChildren().addAll( new Label("Your Username"), new TextField(), new Label("Your Password"), new PasswordField(), new Button("LOGIN")); root.getChi…

Windows 10 Connect

Image
Window 10 Connect is a windows program to help you work with other device, usually smartphone, so you can do like for example transferring file, etc.

To open Windows connect, you can do it by pressing window key, then type "Connect" to find the program, the other way is to click on Open center located on bottom right of your screen, after it's opened, at the bottom tiles, you click the connect tile.

Now your computer is ready for you to connect wirelessly.

JavaFX Load Local HTML File Using WebView

Image
JavaFX is platform to create GUI for desktop application in Java, it has more modern and performance than any other framework for desktop application development. It also support template using FXML and styling using CSS.

You can load an HTML file into JavaFX application using WebView, either it's available online, internet connection required or a local HTML resource, support CSS and Javascript. To load an HTML we can use WebView for example:
1. First create an html and put it on /src/main/resources/helloWorld.html
<html lang="en"> <head><title>Hello World</title></head> <body><h1>Hello world!</h1></body> </html>
2. Now for just demo, create a class name HelloWorldApplication.java that contains main method.
import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.web.WebEngine; import javafx.scene.web.WebView; import javafx.stage.Stage; public class HelloWorldApplication extends App…

Windows 10 Camera

Image
Windows 10 has a default camera application where you can take a picture or video, but camera in computer or laptop sometimes is just useless, i mean who want to take a picture sitting in a desk? But in any way it's a good addition to the OS,

The new camera program in Windows 10 has lots of settings or configuration, here's a short description of the configuration:

- Pro mode, shows advanced controls for photo and video
- Framing grade has 4 options, they are rules of third, golden ratio, cross hair and square
- Photo quality, you can specify which quality the camera will render, but it depends on your camera hardware, mine is really sucks, the maximum is 640x480
- Flicker reduction, basically to set frame-rates, the bigger the better

You can also change the location where the camera will save your photo, you can enable or disable
whether the photo will contains your coordinate location based on GPS, change some privacy settings, etc.

Windows 10 Calendar Where You Can Manage Your Events

Image
As I've already said in the previous post, Windows 10 has so many upgrade, from performance to adding more program, or just upgrade their previous program to be more modern, easy to use and more rich feature. One of the new cool addition to Windows 10 is Windows Calendar, with this program you can't just view full year calendar, you can also add an event you wanna do today or the day before. You can also add an upcoming event, it's kind of reminder so you won't forget or miss an important future event you have.

To add an event just double click on the date of your even, then fill up the event name. You can also set event location and set the time when the reminder will on, either the time of the event, 15 minutes before the event, or whenever you want the even to be on.

You can also sync your calendar event to your Microsoft account, so you will receive the reminder to your associated email.

Calendar is really useful program shipped in Windows 10 by default, you can m…

Windows Alarm & Clock

Image
Windows 10 is really amazing computer Operating System (OS). It has lots of major upgrade from the previous previous which is Windows 7 and 8. From the new cool user interfaces, adding lot of new features and performance enhancement. Windows 100 added new program Alarm & Clock, it is new program really useful for you working with alarms and clock.

As you can see on the picture on alarms and clock program, you can add some cities and know what their time is currently at, and you can also see that the map has dark and light, dark indicate that the place is currently in day night and and light means day light. If you have friends or someone overseas, this map can be helpful for you.

You can also set an alarm to get you up in the morning or whatever time you want to set, the alarm doesn't care if your computer is sleep, as long as it's has enough power or not in low battery condition, it will on automatically in time.

Timer and stopwatch maybe not that big deal, but still som…

3D Viewer in Windows 10 For 3D Printing

Image
Windows 10 has so many great things shipped by default, the one i am gonna talk about is the 3D Viewer. It is a program you can use for inspect 3D model's mesh, texture, material,animation data, and view 3D files in different shading model.

You can also use this program to work with camera, so you can mix real pictures taken by your camera and the 3D file you can load. It support both for taking pictures only or with video recording. The result will be mixed of your real images and the 3D model. You can even change the 3D model theme for example color, size, and texture, and move you can move the 3D model position.

Before you start taking a picture or record a video you want your 3D model to be perfectly looks and positioned, you can do that, there are lots of option you can do with this 3D Viewer program.

It also support for 3D printing, although I've never done that because i don't have 3D printing, you can do that by click menu File and Print 3D.

Netflix The Best Digital TV

Image
Netflix is probably the most popular and used TV media service, i am not using Netflix because i don't watch TV to often, but people around me are using Netflix, so it's popular and loved by many people. You can watch thousands of TV program on Netflix, probably every shows that ever exists and or currently airing are available you can watch on Netflix.

Over all Netflix is one of the best on media industry, providing the best service where we can watch show whatever we want. It has lot of programs let's say Movies, TV Shows plus their original programs, Netflix original production, and many many more type of entertainment can be found on Netflix.

You can watch Netflix either through computer web browser, mobile app and smart TV. That's probably what makes Netflix popular and used by many people, there are many option you can use Netflix.

They are just a TV, so nothing special, but because they kind of have everything it makes them big, but in fact, you can watch any e…

Service In Spring Boot For Beginners

Image
Service in spring boot is component where you usually place your business logic of your application. So service will be the class where mostly you will write Java code. Business logic can be anything for example, when user update profile, buying items, checkout, etc.

So here's an example of simple service in spring for user registration, login, update, and remove.

@Service
public class UserService{

@UserRepository
private UserRepository userRepository;

public User registration(User newUser){
return userRepository.save(newUser);
}

public User login(UserDto user){
return userRepository.findByUsername(user.getUsername());
}

public User update(Long id, User newUser){
User user = userRepository.findById(id).orElse(new User);
user.setUsername(newUser.getUsername());
user.setName(newUser.getName());
userRepository.save(user);
return user;
}

public void remove(Long id){
userRepository.deleteById(id);
}
}

To make a class as a service, you add a @Service annotation, and on the above code we are auto wiring Use…

Repository in Spring Framework For Beginners

Image
Repository in spring is classes use to interact with database, that is simplify as CRUD (create, read, update and delete). To make a class repository, you add a @Repository annotation to the interfaces, but you also need to extends one of spring repository class that is CrudRepository, JpaRepository or PagingAndSortingRepository. And you need to mention your DAO, for example.

@Repository
public interface UserRepository extends JpaRepository<UserDao, Long> {
}

@Entity
class UserDao{
private Long id;
private String name;
}

Actually that's enough, now you can use your repository anywhere you want, just inject that component, for example to find a user you can use it.


@Controller
@RequestMapping("/user")
public Class UserController{
@Autowired 
private UserRepository userRepository;

@GetMapping("findAll")
public List<UserDao> allUser(){
return userRepository.findAll();
}
}

The above class is an example on how to get all user expose by endpoint "user/findAll".

Model In Spring Framework For Beginners

Image
Model in programming language is a representative of an object, so if you have a car object, you can define a car model, for example, car brand, car speed, car price, etc. In pseudo code you can create a car model, something like.

Class Car{
String brand;
Integer speed;
Float price;
}

That's called a model. Now in spring framework, you can add some annotation to your model, so that it can be integratted to you database, those model usually will be call as an entity, so the first thing is to set annotation to car class an @Entity annotation.

@Entity
Class car{
String brand;
Integer speed;
Float price;
}

But, that class should have at least an id it is recommended to have an id to whatever model you want create, so you must have an id field.

@Entitypublic class Car{ @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id;private String brand;private Integer speed;private Float price;}
Now, your entity is ready, but it useless since it doesn't have any public fiel…