Install and trying Slimframework

Hi and hallo. Long time I not write article again and now I back again with new article. Previously I using and learning laravel, and now Laravel has reached version 5. For now why I choose slim and not laravel again?

Because I want to use framework with small size and simple. Laravel is big framework (framework full stack). Laravel has many functions and features, but all unused by me and the features it becomes useless if not used.

So now I want share how to install and trying slimframework. The first, you must install composer. Follow this link https://getcomposer.org/download/. After you success intall composer, now open slimframework site and follow installation guide from there. Or you can open cmd if you’re using windows and open terminal if you using Linux/unix and follow this instruction:
(more…)

Qt toolbar toogle view action

Hello now I want share how to create toolbar view action, that mean is to show and hide the toolbar from the menubar. You can look the apps like this:

Qt toolbar apps
Figure 1. Qt toolbar apps

Ok now create the source code, first you must create a new project (example name project is test):

Project structure
Figure 2. Project structure

Now open your main_window.h and put this source:
(more…)

Qt Form Login. (Parent Window is Disabled After Child Window Login Success)

Hello, Now I want share how to use Qt, previously is using Wxwidget and now I want share using Qt (especially Qt5). Form login will look like this:

Form Login apps
Figure 1. Form Login Application

Okay to create the application like the picture above, follow this instructions:
First open your Qt creator and create new Project (based Qt widgets application) and give the name of the application with the name of the “FormLogin”.
(more…)

Qt struct type redefinition/redefinition header

If you a new Qt programmer like me, may you ever get frustrated with this error

error: C2011: ‘sockaddr’ : ‘struct’ type redefinition

I got this error when I use the header WinSock2.h. There many people from http://stackoverflow.com suggest to include Winsock2.h before windows.h. So the code should be like this:

#include <Winsock2.h>
#include <windows.h>

May be this code is work for you, but if you are using mongodb c++ driver with Qt and must include multiple Winsock2.h in different header, you always get error “type redefinition”.
Qt error type redefinition
Still confused? Look this code:
(more…)

Menonaktifkan autostart service mongodb di Ubuntu

Lama tak posting, sekarang saya akan memposting bagaimana cara menonaktifkan autostart service mongodb di ubuntu. Kenapa harus dimatikan?

Jawabannya si simpel banget, untuk mengurangi pemakaian memory ram, jadi buat apa service mongodb dijalanin kalau sedang tidak dipakai. Lebih baik service-nya dijalankan saat hendak dipakai saja.

Oke mungkin kalian sudah tau cara mematikkan autostart di ubuntu bisa memakai cara ini:


$ sudo update-rc.d -f mongodb remove

Memang benar untuk mematikan service program-program tertentu bisa memakai perintah tersebut. Sebenarnya perintah tersebut melakukan penghapusan script yang tersimpan di /etc/rc0.d/. Atau bisa juga menggunakan program-program yang telah saya bahas sebelumnya disini untuk mematikan autostart service tersebut. Tetapi mongodb ini mempunyai perlakuan khusus untuk mematikan autostart service-nya, kalau anda tidak percaya, coba saja setelah melakukan perintah di atas restart ubuntu anda lalu jalankan perintah ini:


$ sudo service mongodb status
mongodb start/running, process 6856

Dan lihatlah ternyata perintah yang telah kita lakukan sebelumnya tidak berhasil dan ternyata mongodb masih saja running secara otomatis saat ubuntu kita dihidupkan kembali. Lalu bagaimana cara agar menonaktifkannya? Caranya adalah dengan merubah script yang terletak di /etc/init/mongodb.conf. Bukalah script itu dengan perintah berikut ini:


$ sudo nano /etc/init/mongodb.conf

Lalu rubah bagian ini:


start on runlevel [2345]
stop on runlevel [!2345]

Menjadi seperti ini
# start on runlevel [2345]
stop on runlevel [!2345]

Lalu simpan dan coba untuk merestart ubuntu anda kembali. Saya yakin pasti akan berhasil.. 😀

Wxwidgets. Simple application using wxribbon and wxauinotebook.

Okay now I am going to make an application that looks like this:

Wxwidgets. Simple application using wxribbon and wxauinotebook.

Looks pretty right? And how to create application look like that?

For the answer the first open your editor (In this tutorial I using codeblocks) and create a project with name you like. Example I create with name Test then add new file with name “Frame.h”
(more…)