Friday, September 27, 2013

SQL: Data Types

Data Type Syntax Explanation (if applicable)
integer integer
smallint smallint
numeric numeric(p,s) Where p is a precision value; s is a scale value. For example, numeric(6,2) is a number that has 4 digits before the decimal and 2 digits after the decimal.
decimal decimal(p,s) Where p is a precision value; s is a scale value.
real real Single-precision floating point number
double precision double precision Double-precision floating point number
float float(p) Where p is a precision value.
character char(x) Where x is the number of characters to store. This data type is space padded to fill the number of characters specified.
character varying varchar2(x) Where x is the number of characters to store. This data type does NOT space pad.
bit bit(x) Where x is the number of bits to store.
bit varying bit varying(x) Where x is the number of bits to store. The length can vary up to x.
date date Stores year, month, and day values.
time time Stores the hour, minute, and second values.
timestamp timestamp Stores year, month, day, hour, minute, and second values.
time with time zone time with time zone Exactly the same as time, but also stores an offset from UTC of the time specified.
timestamp with time zone timestamp with time zone Exactly the same as timestamp, but also stores an offset from UTC of the time specified.
year-month interval Contains a year value, a month value, or both.
day-time interval Contains a day value, an hour value, a minute value, and/or a second value.




Thursday, September 19, 2013

What’s new in iOS 7.0

Apart from bug fixes and beautiful new design here are few new features that are part of iOS 7 release.

  • New design
    • Redesigned interface updates the entire system and every built-in app
    • Subtle motion and animation; layers and translucency provide depth
    • Elegant new color palette and refined typography 
    • Updated system sounds and ringtones
  • Control Center
    • Quick access to commonly used controls and apps with a swipe up from the bottom of the screen
    • Turn on & off Airplane Mode, Wi-Fi, Bluetooth, Do Not Disturb; adjust screen brightness; access media controls; turn on AirPlay and AirDrop
    • Quickly access flashlight, timer, calculator, camera and music controls
  • Notification Center improvements
    • New Today view gives you an overview of your day, including weather, calendar, and stocks 
    • Notifications dismissed on one device dismisses across all your devices
  • Multitasking improvements
    • Preview screens of open apps when you switch between them
    • Permits any app to keep content up to date in the background
  • Camera improvements
    • Swipe through different camera modes – video, still photo, square aspect, and panorama
    • Real-time photo filters with iPhone 4S or later, and iPod touch (5th generation)
  • Photos improvements
    • Automatically organizes your photos and videos based on time and location into Moments
    • iCloud Photo Sharing supports multiple contributors and videos, plus a new Activity view
    • Add photo filter effects
    • Flickr and Vimeo support
  • AirDrop
    • Quickly and easily share content with people nearby
    • Securely encrypted transfers with no network or setup required
    • Supported on iPhone 5, iPad (4th generation), iPad mini, and iPod touch (5th generation) and requires an iCloud account
  • Safari improvements
    • New iPhone tab view that lets you easily switch between open web pages 
    • Unified smart search field for both search terms and web addresses
    • Shared Links shows web pages shared by people you follow on Twitter
  • iTunes Radio
    • Streaming radio service
    • Pick from over 250 featured and genre-focused stations
    • Start your own station from your favorite artist or song
  • Siri improvements
    • New, more natural sounding male and female voices for US English, French and German
    • Integrated Wikipedia, Twitter search, and Bing web search results
    • Change settings including Wi-Fi, Bluetooth, and brightness
    • Supported on iPhone 4S, iPhone 5, iPad with Retina display, iPad mini, and iPod touch (5th generation)
  • App Store improvements
    • See apps relevant to your current location with Popular Near Me
    • Discover age-appropriate apps in the Kids category
    • Keep your apps up to date automatically
  • Find My iPhone Activation Lock
    • Turning off Find My iPhone, erasing your device, reactivation, and signing out of iCloud requires your Apple ID password 
    • A custom message can be displayed on your device even after a remote erase
  • iTunes Store improvements
    • Preview and buy songs you've heard on iTunes Radio while inside the iTunes Store
    • Add to, and shop from, your iTunes Wish List
    • Scan code with camera to redeem iTunes Gift Cards 
  • Music improvements
    • Play music purchases from iCloud 
    • Rotate your iPhone or iPod touch to browse your music with the Album Wall
  • Videos improvements
    • Play movie and TV show purchases from iCloud 
    • View similar movies and TV shows from Related
  • Maps improvements
    • Turn-by-turn walking directions
    • Automatic night mode 
    • Bookmarks shared across devices via iCloud
  • Mail improvements
    • New Smart Mailboxes, including Unread, Attachments, All Drafts and To or CC
    • Improved search
    • View PDF annotations
  • FaceTime audio calling
  • Block unwanted Phone, Messages and FaceTime callers
  • Support for sending long MMS messages
  • Pull down on any Home Screen to reveal Spotlight search
  • Scan to acquire Passbook passes
  • New ringtones, alarms, alerts and system sounds
  • Definitions of a selected word for additional languages: Italian, Korean, and Dutch
  • Inclinometer in the Compass app
  • Wi-Fi HotSpot 2.0 support
  • Accessibility features
    • Individuals with limited physical motor skills can now control their device using Switch Control
    • Customize closed caption style
    • Handwriting input support in VoiceOver
    • Math input support using Nemeth Braille in VoiceOver
    • Select from multiple premium voices for speak selection and VoiceOver 
    • Support for Made for iPhone Hearing Aids and stereo audio for iPhone 5 and iPod touch (5th generation)
  • Enterprise features
    • Manage which apps and accounts are used to open documents and attachments
    • Per App VPN
    • App Store license management
    • Enterprise single sign-on
    • Remote configuration of managed apps
    • Automatic data protection for third-party apps
    • Exchange Notes syncing
    • Install custom fonts
    • New management queries and restrictions
  • Education features
    • Mobile device management for Apple TV
    • Request AirPlay Mirroring from a student device to Apple TV
    • Pre-configure AirPlay destinations and AirPrint printers
    • Streamlined MDM enrollment
    • Ability to restrict changes to accounts
    • Web content filtering
    • Authorized apps can initiate single app mode
    • Configure accessibility settings for single app mode
  • Features for China
    • Tencent Weibo integration
    • Chinese-English bilingual dictionary
    • Improved handwriting input with improved accuracy, stroke order independence and support for simultaneous multiple character input

PS: Some features may not be available for all countries or all areas.

Wednesday, September 18, 2013

TSQL : Strip Special characters from string

Here is how you can strip all special characters from a column. Here I need to remove all special characters from a column before inserting into database. I wrote this function to reuse this in different places.

CREATE FUNCTION dbo.usfStripSpecailCharacters
(
@str VARCHAR(255)
)
RETURNS VARCHAR(255)
AS
BEGIN

WHILE PATINDEX( '%[~,@,#,$,%,&,*,(,),.,]%', @str ) > 0
SET @str = Replace(REPLACE( @str,
SUBSTRING( @str, PATINDEX( '%[~,@,#,$,%,&,*,(,),.,]%', @str ), 1 ),''),'-','')
RETURN @str

END
GO
-- Use this function and pass your string to remove special characters
SELECT dbo.usfStripSpecailCharacters('test#se3#$%#@-32402');
Hope this is useful!!

TSQL: Time in Military Format in 00:00 or 0000 format

Here is a way you can get time in desired military format. I need this to be in 0000 format.

For example If the current time is 12:35 AM, I need to be display this in 1235 in integer format or if you want with 12:35 you can use the following to fulfill your requirement.

DECLARE @time TABLE (
id INT IDENTITY(1, 1),
dt DATETIME)

INSERT INTO @time
VALUES ('7:34:00 PM')

-- time in 24 hour military format
SELECT CONVERT(VARCHAR(5), dt, 114) AS FormatedDT
FROM @time
-- time without colon in military format
SELECT REPLACE(CONVERT(VARCHAR(5), dt, 114),':','') AS FormatedDT
FROM @time

Hope this is useful!!!

Wednesday, September 04, 2013

Missing Send to items in windows 7

Recently I lost few of my icons went missing from Send to folder when we right click on any item or folder. I frequently use Mail Recipient in this. Here is how we can restore this back from default profile

1. Go to following path for default profile setting to capture

"C:\Users\Default\AppData\Roaming\Microsoft\Windows\SendTo" or any other profiles which you have access to from below locations
"C:\Windows\ServiceProfiles\LocalService\AppData\Roaming\Microsoft\Windows\SendTo"
"C:\Windows\ServiceProfiles\NetworkService\AppData\Roaming\Microsoft\Windows\SendTo"

2. Now go to run command  or type in start-search box and type shell:sendto to access your own profile.

3. Copy missing files from your default profile to your own profile. If you want you can add  your own short cuts for quick access.

You are good to go now. Hope this helps!!