Terjadi keanehan tatkala diriku telah menyambangi XCode 5 bersamaan dengan Cocos2d-x
*Dan mengapa sekarang menggunakan bahasa Indonesia? Ulala, suka-suka saya lah, haha*
Ceritanya saya baru nginstall XCode 5 (sebelumnya pakai XCode 4). Pas compile projek lagi tiba-tiba.. tuing tuing tuing, muncul error "Apple Mach-O Linker (Id) bla bla bla..." diiringi dengan error-error lainnya.
Kalau nggak salah dulu pernah kejadian gini juga, langsung aja deh cari di Build Settings projectnya bagian Apple LLVM 5.0 - Language - C++ nya diganti dikit
C++ Language Dialect : GNU+98 [-std=gnu++98]
C++ Standard Library: libstdc++ (GNU C++ standar library)
compile lagi.. dan bisa! Alhamdulillah...
Kayaknya library Cocos2d-x ada sintaks yang nggak sesuai dengan penulisan C++ yang sekarang gitu ya?
Tuesday, October 29, 2013
Thursday, October 24, 2013
Less Ordinary Review Maverick OSX 10.9
After the shocking release announcement of freely available of the latest version of OSX, I hurriedly download this OS. Of course I was using my campus Wi-Fi, my mobile connection can’t download 5 gigs for several hour, it would take weeks. After that installing the OS for about one and a half hour, and here it is, the Maverick arrived at my Macbook.
Oh by the way, I’ve just bought Mountain Lion for $20 five months before. Maverick is free, and you can upgrade it from Snow Leopard. And what does it means? It means if I quite patient I could upgrade my OS, without buying it! Haha! Damn it Apple!
Oh, back to the review. If you are following tech magazine like Mashable, or Cult of Mac, or Engadget, you name it, you’ll get the review is about several things of Apple has told to public about this new OS. Let those big magazine fellas review about it, I’ll review about the other things then.
Oh by the way, I’ve just bought Mountain Lion for $20 five months before. Maverick is free, and you can upgrade it from Snow Leopard. And what does it means? It means if I quite patient I could upgrade my OS, without buying it! Haha! Damn it Apple!
Oh, back to the review. If you are following tech magazine like Mashable, or Cult of Mac, or Engadget, you name it, you’ll get the review is about several things of Apple has told to public about this new OS. Let those big magazine fellas review about it, I’ll review about the other things then.
1. Looking Good Trackpadish Gesturish
Since the release of Lion, Apple introduce Launchpad that using gigantic pinch (it’s involving 4 or more finger, that’s why it was gigantic) in and out at your trackpad. But it felt unnatural for me. It was a little gesture pinch in and the Launchpad jumps in.But unnatural no more! Because you can hold your pinch a little longer to see the Launchpad blurring in!![]() |
| It useful for those minutes of boring moments. |
And also it happened for pinching out. And I
love the inertia motion when you did that. Wooosh, those windows fly away to
the sides.


Thanks goodness the trackpad didn’t become DVORAK as well (is that exist?), and I can delete add the US’s QWERTY layout. And everything back to normal.
When I hover Twitter’s “follow” button of Twitter’s app the yellow box showing the information of follow status. And when I move to other apps using Cmd+Tab, that yellow box still there! Weird.. maybe it’s Twitter fault..
2. Blurring Dock Background
Following its sister OS, iOS, the effect of blurring is come across Maverick as well. This looks nice.
3. Transparent Foldering
Also like the iOS. I’ve afraid that it would be that “flying into the folder” effect. That would be scary effect for big screen. Fortunately Apple keep those sliding effect, but say goodbye to fabric-ish skeumorphic. Don’t get me wrong, I loved that background as well, but this one looks nice.
But
Holy Cow! DVORAK!
The installation was finished, and I want to type around at Spotlight, when suddenly… “What the heck? Since when it’s ASDF become AEOU?” That’s strange, the keyboard layout was Romaji!Thanks goodness the trackpad didn’t become DVORAK as well (is that exist?), and I can delete add the US’s QWERTY layout. And everything back to normal.
It’s still there
I love to move around between apps (mind my multitasking), and something weird is happened.When I hover Twitter’s “follow” button of Twitter’s app the yellow box showing the information of follow status. And when I move to other apps using Cmd+Tab, that yellow box still there! Weird.. maybe it’s Twitter fault..
hover it
move to iTunes, still there!
Maverick feels good.
Beside of it's cheap price (huh, it's freeeee).... I don’t know, it just felt cozy and more responsive… till now. Maybe a week later I scream in honest for the spite of lag animation through my small free space hardisk (Yes, it’s almost full. Thanks to my University’s assignments, and great downloaded-but-never-read-e-books). Hope you feel cozy about it like I do. Because it’s no longer big cat, but it’s a beach, that named after the dog. So radical, eh?Wednesday, October 23, 2013
Today's Lab Of Cocos2d-X
I was experimenting to deploy my Cocos2d-X’s projects lab to my Android device. Surprisingly there were so many obstacles and ridiculous things bumped me. Here are 4 of them:
cocos2d: WARNING: Image (3000 x 500) is bigger than the supported 2048 x 2048
But the compiler won’t accept ~CCLayer();. Hmmh… I don’t know why. If you know about this issue please tell me ASAP.
So that’s it! Enjoy your journey of Cocos2d-X!
Oh by the way, I am taking Game Programming course and using LibGDX. This engine is so simple and powerful. Have you ever using it? It’s in JAVA. Give it a try; you’ll love it too.
1. Compile configuration to Android
The configuration itself is not a piece of cake, especially on my newbie mind. Here are the step that you have to doPart 1. Eclipse configurations
- Make sure you have your project (of course you have, you won’t compile it before you have something to compile, will you?)
- Import them into your Eclipse (the proj.android folder)
- Import Cocos2d-X library for Android. It’s in [Your Cocos2d-X folder]/cocos2dx/platform/android/java.
- Right click your project (NOT THE LIBRARY), and select properties. Select “Android” tab and make sure you have ticked the target.
- Open project.properties, set the “target” to your target platform. For example I make mine this

- Open AndroidManifest.xml, and set the android:minSdkVersion to 14
- Right click your project folder, select “Android Tools” > “Fix Project Properties
Part 2. Compile commands configurations
- Go to your project’s android folder (proj.android folder).
- Open “build_native.sh” in your favorite text editor and at the top add this line
NDK_ROOT="/Users/YOURUSERNAME/Development/android-ndk-r8e"
a friend of mine told me it was unnecessary. Well it is necessary for Mac (I don’t know how to configure NDK_ROOT variable in Bash for default, but anyway, it works).
Notes: As you can see I am using r8e version of android NDK. This is the only version that can compile Cocos2d-X 2.1.4 right. - Head to “jni” folder
- Open “Android.mk” file. Make sure you have put all your class in LOCAL_SRC_FILES (it will contain HelloWorld and AppDelegeate class for default). This is the example from me:
LOCAL_SRC_FILES := hellocpp/main.cpp \ ../../Classes/AppDelegate.cpp \ ../../Classes/Ball.cpp \ ../../Classes/GameScene.cpp \ ../../Classes/MenuScene.cpp \ - Open “Application.mk” and add this line for targeting your desired platform
APP_PLATFORM := android-17
Part 3. Compiling
- Back to Eclipse. Select your folder, and run it. It will take a moment, so grab a snack or coffee. BEWARE OF ERROR (Google is your friend. No. Best Friend. No. It's your wife).
- Select your target device and scream in joy because you’ve deployed your app in your device.
2. Directly instantiate the initialization
So I have this game that need background of white. I simply add white layer firstCCLayerColor *layerWithColor; layerWithColor->create(ccc4(255, 255, 255, 255)); addChild(layerWithColor);Well, that’s looks okay. It’s compile smoothly on my Mac target, but no in Android target. The error is trivial and pops up when you run the game. You know what? You have to do this instead:
CCLayerColor *layerWithColor = CCLayerColor::layerWithColor->create(ccc4(255, 255, 255, 255)); addChild(layerWithColor);That's insane!
3. No images in my device
So I was using a sprite sheet that sized 3000x500. But unfortunately in my device it won’t drawn and shown as black box instead. Why? Because the LogCat told me that:cocos2d: WARNING: Image (3000 x 500) is bigger than the supported 2048 x 2048
4. Configuring path to Box2D
One of my experiment using Box2D. To compile it you have to tweak “Android.mk” file and add Box2D in your LOCAL_C_INCLUDES. I’ve found mine like this:LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes \
$(LOCAL_PATH)/../../../../external/Box2D \
UNSOLVED
Can’t call parent destructor from override
I’ve try to make game in Box2D and it require manual deallocation being called in destructor. In Mac target, I can write it like thisGameScene::~GameScene(){
delete _world;
_body = NULL;
_world = NULL;
CCLayer::~CCLayer();
}
But the compiler won’t accept ~CCLayer();. Hmmh… I don’t know why. If you know about this issue please tell me ASAP.
So that’s it! Enjoy your journey of Cocos2d-X!
Oh by the way, I am taking Game Programming course and using LibGDX. This engine is so simple and powerful. Have you ever using it? It’s in JAVA. Give it a try; you’ll love it too.
Saturday, September 28, 2013
C++: Header Guard
Pas praktikum PBO dan lagi pakai C++ ada praktikan yang pake #include dan error. Katanya ada kelas yang redeclare! Ooh dan ternyata harus pakai Header Guard supaya nggak error.
Dalam C++ untuk pembuatan kelas dibagi menjadi dua, yakni header dan implementasi. Misalnya kita memiliki kelas-kelas sebagai berikut:
Kendaraan
Mobil
Motor
Berarti kita akan membuat 6 file seperti ini:
Kendaraan.h
Kendaraan.cpp
Mobil.h
Mobil.cpp
Motor.h
Motor.cpp
Misalkan Motor dan Mobil masing-masing inherit Kendaraan. Berarti kedua kelas tersebut harus di "include" ke file Mobil dan Motor kan? Nah disini masalahnya
Dimisalkan kita memiliki kelas Kendaraan sebagai berikut
Kendaraan.h
Kendaraan.cpp
Dan kelas anaknya adalah sebagai berikut
Motor.h
Motor.cpp
Mobil.h
Mobil.cpp
Ketika di compile, yang terjadi adalah error seperti ini
"redefinition of class"! Berarti kita mendefinisikan kelas lebih dari sekali. Ya, soalnya kita sudah mendefiniskan kelas Kendaraan di Motor (dengan #include "Kendaraan.h") kemudian di-include lagi di Mobil, walhasil jadinya dua kali include.
Nah karena itulah kita memerlukan Header guard.
Nah, kita bisa membuat Header Guard dengan memberikan directive berikut di awal tiap header
directive yang kita tulis menyatakan jika belum didefinisikan (#ifndef) maka definisikan (#define) kelas kita. Jangan lupa beri #endif di akhir
beri header guard ini di setiap header kelas yang kamu buat. Dengan pemberian header guard ini kalau kamu #include kelas lebih dari sekali nggak ada lagi issue redefinition of class
referensi:
http://www.learncpp.com/cpp-tutorial/110-a-first-look-at-the-preprocessor/
http://en.wikipedia.org/wiki/Include_guard
http://en.wikipedia.org/wiki/Header_file
Dalam C++ untuk pembuatan kelas dibagi menjadi dua, yakni header dan implementasi. Misalnya kita memiliki kelas-kelas sebagai berikut:
Kendaraan
Mobil
Motor
Berarti kita akan membuat 6 file seperti ini:
Kendaraan.h
Kendaraan.cpp
Mobil.h
Mobil.cpp
Motor.h
Motor.cpp
Misalkan Motor dan Mobil masing-masing inherit Kendaraan. Berarti kedua kelas tersebut harus di "include" ke file Mobil dan Motor kan? Nah disini masalahnya
Case Study
Dimisalkan kita memiliki kelas Kendaraan sebagai berikut
Kendaraan.h
//Kendaraan.h
class Kendaraan{
private:
int kecepatan;
public:
Kendaraan();
~Kendaraan();
void setKecepatan(int kecepatan);
int getKecepatan();
};
Kendaraan.cpp
Kendaraan::Kendaraan(){
}
Kendaraan::~Kendaraan(){
}
void Kendaraan::setKecepatan(int kecepatan){
this->kecepatan = kecepatan;
}
int Kendaraan::getKecepatan(){
return this->kecepatan;
}
Dan kelas anaknya adalah sebagai berikut
Motor.h
//Motor.h
#include "Kendaraan.h"
class Motor:public Kendaraan{
private:
public:
Motor();
~Motor();
};
Motor.cpp
#include "Motor.h"
Motor::Motor(){
}
Motor::~Motor(){
}
Mobil.h
//Mobil.h
#include "Kendaraan.h"
class Mobil:public Kendaraan{
private:
public:
Mobil();
~Mobil();
};
Mobil.cpp
#include "Mobil.h"
Mobil::Mobil(){
}
Mobil::~Mobil(){
}
Dan program main nya seperti ini
Main.cpp
#include <iostream>
#include "Motor.h"
#include "Mobil.h"
using namespace std;
int main(string args[]){
Motor motor;
Mobil mobil;
return 0;
}
Ketika di compile, yang terjadi adalah error seperti ini
In file included from Mobil.h:1,
from Main.cpp:4:
Kendaraan.h:2: error: redefinition of ‘class Kendaraan’
Kendaraan.h:2: error: previous definition of ‘class Kendaraan’
"redefinition of class"! Berarti kita mendefinisikan kelas lebih dari sekali. Ya, soalnya kita sudah mendefiniskan kelas Kendaraan di Motor (dengan #include "Kendaraan.h") kemudian di-include lagi di Mobil, walhasil jadinya dua kali include.
Nah karena itulah kita memerlukan Header guard.
Header Guard
Header guard, atau Include Guard merupakan directives, yaitu perintah yang diawali # dan diakhiri dengan baris baru.Nah, kita bisa membuat Header Guard dengan memberikan directive berikut di awal tiap header
#ifndef KENDARAAN_H
#define KENDARAAN_H
//Kendaraan.h
class Kendaraan{
private:
int kecepatan;
public:
Kendaraan();
~Kendaraan();
void setKecepatan(int kecepatan);
int getKecepatan();
};
#endif
directive yang kita tulis menyatakan jika belum didefinisikan (#ifndef) maka definisikan (#define) kelas kita. Jangan lupa beri #endif di akhir
beri header guard ini di setiap header kelas yang kamu buat. Dengan pemberian header guard ini kalau kamu #include kelas lebih dari sekali nggak ada lagi issue redefinition of class
referensi:
http://www.learncpp.com/cpp-tutorial/110-a-first-look-at-the-preprocessor/
http://en.wikipedia.org/wiki/Include_guard
http://en.wikipedia.org/wiki/Header_file
Tuesday, September 24, 2013
Sebuah Tugas SI: Frameworks, Business Process, dan Jobs
Mata kuliah Sistem Informasi mengajarkan peran sebuah software dalam sebuah sistem. Bukan berarti sebuah software adalah sistem ya! Software merupakan alat dalam "sistem informasi" yang saling terkoneksi dalam sebuah institusi.
Ternyata Sistem Informasi menarik untuk dikaji lebih mendalam. Saya baru tahu bahwa perusahaan dalam menerapkan sistem informasi menggunakan framework. Framework adalah bagan rancangan penggunaan sistem informasi yang teratur. Ahli-ahli sistem informasi telah menerapkan framework-framework dan digunakan luas oleh perusahaan-perusahaan besar.
Saya kurang begitu ngeuh juga sih... Saya kurang bisa menangkap cepat kalau mata kuliahnya sangat teori. Tapi begitu lah ya pokoknya... mudah-mudahan kamunya nangkep.
Berikut ini adalah tugas mata kuliah SI untuk mencari istilah-istilah yang ada dalam SI.
Just check it out
Ternyata Sistem Informasi menarik untuk dikaji lebih mendalam. Saya baru tahu bahwa perusahaan dalam menerapkan sistem informasi menggunakan framework. Framework adalah bagan rancangan penggunaan sistem informasi yang teratur. Ahli-ahli sistem informasi telah menerapkan framework-framework dan digunakan luas oleh perusahaan-perusahaan besar.
Saya kurang begitu ngeuh juga sih... Saya kurang bisa menangkap cepat kalau mata kuliahnya sangat teori. Tapi begitu lah ya pokoknya... mudah-mudahan kamunya nangkep.
Berikut ini adalah tugas mata kuliah SI untuk mencari istilah-istilah yang ada dalam SI.
Just check it out
Subscribe to:
Posts (Atom)


