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
$(document).ready(function(){ | |
if(!("WebSocket" in window)) { | |
alert("Sorry, the build of your browser does not support WebSockets. Please use latest Chrome or Webkit nightly"); | |
return; | |
} | |
ws = new WebSocket("ws://localhost:8080/"); | |
ws.onmessage = function(evt) { | |
data = eval("(" + evt.data + ")"); | |
var p = $("<div class='tweet' style='display:none'><div class='content'><a class='main-screenname' href='http://www.twitter.com/" + data.user.screen_name + "/status/" + data.id + "' target='_blank'>" + data.user.screen_name + "</a> " + data.text + "</div></div>"); |
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
~/luser/MacRuby[master]% macruby -e 'puts OpenCL.devices.map(&:info)' | |
{:name=>"GeForce 9400 GT", :vendor=>"NVIDIA", :version=>"OpenCL 1.0 ", :type=>:gpu, :max_compute_units=>4, :max_work_item_dimensions=>140733193388035, :max_work_item_sizes=>[512, 512, 64], :max_work_group_size=>512, :max_clock_frequency=>1350, :address_bits=>32, :max_mem_alloc_size=>128, :global_mem_size=>512, :error_correction_support=>false, :local_mem_type=>"local", :local_mem_size=>16, :max_constant_buffer_size=>64, :queue_properties=>[:profiling_enable], :image_support=>true, :max_read_image_args=>128, :max_write_image_args=>8, :image2d_max_width=>8192, :image2d_max_height=>8192, :image3d_max_width=>2048, :image3d_max_height=>2048, :image3d_max_depth=>2048, :extensions=>"cl_khr_byte_addressable_store cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_APPLE_gl_sharing cl_APPLE_SetMemObjectDestructor cl_APPLE_ContextLoggingFunctions "} | |
{:name=>"GeForce 9400 GT", :vendor=>"NVIDIA", :version=>"OpenCL 1.0 ", :type=>:g |
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
OpenCL.devices.each do |device| | |
info = device.info | |
puts "Trying on #{info[:name]} #{info[:vendor]} #{info[:version]} [#{info[:type]}]" | |
context = device.create_context | |
queue = context.create_command_queue | |
program = context.create_program <<EOF | |
// OpenCL kernel that computes the square of an input array | |
__kernel square( | |
__global float* input, |
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
Trying on GeForce 9400 GT NVIDIA OpenCL 1.0 [gpu] | |
1073741824.0 | |
Trying on GeForce 9400 GT NVIDIA OpenCL 1.0 [gpu] | |
1073741824.0 | |
Trying on Intel(R) Core(TM)2 Duo CPU E8400 @ 3.00GHz Intel OpenCL 1.0 [cpu] | |
1073741824.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
require 'rubygems' | |
require 'activity_streams' | |
require 'open-uri' | |
twitter = 'http://api.cliqset.com/feed/?svcuser=rubenfonseca&feedid=twitternotesposted' | |
feed = ActivityStreams::Feed.from_xml(open(twitter).read) | |
feed.entries.size #=> 20 | |
feed.entries.first.verbs.size #=> 1 | |
feed.entries.first.verbs.first #=> "http://activitystrea.ms/schema/1.0/post" |
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
- form_for @user do |f| | |
.small= f.error_messages | |
%fieldset | |
%legend= t(:please_fill_the_following_fields) | |
.box | |
= f.label :name, User.human_attribute_name(:name) | |
= f.text_field :name, :style => 'width: 500px' |
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 'rubygems' | |
require 'oauth' | |
consumer = OAuth::Consumer.new 'ds1UTK4sT3R5MVhYIYV6w', 'RtqyirueGdzUt0tpbuuYnZAxUv71E3xrxxpfnkxt4', { :site => 'http://hireme.goplanapp.com' } | |
request = consumer.get_request_token | |
puts request.authorize_url | |
sleep 20 # give us time to authenticate |
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 'rubygems' | |
require 'oauth' | |
require 'json' | |
consumer = OAuth::Consumer.new 'ds1UTK4sT3R5MVhYIYV6w', 'RtqyirueGdzUt0tpbuuYnZAxUv71E3xrxxpfnkxt4', { :site => 'http://hireme.goplanapp.com' } | |
req = consumer.get_request_token | |
puts req.authorize_url | |
sleep 20 |
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
Biscates.Location = (function() { | |
var WATCH_ID; | |
var POSITION; | |
var GEOLOCATION_OPTIONS = { | |
enableHighAccuracy: true, | |
maximumAge: 600000, | |
timeout: 30000 // 30 seconds | |
}; | |
function _initGeolocation() { |