We can make this file beautiful and searchable if this error is corrected: It looks like row 9 should actually have 21 columns, instead of 15 in line 8.
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
Type,Permitted,Country,Region,County,City,Delivery Region,Delivery County,Delivery City,Day,Month,Year,Weekday,StartTime,EndTime,Types,Delivery Postal Codes,AddressType,QtyBeerAllowed,QtyWineAllowed,QtySpiritsAllowed | |
ALCOHOL,ALLOWED,CA,AB,ANY,ANY,AB,ANY,ANY,ANY,ANY,ANY,ANY,10:00 ,23:59 ,DELIVERY,,ANY,ANY,ANY,ANY | |
ALCOHOL,PROHIBITED,CA,ON,ANY,ANY,ON,ANY,ANY,ANY,ANY,ANY,ANY,9:00 ,23:00,DELIVERY,,Residential,ANY,ANY,ANY | |
ALCOHOL,ALLOWED,US,AZ,ANY,ANY,AZ,ANY,ANY,ANY,ANY,ANY,ANY,6:00 ,23:59 ,CURBSIDE_AND_NON_CURBSIDE_AND_DELIVERY,,ANY,ANY,ANY,ANY | |
ALCOHOL,ALLOWED,US,CA,ANY,ANY,CA,ANY,ANY,ANY,ANY,ANY,ANY,6:00 ,23:59 ,CURBSIDE_AND_NON_CURBSIDE_AND_DELIVERY,,ANY,ANY,ANY,ANY | |
ALCOHOL,PROHIBITED,US,CO,ANY,ANY,CO,ANY,ANY,25,12,ANY,ANY,ANY,ANY,DELIVERY,,ANY,ANY,ANY,ANY | |
ALCOHOL,ALLOWED,US,CO,ANY,ANY,CO,ANY,ANY,ANY,ANY,ANY,ANY,8:00 ,23:59 ,DELIVERY,,ANY,ANY,ANY,ANY | |
ALCOHOL,ALLOWED,US,CT,ANY,ANY,CT,ANY,ANY,ANY,ANY,ANY,MON,8:00 ,22:00 ,DELIVERY,,ANY,ANY,ANY,ANY | |
ALCOHOL,ALLOWED,US,CT,ANY,ANY,CT,ANY,ANY,ANY,ANY,ANY,TUE,8:00 ,22:00 |
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
# Given an arbitrary string (without spaces), print out all substrings that are palindromes | |
def generate_random_string(n) | |
n.times.map { rand(97..122).chr }.join | |
end | |
# SLOW SOLUTION | |
def all_substrings(chars) | |
len = chars.length |
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
Not in US | |
A-1 | |
A-2 | |
A-3 | |
AOS Applicant | |
Asylee | |
Asylum Applicant | |
B-1 | |
B-2 | |
C-1 |
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
# update thin merchant index with new field | |
include Utils::Business | |
ThinMerchant.elastic_scan_update do |t| | |
# only perform this reindex for Nevada for now | |
next t if t['state'] != 'NV' | |
tm = ThinMerchant.find_by_id(t['thin_merchant_id']) | |
if tm | |
service = Service.find(t['service_id']) | |
if (external_services = tm.highest_priority_external_services(service).presence) && external_services.count > 0 | |
custom_variation_names = external_services.map(&:variation_name) |
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
To get started on meditation, just follow these steps: | |
Just Sit: Commit to doing nothing more than sitting quietly and watching what | |
happens. Don't pick up the phone, don't answer the doorbell, don't add | |
another item to your to-do list. Just sit and observe the thoughts that arise | |
and pass through your mind. You will likely be surprised by how difficult it | |
is to sit quietly for 10 minutes. In the process, though, you may learn | |
something important about the qualities of the restless mind and the | |
ever-changing nature of life. |
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
<?php | |
class BinarySearchTree { | |
private $_root; | |
public function __construct() { | |
// setup sentinal node | |
$this->_root = new BinarySearchNode(null); | |
} | |
public function getRoot() { | |
return $this->hasNode() ? $this->_root->right : null; |
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
<?php | |
class HashTable { | |
private $_array = array(); | |
private $_size = 10000; | |
public function __construct($size=0) { | |
$size = (int)$size; | |
if ($size > 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
<?php | |
class Node { | |
private $_data; | |
public $next; | |
public function __construct($data) { | |
$this->_data = $data; | |
} |
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
def remove_consecutive_duplicates(xs) | |
[xs.first] + xs.each_cons(2).select do |x,y| | |
x != y | |
end.map(&:last) | |
end | |
remove_consecutive_duplicates([1, 2, 2, 3, 1]) | |
#=> [1,2,3,1] |
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
class stack { | |
private $arr = array(); | |
public function push($s) { | |
$this->arr[] = $s; | |
} | |
public function pop() { | |
return array_pop($this->arr); |
NewerOlder