This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DECLARE @table TABLE | |
( | |
SPID INT | |
,Status VARCHAR(15) | |
,[Login] VARCHAR(30) | |
,HostName VARCHAR(MAX) | |
,BlkBy VARCHAR(10) | |
,DBName VARCHAR(15) | |
,Command VARCHAR(MAX) | |
,CPUTime INT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// forma tradicional, agregando los elementos uno a uno | |
private IDictionary<int, DateTime> GetDiccionaryOriginal(int[] keys) | |
{ | |
var result = new Dictionary<int, DateTime>(); | |
using (var context = DataContextFactory.MyContext) | |
{ | |
context.MY_RECORDs.Where(r => keys.Contains(r.RECORD_ID)) | |
.ToList() | |
.ForEach(r => result.Add(r.RECORD_ID, r.LATEST_UPDATE_TS)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT name | |
,create_date | |
,modify_date | |
FROM sys.tables | |
WHERE name = 'TABLE_NAME' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT rsh.destination_database_name AS [Database] | |
,rsh.user_name AS [Restaurado por] | |
,CASE | |
WHEN rsh.restore_type = 'D' THEN 'Database' | |
WHEN rsh.restore_type = 'F' THEN 'File' | |
WHEN rsh.restore_type = 'G' THEN 'Filegroup' | |
WHEN rsh.restore_type = 'I' THEN 'Differential' | |
WHEN rsh.restore_type = 'L' THEN 'Log' | |
WHEN rsh.restore_type = 'V' THEN 'Verifyonly' | |
WHEN rsh.restore_type = 'R' THEN 'Revert' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Diagnostics; | |
class MiClase | |
{ | |
private void MiFuncion() | |
{ | |
var sw = new Stopwatch(); | |
sw.Start(); | |
// Tu código va aquí |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private TRet WithLogging<T, TRet>(T context, string logmsg, Func<T, TRet> func) where T : DataContext | |
{ | |
TRet result; | |
var log = context.Log; | |
var builder = new StringBuilder(); | |
try | |
{ | |
context.Log = new StringWriter(builder); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
using System.Linq; | |
namespace ViveCodigo.Katas.LCD | |
{ | |
/// <summary> | |
/// Basado en la idea original de @rodrigo_salado | |
/// </summary> | |
public class LCD | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.VisualStudio.TestTools.UnitTesting; | |
namespace ViveCodigo.Katas.LCD.Test | |
{ | |
/// <summary> | |
///This is a test class for LCDTest and is intended to contain all its Unit Tests. | |
///</summary> | |
[TestClass] | |
public class LCDTest | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.vivecodigo.katas.lcd; | |
import java.util.*; | |
public class LCD { | |
private static final String _NONE = " "; | |
private static final String _LEFT = " |"; | |
private static final String _MIDL = " _ "; | |
private static final String _MDLT = " _|"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.vivecodigo.katas.lcd; | |
import static junit.framework.Assert.*; | |
import org.junit.Test; | |
import org.junit.runner.RunWith; | |
import org.junit.runners.Suite; | |
@RunWith(Suite.class) | |
@Suite.SuiteClasses( { AllTests.TestUtils.class, AllTests.LCDTests.class }) |