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
public class Empleado { | |
public string Nombre { get; set; } | |
public string ApellidoPaterno { get; set; } | |
public string ApellidoMaterno { get; set; } | |
} | |
public class App { | |
public static void Main() { | |
var empleados = new List<Empleado>(); | |
//Se llena la coleccion de empleados, la implementación se deja como ejercicio al lector |
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; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Linq.Expressions; | |
namespace ConsoleApplication2 | |
{ | |
class Program | |
{ |
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
require 'chunky_png' | |
image = ChunkyPNG::Image.from_file('input.png') | |
width = image.width | |
height = image.height | |
size_factor = 10 | |
pixelated_width = width / size_factor | |
pixelated_height = height / size_factor |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>DEMO</title> | |
<script src="urlToJQuery"></script> | |
<script> | |
$(document).ready(function() { | |
$("#sumbit-button").click(function(){ | |
var name = $("#name").val(); | |
var age = $("#age").val(); |
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
<? | |
function smart_nl2br($data, $opening_tag, $closing_tag) { | |
$results = ""; | |
$closing_tag_length = strlen($closing_tag); | |
while(($position_start = strpos($data, $opening_tag)) !== false) { | |
$position_end = strpos($data, $closing_tag); | |
$previous_data = substr($data, 0, $position_start); | |
$tag_data = substr($data, $position_start, $position_end - $position_start + $closing_tag_length); | |
$data = substr($data, $position_end + $closing_tag_length); | |
$results = $results . nl2br($previous_data) . $tag_data; |
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
def factorial(number) | |
total = 1 | |
for i in 1..number | |
total = total * i | |
end | |
return total | |
end | |
def sum_digits(number) | |
string = number.to_s |
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
# encoding: UTF-8 | |
def standar_deviation(values) | |
total = 0.0 | |
values.each { |value| total += value } | |
average = total / values.length | |
total = 0.0 | |
deviation = values.each { |value| | |
total += (value - average) ** 2 | |
} |
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
def count_words(max_occurrences, unique_words) | |
unique_words -= 1 | |
total_words = max_occurrences | |
for i in 2..unique_words | |
total_words += max_occurrences / i.to_f | |
end | |
return total_words | |
end | |
def search(max_ocurrences, unique_words) |
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
TextWindow.WriteLine("hola") | |
TextWindow.WriteLine(" hola soy tito ") | |
TextWindow.WriteLine( "te amo mama " ) | |
TextWindow.Write("8x7=") | |
TextWindow.WriteLine(8*7) | |
TextWindow.WriteLine(10+20*53) | |
TextWindow.WriteLine("3 en ingles es tree") |
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
$dbh->beginTransaction(); | |
$statement = $dbh->prepare("INSERT INTO TABLE (field1, field2) VALUES (:v1, :v2)"); | |
$stmt->bindParam(':v1', $value1); | |
$stmt->bindParam(':v2', $value2); | |
for ($i = 0; $i < 300; $i++) { | |
$value1 = 'value'; | |
$value2 = 'another value'; | |
$stmt->execute(); | |
} |
OlderNewer