http://sites.google.com/site/yacoset/Home/signs-that-you-re-a-bad-programmer|Write your checklist
Author: eduardofv
Weird Snippet to Divide an Array [ruby]
Dividing an array of n elements into pieces subarrays is a little bit trickier than it seems. Each subarray will contain chunk_size = n / pieces elements and n % pieces will remain unassigned, and need to be distributed to the subarrays. You can do this in many ways, but in this case we will assign the first remaining element to the first subarray, and so on. So the first n%pieces subarrays will contain n/pieces+1 elements.
def chunk_array(a,pieces)
cs = a.length / pieces #chunk size
r = -1*(a.length%pieces) #remaining elements to be asigned to a chunk
(0..pieces-1).map{|i| r+=1; a[i*cs..(i+1)*cs-1] + (r<1 ? a[r-1..r-1] : [])}
end
C# & Linq Functional Style – Simple XML Parsing
With things like this, C# is regaining my attention. Parse a simple XML to a string array containing only the child elements defined in an other string array:
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Xml.Linq; namespace PruebaLinqFuncional { class Program { public static ListParseXML(string xml, string objectName, string[] dataToParse) { //Programacion funcional en C# :O /* return XDocument.Parse(xml).Descendants(objectName).Select((element) => { var lst = new List (); foreach (string field in dataToParse) lst.Add(element.Element(field).Value); return lst.ToArray (); }).ToList (); */ return XDocument.Parse(xml).Descendants(objectName).Select( (element) => { return dataToParse.Select( (field) => { return element.Element(field).Value; }).ToArray (); }).ToList (); } static void Main(string[] args) { var xml = @" "; foreach (var stra in ParseXML(xml, "Blob", new string[] { "Url", "Name" })) Console.WriteLine(string.Join(",", stra)); Console.ReadLine(); } } } string-value string-value int-value string-value Mi_URL_Uno Mi_Blob_Uno date/time-value etag size-in-bytes blob-content-type Mi_URL_Dos Mi_Blob_Dos date/time-value etag size-in-bytes blob-content-type blob-prefix
GUIDs in Ruby
sudo gem install guid require 'guid' Guid.new
http://rubyforge.org/forum/forum.php?forum_id=4743 go to the bottom)
On Windows this might be useful:
http://www.agileprogrammer.com/dotnetguy/archive/2005/10/27/8991.aspx
StackOverflow Architecture
http://highscalability.com/stack-overflow-architecture|It’s good to see that we are doing similar things…
Introduction to LINQ – Simple XML Parsing
http://www.switchonthecode.com/tutorials/introduction-to-linq-simple-xml-parsing|Para comenzar con Linq to XML
Partidos pol????ticos y Web Servers
Para lo que vale, ahora que estamos a unos días de las elecciones y que al fin se callaron las campañas, aquí va una lista de los Web Servers usados por cada partido (afortunadamente ahora ya solo tienen una página de inicio cumpliendo con la ley electoral):
PAN: Microsoft-IIS/6.0 / ASP.NET
PRI: Microsoft-IIS/6.0 / ASP.NET
PRD: Apache/2.2.9 (Fedora) – PHP/5.2.6
PVEM: Apache/2.2.6 (Fedora)
PT: Apache
Nueva Alianza: Apache/2.0.52 (CentOS)
Convergencia: Apache/2.0.63 (Unix) mod_ssl/2.0.63 OpenSSL/0.9.8b mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage
/5.0.2.2635 PHP/5.2.5
PSD: ngnix/0.5.32
The Google Code University
http://code.google.com/edu/|Online courses and tutorials… checking the whole distributed computing resources.
Priced to Sell
http://www.newyorker.com/arts/critics/books/2009/07/06/090706crbo_books_gladwell?currentPage=1