Skip to content

Instantly share code, notes, and snippets.

View santoshtechwiz's full-sized avatar

santosh kumar singh santoshtechwiz

View GitHub Profile
@santoshtechwiz
santoshtechwiz / CFunction.g4
Created December 22, 2021 08:38 — forked from mattmcd/CFunction.g4
ANTLR4 version of Wrapper Generator
grammar CFunction;
function : retType name args ;
args : '(' arg (',' arg)* ')' ;
arg
: 'double' name # SCALAR_ARG
| 'double' '*' name # ARRAY_ARG
<UserSettings><ApplicationIdentity version="16.0"/><ToolsOptions><ToolsOptionsCategory name="Environment" RegisteredName="Environment"><ToolsOptionsSubCategory name="General" RegisteredName="General" PackageName="Visual Studio Environment Package">
<PropertyValue name="AnimationSpeed">7</PropertyValue>
<PropertyValue name="AutoAdjustExperience">true</PropertyValue>
<PropertyValue name="AutohidePinActiveTabOnly">false</PropertyValue>
<PropertyValue name="CloseButtonActiveTabOnly">true</PropertyValue>
<PropertyValue name="MRUListContainsNItems">10</PropertyValue>
<PropertyValue name="ShowStatusBar">true</PropertyValue>
<PropertyValue name="WindowMenuContainsNItems">10</PropertyValue>
</ToolsOptionsSubCategory><ToolsOptionsSubCategory name="ProjectsAndSolution" RegisteredName="ProjectsAndSolution" PackageName="Visual Studio Environment Package"><PropertyValue name="ProjectsLocation">%vsspv_user_appdata%\Source\Repos</PropertyValue><PropertyValue name="PromptForRenameSymbol">true</P
@santoshtechwiz
santoshtechwiz / AND_OR_NOT
Created June 7, 2021 05:22 — forked from oliverdoetsch/AND_OR_NOT
Blogger: Globally conditional data tags for all page types
#AND
<b:if cond='data:blog.pageType == "index"'>
<b:if cond='data:blog.searchQuery'>
<!--search_page AND index_page-->
</b:if>
</b:if>
#OR
@santoshtechwiz
santoshtechwiz / jquery-mock.js
Created April 26, 2021 14:05 — forked from dbalduini/jquery-mock.js
JQuery stub and mock with Sinon for Unit Tests
(function () {
'use strict';
var sinon = require('sinon');
var keys = ['closest', 'addClass', 'children', 'parent', 'find', 'html',
'remove', 'text', 'ready', 'unveil', 'removeAttr', 'removeClass', 'scroll',
'val', 'height', 'css', 'delay', 'queue', 'dequeue', 'attr'];
function JQueryStub (args) {
var self = this;
@santoshtechwiz
santoshtechwiz / RequestsInParallel.cs
Created July 25, 2020 12:24 — forked from LukeTillman/RequestsInParallel.cs
Async Requests in Parallel
// Use a prepared statement for all the INSERTs
PreparedStatement prepared = session.Prepare("INSERT INTO sometable (column1, column2) VALUES (?, ?)");
// Create a list to hold in flight requests
var requestList = new List<Task>();
// Assume you have some collection of data that needs to be inserted
foreach(var data in dataToInsert)
{
// Provide data values to be inserted with our prepared statement for this piece of data
@santoshtechwiz
santoshtechwiz / webcrawler.cs
Created January 1, 2019 17:58 — forked from icanhasjonas/webcrawler.cs
Web Crawler in C#
using System;
using System.Buffers;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
@santoshtechwiz
santoshtechwiz / PhysicalLatLonToPixelXY.html
Created September 19, 2018 10:23 — forked from iamjpg/PhysicalLatLonToPixelXY.html
Google Maps v3 – Translate Physical Latitude/Longitude into Screen Pixel X/Y
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>google_maps_custom_point</title>
<style>
body {
margin: 0;
@santoshtechwiz
santoshtechwiz / longestCommonSubstring3.cs
Created September 14, 2017 19:40 — forked from jianminchen/longestCommonSubstring3.cs
longest common substring - brute force solution - O(n^3) - code after reviewing.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace longestCommonSubstring
{
class Program
{
@santoshtechwiz
santoshtechwiz / get-permutations.cs
Created September 11, 2017 19:15 — forked from mbenford/get-permutations.cs
Generates all permutations of a set by using LINQ and a recursive approach
public static class Permutations
{
public static IEnumerable<IEnumerable<T>> Get<T>(IEnumerable<T> set, IEnumerable<T> subset = null)
{
if (subset == null) subset = new T[] { };
if (!set.Any()) yield return subset;
for (var i = 0; i < set.Count(); i++)
{
var newSubset = set.Take(i).Concat(set.Skip(i + 1));
@santoshtechwiz
santoshtechwiz / QueueJakes.java
Created August 30, 2017 18:52 — forked from jakswa/QueueJakes.java
circular queue in java
import java.util.Scanner;
public class QueueJakes {
public static void main (String [] args) {
Scanner myscan = new Scanner(System.in);
System.out.print("Enter max queue size: ");
int qSize = myscan.nextInt(), choice;
Queue q = new Queue(qSize);