This file contains hidden or 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
    
  
  
    
  | <script type="text/javascript" language="javascript"> | |
| var goodexit = false; | |
| window.onbeforeunload = confirmRegisterExit; | |
| function confirmRegisterExit(evt){ | |
| if(!goodexit){ | |
| return "Si vas Abandonar el sistema haz Click en Cerrar Sesion!!"; | |
| } | |
| } | |
| </script> | 
  
    
      This file contains hidden or 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
    
  
  
    
  | public static String ReplaceAccents(string str) | |
| { | |
| String normalizedString = str.Normalize(NormalizationForm.FormD); | |
| StringBuilder strBuilder = new StringBuilder(); | |
| for (int i = 0; i < normalizedString.Length; i++) | |
| { | |
| Char c = normalizedString[i]; | |
| if (CharUnicodeInfo.GetUnicodeCategory(c) != UnicodeCategory.NonSpacingMark) | |
| { | |
| strBuilder.Append(c); | 
  
    
      This file contains hidden or 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
    
  
  
    
  | // Método con los parámetros named y optional | |
| public static void Search(string name, int age = 21, string city = "Pueblo") | |
| { | |
| Console.WriteLine("Name = {0} - Age = {1} - City = {2}", name, age, city); | |
| } | |
| static void Main(string[] args) | |
| { | |
| // Llamada estándar | |
| Search("Sue", 22, "New York"); | 
  
    
      This file contains hidden or 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 void btnSearchGoogle_Click(object sender, RoutedEventArgs e) | |
| { | |
| try | |
| { | |
| string page = "http://www.google.com/search?q="; | |
| string query = ""; | |
| if (txtSearchGoogle.Text.Length > 0) | |
| { | |
| string[] buscar = txtSearchGoogle.Text.Split(' '); | |
| foreach (string word in buscar) | 
  
    
      This file contains hidden or 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
    
  
  
    
  | public void ExpanderGrow(object sender, RoutedEventArgs e) | |
| { | |
| //expander principal del evento. | |
| Expander expander = (Expander)sender; | |
| Grid gridControl = (Grid)expander.Parent; | |
| Controls.Control control = (Controls.Control)gridControl.Parent; | |
| Grid gridMain = (Grid)VisualTreeHelper.GetParent((UIElement)control); | |
| int index = Grid.GetRow((UIElement)control); | |
| RowDefinition rowdef = gridMain.RowDefinitions[index]; | 
  
    
      This file contains hidden or 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
    
  
  
    
  | 'Function for determine what letter is the column by number. | |
| Function Col_Letter(lngCol As Long) As String | |
| Dim vArr | |
| vArr = Split(Cells(1, lngCol).Address(True, False), "$") | |
| Col_Letter = vArr(0) | |
| End Function | 
  
    
      This file contains hidden or 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 LINQ filter list with string contains numbers. | |
| listWords = listWords.Where(w => w.Any(c => Char.IsDigit(c))).ToList(); | 
  
    
      This file contains hidden or 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
    
  
  
    
  | public class TrendLineController | |
| { | |
| // Metodo para Calcular la Linea de regresión, con un array de valores int. | |
| public TrendLine CalculateLinearRegression(int[] values) | |
| { | |
| var yAxisValues = new List<int>(); | |
| var xAxisValues = new List<int>(); | |
| for (int i = 0; i < values.Length; i++) | |
| { | 
  
    
      This file contains hidden or 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
    
  
  
    
  | // Sentencia para transformar una lista de string, a una lista de Double. | |
| List<double> lista = listaStrings.Select(x => double.Parse(x)).ToList(); | 
  
    
      This file contains hidden or 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
    
  
  
    
  | // Con esto principalmente, formateamos el DataTable, para luego en un gridview darle formato numerico, fecha, porcentaje, etc. | |
| protected DataTable CopyToDataTable (DataTable datatable, Type type) | |
| { | |
| DataTable dtCloned = null; | |
| // Copiamos la Estructura de la tabla incluidos los esquemas y restricciones. | |
| dtCloned = datatable.Clone(); | |
| // En este caso con un for, a partir de la tercera columna, cambiamos el tipo de data al que deseamos | |
| for (int i = 3; i < dtCloned.Columns.Count; i++) | |
| { | 
NewerOlder