Skip to content

Instantly share code, notes, and snippets.

Avatar

Kedar Mhaswade kedarmhaswade

  • JyMob
  • Sunnyvale, USA
View GitHub Profile
@kedarmhaswade
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: https://tex.stackexchange.com/q/565173/64425
\documentclass[a6paper]{article}
\usepackage{geometry}
\geometry{
bottom=20mm,
left=5mm,
right=5mm,
}
\usepackage{polyglossia}
@kedarmhaswade
kedarmhaswade / .ruby-gemset
Last active Feb 22, 2021
Learning SQL (O'Reilly) With SQLite instead of MySQL
@kedarmhaswade
kedarmhaswade / elements.txt
Created Aug 2, 2020
118 elements from the modern periodic table: name, symbol, atomic number
View elements.txt
Hydrogen,H,1
Helium,He,2
Lithium,Li,3
Beryllium,Be,4
Boron,B,5
Carbon,C,6
Nitrogen,N,7
Oxygen,O,8
Fluorine,F,9
Neon,Ne,10
View mathematical_creation.md

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
kedarmhaswade / ValueIsNotVariable.java
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)
View ValueIsNotVariable.java
class ValueIsNotVariable {
static int get() {
return 10;
}
static void inc() {
get() += 1;
}
}
/**
➜ Java javac Assign.java
@kedarmhaswade
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
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")
}
View wlan0.next.log
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 41.28.5.1 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
kedarmhaswade / DirectMemorySize.java
Created Feb 12, 2017 — forked from rednaxelafx/DirectMemorySize.java
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
View DirectMemorySize.java
import java.io.*;
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.tools.*;
import sun.jvm.hotspot.utilities.*;
public class DirectMemorySize extends Tool {
@kedarmhaswade
kedarmhaswade / PrintThreadIds.java
Created Apr 23, 2016 — forked from rednaxelafx/PrintThreadIds.java
find out the correspondence between the tid/nid of Java threads as shown from jstack/JMX, on HotSpot/Linux
View PrintThreadIds.java
package fx.jvm.hotspot.tools;
import java.util.List;
import sun.jvm.hotspot.tools.Tool;
public class PrintThreadIds extends Tool {
public static void main(String[] args) {
PrintThreadIds tool = new PrintThreadIds();
tool.start(args);