Mostrando entradas con la etiqueta Software. Mostrar todas las entradas
Mostrando entradas con la etiqueta Software. Mostrar todas las entradas

WPF Color Generator

namespace SenenFernandez.SmartExtensionMethods
{
    using System;
    using System.Windows.Media;

    public class SmartColorGenerator
    {
        private readonly Random random;
        private static readonly object sync = new object();
        private static SmartColorGenerator instance;

        public static SmartColorGenerator Instance
        {
            get
            {
                lock (sync)
                {
                    return instance ?? (instance = new SmartColorGenerator());
                }
            }
        }

        public SmartColorGenerator(int seed = 255)
        {
            random = new Random(seed);
        }

        public SolidColorBrush GetBrush(double opacity = 1.0)
        {
            var brush = new SolidColorBrush(GetColor(opacity));
            brush.Freeze();
            return brush;
        }

        public Color GetColor(double opacity = 1.0)
        {
            int alpha = (int)
                (255*(opacity > 1.0 ? 1 : opacity < 0 ? 0 : opacity));
            var color = new Color
            {
                A = (byte) (alpha),
                R = GetNext(),
                B = GetNext(),
                G = GetNext()
            };
            return color;
        }

        private byte GetNext()
        {
            return (byte) (random.Next(127) + 128);
        }
    }
}

SQLServer Connection Monitor

SELECT T1.session_id AS [SessionId]
  
, T1.host_process_id AS [HostPid]
  
, DB_NAME(T3.dbid) AS [Database]
  
, T1.HOST_NAME AS [Host]
  
, T1.program_name AS [ApplicationName]

   , T1.login_name AS [UserName]
  
, T2.client_net_address AS [IP]
  
, T1.cpu_time AS [Cpu]
  
, T1.memory_usage AS [Ram]
  
, T4.Connections AS [Connections]
  
, T4.net_transport AS [NetTransport]
  
, T2.net_packet_size AS [NetPacketSize]
  
, '[' + DB_NAME(T3.dbid) + '].['
    
+ object_schema_name(T3.objectid, T3.dbid) + '].['
    
+ OBJECT_NAME(T3.objectid, T3.dbid) + ']' AS [ObjectName]
  
, T3.TEXT AS [Query]

FROM sys.dm_exec_sessions T1
INNER JOIN sys.dm_exec_connections T2 ON T2.session_id = T1.session_id
CROSS APPLY sys.dm_exec_sql_text(T2.most_recent_sql_handle) T3
INNER JOIN
(
  
SELECT T1.dbid, T1.spid, T2.net_transport, COUNT(T1.dbid) AS [Connections]
  
FROM sys.sysprocesses T1
  
INNER JOIN sys.dm_exec_connections T2 ON T1.spid = T2.session_id
  
GROUP BY dbid, T1.spid, T2.net_transport

) T4 ON T4.spid = T1.session_id
ORDER BY Connections DESC, Cpu DESC, Ram DESC

Update SQLServer Identity Column


DECLARE @NewId INT = 23

DECLARE @TableName VARCHAR(MAX) = 'Database.Schema.TableName'

DBCC CHECKIDENT (@TableName, RESEED, @NewId)

 

Tor - Anonymity Online




Tor is free software and an open network that helps you defend against traffic analysis, a form of network surveillance that threatens personal freedom and privacy, confidential business activities and relationships, and state security.


HTML5 Rocks

Interactive Presentation


Watch the slideshow that lets you play with HTML5 features.

Code Playground


Jump headfirst into HTML5 by experimenting with each API.

Samples Studio


A showroom of content that you can reuse in your own site.

Camera Mouse

.NET Reactor

Merge .NET Assemblies with ILMerge

Framework v4.0
cmd: ILMerge /targetplatform:v4,C:\Windows\Microsoft.NET\Framework\v4.0.30319 /out:MyMergeApp.exe MyExe.exe MyDll1.dll MyDll2.dll MyDll3.dll

Framework v3.5
cmd: ILMerge /lib:C:\Windows\Microsoft.NET\Framework\v3.5 /out:MyMergeApp.exe MyExe.exe MyDll1.dll MyDll2.dll MyDll3.dll

Framework v2.0
cmd: ILMerge /out:MyMergeApp.exe MyExe.exe MyDll1.dll MyDll2.dll MyDll3.dll

Donwload: ILMerge from Microsoft Tools & Utilities