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
// Busca los posts relacionados | |
function BuscarRelacionados(pstTag){ | |
pstTag = $.trim(pstTag); | |
if(pstTag){ | |
$.getScript("http://developers.do/api/read/json?tagged=" + pstTag, function(){ | |
// Crea el header el LI | |
$("<span style='font-weight: bold;' id='spn" + pstTag + "'>" + pstTag + "</span><ul id='" + pstTag+ "'></ul><br>").appendTo("#PostsRelacionados"); |
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
require "net/http" | |
require "json" | |
url = "http://www.emplea.do/jobs.json" | |
resp = Net::HTTP.get_response(URI.parse(url)) | |
data = resp.body | |
@result = JSON.parse(data) | |
puts @result |
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 urllib2 | |
import simplejson | |
url = "http://www.emplea.do/jobs.json" | |
resp = urllib2.Request(url) | |
opener = urllib2.build_opener() | |
data = opener.open(resp) | |
result = simplejson.load(data) |
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; | |
}); |
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
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
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
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
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] |
OlderNewer