Skip to content

Instantly share code, notes, and snippets.

View nagasudhirpulla's full-sized avatar
🎯
Focusing

Pulla Naga Sudhir nagasudhirpulla

🎯
Focusing
View GitHub Profile
@nagasudhirpulla
nagasudhirpulla / WebMercator.cs
Created September 26, 2017 17:03
C# Web Mercator utility class
/// <summary>
/// Conversion routines for Google, TMS, and Microsoft Quadtree tile representations, derived from
/// http://www.maptiler.org/google-maps-coordinates-tile-bounds-projection/
/// </summary>
public class WebMercator
{
private const int TileSize = 256;
private const int EarthRadius = 6378137;
private const double InitialResolution = 2 * Math.PI * EarthRadius / TileSize;
private const double OriginShift = 2 * Math.PI * EarthRadius / 2;
@nagasudhirpulla
nagasudhirpulla / angular_multiple_modules_views.html
Created January 28, 2018 17:42
Demonstrates how to create multiple angular ng-views using multiple modules. Note that is possible by using angular.bootstrap function.
<!DOCTYPE html>
<html>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular-route.js"></script>
<body>
<div id="myApp">
<p><a href="#/!">Main</a></p>
<a href="#!red">Red</a>
<a href="#!green">Green</a>
@nagasudhirpulla
nagasudhirpulla / dem_forecast_notes.md
Last active February 18, 2018 08:43
Demand Forecast Prediction Notes

Main Factors

Day of Week, Block of day, Tempurature Dependent load, Special day, load crash/load shedding

Demand Equation

Demand at a block
=
Connected Load * temp * (fTempSun * isSun + fTempMon * isMon + fTempTue * isTue + fTempWed * isWed + fTempThu * isThu + fTempFri * isFri + fTempSat * isSat)
+
Connected Load * (fDemSun * isSun + fDemMon * isMon + fDemTue * isTue + fDemWed * isWed + fDemThu * isThu + fDemFri * isFri + fDemSat * isSat)
@nagasudhirpulla
nagasudhirpulla / Notes_1.md
Last active March 10, 2018 09:55
Programming Concepts

When to use interface and abstract class - https://www.c-sharpcorner.com/article/when-to-use-abstract-class-and-interface-in-real-time-projects/

Interface = Abstract class without non abstract methods and members. Default scope for all interface members is Public

Virtual methods are those which can be overriden in the derived classes. By default class members are not virtual and hence cannot be overriden in derived classes.

https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/virtual

Inversion of Control - https://www.youtube.com/watch?v=vFzP2SaMyA0

  1. API security
  2. Use existing db to use IdentityUser Model Class in default aspnet security like rename fields etc. -- addressed in Tutorial_2_Security_API_Razor.md
  3. Extension Folder in the ASP core razor template
  4. Learn about Nullable
@nagasudhirpulla
nagasudhirpulla / pasteFile.py
Created August 12, 2018 14:34
python file transfer in network
# -*- coding: utf-8 -*-
"""
Created on Sun Aug 12 19:22:37 2018
@author: Nagasudhir
https://ashishpython.blogspot.com/2013/11/how-to-connect-one-computer-to-another_1.html?m=1
https://www.howtogeek.com/howto/16196/how-to-disconnect-non-mapped-unc-path-drives-in-windows/