Skip to content

Instantly share code, notes, and snippets.

View ambitiousrahul's full-sized avatar

Rahul Ranjan ambitiousrahul

View GitHub Profile
@ambitiousrahul
ambitiousrahul / gist:290af8ced3041421d4a798ce1c8684ab
Created February 21, 2024 05:32
Differentiating Standard Error and Standard Deviation in Sample Analysis- A Quick Reference
**Differentiating Standard Error and Standard Deviation in Sample Analysis- A Quick Reference:**
| Criteria | Standard Deviation (SD) | Standard Error (SE) |
|-------------------------------|-----------------------------------------------------------|----------------------------------------------------------|
| **Focus** | Individual data point variability within a sample. | Precision of a point estimate (e.g., sample mean). |
| **Formula** | \[SD = \sqrt{\frac{\sum{(X_i - \bar{X})^2}}{n}}\] | \[SE = \frac{SD}{\sqrt{n}}\] |
| **Application** | Describing the spread of data points. | Estimating how much the sample mean varies from the true population mean. |
| **Influence on Calculation** | Based solely on the sample. | Involves both sample variability and size.
@ambitiousrahul
ambitiousrahul / UpdateStoredProcedureWithTableTypeInputParamater.cs
Last active August 22, 2022 13:09
This methods calls stored procedure with table type input parameter using c# core
using Microsoft.Data.SqlClient;
using Microsoft.Data.SqlClient.Server;
///<summary>
/// Method that calls stored procedure accepting a table type parameter
///</summary>
async Task<int> UpdateProcedure(UpdateViewModel upViewMOdel)
{
List<SqlDataRecord> updateParams = new List<SqlDataRecord>();
@ambitiousrahul
ambitiousrahul / Abstract Factory Pattern Implementation for Error Classification in global handlers while creating web apis
Last active August 5, 2022 12:00
While working on the web api with csharp PL, its often a case that we need to implement a global exception handler so as to define a common place to account for all kinds of exceptions that we want to handle. This certainly improves code readability and maintainability. So, this presents a scenario to implement Abstract Factory Pattern which not…
// The Global Exception Handler File that leverages this ErrorClassificationFactory class.
using System;
using Microsoft.AspNetCore.Http;
using System.Threading.Tasks;
using Microsoft.Data.SqlClient;
using System.Web.Http;
using System.Data.SqlTypes;
using Microsoft.EntityFrameworkCore;
@ambitiousrahul
ambitiousrahul / LazyLoadingDemo.cs
Last active December 21, 2021 10:09
Lazy Loading Techniques in C# dotnet core.
using System;
using System.Diagnostics;
namespace LazyLoadingExample
{
public class MyPreferences
{
private Widget myWidget = null;
public Widget GetMyWidgetObject(int widgetId)
@ambitiousrahul
ambitiousrahul / ConsistentHash.py
Created October 17, 2021 10:49
Contains Simplistic ConsistentHashing class code written in Python
"""Node to be added to hashring based on th its hash value."""
class Node:
def __init__(self,nodeHashValue) -> None:
self.hashValue =nodeHashValue
# resources are maintained in a local dictionary for HashRing node.
self.resources={}
self.previous=None
self.next=None