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
| namespace PalindromeGist | |
| { | |
| struct Program | |
| { | |
| public static bool Espalindromo(string word) | |
| { | |
| char[] origin = word.ToCharArray(); | |
| for (int i = 0; i < word.Length; i++) | |
| { | |
| if (origin[i] != origin[(origin.Length - 1) - 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
| count = 0 | |
| File.open("seed.txt") do |f| | |
| while line = f.gets | |
| one, two = line.split(" ").map(&:to_i) | |
| while (one <= two) do | |
| one += 1 | |
| muestra = one.to_s |
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
| #!/usr/bin/env python | |
| def is_palindrome(num): | |
| return str(num) == str(num)[::-1] | |
| def closest_higher(target, collection) : | |
| """Return the closest number to `target` in `collection` | |
| that is higher than `target`""" | |
| return max((target - i, i) for i in collection if (target - i) < 0)[1] |
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
| using System; | |
| using System.IO; | |
| using System.Diagnostics; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| namespace palindrome | |
| { | |
| class MainClass | |
| { |
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
| def is_palindrome?(num) | |
| s = num.to_s | |
| s == s.reverse | |
| end | |
| count = 0 | |
| File.open("seed.txt") do |f| | |
| while line = f.gets | |
| one = line.split[0] | |
| two = line.split[1] |
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
| 235952 696834 | |
| 410744 1972018 | |
| 482537 762623 | |
| 266013 1506104 | |
| 332936 1357451 | |
| 115587 1881152 | |
| 255431 833493 | |
| 437349 1833622 | |
| 384940 1333384 | |
| 45184 1263934 |
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
| file = File.open("seed.txt", "w") | |
| 20.times do | |
| one = Random.rand(1...500000) | |
| two = Random.rand(500000...2000000) | |
| file.write("#{one} #{two}\n") | |
| 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
| using System; | |
| using System.Net; | |
| using Newtonsoft.Json; | |
| namespace api | |
| { | |
| class MainClass | |
| { | |
| public static void Main (string[] args) | |
| { |
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
| package com.hminaya.storage; | |
| import java.io.BufferedReader; | |
| import java.io.InputStream; | |
| import java.io.InputStreamReader; | |
| import org.apache.http.HttpEntity; | |
| import org.apache.http.HttpResponse; | |
| import org.apache.http.client.HttpClient; | |
| import org.apache.http.client.methods.HttpGet; |
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
| var http = require('http'); | |
| var url = 'http://www.emplea.do/jobs.json'; | |
| http.get(url, function(res) { | |
| var body = ''; | |
| res.on('data', function(chunk) { | |
| body += chunk; | |
| }); |