This file contains hidden or 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
| import smtplib | |
| fromaddr = 'email@gmail.com' | |
| toaddrs = 'email@gmail.com' | |
| msg = 'There was a terrible error that occured and I wanted you to know!' | |
| # Credentials (if needed) | |
| username = 'email@gmail.com' | |
| password = '' |
This file contains hidden or 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
| import bubbles | |
| URL = "https://raw.github.com/Stiivi/cubes/master/examples/hello_world/data.csv" | |
| p = bubbles.Pipeline() | |
| p.source(bubbles.data_object("csv_source", URL, infer_fields=True)) | |
| p.aggregate("Category", "Amount (US$, Millions)") | |
| p.pretty_print() |
This file contains hidden or 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
| SELECT | |
| SUBSTRING([Customer Phone], 1, 3) + '-' + SUBSTRING([Customer Phone], 4, 3) + '-' +SUBSTRING([Customer Phone], 7, 4) | |
| FROM tablename |
This file contains hidden or 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
| DECLARE @MMDDYYYY VARCHAR(10) | |
| SET @MMDDYYYY = '07042013' | |
| SELECT STUFF(STUFF(@MMDDYYYY, 3, 0, '/'), 6, 0, '/') AS [MM/DD/YYYY] |
This file contains hidden or 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
| DECLARE @Heroes TABLE ( | |
| [HeroName] VARCHAR(20) | |
| ) | |
| INSERT INTO @Heroes ( [HeroName] ) | |
| VALUES ( 'Superman' ), ( 'Batman' ), ('Ironman'), ('Wolverine') | |
| --SELECT * FROM @Heroes | |
| SELECT STUFF((SELECT ',' + [HeroName] | |
| FROM @Heroes |
This file contains hidden or 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
| substring( LEFT([Product Details], charindex('Product Name', [Product Details], CHARINDEX('SKU: ', [Product Details]))-3), CHARINDEX('SKU: ', [Product Details]) + len('SKU: '), LEN([Product Details])) |
This file contains hidden or 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
| ,REPLACE( | |
| REPLACE( | |
| REPLACE( | |
| REPLACE( | |
| REPLACE([Billing Phone],'(','') | |
| ,')','') | |
| ,'-','') | |
| ,' ','') | |
| ,'+','') AS PhoneNumber |
This file contains hidden or 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
| ,RIGHT(columnname, LEN(columnname) - 2) AS MyTrimmedColumn |
This file contains hidden or 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 DatabaseNameHere | |
| SELECT | |
| -- This CASE Expression Verifies that the Value in the UPC Field is All Numbers and It's Total Length is 12 | |
| ,CASE WHEN ISNUMERIC(UPC) = 1 AND LEN([UPC]) = 12 THEN [UPC] | |
| WHEN ISNUMERIC(UPC) = 1 AND LEN([UPC]) = 11 THEN '0'+[UPC] | |
| ELSE '' END AS [UPC] | |
| FROM dbo.YourTableNameHere |
This file contains hidden or 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
| from suds.client import Client | |
| import logging | |
| logging.basicConfig(level=logging.INFO) | |
| logging.getLogger('suds.client').setLevel(logging.DEBUG) | |
| # Specify Login Information | |
| developer_key = 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' | |
| password = 'xxxxxxxx' | |
| account_guid = 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' |
OlderNewer