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
| using System; | |
| using System.Net; | |
| using System.Security.Cryptography; | |
| using System.Text; | |
| namespace EANAPI | |
| { | |
| class Program | |
| { | |
| static void Main(string[] args) | |
| { |
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 case was, I had some pictures selected in Google Photos. But, they were of low quality and not good for printing. Hence, needed to find the same pictures in Camera Memory card. | |
| import os | |
| import shutil | |
| # location of low quality images | |
| googlePhotosalbumPath = '/Users/lowQualityImages' | |
| # location of high quality images | |
| originalPath = '/Volumes/MEMORY_CARD/DCIM/' |
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
| =IIF( Globals!RenderFormat.Name="WORD" OR | |
| Globals!RenderFormat.Name="XML" OR | |
| Globals!RenderFormat.Name="CSV" OR | |
| Globals!RenderFormat.Name="TAB" OR | |
| Globals!RenderFormat.Name="PDF" OR | |
| Globals!RenderFormat.Name="MHTML" OR | |
| Globals!RenderFormat.Name="EXCEL", | |
| Format(Fields!Revenue.Value, "#0.00"), | |
| Format(Fields!Revenue.Value, "$#0.00") | |
| ) |
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 @date date = getdate() -30, @cmd varchar(1000) | |
| WHILE (@date < GETDATE()) | |
| BEGIN | |
| SET @cmd = 'START DTExec.exe /f "<package>.dtsx" /set \package.variables[User::<variableName>].Value;' + CONVERT(char(10), @date,126); | |
| exec master..xp_cmdshell @cmd | |
| SET @date = DATEADD(day, 1, @date) | |
| END |
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 CAST(DateAdd(ms, AVG(CAST(DateDiff( ms, '00:00:00', cast([Date Time] as time)) AS BIGINT)), '00:00:00' ) as Time ) AvgTime | |
| from table |
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( Substring((DT_WSTR,50) GETDATE(),1,19),"-",""),":","")," ","_") |
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
| /* | |
| -- Updated the code from here: http://vinay.inkeysolutions.com/2013/08/ssrs-download-all-rdl-files-from-report.html | |
| -- Allow advanced options to be changed. | |
| EXEC sp_configure 'show advanced options', 1 | |
| GO | |
| -- Update the currently configured value for advanced options. | |
| RECONFIGURE | |
| GO | |
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
| myObj <- read.table("<file>.TAB", sep="\t", fill = T, header=TRUE, quote = ""); | |
| sprintf("%d $%f", sum(myObj$IntColumn, na.rm = T), sum(myObj$MoneyColumn, na.rm = T)); |
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
| WITH cte AS ( | |
| SELECT primaryKeyColumn, | |
| row_number() OVER(PARTITION BY DateOrSomeColumn ORDER BY someColumn ASC) AS [rn] | |
| FROM TableName | |
| ) | |
| /* To verify the output first, comment the select and uncomment the delete statement to delete the rows */ | |
| SELECT * FROM cte WHERE [rn] > 1; | |
| /* uncomment below to delete */ |
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
| IF (OBJECT_ID('tempdb..#AllEmails') IS NOT NULL) | |
| DROP TABLE #AllEmails | |
| ; | |
| WITH subscriptionXmL | |
| AS ( SELECT SubscriptionID , | |
| OwnerID , | |
| Report_OID , | |
| Locale , | |
| InactiveFlags , | |
| ExtensionSettings , |
NewerOlder