Skip to content

Instantly share code, notes, and snippets.


Kedar Mhaswade kedarmhaswade

  • JyMob
  • Sunnyvale, USA
View GitHub Profile
kedarmhaswade / devanagari-based-multi-lingual-template.tex
Last active Mar 27, 2021
A basic smartphone-viewable template for devanagari based articles typeset for different (Indic) languages. Uses velthuis encoding for 7-bit ASCII transliteration.
View devanagari-based-multi-lingual-template.tex
% Thanks to:
kedarmhaswade / .ruby-gemset
Last active Feb 22, 2021
Learning SQL (O'Reilly) With SQLite instead of MySQL
kedarmhaswade / elements.txt
Created Aug 2, 2020
118 elements from the modern periodic table: name, symbol, atomic number
View elements.txt

Mathematical Creation

How is mathematics made? What sort of brain is it that can compose the propositions and systems of mathematics? How do the mental processes of the geometer or algebraist compare with those of the musician, the poet, the painter, the chess player? In mathematical creation which are the key elements? Intuition? An exquisite sense of space and time? The precision of a calculating machine? A powerful memory? Formidable skill in following complex logical sequences? A supreme capacity for concentration?

The essay below, delivered in the first years of this century as a lecture before the Psychological Society in Paris, is the most celebrated of the attempts to describe what goes on in the mathematician's brain. Its author, Henri Poincaré, cousin of Raymond, the politician, was peculiarly fitted to undertake the task. One of the foremost mathematicians of all time, unrivaled as an analyst and mathematical physicist, Poincaré was known also as a brilliantly lucid expositor of the philosophy

kedarmhaswade /
Created Apr 22, 2019
A method call expression results in a value, not an automatic variable (that should appear on the lhs of an assignment statement)
class ValueIsNotVariable {
static int get() {
return 10;
static void inc() {
get() += 1;
➜ Java javac
kedarmhaswade / .psudo
Last active Feb 8, 2019
A simple, but mysterious function
View .psudo
// This is simply some pseudo code; applicable to any programming language that has support for
// basic data types and recursive functions
// Two questions:
// 1- Solve the "mystery": what does the function do?
// 2- Enhance the function to accommodate other integers.
function mystery(int a, int b) {
if (b == 1) {
return a
return mystery(a, b - 1) + a
kedarmhaswade / queue.go
Last active Jan 18, 2019
A naive circular buffer ...
View queue.go
// A naive circular buffer ...
type CircularBuffer struct {
buf []int
cap, head, tail int
func (q *CircularBuffer) add(d int) error {
if q.tail-q.head > q.cap {
return errors.New("buffer full")
Sep 14 20:18:40 mypc kernel: [ 1241.379380] Intel(R) Wireless WiFi driver for Linux, in-tree:
Sep 14 20:18:40 mypc kernel: [ 1241.379383] Copyright(c) 2003-2013 Intel Corporation
Sep 14 20:18:40 mypc kernel: [ 1241.379429] iwlwifi 0000:02:00.0: enabling device (0000 -> 0002)
Sep 14 20:18:40 mypc kernel: [ 1241.379505] iwlwifi 0000:02:00.0: can't disable ASPM; OS doesn't have ASPM control
Sep 14 20:18:40 mypc kernel: [ 1241.379576] iwlwifi 0000:02:00.0: irq 51 for MSI/MSI-X
Sep 14 20:18:40 mypc kernel: [ 1241.380366] iwlwifi 0000:02:00.0: loaded firmware version build 33926 op_mode iwldvm
Sep 14 20:18:40 mypc kernel: [ 1241.409982] iwlwifi 0000:02:00.0: CONFIG_IWLWIFI_DEBUG disabled
Sep 14 20:18:40 mypc kernel: [ 1241.409987] iwlwifi 0000:02:00.0: CONFIG_IWLWIFI_DEBUGFS enabled
Sep 14 20:18:40 mypc kernel: [ 1241.409988] iwlwifi 0000:02:00.0: CONFIG_IWLWIFI_DEVICE_TRACING enabled
Sep 14 20:18:40 mypc kernel: [ 1241.409990] iwlwifi 0000:02:00.0: Detected Intel(R) Centrino(R) Wireless-N + WiMAX 6150 BG
kedarmhaswade /
Created Feb 12, 2017 — forked from rednaxelafx/
An Serviceability-Agent based tool to see stats of NIO direct memory, as an alternative on JDK6 without JMX support for direct memory monitoring. Only works on JDK6; to work on JDK7 will need some tweaking because static variables are moved to Java mirror
import java.util.*;
import sun.jvm.hotspot.memory.*;
import sun.jvm.hotspot.oops.*;
import sun.jvm.hotspot.debugger.*;
import sun.jvm.hotspot.runtime.*;
import sun.jvm.hotspot.utilities.*;
public class DirectMemorySize extends Tool {
kedarmhaswade /
Created Apr 23, 2016 — forked from rednaxelafx/
find out the correspondence between the tid/nid of Java threads as shown from jstack/JMX, on HotSpot/Linux
import java.util.List;
public class PrintThreadIds extends Tool {
public static void main(String[] args) {
PrintThreadIds tool = new PrintThreadIds();