background preloader


Facebook Twitter

NodeSet — Documentation for sparklemotion/nokogiri. Inherits: Object Object Nokogiri::XML::NodeSet show all Includes: Enumerable, Searchable Defined in: lib/nokogiri/xml/node_set.rb, ext/nokogiri/xml_node_set.c more...

NodeSet — Documentation for sparklemotion/nokogiri

Overview A NodeSet contains a list of Nokogiri::XML::Node objects. Constant Summary Constants included from Searchable Searchable::LOOKS_LIKE_XPATH Instance Attribute Summary collapse #document ⇒ Object The Document this NodeSet is associated with. Programming Ruby: The Pragmatic Programmer's Guide. Ruby Regular Expressions: Ruby Study Notes - Best Ruby Guide, Ruby Tutorial. Regular expressions, though cryptic, is a powerful tool for working with text.

Ruby Regular Expressions: Ruby Study Notes - Best Ruby Guide, Ruby Tutorial

Ruby has this feature built-in. It's used for pattern-matching and text processing. Capturing multiple matches in Ruby - To collect all regex matches in a string into an array, pass the regexp object to the string’s scan() method, e.g.: myarray = mystring.scan(/regex/).

Capturing multiple matches in Ruby -

Sometimes, it is easier to create a regex to match the delimiters rather than the text you are interested in. In that case, use the split() method instead, e.g.: myarray = mystring.split(/delimiter/). The split() method discards all regex matches, returning the text between the matches. The scan() method does the opposite. If your regular expression contains capturing groups, scan() returns an array of arrays. For me it was not obvious how to emulate Perl’s /g regex modifier in Ruby, to capture all matches in an array, for example. Expresiones Regulares - Ruby Tutorial. Las expresiones regulares, aunque crípticas, son una poderosa herramienta para trabajar con texto.

Expresiones Regulares - Ruby Tutorial

Son usadas para reconocer patrones y procesar texto. Expresiones regulares en Ruby – No te dejes intimidar – Primera parte – Mis Ideas. Las expresiones regulares normalmente, se ven desde un punto de vista intimidatorio, bueno así las vi yo mismo y alguna vez a día de hoy también , pero como a todo hay que ponerse a ello y entenderlas, para que dejemos de lado su cara intimidatoria, sea cual sea.

Expresiones regulares en Ruby – No te dejes intimidar – Primera parte – Mis Ideas

Pero realmente tenemos que preguntarnos ¿Qué nos dejan hacer las expresiones regulares? En el libro de Programming Ruby 1.9 de Dave Thomas, hay un capítulo dedicado a las expresiones regulares (recomiendo leer el libro) que dice algo asó como: . el punto coincide con cualquier carácter excepto una línea nueva | el pipeline es un condicional de una u otra ( ) para agrupar los paréntesis. The beginners' guide to Redcode, v1.22. Version 1.22 Contents Preface There aren't too many beginners interested in the game of Core War these days.

The beginners' guide to Redcode, v1.22

Of course, this is quite natural -- not that many people would consider optimizing assembly code to be fun anyway -- but one reason for the high starting threshold may be the difficulty of finding information on the very basics of the game. True, there are many good documents around, but most of them are either too technical, outdated, too hard to find or simply incomplete. That is why I decided to write this guide. To be honest, I am still a beginner in this game myself. This guide is intended for the very beginners. The flavor of Redcode used in this guide is (mostly) the current de facto standard, the ICWS '94 Standard Draft with pMARS 0.8 extensions. Important: There is no simple way to teach Redcode-- or any programming language-- in a strictly linear way.

GitHub - michelpereira/gamesofcoding: A curated list of games that can teach you how to learn a programming language. Collection Pipeline. Collection pipelines are a programming pattern where you organize some computation as a sequence of operations which compose by taking a collection as output of one operation and feeding it into the next.

Collection Pipeline

(Common operations are filter, map, and reduce.) This pattern is common in functional programming, and also in object-oriented languages which have lambdas. This article describes the pattern with several examples of how to form pipelines, both to introduce the pattern to those unfamiliar with it, and to help people understand the core concepts so they can more easily take ideas from one language to another.

The collection pipeline is one of the most common, and pleasing, patterns in software. It's something that's present on the unix command line, the better sorts of OO languages, and gets a lot of attention these days in functional languages. Convertir a números romanos entre 1 y 999 – Diagrama de flujo. Convertir a números romanos entre 1 y 99 – Diagrama de flujo. Problema Realizar un algoritmo que permita convertir un número arábigo comprendido entre 1 y 99 a números romanos.

Convertir a números romanos entre 1 y 99 – Diagrama de flujo

Solución Entrada: 97Salida: XCVII Para solucionar este problema primero llamamos a la subrutina InicializaUnidades, luego a la subrutina InicializaDecenas, se pide al usuario ingrese un número entre 1 y 99, el cual se captura en la variable “N”. Se compara Si el número es mayor o igual a cero (N>=0) Si es Falso (No) Se Muestra el número que corresponde en romanos Si es Verdadero (Si) Se llama a la Subrutina ObtenerUnidadesDecenas, se muestra el número que corresponde en romanos Finaliza. Diagrama de flujo - Convertir numero arabigo a romanos. Unix - shell command equivalent to pressing enter key on keyboard. Ruby-style-guide/ at master · bbatsov/ruby-style-guide. A Guide to Method Chaining. Method chaining is a very handy technique for invoking multiple methods at once.

A Guide to Method Chaining

Not only does it improve the readability of the code, but it also reduces the amount of code needed when interacting with a class or an instance of a class. You have probably already interacted with method chaining in one way or another, especially if you have used ActiveRecord. 15 Agrupaciones en Ruby - Hash - El blog de Daniel A. Nuñez C. Ruby Iterators: Times, Step Loops. RubyKeywordArrayHashString2DCaseClassConsoleConvertDateTimeDuplicatesExceptionFileFormatIfIteratorMathMethodNilNumberRandRecursionRegexpSetSortSplitSubSubstringWhile Iterator.

Ruby Iterators: Times, Step Loops

Hash. Hsh == other_hash → true or false click to toggle source Equality—Two hashes are equal if they each contain the same number of keys and if each key-value pair is equal to (according to Object#==) the corresponding elements in the other hash. h1 = { "a" => 1, "c" => 2 } h2 = { 7 => 35, "c" => 2, "a" => 1 } h3 = { "a" => 1, "c" => 2, 7 => 35 } h4 = { "a" => 1, "d" => 2, "f" => 35 } h1 == h2 h2 == h3 h3 == h4 static VALUE rb_hash_equal(VALUE hash1, VALUE hash2) { return hash_equal(hash1, hash2, FALSE); } Entendiendo This — JavaScript. Entendiendo This — JavaScript. Practice coding with fun programming challenges - CodinGame. HTML5 UP! Responsive HTML5 and CSS3 Site Templates.

Learn HTML5, CSS3, Javascript - video style tutorials. Bringing modern web standards to everyone. How To Style HTML5 Range Slider Across Multiple Browsers. The range is one of the new input type introduced in HTML5. This input type allows one to input number within the specified range. The browsers will render this input type natively as a slider control. It’s a very intuitive user interface that we commonly find in an App. We can slide the handle bar to the right or left to produce the number within the range. But as you can see above, each browser displays this input type in a slightly different taste that may not sit well with some designers.

Recommended Reading: Creating & Styling Progress Bar With HTML5 In Chrome, Safari, and Opera. StackEdit – In-browser markdown editor.