Wysmedia.com

Icon

~ We make IT easy for you ~

Grails and Mysql InnoDB

Here is a little tips to let grails create using innodb engine on mysql, everytime grails create a domain/table.

1
2
3
4
5
6
7
 dataSource {
      pooled = true
      driverClassName = "com.mysql.jdbc.Driver"
      username = "wysmedia"
      password = "password"
      dialect = org.hibernate.dialect.MySQLInnoDBDialect
 }

dialect = org.hibernate.dialect.MySQLInnoDBDialect that’s the main idea to set mysql using innodb. With InnoDB you can use service transaction or database transaction

Safari 4(beta) = Full of Craps !

http://corymathews.com/?p=260 says that Safari 4 (beta) is full of crap. I just uninstalled few minutes ago.
Read the rest of this entry »

Firebug console

Just playing with Firebug and instead of displaying “annoying” alert, we can use console.log(”your object”);

for example

var a = $("#test").val();
console.log(a);
var b = $("inputA");
console.log(b);

easy ? :)

Nice ICal Calendar with JQuery

Stefanoverna.com write how to create a nice looking calendar like those in ICal using Jquery. It looks good :)

on
this web

Open Flash Chart, a simple Chart for your web

j pimmel wrote : how to make open flash cart work

Open flash cart, is flash based cart that helping you to build graphs on your web page, you can use any programming language even using javascript :) It is small and free to use

More information about Open Flash Cart go to this page: http://teethgrinder.co.uk/open-flash-chart/

Using Liquibase (tutorial)

Liquibase is the powerful database migration that available for free. For long time I am envy of rails database migration system. It is nice and have rich features.

Few weeks ago, I found that Grails has Liquibase plugin (there are 2, liquibase and autobase). I tried both plugins and autobase won my heart because the simplicity they offer (not using XML is the biggest advantages, for me at least). Liquibase however build as stand alone java application that you can run with any operating system that support java.

Here I will show you how to configure and using Liquibase on command line, so you can apply whether you are using php, python, or others programming language/framework

Read the rest of this entry »

Blueprintcss – Small Tutorial

Blueprintcss is a css framework that help web designer to create a good and tidy web pages.

Blueprintcss using 950px container width. Divide by 24 column by default…

Read the rest of this entry »

Checkbox of chaos

Yesterday I got a headache problem with a checkbox. I wrote like this on GSP

1
2
3
4
5
6
<g:form action="save">
... table ... 
<g:checkBox name="myCheckbox" value="" />
... other element ... 
<input type='submit' value='Save'/>
</g:form>

did you know what the happened ? myCheckbox always returned empty or null value everytime I saved the form. I thought Grails has bug at first, I did check and create a checkbox using scaffold and I found that value=”" makes the null value everytime I saved the form
The solution was simple enough:

1
2
3
4
5
6
<g:form action="save">
... table ... 
<g:checkBox name="myCheckbox"/>
... other element ... 
<input type='submit' value='Save'/>
</g:form>

Just eliminate value=”" and it all solved. I learned that using value=”somethingHere” can be useful if we want to save a value into our database. I hope my tricks can save you from headache. Be aware of checkbox .. hahaha…

Trapping Server Error

Sometimes we found that our server are not behave normal, like there are bugs or server produce runtime exception (or error 404 etc). Those exception are not returned by ajax. So it will keep hidden and seems nothing happened. But if you have firebug installed, you can found that there are errors happened from your server.

So here is how you can trap all errors and displayed on your screen (without using firebug).

This example works on grails main layout (but you can use this tips on any programming language, just put this code on main layout). My code using Jquery and JQalert to display the error

1
2
3
4
5
6
7
$(document).ready(function(){
                $(document).ajaxError(function(event, request, setting){
                    var re = /&lt;br\/&gt;|&lt;br&gt;/g; // for replacing all &lt;br/&gt; with empty string in error 404
                    var txt = request.responseText.replace(re,"");
                    jqalert(txt,"Server Error");
                });
});

PasteBin.com , copy and paste

Hi, I found this website is pretty usefull. http://pastebin.com

today i had chat with my patner. She has bad internet connection so the IM turn on and off. sometimes i have to write and copy paste the previous text again and again.

Until i found this nice web, everything going to be fun. I can explain the code one by one and there are code formatting with color / syntax highlighting. How it work .. just type your code in there and choose the syntax. It will format your syntax and you can send to your patner the url.

here is the example: http://pastebin.com/f6e23351

have fun !

and happy valentine day !