Ebean Partial Column Selection

Okay, because of some reasons, I have to learn Java and choose a Java web framework for my next project. After seeing around, I choose playframework, and I am using MySQL for the database.

After reading some documentation, I use Evolution and Ebean for the ORM. And then I found a problem when using Ebean. It still returning all columns although I selected some columns with this method based on this documentation.

List<MyModel> getUser = MyModel.find.select("columnA, columnB").findList()

After searching some solutions on google, I found this solution. So you have to do it like this.

JsonContext jc = Ebean.json();
List<MyModel> getUser = MyModel.find.select("columnA, columnB").findList();
String allUser = jc.toJson(getUser);

But when you use this method, the type of result will be a string type, so do not forget using Json.parse() if you want to use it as an object.

Continue Reading

Compiling fprynt in Linux Mint 17.1 64bit

Hi,

If you are using Linux Mint 17.1 64bit and you want to compile this fprynt library, please open the CMakeLists.txt file and find these lines.


target_link_libraries(fprynt /usr/lib/libboost_python.so)
target_link_libraries(fprynt /usr/lib/libpython2.7.so)
target_link_libraries(fprynt /usr/local/lib/libfprint.so)

And change the library path.


target_link_libraries(fprynt /usr/lib/x86_64-linux-gnu/libboost_python.so)
target_link_libraries(fprynt /usr/lib/x86_64-linux-gnu/libpython2.7.so)
target_link_libraries(fprynt /usr/lib/libfprint.so)

But before doing this, please make sure that the library are exist.

Continue Reading

Phalcon Framework and Volt Templating

Why Phalcon?

Yes, because it’s fast and light.

But please remember, when you are using volt templating, you will find the problem when you want to add the attributes inside the textField() tag.

When you are not using volt, it should be like this.

echo $this->tag->textField(array("name", "class"=>"tes"));

But when you are using volt, from the documentation, you have to do like this.

{{ textField("name", "class":"tes") }}

But you will see this error.

Parse error: syntax error, unexpected '=>' (T_DOUBLE_ARROW) in /var/www/phalcon/cache/volt/%%var%%www%%phalcon%%app%%views%%signup%%index.volt.php on line 7

I’ve googled about this problem and found this link, but still no luck.

Finally, I found the solution. I tried to make an array for the attributes

{{ textField(["name", "class":"tes"]) }}

And it worked very well on the latest build (I am using version 2.0.7). 🙂

P.S: I hope this is not the one and only posting for this year 😛

Continue Reading

Twittshell

Selamat pagi..
Bertemu lagi dengan bung LinX saudara-saudara (gaya komentator yang lagi demam piala dunia)..Setelah kemaren kita ngotak-atik tampilan menjadi lebih seger dan lebih fresh bin free..Akhirnya kita ketemu lagi untuk sebuah sharing-sharing pengetahuan..hehehe
Yak, untuk kali ini, aQ akan ngebahas lagi tentang shell scripting lagi, yah karena nickQ LinX, jadi ya gak jauh-jauh dari linux *gak nyambung*..Tapi karena untuk membuat program ini diperlukan bash shell, jadi ya jangan pake csh, ksh, dll karena sintaxnya juga beda..
So..to the point aja ya..program kali ini adalah program sederhana yang berhubungan dengan jejaring sosial, yaitu twitter. Temen-temen pasti tahu apa itu twitter. Twitter adalah sebuah jejaring sosial yang isinya cuma update dan update status, tapi lebih formalnya ya disebut microblogging, karena di twitter kita bisa update status dan bisa ngeliat status orang yang kita follow atau ikutin..Nah, Setelah aQ nyoba otak-atik seharian,

Continue Reading