Skip to content

Instantly share code, notes, and snippets.

Joel Bryan Juliano jjuliano

Block or report user

Report or block jjuliano

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am jjuliano on github.
  • I am joelbryan (https://keybase.io/joelbryan) on keybase.
  • I have a public key whose fingerprint is 84BA 318B DD8B E94F 94E5 3A6E E6D7 F776 CE6D E3A7

To claim this, I am signing this object:

@jjuliano
jjuliano / euler-006.rb
Created Dec 12, 2012
Find the 10001st prime.
View euler-006.rb
#!/usr/bin/env ruby
# By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13.
# What is the 10001st prime number?
# Solution:
primes, remainder = [], []
limit = 10001
rangemax = limit/10
n = 2
@jjuliano
jjuliano / euler-005.rb
Created Dec 12, 2012
What is the difference between the sum of the squares and the square of sums?
View euler-005.rb
#!/usr/bin/env ruby
# The sum of the squares of the first ten natural numbers is,
# 12 + 22 + ... + 102 = 385
# The square of the sum of the first ten natural numbers is,
# (1 + 2 + ... + 10)2 = 552 = 3025
# Hence the difference between the sum of the squares of the first ten natural
# numbers and the square of the sum is 3025 385 = 2640.
# Find the difference between the sum of the squares of the first one hundred natu-
# ral numbers and the square of the sum.
@jjuliano
jjuliano / euler-004.rb
Created Dec 12, 2012
Find the largest palindrome made from the product of two 3-digit numbers
View euler-004.rb
#!/usr/bin/env ruby
# A palindromic number reads the same both ways. The largest palindrome made
# from the product of two 2-digit numbers is 9009 = 91 99. Find the largest palin-
# drome made from the product of two 3-digit numbers.
# Solution:
palindromes = []
(100..999).each do |x|
(100..999).each do |y|
@jjuliano
jjuliano / euler-003.rb
Created Dec 12, 2012
Find the largest prime factor of a composite number.
View euler-003.rb
#!/usr/bin/env ruby
# Problem: Find the largest prime factor of a composite number.
# Description: The prime factors of 13195 are 5, 7, 13 and 29.
#
# What is the largest prime factor of the number 600851475143?
# Solution:
number = 600851475143
@jjuliano
jjuliano / euler-002.rb
Created Dec 10, 2012
Find the sum of all the even-valued terms in the Fibonacci sequence which do not exceed four million.
View euler-002.rb
#!/usr/bin/env ruby
#
# Problem: Find the sum of all the even-valued terms in the Fibonacci sequence which do not exceed four million.
# Description: Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be:
#
# 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...
#
# Find the sum of all the even-valued terms in the sequence which do not exceed four million.
#
# Solution:
@jjuliano
jjuliano / euler-001.rb
Created Dec 9, 2012
Add all the natural numbers below one thousand that are multiples of 3 or 5.
View euler-001.rb
#!/usr/bin/env ruby
# Problem: Add all the natural numbers below one thousand that are multiples of 3 or 5.
# Description: If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. @ The sum of these multiples is 23.
# Find the sum of all the multiples of 3 or 5 below 1000.
sum = 0
limit = 1000 - 1
@jjuliano
jjuliano / my_application_controller.rb
Created Jul 11, 2012
[Rubymotion] UITableView and UITableViewCell using SimpleView (https://github.com/seanho/SimpleView) taken from Teacup example by Colinta (http://colinta.com/thoughts/aw_hell_its_a_table_cell.html). [refactor to use more SimpleView convention for tagging,
View my_application_controller.rb
class MyApplicationController < UIViewController
def viewDidLoad
@data = [
{ icon: 'niftywow',
project: 'NiftyWow',
description: "Oh you just can't imagine.",
logos: ['apple', 'github']
},
{ icon: 'amazingwhizbang',
You can’t perform that action at this time.