This file contains 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
#include <stdio.h> | |
#include <string.h> | |
int main(void) | |
{ | |
FILE *fpb; | |
char str[100],filename[100]; | |
//char str2[]=".c" | |
char check; | |
int length,flength,i; |
This file contains 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
#include <stdio.h> /* | |
=begin | |
*/ | |
//C言語の記述 | |
int main(void) | |
{ | |
printf("Hello,World!\n"); | |
return 0; | |
} | |
/* |
This file contains 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 | |
require 'twitter' | |
Twitter.configure do |config| | |
config.consumer_key = 'consumer_key' | |
config.consumer_secret = 'consumer_secret' | |
config.oauth_token = 'oauth_token' | |
config.oauth_token_secret = 'oauth_token_secret' | |
end |
This file contains 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 'uri' | |
def expand_url(url) | |
uri = url.kind_of?(URI) ? url : URI.parse(url) | |
begin | |
Net::HTTP.start(uri.host, uri.port) do |io| | |
r = io.head(uri.path) | |
r['Location'] ? expand_url(r['Location']) : uri.to_s | |
end |
This file contains 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 'nokogiri' | |
require 'open-uri' | |
require 'kconv' | |
url = ARGV[0] ? ARGV[0].chomp : "http://blogs.yahoo.co.jp/ikedadamu/6739054.html" | |
encode = ARGV[1] ? ARGV[1].chomp : nil | |
page = Nokogiri::HTML(open(url),encode) | |
puts page.to_html.toutf8 |
This file contains 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 "pp" | |
module MyTwitter | |
def links_only(statuses) | |
include_links_statuses = [] | |
statuses.each do |status| | |
include_links_statuses << status unless ( status.urls.empty? && status.media.empty? ) | |
end | |
# pp include_links_statuses |
This file contains 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 status | ruby -ne '/modified:\s+(.+?\.rb)/ =~ $_ ; print $1," " if $1' | |
=> | |
a.rb | |
b.rb |
This file contains 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
#coding: UTF-8 | |
module Totsuzen | |
def totsuzen(str = "突然の死") | |
str_length = 0 | |
str.each_char do |c| | |
str_length += (c.bytesize > 1) ? 2 : 1 | |
end | |
str_length /= 2 | |
result = "_人#{ "人" * str_length }人_\n" | |
result << "> #{str} <\n" |
This file contains 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 'open-uri' | |
Dir.mkdir("yosan_up") unless FileTest.exist? "yosan_up" | |
("01".."18").each do |i| | |
url = "http://www.jr-eki.com/timetable/yosan_up-seto/img/#{i}.gif" | |
image = open(url).read | |
File.write("yosan_up/" + i + ".gif",image) | |
end |
This file contains 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
#include <stdio.h> | |
#include <stdlib.h> | |
int main(int argc,char *argv[]) | |
{ | |
unsigned int a,b,amari,i; | |
if(argc<2) | |
{ | |
printf("整数を入力してください。\n"); |
OlderNewer