Skip to content

Instantly share code, notes, and snippets.

View kgashok's full-sized avatar
🎯
Focusing

Ashok Bakthavathsalam kgashok

🎯
Focusing
View GitHub Profile
@kgashok
kgashok / C#Example.cs
Created May 10, 2016 02:58 — forked from ahmedahamid/C#Example.cs
Why I started to feel differently about C# | Using Dictionaries
//
// (1) C#: Defining an initializing a dictionary [key type=string, value type=int]
//
Dictionary<string, int> dict = new Dictionary<string, int>()
{
{"Eve", 101},
{"George", 150},
{"Emma", 200}
};
//
@kgashok
kgashok / C++Example.cpp
Created May 10, 2016 02:57 — forked from ahmedahamid/C++Example.cpp
Why I started to feel differently about C# | Using STL map
//
// (1) C++: - Defining a dictionary [key type=string, value type=int]
// - No easy way to initialize.
//
map<string, int> dict;
//
// (1`) C++11: Defining and initializing a dictionary [key type=string, value type=int]
//
map<string, int> dict
{
@kgashok
kgashok / fizzbuzz.elm
Last active May 6, 2016 01:29 — forked from ctran/fizzbuzz.elm
Fizz Buzz in elm
import Graphics.Element exposing (Element, flow, down, show)
import List exposing (map)
main : Element
main =
let fizzBuzz n = case (n % 3, n % 5) of
(0, 0) -> "FizzBuzz"
(0, _) -> "Fizz"
(_, 0) -> "Buzz"
_ -> toString n
@kgashok
kgashok / Sample.elm
Created April 30, 2016 17:30 — forked from rundis/Sample.elm
Reversing a string using a stack
module Sample where
import Stack exposing (..)
import String
import Html exposing (..)
reverseString : String -> String
reverseString str =
String.split "" str
|> Stack.fromList
@kgashok
kgashok / todo.md
Last active August 29, 2015 14:03
both checked and unchecked

###ToDo list

  • Do it

  • Test it

  • Fix it

  • Done this well

  • Nice work!