Categories
Tech

GIT: Get Tag Details of Current Checkout

About two weeks ago I migrated a project from CVS to git. After migration when we tried to build the project it kept failing.

On debugging, I figured that in build.xml (it’s a legacy project with a complex ANT build script) they were trying to figure out from which tag it has been checked out by reading the Tag file in the .CVS folder.

Since this file wasn’t going to be there in the cloned git repo, I started looking ways to achieve this in git. I finally found a git command which gives the tag details of the current checkout, and it’s:

git describe

This command gives the details about the most recent tag reachable from it. You can read more about it at https://git-scm.com/docs/git-describe

To use it in ANT all one has to do is create a an executable git target and pass describe as its argument. Below is how we are getting the details:

[code lang=”xml”]
<target name="tag-details" >
<!– Get the closest tag string using git describe if possible –>
<echo message="Getting git tag details"/>
<exec executable="git" outputproperty="project.tag.details" failifexecutionfails="false">
<arg value="describe"/>
</exec>
</target>
[/code]

Categories
Tech

Hibernate: Dynamic Insert

While doing code-review I came across hibernate’s dynamic-insert property and found it really useful. dynamic-insert is a boolean attribute of class element as defined in hibernate-mapping-3.0.dtd. This is an optional attribute of the class element and if not defined explicitly defaults to false.

As the name says, setting this property to true makes insert query generated by hibernate dynamic i.e. it will include only non-null values of DTO in the prepared statement.

Let’s explore this with the help of an example, for which I’m using PostgreSQL 9 and Hibernate 5.1.0.

Categories
Tech

Official Windows 8 Keyboard Shortcuts from Microsoft

In one of my previous posts I had posted a list of new keyboard shortcuts available in Microsoft Windows 8.

I now have the official list of keyboard shortcuts from Microsoft, which you can download it here [PDF].
Official keyboard shortcuts for Windows 8 from Microsoft

Categories
Tech

[JavaScript] Check if a function Exists or Not

If you want to check if a function exists or not before calling, here’s how to do it


if(typeof window.functionName == 'function') {
functionName (arg1, arg2);
}

It returns a boolean value indicating if the function exists or not.

Categories
Tech

Windows 8 New Shortcut Keys

Windows 8Windows 8 Consumer Preview is out and with it comes a host of new keyboard shortcuts to help navigate across the new Metro UI. Here’s a short list of the shortcut keys introduced with Windows 8.

Shortcut keys Description
Windows key Brings up the Metro start screen. You can start typing to search for an app, just like the Windows 7 start menu.
Win + D Brings up the old Windows desktop.
Win + C Brings up the Charms menu, where you can search, share, and change settings.
Win + I Opens the settings panel, where you can change settings for the current app, change volume, wireless networks, shut down, or adjust the brightness.
Win + Z Opens the App Bar for the current Metro application.
Win + H Opens the Metro Share panel.
Win + Q Brings up the Metro App Search screen.
Win + W Brings up the Metro Settings search screen.
Win + F Brings up the Metro File search screen.
Win + K Opens the Devices panel (for connecting to a projector or some other device)
Win + , (comma) Aero Peek at the desktop.
Win + . (period) Snaps the current Metro application to one side of the screen. (Right side)
Win + Shift + . (period) Snaps the current Metro application to the other side of the screen. (Left side)
Win + J Switches focus between snapped Metro applications.
Win + Page Up (or) Down Moves the current app to the other monitor.
Win + Tab Opens the Metro application switcher menu, switches between applications.
Win + O Lock device orientation..

PC World has a complete list of keyboard shortcuts available in Windows 8, along with the ones carried forward from Windows 7.

Categories
Tech

Windows 8 Consumer Preview aka Beta is out

Windows 8

Microsoft has announced the availability of Windows 8 Consumer Preview aka the beta version of Windows 8.

The Windows 8 Consumer Preview is available worldwide for download in English, French, German, Japanese and simplified Chinese languages. More information about Windows 8 and how to download the Consumer Preview is available at http://preview.windows.com. The ISO files can be downloaded directly from here.

The system requirements/recommendations for the Consumer Preview include:

  • 1 GHz or faster processor.
  • 1 GB RAM (32-bit) or 2 GB RAM (64-bit).
  • 16 GB available hard disk space (32-bit) or 20 GB (64-bit).
  • DirectX 9 graphics device with WDDM 1.0 or higher driver.
  • Metro style applications require a minimum of 1024×768 screen resolution, and 1366×768 for the snap feature.

Full details can be found at Building Windows 8 Blog

Microsoft has also released a Product Guide for Windows 8 Consumer preview, which you can download from here [PDF].

Categories
Tech

Restore Opera address field drop down arrow

Since version 11.50 Opera decided to hide the arrow in the address field drop down by default. So if you need to access the address list you will have to first set focus to the address bar and the pressing the down arrow key.

But if you would like the address field drop down arrow back follow the setps below

  1. Goto opera:config
  2. Search Show Dropdown Button In Addressfield
  3. Check that option
  4. Save

You should now have your address field drop down arrow back.
Opera with address field drop down arrow

Categories
Tech

System Requirements: Microsoft Office 2010 Professional Technical Preview

Microsoft Office 2010 Technical Preview Logo
Microsoft Office 2010 Technical Preview Logo

In my previous post Setup: Microsoft Office 2010 Professional Technical Preview, as pointed out by Ganesh I didn’t mention the system requirements for Microsoft Office 2010 Professional Technical Preview.

So here it is:

Component Requirement
Computer and processor 500 MHz processor or higher
Memory 256 megabytes (MB) of RAM or higher
Hard disk 2 gigabytes (GB). A part of this disk space is free after installation if the original download package is removed from the hard disk.
Drive CD-ROM drive or DVD drive
Display 1024 x 768 or higher-resolution monitor
Operating system Windows® XP with Service Pack 3 (SP3) (32-bit), Windows Vista® with SP1 (32-bit or 64-bit), Windows® Server 2003 R2 with SP2 (32-bit or 64-bit), Windows® Server 2008 with SP1 (32-bit or 64-bit), Windows® 7 (32-bit or 64-bit). Terminal Server and Windows on Windows (WOW) (which allows installing 32-bit versions of Office 2010 on 64-bit operating systems) are supported.
Additional Requirements and product functionality can vary based on the system configuration and operating system.

The requirements is same as Office 2007, which is very good and the other thing to note is that the 64-bit Office 2010 is not supported on Windows XP 64-bit and Microsoft has no plans to support it in future either

Categories
Tech

Setup: Microsoft Office 2010 Professional Technical Preview

Microsoft Office 2010 Technical Preview Logo
Microsoft Office 2010 Technical Preview Logo

As mentioned in the previous post, I am testing the 64-bit version of Microsoft Office 2010 Technical Preview, so here’s how the install process went.

The installer for Office 2010 Professional x64 is 598 MB and contains Word, Excel, PowerPoint, OneNote, Outlook, Publisher and Access. There is a separate installer for Visio (342 MB), InfoPath (281 MB), SharePoint Designer (75 MB) and SharePoint Workspace (246 MB).

Right now I have only installed the Office 2010 Professional Technical Preview x64 pack.

Categories
Tech

Tasks: the first graduate of Gmail Labs

Google has just graduated Tasks out of Gmail Labs, a nifty feature to keep track of your to do list.

Gmail Task
Gmail Task

Tasks is a Gmail feature designed to help you keep track of the things you need to do. You can create lists of items, set due dates and notes, and even add Gmail messages directly to Tasks

Tasks is available for Gmail, Google Calendar, iGoogle and mobile phones.