Skip to content

Instantly share code, notes, and snippets.

require "rubygems"
require "sinatra"
require "erb"
require "digest/md5"
require "uri"
require "data_mapper"
set :static, true
set :public_folder, "#{File.dirname(__FILE__)}/public"
set :views, "#{File.dirname(__FILE__)}/views"
print "oi"
def square(n):
return n * n
def abs(n):
if n > 0:
return n
elif n < 0:
return -n
Failures:
1) User adds a note to a dealer in T-1000 note is added and shown on the dealer page
Failure/Error: go_to_dealer_page dealer.name
Capybara::ElementNotFound:
Unable to find link "Dealers"
# ./spec/support/helpers/ember_app_navigation/dealer.rb:11:in `go_to_dealers_page'
# ./spec/support/helpers/ember_app_navigation/dealer.rb:5:in `go_to_dealer_page'
# ./spec/features/t1000/notes_spec.rb:9:in `block (2 levels) in <top (required)>'
package tasks
import (
"fmt"
"github.com/asdine/storm"
"github.com/asdine/storm/q"
)
// Init storm
var DB *storm.DB
DB, err := storm.Open("my_storm.db")
sudo apt-get update
sudo apt-get -y upgrade
sudo apt-get -y install unzip python3-pip python3-setuptools python3-dev build-essential libssl-dev libffi-dev xvfb
sudo pip3 install --upgrade pip
export LANGUAGE=en_US.UTF-8
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
locale-gen en_US.UTF-8
sudo dpkg-reconfigure locales
pip3 install --upgrade pip
import java.io.*;
import java.util.*;
/*
Word Count Engine
Implement a document scanning function wordCountEngine, which receives a string document and returns a list of all unique words in it and their number of occurrences, sorted by the number of occurrences in a descending order. If two or more words have the same count, they should be sorted according to their order in the original sentence. Assume that all letters are in english alphabet. You function should be case-insensitive, so for instance, the words “Perfect” and “perfect” should be considered the same word.
The engine should strip out punctuation (even in the middle of a word) and use whitespaces to separate words.
Analyze the time and space complexities of your solution. Try to optimize for time while keeping a polynomial space complexity.