Thursday, December 25, 2014

Visual Studio 2013 IDE Enhancements


VS 2013 brings in a host of new IDE editor features that 2012 and all prior were lacking, especially elegant is the Peek window with breadcrumbs, We can now go to definition drill down and back multiple levels with ease, Check this out, Alt F12 wil bring up an inline peek window for the selected type:





For more info see this vid starting @ 31:34
https://www.youtube.com/watch?v=wa9Tvr9yiQs

VS 2013 Keyboard Shortcuts here:
https://drive.google.com/file/d/0B_g_1Tnrt6oFcnh4M1NVQV9vLVU/view?usp=sharing

Tuesday, December 16, 2014

Cool. Clean, Simple and Powerful Wireframe UI Design and Collaboration Tools!!!

Tools
1.      Wireframes:   https://moqups.com
2.      Shareable Notepad : http://notepad.cc/share/c2LgKkk1nv
4.      Screen Shots to the Clould! : https://app.prntscr.com/en/download.html


Screen Sharing:
2.      Google Hangout: has Remote Desktop to! http://prntscr.com/5hb4ju

Using Lync From Chrome

FYI, I came across this which has fixed my Chrome to Lync Desktop activation issue, When I click Join Lync in Chrome it would open the browser plugin because it could not detect and activate the desktop Lync, IE does, so this work-around, however kluge it is uses "IE Tabs" in Chrome, any http://meet* opens in IE tab thus activating Lync desktop....lol


Sunday, December 14, 2014

Assign a Static IP for Brighthouse or OpenDNS for Home Computer

Need a static IP for your home networked computers (not internet facing router) well you can use the tcpip properties of adapter, and set 4 fields as follows, Just make sure that U get the correct DNS server for your ISP or DNS...In my case I have used Brighthouse and OpenDNS   respectively are displayed below,:

This helpful when U need to set RDP to your router or expose a SQL or VM to the internet:



Thursday, December 11, 2014

MS Office 2013/365 Eval Download Difficult to Find:

.. Direct DL Provided by a 3rd party guy...MS does not provide a means to access direct:
http://www.askvg.com/direct-download-link-microsoft-office-2013-professional-plus-free-trial/


Time to move to OpenOffice?

Monday, December 1, 2014

Image edit Settings for Ocean or Surf Photography: Post Edit

A. Surf photography Lightroom tutorial. How I edit my photos. KEEP IT SIMPLE.

/ Mid-Morning, PartlyCloudy, Watershot

1. Straighten w/ Horizon

2. Exposure:

  • a. Increase if dark & inverse
  • Exposure: +2.02, Contrast: +12

3. Highlights Down : -100

4. Shadow Brighten: Increase: +24

5. Whites Up: +14

6. Blacks Down: -26

7. Clarity: boost tad: + 10 , Saturation: -2

8. Zoom in check

9. Curve/Histogram Fix

10. DeNoise

  • a. If bands in dark areas, deNoise

11. Sharpen : 2-5

12. Lenses Correction

B. Processing Surf Photos With Adobe Lightroom /

Overcast Waters hot

1. Exposure : Up

2. Contrast: +93

3. Clarity” +38

4. Vibrancy: +50

5. Temp: down

6. Tint; +10

7. Tones:

  • a. Highlights: -100
  • b. Whites : -45
  • c. Blacks: -24
  • d. Shadows: +50

8. DeNoise/Noise Reduction : color; 10

C. Photoshop Tutorial- Surf Photography /

Cloudy Mid Morning Watershot

1. Exposure: : +1.05, Contrast: +93

2. Highlights: -100, Shadows: +60

3. Whites: –45, Blacks: -24

4. Clarity: +38, Vibrance: +45

5. White Balance:

  • a. Temp: 6600
  • b. Tint: +20

6. Mask Clouds:

  • a. Contrast: +100
  • b. Exposure: -2
  • c. Highlights: -10
  • d. Shadows: -50

7. Laser: Ride + Wave

  • a. Contrast: +1


D. 36 (not-so) Essential Steps to Editing SURF Images! /

Mid day, Bight, Landshot Pieline

1. Contrast: +34

2. Highlights: -88

3. Shadows: +42

4. Whites : +39

5. Blacks: -12

6. Clarity: +20

7. Vibrancy: +9

8. White Balance:

  • a. Temp: 6600
  • b. Tint: +19

10. Curves:

a. Highlights: +21

b. Lights: +20

c. Darks: +14

d. Shadows: +9

9. Curves:

a. Red: -2

b. Yellow: +22

c. Aquas: -94


E. Post-Production Tutorial- Surf Shooting from Land. /

Morning, Bright

1. Exposure: -.7

2. Contrast: +39

3. Shadow’s: +38 / Highlights: -100

4. White +28/ Blacks: -28

5. Clarity: +46 / Vibrancy +9

6. Tones:

a. Temp: 4900

b. Tint: + 3

7. Select area: Wave & Riders:

a. Temp: +2

b. Tone: +6

c. Exposure: +.3

d. Contrast” +71

e. Highlights”: -100

f. Shadows: + 100

g. Clarity”: + 43

h. Saturation: +40

i. Sharpness: +8

F. How To Edit Your Surf Photos | Light room Editing :

Morning /Dark/Shadows

1. Highlights: +38

2. Shadows: +36

3. Whites: + 20

4. Blacks: -22

5. Temp: 6300, Tint: +14

6. Exposure: +0.26, Contrast: 0

7. Clarity: +38

8. Saturation: +11

9. Colors/Only play with

10. Orange, Green, Blue, Aqua

11. Sharpness: + 30

G. How To Edit Your Surf Photos | Light room Editing 2 :

Morning /Dark

1. Highlights: -55

2. Shadows: +36

3. Whites: + 13

4. Blacks: -7

5. Temp: 6300, Tint: +23

6. Exposure: +0.16, Contrast: +3

7. Clarity: +40

8. Saturation: +0

9. Colors/Only play with

10. Orange (+1-+20), Green, Blue, Aqua

11. Sharpness: + 40

H. How to edit AMAZING LANDSCAPE PHOTOS

PM/Partly Cloudy

1. Highlights: -100

2. Shadows: +65

3. Whites: + 0

4. Blacks: -50

5. Temp: 6100, Tint: +28

6. Exposure: +0, Contrast: +50

7. Clarity: +18, Vibrance: +8

8. Saturation: +0

9. Colors/Only play with

10. Orange , Green, Blue (Saturation: –41, Lumins: +20) , Aqua (make it feel cold)

11. Sharpness: + 40

I How to Edit a Wave Photo in Lightroom

Flat Color/Noon/Clear

1. Highlights: -100

2. Shadows: 0

3. Whites: + 16

4. Blacks: -57

5. Temp: -11, Tint: 0

6. Exposure: +0, Contrast: +47

7. Clarity: +100, Vibrance: +37

8. Saturation: +23

9. Colors/Only play with

10. Orange , Green, Blue (Saturation: –41, Lumins: +20) , Aqua (make it feel cold)

11. Sharpness: + 40


J Surf photography — Late Afternoon Dusk

Late Afternoon Dusk

1. Highlights: -27

2. Shadows: +8

3. Whites: -65

4. Blacks: +7

5. Temp: -11, Tint: 0

6. Exposure: +1.2, Contrast: +80

7. Clarity: -15, Vibrance: +37

8. Saturation: +23

9. Colors/Only play with

10. Orange 0,-30,-24 , Red +20,+25,-20, Green, Blue , Aqua –34,-59,-10

11. Sharpness: + 20

K Why LIGHTROOM EDITS go WRONG!

Late Afternoon Dusk

1. Highlights:0

2. Shadows: 0

3. Whites: 0

4. Blacks: 0

5. Tint: +7

6. Exposure: 0, Contrast: +38

7. Clarity: +21, Vibrance: 0

8. Saturation: 0

9. Colors/Only : Choose Color to bring out, What do u want people to look at::

Pick Color: Increase Saturation/ Decrease Luminance

Saturation: Aqua: + 62, Blue: –7

Luminance: +26

Saturation: Yellow: + 61, Green: +46

Luminance: Yellow: +81, Green+ 34

11. Lens Correction: ON

L Beach Color Grading Effect in Photoshop & Lightroom Mobile

Mid Afternoon Clear, BlueSky

1. Highlights:-100

2. Shadows: +76

3. Whites: +48

4. Blacks: -11

5. Tint:0

6. Exposure: 0, Contrast: 30

7. Clarity: 15, DeHaze: 15, Vibrance: 0

8. Saturation: -25

9. Colors/Only : ToDo

10. Blue: 0, Green: 0

11. Lens Correction:

*** MISC More Info: Links ***

M Lightroom Tutorial - Editing Beach Photos

Noon, Sunny Partly Cloudy, Reduce Shadows, using Curves

- Composition, show surfer coming from right or left to show anticipation; Top or bottom 3rd

- Shutter: TV Mode, Freeze Action: 1/800->1/200; 1/800 or Super Sunny: 1/1000

- If image darkened from edit, Bring UP exposure

- Highlights all UP: Colors are Blown Out

- Shadows UP: Brightens

- Bad AM Beach Photos: Avoid DULL, Highlights/Whiets Blown Out, Histogram on Right Peak

- Dark AM Photos: Vibrance +75, Magenta+2, Clarity+10, Shadows +40, Hughlights-5, Contrast +33,

N. Photoscape X Setting Descriptions:

  • Brighten. We’ll slide the brightness to 100 since the image is super dark.
  • Lighten Shadows. We’ll increase this to about 50 to lighten up the dark areas of the image to bring out more detail and texture.
  • Exposure. Exposure is very similar to brighten. We already increased Brighten to 100 and the image still looks very dark so we’ll up the Exposure to about 65.
  • Vibrance. Vibrance is a tool that will add color to the image, similar to Saturation. I like to use the Vibrance tool because it will only intensify the colors that look muted and leave the colorful parts as they are.
  • Lighten Shadows. This will bring out detail and color in the darker areas of the photo. This is especially helpful if you shoot sunset and sunrise photos that can often come out a bit too dark.
  • Darken Highlights. This will darken the light parts of the image. By darkening highlights, we are able to make the sky look a lot more vibrant.
  • Saturation. Saturation increases the intensity of all colors in the image. When adding saturation be careful not to go overboard with it. While a little bit of saturation can make the photo look better, too much can make it look unnatural and overly saturated.
  • Temperature. Since we’re going for a sunset look in this photo we’ll move the temperature slider towards the orange/warmer tones.
  • Tint. We’ll move the tint slider a bit towards purple tones which look more natural than green tones in a sunset.
  • HDR: HDR or “High Dynamic Range” is a technique that photographers use to capture extra detail in photos. In a typical HDR process a photographer will usually take multiple photos at different exposure levels (dark, medium, light) and then use the HDR setting to combine these photos into one. This would yield one finished photo with even exposure levels and tons of detail.

*** Template

XX Link Title

Time, Description

1. Highlights:0

2. Shadows: 0

3. Whites: 0

4. Blacks: 0

5. Tint:0

6. Exposure: 0, Contrast: 0

7. Clarity: 0, DeHaze: 0, Vibrance: 0

8. Saturation: 0

9. Colors/Only : ToDo

10. Blue: 0, Green: 0

11. Lens Correction:

12: Curve:

FastStone Image Viewer: Edit Shortcuts

1. Rotate / Straighten Horizon:

Alt+F4

2. Settings (F12)

- Mouse Wheel : Zoom In / Out

- Arrow Keys: Next / Previous Image

3. Clone And Heel : Ctrl + Left Click

- https://www.youtube.com/watch?v=qTXdM-NMySY&t=8m40s

4: Histogram: Curve

https://www.youtube.com/watch?v=qTXdM-NMySY&t=5m20s

5. Curves Tutorial:

- Horizontal : shadow....midtone....highlights

- Vertical: Up = Lighten,. Down = Darken

- Contrast: more horizontal = less contrast ; more vertical = more contrast.

https://www.dpreview.com/forums/post/38119620

Sunday, November 30, 2014

Export DataTable to CSV quick and dirty:

Export DataTable to CSV quick and dirty:

 static void DataTableToCSV(string path, DataTable table, bool isFirstRowHeader)
        {
            var lines = new List<string>(); 

            // headers
            if (isFirstRowHeader)
            {
                string[] colnames = table.Columns.Cast<DataColumn>().Select(column => column.ColumnName.Replace(",","")).ToArray();
                var header = string.Join(",", colnames);
                lines.Add(header);
            }
 
            // clean columns names
var valueLines = table.AsEnumerable()
                      .Cast<DataRow>()
                      .Select(row => string.Join(",", 
                              row.ItemArray
                                 .Select(o => "\"" + o.ToString().Replace(",","") + "\"")
.ToArray()));
 
            // Stuff the rows into a string joined by new line characters
            var allLines = string.Join(Environment.NewLine, valueLines.ToArray<string>());
            lines.Add(allLines);
 
            // put that file to bed
            File.WriteAllLines(path, lines.ToArray());
        }

 

Wednesday, November 12, 2014

SQL Server Data Compression Tests


What is the impact of "SQL Server Data Compression" on query performance for a typical large Table?
Using attached SQL, following results achieved:
/** 
Column Compression Tests 
SQL Server 2012 EE
20141112
Reference: 
**/




/*** 1. Find Sample Data *******/

----4,567,526
--SELECT count(*) 
--FROM adventureworksstage.dbo.MetalTransactions

----5979889
SELECT count(*) 
from adventureworks.Metal_and_Process.Orders

--SELECT top 10 *
--from adventureworks.Metal_and_Process.Orders

SELECT *
into adventureworksstage..Orders_Heap_20141112
from adventureworks.Metal_and_Process.Orders


--SELECT *
--from adventureworksstage..Orders_Heap_20141112
--where [name] = 'Bazinga!'


/** 2. Run Query Without Compression Capture IO Stats **********/
use adventureworksStage
go

DBCC FREEPROCCACHE
DBCC DROPCLEANBUFFERS 
GO

 SET STATISTICS io ON 
 GO
 SET STATISTICS time ON
 GO
SELECT *
from adventureworksstage..Orders_Heap_20141112
where [name] like 'Delivery Required Loading %'


/*** 3. Stats and get AVG ******/

Table 'Orders_Heap_20141112'. Scan count 1, logical reads 16263, physical reads 0, read-ahead reads 21256, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.

 SQL Server Execution Times:
   CPU time = 1172 ms,  elapsed time = 1928 ms.



Table 'Orders_Heap_20141112'. Scan count 1, logical reads 16263, physical reads 0, read-ahead reads 21256, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.

 SQL Server Execution Times:
   CPU time = 1093 ms,  elapsed time = 1938 ms.



Table 'Orders_Heap_20141112'. Scan count 1, logical reads 16263, physical reads 0, read-ahead reads 21256, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.

 SQL Server Execution Times:
   CPU time = 1109 ms,  elapsed time = 2016 ms.



Table 'Orders_Heap_20141112'. Scan count 1, logical reads 16263, physical reads 0, read-ahead reads 21256, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.

 SQL Server Execution Times:
   CPU time = 1297 ms,  elapsed time = 1990 ms.



MEDIAN 
CPU time = 1167.75 (1.2 sec)
elapsed time = 1968 (2 sec)
logical reads = 16263



/** 4. Test Column Compression **/
SELECT top 10 *
into adventureworksstage..Orders_Heap_20141112_0
from adventureworksstage..Orders_Heap_20141112

ALTER TABLE adventureworksstage..Orders_Heap_20141112_0 REBUILD WITH ( DATA_COMPRESSION = ROW ) 
GO
DBCC FREEPROCCACHE
DBCC DROPCLEANBUFFERS 
GO


drop table adventureworksstage..Orders_Heap_20141112
drop table adventureworksstage..Orders_Heap_20141112_0

sp_LockDetail

1. As part of any DB tuning and maintenance, the attached sproc package has been added to my "SQL Server Maintenance Automation" package.
2. This script provides: detailed lock info for current connections, and provide filters
3. Use this when locking issues arise such as timeouts and/or deadlocks.
4. This sproc can be deployed to any sql server.

5. Sproc uses an optional table "select * from master..sp_LockDetailResults" to save results, although not required. Table can be used to track lock trends over time. E,g: Exec sp_LockDetail every 5 seconds.
7. Usage Examples:
-- view locks for db
exec [sp_LockDetail] @dbname='master', @insert = 1
-- view locks for db and save to table
exec [sp_LockDetail] @dbname='master', @insert = 1
-- view results
select * from master..sp_LockDetailResults
-- view locks for db and and lock mode
exec [sp_LockDetail] @dbname='master', @lockMode='exclusive'



/****************** CODE *****************/

USE MASTER
 GO    

 alter PROCEDURE [dbo].[sp_LockDetail]
 (
@dbname varchar(255)=null
,@lockMode varchar(255) = null
,@lockType varchar(255) = null
,@insert bit = null
)
 AS
/*********************************
NAME:       [sp_LockDetail]
PURPOSE:    View detailed lock info for current connections, and provide filters
      
REVISIONS:
Ver        Date        Author           Description
---------  ----------  ---------------  ------------------------------------
1.0        20141101    JRD             1. Created this script.
2.0        20141111    JRD             1. Mod use table save to option
    USES:
sys 
master..sp_LockDetailResults TABLE
see sp_LockDetailResults.sql

USED BY:
DBA

UNIT TESTS
-- view locks for db
exec [sp_LockDetail] @dbname='master', @insert = 1
-- view locks for db and save to table
exec [sp_LockDetail] @dbname='master', @insert = 1
-- view results
select * from master..sp_LockDetailResults
-- view locks for db and and lock mode
exec [sp_LockDetail] @dbname='master', @lockMode='exclusive'
 */
 BEGIN
 select
 distinct * into #results
 from
(
select 
CASE   
  WHEN x.resource_type IN ('DATABASE', 'FILE', 'METADATA') THEN x.resource_type  
  WHEN x.resource_type = 'OBJECT' THEN OBJECT_NAME(x.resource_associated_entity_id, x.[dbid])  
  WHEN x.resource_type IN ('KEY', 'PAGE', 'RID') THEN   
  (  
  SELECT OBJECT_NAME([object_id])  
  FROM sys.partitions  
  WHERE sys.partitions.hobt_id =   
x.resource_associated_entity_id  
  )  
  ELSE 'Unidentified'  
  END AS requested_object_name,
'N/A'  ObjectName
,(CASE x.REQUEST_MODE
WHEN 'SCH-S' THEN 'SCHEMA STABILITY'
WHEN 'SCH-M' THEN 'SCHEMA MODIFICATION'
WHEN 'S' THEN 'SHARED'
WHEN 'U' THEN 'UPDATE'
WHEN 'X' THEN 'EXCLUSIVE'
WHEN 'IS' THEN 'Intent Shared'
WHEN 'IU' THEN 'Intent Update'
WHEN 'IX' THEN 'Intent Exclusive'
WHEN 'SIU' THEN 'Shared Intent Update'
WHEN 'SIX' THEN 'Shared Intent Exclusive'
WHEN 'UIX' THEN 'Update Intent Exclusive'
WHEN 'BU' THEN 'Bulk Update'
WHEN 'RangeS_S' THEN 'Shared Key-Range and Shared Resourcelock'
WHEN 'RangeS_U' THEN 'Shared Key-Range and Update Resource lock'
WHEN 'RangeI_N' THEN 'Insert Key-Range and Null Resourcelock'
WHEN 'RangeI_S' THEN 'Key-Range Conversion lock, created by an overlap of RangeI_N and S locks'
WHEN 'RangeI_U' THEN 'Key-Range Conversion lock, created byan overlap of RangeI_N and U locks'
WHEN 'RangeI_X' THEN 'Key-Range Conversion lock, created byan overlap of RangeI_N and X locks'
WHEN 'RangeX_S' THEN 'Key-Range Conversion lock, created byan overlap of RangeI_N and RangeS_S locks'
WHEN 'RangeX_U' THEN 'Key-Range Conversion lock, created byan overlap of RangeI_N and RangeS_U locks'
WHEN 'RangeX_X' THEN 'Exclusive Key-Range and ExclusiveResource lock'
ELSE NULL
END) AS REQUEST_LOCK_MODE
,x.*
from
(
SELECT 
SessionID = s.Session_id,
resource_type,   
DatabaseName = DB_NAME(resource_database_id),
request_status,
request_owner_type,
objectid,
dbid,
a.number,
a.encrypted ,
a.blocking_session_id,
a.text ,      
request_mode,
request_type,
login_time,
host_name,
program_name,
client_interface_name,
login_name,
nt_domain,
nt_user_name,
s.status,
last_request_start_time,
last_request_end_time,
s.logical_reads,
s.reads,
resource_associated_entity_id
        
FROM   
sys.dm_tran_locks l
JOIN sys.dm_exec_sessions s ON l.request_session_id = s.session_id
LEFT JOIN   
(
SELECT  *
FROM    sys.dm_exec_requests r
CROSS APPLY sys.dm_exec_sql_text(sql_handle)
) a ON s.session_id = a.session_id
WHERE  
s.session_id > 50
and 
resource_database_id > 1
) x
where
DatabaseName not in ('master', 'model', 'msdb', 'tempdb','distribution')
and
(@dbname is null or DatabaseName = @dbname)
) y
where 
(@lockMode is null or REQUEST_LOCK_MODE = @lockMode)
and
(@lockType is null or resource_type = @lockType)
        
        declare @dt datetime
        select @dt = GETDATE()
if (@insert = 1)
begin 
--print 'ins'
INSERT INTO [master].[dbo].[sp_LockDetailResults]
           ([ObjectName]
           ,[REQUEST_LOCK_MODE]
           ,[SessionID]
           ,[resource_type]
           ,[DatabaseName]
           ,[request_status]
           ,[request_owner_type]
           ,[objectid]
           ,[dbid]
           ,[number]
           ,[encrypted]
           ,[blocking_session_id]
           ,[text]
           ,[request_mode]
           ,[request_type]
           ,[login_time]
           ,[host_name]
           ,[program_name]
           ,[client_interface_name]
           ,[login_name]
           ,[nt_domain]
           ,[nt_user_name]
           ,[status]
           ,[last_request_start_time]
           ,[last_request_end_time]
           ,[logical_reads]
           ,[reads]
           ,[DateTimeCreated])
SELECT [ObjectName]
      ,[REQUEST_LOCK_MODE]
      ,[SessionID]
      ,[resource_type]
      ,[DatabaseName]
      ,[request_status]
      ,[request_owner_type]
      ,[objectid]
      ,[dbid]
      ,[number]
      ,[encrypted]
      ,[blocking_session_id]
      ,[text]
      ,[request_mode]
      ,[request_type]
      ,[login_time]
      ,[host_name]
      ,[program_name]
      ,[client_interface_name]
      ,[login_name]
      ,[nt_domain]
      ,[nt_user_name]
      ,[status]
      ,[last_request_start_time]
      ,[last_request_end_time]
      ,[logical_reads]
      ,[reads]
      ,@dt
  FROM #results



end
select * from #results order by [databasename]
drop table #results
END