Slides from a workshop I held for some colleagues during December 2010. Slides, exercises and solutions downloadable at http://kjeldahlnilsson.net/ruby101.zip
From the Java Collections Framework to the enhancements Groovy brings to the table when working with Collections. Based on https://tedvinke.wordpress.com/?s=Groovy+Weekend+Collections
Slides from a workshop I held for some colleagues during December 2010. Slides, exercises and solutions downloadable at http://kjeldahlnilsson.net/ruby101.zip
From the Java Collections Framework to the enhancements Groovy brings to the table when working with Collections. Based on https://tedvinke.wordpress.com/?s=Groovy+Weekend+Collections
Techniques for Reviewing a User InterfaceRhonda Bracey
Rhonda Bracey's presentation from the WritersUA 2008 Conference (Portland, OR)
****************
"Can you just look over these new screens for us? Oh, and can you check the error messages too? It won't take long!" If you've been asked to review a web or standalone application's user interface but don't know what to look for other than checking the text, then this session is for you. As technical communicators, we are often in a position to identify usability problems related to the logical flow, layout, and structure of the interface; inconsistencies in the design; non-compliance with standards and guidelines; ambiguous wording on labels, error messages, dialogs, and onscreen user assistance; performance issues; functional errors; and the like. Rhonda shares practical checklists of things to look for when reviewing an interface, as well as various tools that can assist you.
— YOU WILL LEARN —
* What to look for when checking an application's user interface, including overall design, textual and visual elements, user actions and interactions, navigational links, and the '-ilities': accessibility, readability, usability.
* About some tools that can help automate parts of the review process.
**************
Other supporting material available from here: http://www.cybertext.com.au/10353.htm
Value objects express “‘what’ something is rather than ‘who’ or ‘which’ it is.” In other words, values lack identity.
For example, the number 10 or the color red - all instances of 10 are conceptually equal to all other instances of 10, and likewise, red is always red. Two red bikes, however, have distinct identities.
We’ll explore how extracting value objects can simplify the challenge of bringing the real-world to bear as software. Then, we’ll touch on some strategies for integrating value objects with everyone’s favorite ORM, ActiveRecord.
Discussing language constructs with fellow developers in the context of solving a particular problem is something we do routinely. While most such conversations are productive and useful, a fair portion degenerate into angry brawls. A pattern we've observed in the latter situation is that a surprising number of times the argument is that "Why shouldn't I use language feature X to achieve objective Y- after all, the language supports X."
In this talk Aakash and Niranjan walk through a few features of the Ruby language which when used wisely allows programmers to solve problems elegantly but if they are used without caution can lead to bad code.
There are many things that make Ruby a great language, but above all else, the beautiful and friendly syntax. A perfect exemplar of this is the case statement: case enables a flexible method of dispatching on an object that is both natural and intuitive. But case can't do it alone. No, it requires the help of it's little-known and under-appreciated sidekick the === (threequals) operator.
In this talk we'll dive into this fascinating corner of the Ruby language and see what trouble we can cause with the humble threequals. We'll go over the basics of how it interacts with case, and then go into some tips and tricks for making the most of this useful bit of syntax, and ultimately create a little pattern matching mini-language as a demonstration.
RedDot Ruby Conf 2014 - Dark side of ruby Gautam Rege
I love Ruby! But as in any relationship, to love means that you (often) have to accept the “dark side” too! Ruby is human in nature and has a lot of gotchas, tricks, weirdness and sometimes scary features that I plan to highlight. This talk aims to provide the “Ah-ha!” moments when working in Ruby.
This talk is for beginners and experts alike - in fact, I tag slides to mark their level and beginners can choose to tune out of the heavy stuff! My talk shall cover the dark side of the following features of Ruby (in no particular order)
Keyword wierdness
method missing
Module inheritance! (huh?)
Accessor righteousness
Curried Procs for the hungry
Base Conversions
Cherry picking module methods
Oniguruma games
Object id weirdness
procs, blocks and our friend stabby.
==, ===, eql? and equal?
and more…
As with most of my talks, humor plays an important role and I shall aim to get everyone high on Ruby with a deep dive!
For fun: An algorithm and Python Code for creating word chains between words of the same length. Words are linked on the chain if they differ by only one letter. All words must be English words (e.g. contained in Unix words file with possible additions of missing words). Example: wife -> life -> live -> love
Techniques for Reviewing a User InterfaceRhonda Bracey
Rhonda Bracey's presentation from the WritersUA 2008 Conference (Portland, OR)
****************
"Can you just look over these new screens for us? Oh, and can you check the error messages too? It won't take long!" If you've been asked to review a web or standalone application's user interface but don't know what to look for other than checking the text, then this session is for you. As technical communicators, we are often in a position to identify usability problems related to the logical flow, layout, and structure of the interface; inconsistencies in the design; non-compliance with standards and guidelines; ambiguous wording on labels, error messages, dialogs, and onscreen user assistance; performance issues; functional errors; and the like. Rhonda shares practical checklists of things to look for when reviewing an interface, as well as various tools that can assist you.
— YOU WILL LEARN —
* What to look for when checking an application's user interface, including overall design, textual and visual elements, user actions and interactions, navigational links, and the '-ilities': accessibility, readability, usability.
* About some tools that can help automate parts of the review process.
**************
Other supporting material available from here: http://www.cybertext.com.au/10353.htm
Value objects express “‘what’ something is rather than ‘who’ or ‘which’ it is.” In other words, values lack identity.
For example, the number 10 or the color red - all instances of 10 are conceptually equal to all other instances of 10, and likewise, red is always red. Two red bikes, however, have distinct identities.
We’ll explore how extracting value objects can simplify the challenge of bringing the real-world to bear as software. Then, we’ll touch on some strategies for integrating value objects with everyone’s favorite ORM, ActiveRecord.
Discussing language constructs with fellow developers in the context of solving a particular problem is something we do routinely. While most such conversations are productive and useful, a fair portion degenerate into angry brawls. A pattern we've observed in the latter situation is that a surprising number of times the argument is that "Why shouldn't I use language feature X to achieve objective Y- after all, the language supports X."
In this talk Aakash and Niranjan walk through a few features of the Ruby language which when used wisely allows programmers to solve problems elegantly but if they are used without caution can lead to bad code.
There are many things that make Ruby a great language, but above all else, the beautiful and friendly syntax. A perfect exemplar of this is the case statement: case enables a flexible method of dispatching on an object that is both natural and intuitive. But case can't do it alone. No, it requires the help of it's little-known and under-appreciated sidekick the === (threequals) operator.
In this talk we'll dive into this fascinating corner of the Ruby language and see what trouble we can cause with the humble threequals. We'll go over the basics of how it interacts with case, and then go into some tips and tricks for making the most of this useful bit of syntax, and ultimately create a little pattern matching mini-language as a demonstration.
RedDot Ruby Conf 2014 - Dark side of ruby Gautam Rege
I love Ruby! But as in any relationship, to love means that you (often) have to accept the “dark side” too! Ruby is human in nature and has a lot of gotchas, tricks, weirdness and sometimes scary features that I plan to highlight. This talk aims to provide the “Ah-ha!” moments when working in Ruby.
This talk is for beginners and experts alike - in fact, I tag slides to mark their level and beginners can choose to tune out of the heavy stuff! My talk shall cover the dark side of the following features of Ruby (in no particular order)
Keyword wierdness
method missing
Module inheritance! (huh?)
Accessor righteousness
Curried Procs for the hungry
Base Conversions
Cherry picking module methods
Oniguruma games
Object id weirdness
procs, blocks and our friend stabby.
==, ===, eql? and equal?
and more…
As with most of my talks, humor plays an important role and I shall aim to get everyone high on Ruby with a deep dive!
For fun: An algorithm and Python Code for creating word chains between words of the same length. Words are linked on the chain if they differ by only one letter. All words must be English words (e.g. contained in Unix words file with possible additions of missing words). Example: wife -> life -> live -> love
You do not need automation engineer - Sqa Days - 2015 - ENIakiv Kramarenko
English Version of presentation for the "You don't need automation engineer" talk, given (in russian) at SQA Days 2015.
You can watch the "screencast" try-out cut at https://youtu.be/TZhbI-JPdG0
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...Levi Shapiro
Letter from the Congress of the United States regarding Anti-Semitism sent June 3rd to MIT President Sally Kornbluth, MIT Corp Chair, Mark Gorenberg
Dear Dr. Kornbluth and Mr. Gorenberg,
The US House of Representatives is deeply concerned by ongoing and pervasive acts of antisemitic
harassment and intimidation at the Massachusetts Institute of Technology (MIT). Failing to act decisively to ensure a safe learning environment for all students would be a grave dereliction of your responsibilities as President of MIT and Chair of the MIT Corporation.
This Congress will not stand idly by and allow an environment hostile to Jewish students to persist. The House believes that your institution is in violation of Title VI of the Civil Rights Act, and the inability or
unwillingness to rectify this violation through action requires accountability.
Postsecondary education is a unique opportunity for students to learn and have their ideas and beliefs challenged. However, universities receiving hundreds of millions of federal funds annually have denied
students that opportunity and have been hijacked to become venues for the promotion of terrorism, antisemitic harassment and intimidation, unlawful encampments, and in some cases, assaults and riots.
The House of Representatives will not countenance the use of federal funds to indoctrinate students into hateful, antisemitic, anti-American supporters of terrorism. Investigations into campus antisemitism by the Committee on Education and the Workforce and the Committee on Ways and Means have been expanded into a Congress-wide probe across all relevant jurisdictions to address this national crisis. The undersigned Committees will conduct oversight into the use of federal funds at MIT and its learning environment under authorities granted to each Committee.
• The Committee on Education and the Workforce has been investigating your institution since December 7, 2023. The Committee has broad jurisdiction over postsecondary education, including its compliance with Title VI of the Civil Rights Act, campus safety concerns over disruptions to the learning environment, and the awarding of federal student aid under the Higher Education Act.
• The Committee on Oversight and Accountability is investigating the sources of funding and other support flowing to groups espousing pro-Hamas propaganda and engaged in antisemitic harassment and intimidation of students. The Committee on Oversight and Accountability is the principal oversight committee of the US House of Representatives and has broad authority to investigate “any matter” at “any time” under House Rule X.
• The Committee on Ways and Means has been investigating several universities since November 15, 2023, when the Committee held a hearing entitled From Ivory Towers to Dark Corners: Investigating the Nexus Between Antisemitism, Tax-Exempt Universities, and Terror Financing. The Committee followed the hearing with letters to those institutions on January 10, 202
Safalta Digital marketing institute in Noida, provide complete applications that encompass a huge range of virtual advertising and marketing additives, which includes search engine optimization, virtual communication advertising, pay-per-click on marketing, content material advertising, internet analytics, and greater. These university courses are designed for students who possess a comprehensive understanding of virtual marketing strategies and attributes.Safalta Digital Marketing Institute in Noida is a first choice for young individuals or students who are looking to start their careers in the field of digital advertising. The institute gives specialized courses designed and certification.
for beginners, providing thorough training in areas such as SEO, digital communication marketing, and PPC training in Noida. After finishing the program, students receive the certifications recognised by top different universitie, setting a strong foundation for a successful career in digital marketing.
Operation “Blue Star” is the only event in the history of Independent India where the state went into war with its own people. Even after about 40 years it is not clear if it was culmination of states anger over people of the region, a political game of power or start of dictatorial chapter in the democratic setup.
The people of Punjab felt alienated from main stream due to denial of their just demands during a long democratic struggle since independence. As it happen all over the word, it led to militant struggle with great loss of lives of military, police and civilian personnel. Killing of Indira Gandhi and massacre of innocent Sikhs in Delhi and other India cities was also associated with this movement.
This slide is special for master students (MIBS & MIFB) in UUM. Also useful for readers who are interested in the topic of contemporary Islamic banking.
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Dr. Vinod Kumar Kanvaria
Exploiting Artificial Intelligence for Empowering Researchers and Faculty,
International FDP on Fundamentals of Research in Social Sciences
at Integral University, Lucknow, 06.06.2024
By Dr. Vinod Kumar Kanvaria
Francesca Gottschalk - How can education support child empowerment.pptxEduSkills OECD
Francesca Gottschalk from the OECD’s Centre for Educational Research and Innovation presents at the Ask an Expert Webinar: How can education support child empowerment?
How to Make a Field invisible in Odoo 17Celine George
It is possible to hide or invisible some fields in odoo. Commonly using “invisible” attribute in the field definition to invisible the fields. This slide will show how to make a field invisible in odoo 17.
8. My name is James.
My name is not Jesus.
{ “My name” => [“is”],
“name is” => [“James”, “not”],
…}
9. class MarkovChain
def learn(text)
text.strip
.sub(/s+/, " ")
.sub(/( .){3,}/) { $&.delete(" ") }
.scan(/(?:w[-'w]*|,|(?:.{3,} |[.!?] ))/)
.each_cons(@order + 1) do |words|
if @starters.empty?
@starters << words[0..-2]
elsif words.first =~ /A[.!?]/
@starters << words[1..-1]
end
(@word_map[words[0..-2]] ||= [ ]) << words[-1]
end
end
end
10. class MarkovChain
def contruct_paragraph(sentence_count = rand(10) + 1)
words = @starters.sample
sentences = words.count { |word| word =~ /A[.!?]/ }
until sentences >= sentence_count
if choices = @word_map[words.last(@order)]
words << choices.sample
sentences += 1 if words.last =~ /A[.!?]/
else
start = @starters.sample
words.push(*start)
sentences += start.count { |word| word =~ /A[.!?]/ }
end
end
paragraph = words.join(' ')
.gsub(/ ([,.!?])/, '1')
.gsub(/.( .)+/, ".")
.gsub(/AW+/, "")
"t#{paragraph}n"
end
end
11. class MarkovChain
def contruct_paragraph(sentence_count = rand(10) + 1)
words = @starters.sample
sentences = words.count { |word| word =~ /A[.!?]/ }
until sentences >= sentence_count
if choices = @word_map[words.last(@order)]
words << choices.sample
sentences += 1 if words.last =~ /A[.!?]/
else
start = @starters.sample
words.push(*start)
sentences += start.count { |word| word =~ /A[.!?]/ }
end
end
paragraph = words.join(' ')
.gsub(/ ([,.!?])/, '1')
.gsub(/.( .)+/, ".")
.gsub(/AW+/, "")
"t#{paragraph}n"
end
end
12. class MarkovChain
def contruct_paragraph(sentence_count = rand(10) + 1)
words = @starters.sample
sentences = words.count { |word| word =~ /A[.!?]/ }
until sentences >= sentence_count
if choices = @word_map[words.last(@order)]
words << choices.sample
sentences += 1 if words.last =~ /A[.!?]/
else
start = @starters.sample
words.push(*start)
sentences += start.count { |word| word =~ /A[.!?]/ }
end
end
paragraph = words.join(' ')
.gsub(/ ([,.!?])/, '1')
.gsub(/.( .)+/, ".")
.gsub(/AW+/, "")
"t#{paragraph}n"
end
end
13.
14.
15. require "open-uri"
def load_fairy_tales
open("#{URL}/index.html") do |list|
list.read.scan(/href="([^"]+.txt)"/) do |story_url|
open("#{URL}/#{story_url.first}") do |story|
text = story.read
if text.sub!(/As*(w.+w)/, "0")
print "Loading #{$1}... " if DEBUG
yield text
puts "Done." if DEBUG
end
end
end
end
end
16. DEBUG = ARGV.delete("-d")
URL = "http://www.kidsnewsroom.org/elmer/infocentral/stories/grimm"
CHAIN_FILE = "markov_chain.marshal"
def build_chain
if File.exist? CHAIN_FILE
File.open(CHAIN_FILE) { |file| Marshal.load(file) }
else
MarkovChain.new.tap { |chain|
load_fairy_tales { |tale| chain.learn(tale) }
File.open(CHAIN_FILE, "w") { |file| Marshal.dump(chain, file) }
}
end
end
chain = build_chain
bible_length = File.size("bible.txt")
open("generated_tales.txt", "w") do |tales|
until tales.size >= bible_length
tales.write(chain.contruct_paragraph)
end
end
18. NONSENSE
Jack's life had gone into the depths of the beds.
After having counted again and then pretended to begin
working on them, the dwarfs advice I'm an old hut made of
twigs and dead leaves.
A whole world was stirring to life and the Princess fussed
around and ordered new clothes to be coming from inside
the oven door shut.
19. THOUGHT PROVOKING
But wealth doesn't always bring happiness.
In the meantime, Puss in Boots.
He was a lovely girl.
The gold pieces were spent to buy a lot more than any
mangy donkey or half-ruined mill, the bowl lay empty on a
large spider who promised to help her.
You are, your Highness, you'll have to work like the others,
or you'll not get even that.
20. SCARY
Hope flooded Pinocchio's heart as the water rushed into its
cavern-like mouth…
…the second Geppetto carved out the bone You're still
much too thin she complained.
Hansel opened the door. Who's there cried Grandma from
her bed It's me, otherwise it won't taste nice.
35. I GOOGLED IT
I know it sounds weird but you can put cabbage leaves on
your breasts and it will dry your milk out! I did it and it
works.
36. I GOOGLED IT
I know it sounds weird but you can put cabbage leaves on
your breasts and it will dry your milk out! I did it and it
works.
Cool cabbage compresses will reduce swelling quickly, and if
left in place for long periods will help diminish milk supply.
This method may be used instead of or in addition to
removing small amounts of milk to reduce supply. Use fresh
green leaves, cleaned and chilled, wrapped around the
breasts. Change them about every two hours.
42. TRAITS OF A SKEPTIC
Questions authority
A questioning attitude of knowledge, facts, or opinions/
beliefs stated as facts
Suspended judgement and systemic doubt
Requires all new information to be well supported by
evidence
46. LOGICAL FALLACIES
Christianity has the largest group of followers, because it’s
the best religion.
God exists because the Bible says so. The Bible is inspired.
Therefore, we know that God exists.
47. LOGICAL FALLACIES
Christianity has the largest group of followers, because it’s
the best religion.
God exists because the Bible says so. The Bible is inspired.
Therefore, we know that God exists.
Either God exists or evolution is true.
48. LOGICAL FALLACIES
Christianity has the largest group of followers, because it’s
the best religion.
God exists because the Bible says so. The Bible is inspired.
Therefore, we know that God exists.
Either God exists or evolution is true.
William Lane Craig is a jerk. I can’t listen to his debates.
49. LOGICAL FALLACIES
Christianity has the largest group of followers, because it’s
the best religion.
God exists because the Bible says so. The Bible is inspired.
Therefore, we know that God exists.
Either God exists or evolution is true.
William Lane Craig is a jerk. I can’t listen to his debates.
God doesn’t reveal Himself to nonbelievers.
52. BRAIN ODDITIES
The ideo-motor response: vividly imagine sucking on a
lemon and you may salivate
Pareidolia: why you see animals/faces in the clouds
53. BRAIN ODDITIES
The ideo-motor response: vividly imagine sucking on a
lemon and you may salivate
Pareidolia: why you see animals/faces in the clouds
Hypnagogia: ???
54. AS YOU KNOW IT
http://ufoclearinghouse.webs.com/ufochreportingcenter.htm
55. MEMBER BENEFITS
We never get abducted by aliens
We don’t lose sleep over the Feng Shui in our houses
We save a lot of money by avoiding alternative medical
treatments like acupuncture, chiropractors, etc.
We get to study tons of interesting subjects
Our children have a higher survival rate since we vaccinate
56. DIRTY LITTLE SECRETS
We kill a sacred cow to join
We’re all mad that second hand smoke doesn’t kill people
We can be slow to react to things like man-made global
warming
We have to be careful not too see logical fallacies
everywhere
We have to remember to be skeptical, not cynical
58. HIDDEN PROPHECY
Equidistant Linguistic Sequences spell out historic events
Events occurring after the Bible can be found
However, they are usually wrong unless we find them after
they occur
Works best with the English and Hebrew translations
59. A GRID OF LETTERS
http://en.wikipedia.org/wiki/Bible_code
64. class ELSSearch
def find_sequences(word, min_offset)
matched = false
letters = word.split("")
loop do
puts "Searching #{min_offset} for #{word}..." if DEBUG
@text.scan( / #{letters.join(".{#{min_offset}}")} |
#{letters.reverse.join(".{#{min_offset}}")} /x ) do
matched = true
@sequences[word][min_offset] << $~.offset(0)
end
break if matched
min_offset += 1
end
end
end
65. class ELSSearch
def find_sequences(word, min_offset)
matched = false
letters = word.split("")
loop do
puts "Searching #{min_offset} for #{word}..." if DEBUG
@text.scan( / #{letters.join(".{#{min_offset}}")} |
#{letters.reverse.join(".{#{min_offset}}")} /x ) do
matched = true
@sequences[word][min_offset] << $~.offset(0)
end
break if matched
min_offset += 1
end
end
end
66. class ELSSearch
def box_results(result = SearchResult.new, words = @words)
word = words.first
@sequences[word].each_value do |bounds|
bounds.each do |start, stop|
if result.overlaps?(start, stop)
expanded_results = result.expand(start, stop, word)
if words.size <= 1
return expanded_results
else
if nested_results = box_results(expanded_results, words[1..-1])
return nested_results
end
end
end
end
end
nil
end
end
67. class ELSSearch
def box_results(result = SearchResult.new, words = @words)
word = words.first
@sequences[word].each_value do |bounds|
bounds.each do |start, stop|
if result.overlaps?(start, stop)
expanded_results = result.expand(start, stop, word)
if words.size <= 1
return expanded_results
else
if nested_results = box_results(expanded_results, words[1..-1])
return nested_results
end
end
end
end
end
nil
end
end
68. class ELSSearch
def box_results(result = SearchResult.new, words = @words)
word = words.first
@sequences[word].each_value do |bounds|
bounds.each do |start, stop|
if result.overlaps?(start, stop)
expanded_results = result.expand(start, stop, word)
if words.size <= 1
return expanded_results
else
if nested_results = box_results(expanded_results, words[1..-1])
return nested_results
end
end
end
end
end
nil
end
end
69. class ELSSearch
def box_results(result = SearchResult.new, words = @words)
word = words.first
@sequences[word].each_value do |bounds|
bounds.each do |start, stop|
if result.overlaps?(start, stop)
expanded_results = result.expand(start, stop, word)
if words.size <= 1
return expanded_results
else
if nested_results = box_results(expanded_results, words[1..-1])
return nested_results
end
end
end
end
end
nil
end
end
70. class ELSSearch
def perform
@words.each do |word|
find_sequences(word, 1)
end
until @result = box_results
find_sequences(*lowest_sequence)
end
end
private
def lowest_sequence
word = @sequences.sort_by { |_, os| [os.keys.max, rand] }.first.first
[word, @sequences[word].keys.max + 1]
end
end
71. class ELSSearch
def perform
@words.each do |word|
find_sequences(word, 1)
end
until @result = box_results
find_sequences(*lowest_sequence)
end
end
private
def lowest_sequence
word = @sequences.sort_by { |_, os| [os.keys.max, rand] }.first.first
[word, @sequences[word].keys.max + 1]
end
end
72. class ELSSearch
def perform
@words.each do |word|
find_sequences(word, 1)
end
until @result = box_results
find_sequences(*lowest_sequence)
end
end
private
def lowest_sequence
word = @sequences.sort_by { |_, os| [os.keys.max, rand] }.first.first
[word, @sequences[word].keys.max + 1]
end
end
73. class ELSSearch
def perform
@words.each do |word|
find_sequences(word, 1)
end
until @result = box_results
find_sequences(*lowest_sequence)
end
end
private
def lowest_sequence
word = @sequences.sort_by { |_, os| [os.keys.max, rand] }.first.first
[word, @sequences[word].keys.max + 1]
end
end
74. class ELSSearch
def show_results(highlight = false)
matched_text = @text[@result.start...@result.stop]
lowest_offset = @result.mapping.values.map(&:first).min
box_size = nil
@result.mapping.each do |w, os|
i = os.first - lowest_offset
o = (os.last - os.first - w.size) / (w.size - 1)
box_size = o if box_size.nil? or o > box_size
w.size.times do |c|
j = i + ((o + 1) * c)
matched_text[j, 1] = matched_text[j, 1].upcase
end
end
matched_text.gsub!(/G.{#{[box_size, 80].min}}/, "0n")
matched_text.gsub!(/[A-Z]/, "e[1m0e[0m") if highlight
matched_text
end
end
75. class SearchResult
def initialize(start = nil, stop = nil, mapping = { })
@start = start
@stop = stop
@mapping = mapping
end
attr_reader :start, :stop, :mapping
def overlaps?(start, stop)
(@start.nil? and @stop.nil?) or (stop >= @start and start <= @stop)
end
def expand(start, stop, word)
self.class.new( [@start, start].compact.min,
[@stop, stop].compact.max,
@mapping.merge(word => [start, stop]) )
end
end
76. class SearchResult
def initialize(start = nil, stop = nil, mapping = { })
@start = start
@stop = stop
@mapping = mapping
end
attr_reader :start, :stop, :mapping
def overlaps?(start, stop)
(@start.nil? and @stop.nil?) or (stop >= @start and start <= @stop)
end
def expand(start, stop, word)
self.class.new( [@start, start].compact.min,
[@stop, stop].compact.max,
@mapping.merge(word => [start, stop]) )
end
end
98. SCIENCE OR FICTION
Episode 80, 1/31/2007:
New study shows that men enjoy romantic movies, so-
called chick flicks, almost as much as women.
99. SCIENCE OR FICTION
Episode 80, 1/31/2007:
New study shows that men enjoy romantic movies, so-
called chick flicks, almost as much as women.
A recent study has found that the most unpleasant sound
to humans is the sound of nails scratching across a
blackboard.
100. SCIENCE OR FICTION
Episode 80, 1/31/2007:
New study shows that men enjoy romantic movies, so-
called chick flicks, almost as much as women.
A recent study has found that the most unpleasant sound
to humans is the sound of nails scratching across a
blackboard.
Researchers have witnessed free-ranging spider monkeys
anointing themselves with crushed aromatic plants that
they believe is used as a type of perfume.
104. OTHER RESOURCES
Blogs Books by
Skepchick James Randi
Bad Astronomy Jon Ronson
Podcasts Richard Wiseman
Skeptiod
QuackCast
105. OTHER RESOURCES
Blogs Books by
Skepchick James Randi
Bad Astronomy Jon Ronson
Podcasts Richard Wiseman
Skeptiod Magazines
QuackCast Skeptical Inquirer
109. (CONTINUED)
TV Shows Web Sites
South Park Snopes.com
Bullshit! An Index to Creationist
Claims
CSI
Uncomfortable
iPhone App Questions: Was the
Death Star Attack an
Skeptic’s Dictionary
Inside Job?