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
Verifying that +seifip is my blockchain ID. https://onename.com/seifip |
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
""" | |
Use a Counter to find the most common words in "The Wonderful Wizard of Oz" by | |
L. Frank Baum. | |
Available in plain text at: | |
https://ia700500.us.archive.org/2/items/thewonderfulwiza00055gut/wizoz10.txt | |
short link: http://bit.ly/thewonderfulwizard | |
Note: This code also counts the words in the header, so it's not a *realistic* |
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
const x = 0.2 + 0.1; | |
// ↪ 0.30000000000000004 |
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
CREATE OR REPLACE FUNCTION test_float() | |
RETURNS float AS $$ | |
DECLARE | |
price float = 0.0; | |
BEGIN | |
WHILE price < 10.0 LOOP | |
price = price + 0.1; | |
END LOOP; | |
RETURN price; | |
END; |
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
const x = 0.2 + 0.1; | |
// ↪ 0.30000000000000004 |
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
CREATE OR REPLACE FUNCTION test_float() | |
RETURNS float AS $$ | |
DECLARE | |
price float = 0.0; | |
BEGIN | |
WHILE price < 10.0 LOOP | |
price = price + 0.1; | |
END LOOP; | |
RETURN price; |
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
CREATE OR REPLACE FUNCTION test_float() | |
RETURNS float AS $$ | |
DECLARE | |
price float = 0.0; | |
BEGIN | |
WHILE price < 10.0 LOOP | |
price = price + 0.1; | |
END LOOP; | |
RETURN price; |
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
CREATE OR REPLACE FUNCTION test_numeric() | |
RETURNS numeric(3, 1) AS $$ | |
DECLARE | |
price numeric(3, 1) = 0.0; | |
BEGIN | |
WHILE price < 10.0 LOOP | |
price = price + 0.1; | |
END LOOP; | |
RETURN price; |
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
INSERT INTO items VALUES ('¥999'); | |
-- ERROR: 22P02: invalid input syntax for type money: "¥999" |
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
-- total_price | quantity | |
-- ::money | ::integer | |
-- ---------------------------- | |
-- $3.50 | 4 | |
SELECT price::numeric / quantity FROM items; | |
-- $0.87 | |
SELECT price::numeric / quantity; | |
-- 0.87500000000000000000 |
OlderNewer