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
| Encoding.default_external = 'UTF-8' | |
| Encoding.default_internal = 'UTF-8' | |
| require 'haml' | |
| class ErbEngine < Haml::Engine | |
| def push_script(text, preserve_script, in_tag = false, preserve_tag = false, | |
| escape_html = false, nuke_inner_whitespace = false) | |
| push_text "<%= #{text.strip} %>" | |
| end | |
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
| git branch -rd TOREMOVE | |
| git push origin :TOREMOVE | |
| or | |
| git branch -rd origin/TOREMOVE |
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
| //Valid JSON format for tweet received | |
| { | |
| "id": "tag:search.twitter.com,2005:327100841452519425", | |
| "objectType": "activity", | |
| "actor": { | |
| "objectType": "person", | |
| "id": "id:twitter.com:114054810", | |
| "link": "http://www.twitter.com/anuel_81", | |
| "displayName": "luis enrique anuel", | |
| "postedTime": "2010-02-13T23:51:24.000Z", |
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
| #encoding: utf-8 | |
| # Problema 1 del Examen 2o. Parcial | |
| # author: @edolopez | |
| entero = 0 | |
| cont = 1 | |
| begin | |
| puts "Eso no es correcto, intenta de nuevo!" if entero > 50 |
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
| # encoding: UTF-8 | |
| # Pide calificación mexicana y convierte a americana | |
| def pregunta_usuario(variable) | |
| puts "sigo en el bloque" | |
| begin | |
| # acciones al menos 1 vez | |
| puts "Dame un valor entero para la calificación que quieres convertir" | |
| calificacion = gets.to_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
| import java.io.*; | |
| public class Age { | |
| public static void main(String [] args) throws IOException { | |
| InputStreamReader inStream = new InputStreamReader(System.in); | |
| BufferedReader systemIn = new BufferedReader(inStream); | |
| String my_name, greeting, myAge, variable; |
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
| import java.util.Scanner; | |
| public class Fibonacci { | |
| public static void main (String [] args) { | |
| Scanner input = new Scanner(System.in); | |
| // Asks for the first number | |
| int num = input.nextInt(); |
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
| import java.util.Scanner; | |
| public class ArraysBasics { | |
| public static void main(String [] args) { | |
| Scanner input = new Scanner(System.in); | |
| int meanAge = 0, i; | |
| // Initialization of the two arrays depending on user input | |
| int positions = input.nextInt(); | |
| int[] myArray = new int[positions]; |
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 Partial1CSII { | |
| public static void main(String[] args) { | |
| // Calling exercise II | |
| System.out.println(lowest(4,3,-45)); | |
| // Calling exercise III | |
| int[] numbers = new int[]{4, 20, 35, 4, 6}; | |
| System.out.println(diff(numbers)); |
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 int search(int[] numbers, int key) { | |
| for (int index = 0; index < numbers.length; index++) { | |
| if (numbers[index] == key) | |
| return index; // Founds the elemnt and finishes the search | |
| } | |
| // If we get to the end of the loop, a value has not yet | |
| // been returned. We did not find the key in this array. | |
| return -1; | |
| } |
OlderNewer