Skip to content

Instantly share code, notes, and snippets.

View vmandrade's full-sized avatar
🎯
Focusing

Vic vmandrade

🎯
Focusing
View GitHub Profile
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Runtime.InteropServices;
using System.Threading;
namespace ICTest
{
// Destination object for touch/mouse/pen gestures.
@vmandrade
vmandrade / CURPValido.cs
Created June 14, 2020 03:43 — forked from proteo5/CURPValido.cs
Métodos en C# para Validar el CURP
private bool CurpValida(string curp)
{
var re = @"^([A-Z][AEIOUX][A-Z]{2}\d{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\d|3[01])[HM](?:AS|B[CS]|C[CLMSH]|D[FG]|G[TR]|HG|JC|M[CNS]|N[ETL]|OC|PL|Q[TR]|S[PLR]|T[CSL]|VZ|YN|ZS)[B-DF-HJ-NP-TV-Z]{3}[A-Z\d])(\d)$";
Regex rx = new Regex(re, RegexOptions.Compiled | RegexOptions.IgnoreCase);
var validado = rx.IsMatch(curp);
if (!validado) //Coincide con el formato general?
return false;
//Validar que coincida el dígito verificador
###############################################################################
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#r "packages/FSharp.Data.1.1.10/lib/net40/FSharp.Data.dll"
open FSharp.Data.Csv
open FSharp.Data.Csv.Extensions
let csv = CsvFile.Load("http://faculty.washington.edu/heagerty/Books/Biostatistics/DATA/ozone.csv")
//What are the column names of the dataset?
csv.Headers
### R code from vignette source 'Presentation.Rnw'
### Encoding: UTF-8
###################################################
### code chunk number 1: init
###################################################
options(width=60)
###################################################
@vmandrade
vmandrade / pvalue.R
Created December 29, 2013 17:15 — forked from klmr/pvalue.R
#' Print relevant digits of a p-value.
#'
#' The idea is, under the assumption that H0 holds, to print as many digits of
#' p as are strictly necessary to demonstrate H0. Turning this around, if we
#' need to print many digits this probably means that we can reject H0.
#'
#' @param pvalue a single p-value
#' @param max_precision limit the maximum number of leading zeros to display
#' @param p typographic representation of the variable “p”
pretty_p <- function (pvalue, max_precision = 5, p = bquote(italic(p))) {
#r "bin/v40/FSharp.Data.dll"
open FSharp.Data.Csv
open FSharp.Data.Csv.Extensions
let csv = CsvFile.Load("http://faculty.washington.edu/heagerty/Books/Biostatistics/DATA/ozone.csv")
//What are the column names of the dataset?
csv.Headers
//Extract the first 2 rows of the data frame and print them to the console
// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible).
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export.
var FORMAT_ONELINE = 'One-line';
var FORMAT_MULTILINE = 'Multi-line';
var FORMAT_PRETTY = 'Pretty';
var LANGUAGE_JS = 'JavaScript';
var LANGUAGE_PYTHON = 'Python';