Good news for Eclipse users is that all new builds of Eclipse 3.7.1, 3.8 and 4.2 will now fully support Java 7.
Earlier development of Java7 support in Eclipse was being done in BETA_JAVA7 branch which now has been fully merged into the HEAD and the R3_7_maintenance branch.
So the implication is that if you want Java7 support, you need to move to the latest builds of Eclipse Indigo (3.7.x) or higher. Cannot use Eclipse Helios (3.6.x) or even the initial versions of Indigo as the older JDT & Core packages do not understand the new Java7 features as Eclipse uses its own compiler and the ones built into older versions of Eclipse do not support Java 7. Also, as noted in the Project Plan For Eclipse Project, version Helios, support for Java 7 is deferred and decoupled from the 3.6 release since Java 7 release will be after the official release of 3.7.
Note that you will need to download a 3.7 maintenance build (>= M20110729-1400), a 3.8 build (>= I20110729-1200), a 4.1 maintenance build (coming soon) or a recent 4.2 build (>= I20110729-0200) to get Java7 support in Eclipse.
Friday, July 29, 2011
Java 7 GA release finally available
Java 7 was finally release into the wild today and made "GA" - Generally Available!
Download the latest from here.
Here's a very high level list of the new features/changes that made into Java7:
VM
Language
Core
Internationalization
I/O & Networking
Security & Cryptograpphy
Database Connectivity
Client
Web
Management
Pheww - that was a long list to say the least ;) No wonder the release date for Java7 was a very difficult moving target.
I will be putting out a detailed post on each of the features soon - so keep watching this space!
Download the latest from here.
Here's a very high level list of the new features/changes that made into Java7:
VM
- Support for dynamically-typed languages using the new InvokeDynamic instructions
- Strict class-file checking
Language
- Small language enhancements from Project Coin like Strings in switch statements, try-with-resources statements, diamond operator, etc.
Core
- Upgrade class-loader architecture to avoid deadlocks in non-hierarchical class-loader topologies
- Concurrency and collections updates in form of a lightweight fork/join framework, flexible and reusable synchronization barriers, transfer queues, concurrent linked double-ended queues, and thread-local pseudo-random number generators
Internationalization
- Support for Unicode 6.0
- Separate handling of locales to separate formatting locales from user-interface language locales
I/O & Networking
- New APIs for filesystem access, scalable asynchronous I/O operations, etc
- New NIO.2 filesystem provider for zip and jar files
- API for the Stream Control Transmission Protocol (SCTP) on Solaris
- SDP (Sockets Direct Protocol) support for reliable, high-performance network streams over Infiniband connections on Solaris and Linux
- Networking code modified to use the Windows Vista IPv6 stack, when available, in preference to the legacy Windows stack
- Support for Transport Layer Security version 1.2
Security & Cryptograpphy
- Implementation of the standard Elliptic Curve Cryptographic (ECC) algorithms to allow Java programs to support it out of the box
Database Connectivity
- JDBC 4.1 and Rowset 1.1
Client
- New Java2D graphics pipeline based upon the X11 XRender extension, which provides access to much of the functionality of modern GPUs
- New platform APIs for features originally implemented in the 6u10 release namely Translucent and shaped windows, and heavyweight/lightweight component mixing
- Cross-platform Nimbus look-and-feel for Swing
- SwingLabs JXLayer component decorator added to the platform
- New Gervill sound synthesizer created and made available
Web
- Upgrade of the components of the XML stack to the most recent stable versions: JAXP 1.4, JAXB 2.2a, and JAX-WS 2.2
Management
- Enhanced MBeans to report the recent CPU load of the whole system, the CPU load of the JVM process, and to send JMX notifications when GC events occur
Pheww - that was a long list to say the least ;) No wonder the release date for Java7 was a very difficult moving target.
I will be putting out a detailed post on each of the features soon - so keep watching this space!
Thursday, July 21, 2011
Conditional Breakpoints in Eclipse
If you have a big data set that you are using to test changes that apply to specific scenarios or rows, Eclipse conditional breakpoints can help to make life easier and simpler.
In Debug View (obviously!), right-click on the breakpoint that you want to make conditional and in the window that opens up, check "Enabled" box and then the "Conditional" box. This enables the textarea below it where you can enter any valid java expression which should trigger this breakpoint when true.
Optionally, you can also check the "Hit count" box and enter a positive number to make this breakpoint trigger after that many number of iterations.
In Debug View (obviously!), right-click on the breakpoint that you want to make conditional and in the window that opens up, check "Enabled" box and then the "Conditional" box. This enables the textarea below it where you can enter any valid java expression which should trigger this breakpoint when true.
Optionally, you can also check the "Hit count" box and enter a positive number to make this breakpoint trigger after that many number of iterations.
Wednesday, May 25, 2011
Change format of Date displayed in SQL Developer
To change the format of Date column displayed in SQL Developer worksheets (output of SQL queries) do the following:
- Select Tools > Preferences
- Expand the Database section
- In the NLS Date format field, enter the desired date format as supported by Oracle
Tuesday, April 5, 2011
Restore MS SQL Server Backup file
Recently I was faced with a dilemma - a friend of mine had a M$ SQL Server backup file and wanted me to extract some data from it. Since I work on Ubuntu & LAMP stack, I had to grab hold of a Win7 laptop and then follow the below steps.
To restore a database you need to do three things:
Assume: For this example, the backup file is C:\Backups\DB_Backup_20110131.bak
Step 1: Install MS SQL Server
Go to Micro$oft site using the direct link http://www.microsoft.com/express/Database/I-nstallOptions.aspx and download and install the most appropriate version of SQL Server Express.
Step 2: Interrogate Backup File
This will return something like the below set of rows which represent the internal logical composition of the backup file:
Step 3: Restore from Backup File
To restore a database you need to do three things:
- Install MS SQL Server Express
- Interrogate the backup file to find the logical file names it contains
- Restore the file into the appropriate database
Assume: For this example, the backup file is C:\Backups\DB_Backup_20110131.bak
Step 1: Install MS SQL Server
Go to Micro$oft site using the direct link http://www.microsoft.com/express/Database/I-nstallOptions.aspx and download and install the most appropriate version of SQL Server Express.
Step 2: Interrogate Backup File
RESTORE FILELISTONLY FROM DISK = 'C:\Backups\DB_Backup_20110131.bak'
This will return something like the below set of rows which represent the internal logical composition of the backup file:
LogicalName PhysicalName Type FileGroupName Size MaxSize ------------------ ---------------------------- ---- ------------- --------- -------------- SourceDatabase_data C:\SqlServer\Src_DB_Data.mdf D PRIMARY 836461765 35184372080640 SourceDatabase_log C:\SqlServer\Src_DB_Log.ldf L NULL 91592723 35184372080640
Step 3: Restore from Backup File
RESTORE DATABASE Destination_DB
FROM DISK = 'C:\Backups\DB_Backup_20110131.bak'
WITH
REPLACE, -- Overwrite DB - if one exists
RECOVERY, -- Use if this is the only file to recover
STATS = 10, -- Show progress (every 10%)
MOVE 'SourceDatabase_data' TO 'C:\SqlServer\Src_DB_Data.mdf',
MOVE 'SourceDatabase_log' TO 'C:\SqlServer\Src_DB_Data.mdf'
Array Equality in JUnit
Till JUnit4.2.*, the only way to compare equality of arrays was to use the following snippet of code:
JUnit4.3.* added the assertArrayEquals methods but surprisingly omitted a method to compare arrays of primitive doubles so, one had to fall back to the above mentioned way to compare them.
This important feature was added in JUnit4.6 so if you are using that or a later version, you can do the following:
The advantage with using the assertArrayEquals method over the previous method is that this method clearly indicates the first element which differed. For example, when the below basic test is run, it gives the error message:
Here is a sample class file showing implementation of the above test:
assertTrue(java.util.Arrays.equals(primitiveArray1, primitiveArray2));
JUnit4.3.* added the assertArrayEquals methods but surprisingly omitted a method to compare arrays of primitive doubles so, one had to fall back to the above mentioned way to compare them.
This important feature was added in JUnit4.6 so if you are using that or a later version, you can do the following:
assertArrayEquals(doubleArray1, doubleArray2, delta)where delta is the allowed tolerance.
The advantage with using the assertArrayEquals method over the previous method is that this method clearly indicates the first element which differed. For example, when the below basic test is run, it gives the error message:
arrays first differed at element [2]; expected:<2.3124> but was:<2.3224>
Here is a sample class file showing implementation of the above test:
import static org.junit.Assert.assertArrayEquals;
import org.junit.Test;
public class AAETest {
@Test
public void testAAEDouble() {
double[] da1 = {1.002d, 1.234d, 2.3124d, 3.91293d};
double[] da2 = {1.003d, 1.2345d, 2.3224d, 3.91293d};
double tol = 0.001d;
assertArrayEquals(da1, da2, tol);
}
}
Comparison of Intel Atom processors
With the various Atom Processor based netbooks and nettops being available these days, it becomes very difficult to decide which one to go for. Searching for the differences between the processors, I found the following comparison chart:
This is taken from the Intel Ark site.
Now based on the above table, the decision making process is slightly easier!
| Product Name | Max TDP | Cores / Threads | Intel® VT-x | Integrated Graphics | Intel® Turbo Boost Technology | Status |
|---|---|---|---|---|---|---|
| Intel® Atom™ Processor Z560 (512K Cache, 2.13 GHz, 533 MHz FSB) | 2.5 Watts | 1C / 2T | Yes | No | Launched | |
| Intel® Atom™ Processor Z550 (512K Cache, 2.00 GHz, 533 MHz FSB) | 2.4 Watts | 1C / 2T | Yes | No | Launched | |
| Intel® Atom™ Processor Z540 (512K Cache, 1.86 GHz, 533 MHz FSB) | 2.4 Watts | 1C / 2T | Yes | No | Launched | |
| Intel® Atom™ Processor Z530P (512K Cache, 1.60 GHz, 533 MHz FSB) | 2.2 Watts | 1C / 2T | Yes | No | Launched | |
| Intel® Atom™ Processor Z530 (512K Cache, 1.60 GHz, 533 MHz FSB) | 2 Watts | 1C / 2T | Yes | No | Launched | |
| Intel® Atom™ Processor Z520PT (512K Cache, 1.33 GHz, 533 MHz FSB) | 2.2 Watts | 1C / 2T | Yes | No | Launched | |
| Intel® Atom™ Processor Z520< (512K Cache, 1.33 GHz, 533 MHz FSB) | 2 Watts | 1C / 2T | Yes | No | Launched | |
| Intel® Atom™ Processor Z515 (512K Cache, 1.20 GHz, 400 MHz FSB) | 1.4 Watts | 1C / 2T | No | No | Launched | |
| Intel® Atom™ Processor Z510PT (512K Cache, 1.10 GHz, 400 MHz FSB) | 2.2 Watts | 1C / 2T | No | No | Launched | |
| Intel® Atom™ Processor Z510P (512K Cache, 1.10 GHz, 400 MHz FSB) | 2.2 Watts | 1C / 2T | No | No | Launched | |
| Intel® Atom™ Processor Z510 (512K Cache, 1.10 GHz, 400 MHz FSB) | 2 Watts | 1C / 1T | No | No | Launched | |
| Intel® Atom™ Processor Z500 (512K Cache, 800 MHz, 400 MHz FSB) | 0.65 Watts | 1C / 2T | No | No | Launched | |
| Intel® Atom™ Processor N570 (1M Cache, 1.66 GHz) | 8.5 Watts | 2C / 4T | Launched | |||
| Intel® Atom™ Processor N550 (1M Cache, 1.50 GHz) | 8.5 Watts | 2C / 4T | No | Yes | No | Launched |
| Intel® Atom™ processor N475 (512K Cache, 1.83 GHz) | 6.5 Watts | 1C / 2T | No | Yes | No | Launched |
| Intel® Atom™ Processor N470 (512K Cache, 1.83 GHz) | 6.5 Watts | 1C / 2T | No | Yes | No | Launched |
| Intel® Atom™ processor N455 (512K Cache, 1.66 GHz) | 6.5 Watts | 1C / 2T | No | Yes | No | Launched |
| Intel® Atom™ Processor N450 (512K Cache, 1.66 GHz) | 5.5 Watts | 1C / 2T | No | Yes | No | Launched |
| Intel® Atom™ Processor N280 (512K Cache, 1.66 GHz, 667 MHz FSB) | 2.5 Watts | 1C / 2T | No | No | Launched | |
| Intel® Atom™ Processor N270 (512K Cache, 1.60 GHz, 533 MHz FSB) | 2.5 Watts | 1C / 2T | No | No | Launched | |
| Intel® Atom™ Processor E680T (512K Cache, 1.60 GHz) | 4.5 Watts | 1C / 2T | Yes | Yes | No | Launched |
| Intel® Atom™ Processor E680 (512K Cache, 1.60 GHz) | 4.5 Watts | 1C / 2T | Yes | Yes | No | Launched |
| Intel® Atom™ Processor E665CT (512K Cache, 1.3 GHz) | 7 Watts | 1C / 2T | Yes | Yes | Launched | |
| Intel® Atom™ Processor E665C (512K Cache, 1.3 GHz) | 7 Watts | 1C / 2T | Yes | Yes | Launched | |
| Intel® Atom™ Processor E660T (512K Cache, 1.30 GHz) | 3.6 Watts | 1C / 2T | Yes | Yes | No | Launched |
| Intel® Atom™ Processor E660 (512K Cache, 1.30 GHz) | 3.6 Watts | 1C / 2T | Yes | Yes | No | Launched |
| Intel® Atom™ Processor E645CT (512K Cache, 1.0 GHz) | 7 Watts | 1C / 2T | Yes | Yes | Launched | |
| Intel® Atom™ Processor E645C (512K Cache, 1.0 GHz) | 7 Watts | 1C / 2T | Yes | Yes | Launched | |
| Intel® Atom™ Processor E640T (512K Cache, 1.00 GHz) | 3.6 Watts | 1C / 2T | Yes | Yes | No | Launched |
| Intel® Atom™ Processor E640 (512K Cache, 1.00 GHz) | 3.6 Watts | 1C / 2T | Yes | Yes | No | Launched |
| Intel® Atom™ Processor E625CT (512K Cache, 600 MHz) | 7 Watts | 1C / 2T | Yes | Yes | Launched | |
| Intel® Atom™ Processor E625C (512K Cache, 600 MHz) | 7 Watts | 1C / 2T | Yes | Yes | Launched | |
| Intel® Atom™ Processor E620T (512K Cache, 600 MHz) | 3.3 Watts | 1C / 2T | Yes | Yes | No | Launched |
| Intel® Atom™ Processor E620 (512K Cache, 600 MHz) | 3.3 Watts | 1C / 2T | Yes | Yes | No | Launched |
| Intel® Atom™ processor D525 (1M Cache, 1.80 GHz) | 13 Watts | 2C / 4T | No | Yes | No | Launched |
| Intel® Atom™ Processor D510 (1M Cache, 1.66 GHz) | 13 Watts | 2C / 4T | No | Yes | No | Launched |
| Intel® Atom™ processor D425 (512K Cache, 1.80 GHz) | 10 Watts | 1C / 2T | No | Yes | No | Launched |
| Intel® Atom™ Processor D410 (512K Cache, 1.66 GHz) | 10 Watts | 1C / 2T | No | Yes | No | Launched |
| Intel® Atom™ Processor 330 (1M Cache, 1.60 GHz, 533 MHz FSB) | 8 Watts | 2C / 4T | No | No | End of Life | |
| Intel® Atom™ Processor 230 (512K Cache, 1.60 GHz, 533 MHz FSB) | 4 Watts | 1C / 2T | No | No | End of Life |
This is taken from the Intel Ark site.
Now based on the above table, the decision making process is slightly easier!
Friday, February 25, 2011
Fix Magento Invalid model for shipping method
Since a couple of days I had been playing around with various shipping method modules and installing & uninstalling them to see which fit the requirements. Then when I tried to ship an order from the backend, I would just get the error and on checking the logs, saw the error message "Invalid model for shipping method:" with a huge unintelligible stack trace.
I suspected foul play between my custom theme and the various shipping methods modules that I had tried so I removed all of them and then tried but got the same result. On reinstalling the modules, I noticed that the configuration data was being pre-populated automatically and this got me thinking.
I poked around in the database and found that the configuration info is stored in the table core_config_data. In this table, I saw rows of data for all the modules that I was playing around with!
I deleted all these errant rows carefully, then cleared Magento cache and tried again and eureka! The order was processed & completed successfully!
I suspected foul play between my custom theme and the various shipping methods modules that I had tried so I removed all of them and then tried but got the same result. On reinstalling the modules, I noticed that the configuration data was being pre-populated automatically and this got me thinking.
I poked around in the database and found that the configuration info is stored in the table core_config_data. In this table, I saw rows of data for all the modules that I was playing around with!
I deleted all these errant rows carefully, then cleared Magento cache and tried again and eureka! The order was processed & completed successfully!
Wednesday, February 23, 2011
Set Default Quantity to 1 in Magento
By default, the quantity box on the product page is always blank and that is not very user friendly. It would be great if the box would be set to "1" by default .
Now this can be done without any programming - only through configuration changes in the backend as follows:
Abracadabra! The work is done - now products page quantity box is defaulted to 1.
Now this can be done without any programming - only through configuration changes in the backend as follows:
- Go to Admin Panel -> System -> Configuration -> Inventory-> Product Stock Options from the Menu
- Click on Add Minimum Qty button (next to Minimum Qty Allowed in Shopping Cart option)
- Choose Customer Group: ALL GROUPS as you want this to be applied to all users
- Enter 1 for Minimum Qty
- Save Config
Abracadabra! The work is done - now products page quantity box is defaulted to 1.
Saturday, January 22, 2011
Flying with Froyo on Vibrant
Froyo is now available for T-Mobile Samsung Galaxy S Vibrant, however to really get it, you need to have the charged to more than 75% and have the Samsung Kies Mini downloaded & installed. This release is not OTA and the full fledged Samsung Kies software dos not work for USA hence the Mini is required.
Downloading Kies downloader was quite fast, however the actual installer download took some time but the install was a breeze. Hooked up my phone to the laptop and was told that an update is available and I started it. The downloading took about 15 minutes and then the actual install another 7 minutes. Here are the steps:
Downloading Kies downloader was quite fast, however the actual installer download took some time but the install was a breeze. Hooked up my phone to the laptop and was told that an update is available and I started it. The downloading took about 15 minutes and then the actual install another 7 minutes. Here are the steps:
- Setup Vibrant as follows:
- Go to Menu > Settings > Applications and check the box beside "Unknown Sources"
- Go to Menu > Settings > Applications > USB Settings and select "Ask on connection"
- Download Samsung Kies Mini from Samsun website.
- Install Kies Mini
- Ensure that the battery on your phone is more than 75% charged
- Take a backup of your data from the phone
- Start Kies Mini and connect the phone to the PC
- On phone prompt, choose "Samsung Kies" as the connect method on the phone
- Kies will show that an update is available, click on the "Phone Upgrade" button on the left
- A disclaimer Caution screen pops up - Read the Caution statements
- Click the checkbox for "I have read and understood...", and click the Upgrade button
- Kies will download the upgrade from the server - this took about 15 minutes for me
- Once the files are downloaded, Kies will start the upgrade process and the phone screen will change to reflect this with icons and info of what step is being performed
- After the installation finishes, click on the "Ok" button in the last screen to complete it.
- Now the phone should reboot by itself and now you can disconnect your phone from the PC
My phone just kept waiting for about 5 minutes in the initial screen that displays the Vibrant logo and then came up.
Here are the differences that I see right off the bat:
- Menu icons are colorful
- Phone seems to be a bit faster than before
- T-Mobile TV is now available - this is a pad service so not that interesting for now
- Option to add Samsung widgets on the home screen using the long press is not available any more
- WiFi calling is now available - but this still uses plan minutes so is useful only in places where T-Mobile or any other roaming GSM signal is not available, but a Wi-Fi signal is available.
- There is a new app for Google Search
- USB / Wi-Fi tethering is now available from Settings > Wireless and network > Mobile AP and Settings > Wireless and network > Tethering
- In the pull down menu from the top notification bar, there is a new icon to control Auto-Rotation
Here are the current version numbers:
- Firmware version: 2.2
- Baseband version: T959UVKA6
- Kernel version: 2.6.32.9
- Build number: FROYO.UVKA6
Yay!!! Finally on Froyo!!!
Subscribe to:
Posts (Atom)
loading..