Rama Charan's Blog
About technology and more..
Thursday, March 4, 2021
Saturday, November 7, 2020
Sql Query titbits
Generate Dates and hour between Date Range
DECLARE
@start DateTime = getdate() -1,
@end DateTime = getdate();
;
WITH Dates_CTE
AS (SELECT @start AS Dates
UNION ALL
SELECT Dateadd(hh, 1, Dates)
FROM Dates_CTE
WHERE Dates < @end)
SELECT DAY(dates),DATEPART(hour,Dates)
FROM Dates_CTE
OPTION (MAXRECURSION 0)
Got better queries? .. Add in comment .. Thanks
Wednesday, July 8, 2020
ef core tips
Debug code-first Entity Framework migration codes
Place this piece of code right above the migration you want to debug:
if (!System.Diagnostics.Debugger.IsAttached)
System.Diagnostics.Debugger.Launch();
More details / Ref : https://stackoverflow.com/a/52700520/193061
Thursday, July 2, 2020
Powershell TitBits
Replace all file names in a folder
Get-ChildItem -Filter “*ModelMap*” -Recurse | Rename-Item -NewName {$_.name -replace ‘ModelMap’ ,’ModelMapping’ }
Thursday, June 4, 2020
Java To C# mapping
Java C#
Map Dictionary
Set HashSet
Pair KeyValuePair
.map .Select
.collect .ToList()
.stream .AsEnumerable
LinkedHashSet <Need custom impl >
flatMap() SelectMany
format() String.format()
zip( .Zip(
joining() String.Join(
InstStream(1,100) Enumerable.Range(1, 100)
Function Func
.apply( .Invoke(
.isEmpty() .Any()
.size() .Count
.filter( .Where(
BiFunction Func
Monday, January 6, 2020
Addins for Software tools
SQL management addins
VS Code Addins
- Javascript/ Typescript
- Prettier
- using powershell
- d
Friday, January 3, 2020
RxJs Excellent posts
RxJs Excellent posts
RxJS Operators for Dummies: forkJoin, zip, combineLatest, withLatestFrom
https://scotch.io/tutorials/rxjs-operators-for-dummies-forkjoin-zip-combinelatest-withlatestfrom
Subscribe to:
Posts (Atom)
Devops links
Build Versioning in Azure DevOps Pipelines
-
Build Versioning in Azure DevOps Pipelines
-
Don't use FirstorDefault() unless you are sure its valid/ verified in the business scenario. else you are going to introduce bugs in t...
-
Generate Dates and hour between Date Range DECLARE @start DateTime = getdate() -1, @end DateTime = getdate(); ; WITH Dates_CTE ...