Grails MyISAM vs InnoDB

MySQL is a popular choice of database for many developers. It’s open source, easy to install, stable, and very fast. However, MySQL comes with several storage engine and you need to decide which one to choose. The two most popular are:

  • MyISAM – this is the default storage engine for MySQL prior to version 5.5. I believe this is the fastest storage engine of all, but the drawside is it does not support transactions.
  • InnoDB – this is not as fast as MyISAM, but it support transactions. This is the most popular among Java/Grails developers.

Edit DataSource.property and specify the dialect property. To use MyISAM, your configuration will look like this:

dataSource {
    pooled = true
    driverClassName = "com.mysql.jdbc.Driver"
    dialect = 'org.hibernate.dialect.MySQL5Dialect'
}
...

To use InnoDB, your configuration should look like:

dataSource {
    pooled = true
    driverClassName = "com.mysql.jdbc.Driver"
    dialect = 'org.hibernate.dialect.MySQL5InnoDBDialect'
}
...

Display driver stopped responding and has recovered

This is a common issue. It is a Windows issue. Here is Microsoft’s article.

Here is a work around:

The following is a way to extend the time Windows waits before it restarts the video. It doesn’t “fix” the original issue, but it should prevent most, if not all, of the TDR’s from happening.

Note: If you are not familiar with editing the registry, I wouldn’t recommend changing the TDR. It involves creating new keys and values, which have to be exactly the same as the instructions, even the capitalization.
1.Click Start, Run, and type “regedit”
2.Navigate to: HKey Local Machine\System\CurrentControlSet\Control\
3.Locate the “GraphicsDrivers” key, and right-click on it.
4.Click “New”at the top of the page and create “DWORD Value”(for 32bit) or “QWORD” (for 64bit)
5.Label the new value “TdrDelay”
6.Double click on TdrDelay, and enter the number of seconds you want Windows to wait before timing out. The default is two seconds, so start out with 8, and you can make it a few seconds longer if it doesn’t fix the issue.
7.Close the registry editor and reboot the computer.

Java 7 Mail Server Connection Failed With ‘java.net.SocketException: Permission denied: connect.’ Exception

Use this

Use the '-Djava.net.preferIPv4Stack=true' JVM system property to help enable support for IPv4 on Java 7.

Add Expire date on PDF

function Expire()
{
var rightNow = new Date();
var beginDate = new Date(“March 23, 2014 00:00:01″);
var endDate = new Date(“March 28, 2014 23:59:59″);
if (rightNow < beginDate || rightNow > endDate)
{
app.alert(“Expired”, 0, 0);
this.closeDoc()
}
}
Expire();

Open DeviceAdmin from adb shell

adb shell am start -a android.intent.action.MAIN -n com.android.settings/.DeviceAdminSettings