A random collection

Archive for May 2010

INDIA: वन्दे मातरम्

वन्दे मातरम्
सुजलाम् सुफलाम् मलयजशीतलाम्
शस्य श्यामलाम् मातरम्
शुभ्र ज्योत्स्ना पुलकित यामिनीम्
फुल्ल कुसुमित द्रुमदलशोभिनीम्
सुहासिनीम् सुमधुर भाषिणीम्
सुखदाम् वरदाम् मातरम्
वन्दे मातरम्

सप्त कोटि कण्ठ कलकल निनाद कराले
निसप्त कोटि भुजैर्ध्रुत खरकरवाले
के बोले मा तुमी अबले
बहुबल धारिणीम् नमामि तारिणीम्
रिपुदलवारिणीम् मातरम्
वन्दे मातरम्

तुमि विद्या तुमि धर्म,तुमि हृदि तुमि मर्म
त्वम् हि प्राणाः शरीरे
बाहुते तुमि मा शक्ति
हृदये तुमि मा भक्ति
तोमारै प्रतिमा गडि मंदिरे मंदिरे
वन्दे मातरम्

त्वम् हि दुर्गा दशप्रहरणधारिणी
कमला कमलदल विहारिणी
वाणी विद्यादायिनी, नमामि त्वाम्
नमामि कमलाम् अमलाम् अतुलाम्
सुजलाम् सुफलाम् मातरम्
वन्दे मातरम्

श्यामलाम् सरलाम् सुस्मिताम् भूषिताम्
धरणीम् भरणीम् मातरम्
वन्दे मातरम्

Written by curious

May 28, 2010 at 9:54 am

Posted in india

INDIA: त्वमेव माता

त्वमेव माता च पिता त्वमेव
त्वमेव बंधू च सखा त्वमेव
त्वमेव विद्या द्रविणं त्वमेव
त्वमेव सर्वं मम देव देव

Written by curious

May 26, 2010 at 1:35 pm

Posted in mantras

.NET: Starting Debug Web Server from the Command line

"C:\Program Files\Common Files\Microsoft Shared\DevServer\9.0\WebDev.WebServer.exe" /port:3200 /path:"c:\bla-bla\webroot" /vpath:"/"

"C:\Program Files\Common Files\Microsoft Shared\DevServer\10.0\WebDev.WebServer40.exe" /path:"C:\bla-bla\webroot" /port:3200 /vpath:"/"
Windows Registry Editor Version 5.00

@="Start Web Server here"

@="\"c:\\program files\\Common Files\\microsoft shared\\DevServer\\9.0\\WebDev.WebServer.exe\" /path:\"%L\""

Written by curious

May 21, 2010 at 8:42 pm

Posted in dotNET, tech-tips

MATH: Vedic Mathematics

General Rule: Multiplication of 2 digit numbers

To multiply: 23×45

  1. Multiply Least Significant Digits (Rightmost Digits) of both the numbers, 3×5 = 15
  2. Multiply Leftmost Digit of first number with Rightmost Digit of second number, 2×5 = 10
  3. Multiply Rightmost Digit of first number with Leftmost Digit of second number, 3×4 = 12
  4. Add the products obtained in previous 2 steps: 10+12 = 22
  5. Multiply Leftmost Digits of both the numbers, 2×4 = 8
  6. Now write down the digits from steps result:
    1. Write down rightmost digit of the product from step (A) as the rightmost digit, so “5”
    2. If the number in step (A) was a 2-digits number, then carry over the the leftmost digit from it to the sum from step (D) [22+1=23], and write down the rightmost digit of this sum to the left of result from the previous step, “35”
    3. If there is any carry over from the previous step, add it to the product in step (E) [8+2=10], and write it to the left of the number in previous step, so “1035”.

Rule: Multiply 2 numbers that slightly less than 100

Rule: Multiply by 11

Rule: Subtracting a number from a power of 10, example 100, 1000, 10000, …

Written by curious

May 18, 2010 at 6:17 pm

Posted in maths

QUANT: Glossary

Skews (Volatility Skews)
Convex Function
A function f is said to be Convex in an interval I if at any points x,y \in I:

    f(\lambda x + (1-\lambda)y) \leq \lambda f(x) + (1-\lambda) f(y), \text{ where } 0 \leq \lambda \leq 1

A decent function (continuous and differentiable) will be convex if it lies at or above the tangents at any points on its curve

    f(x+\delta) \geq f(x) + \delta f'(x)
Inflection Point
Point where a curve/function changes from convex to concave (or vice versa)
Curve obtained by slicing a cone with a plane VERTICALLY.

Asymptotes: a hyperbola has 2 asymptotes, lines that become tangent to the curve at infinity on the 2 sides of the hyperbola curve.

Conic Sections
Circle, Ellipse, Parabola, Hyperbola

General equation of a conic section:
Ax^2 + Bxy + Cy^2 + Dx + Ey + F = 0

Circle: x^2 + y^2 = r^2. Note: B^2-4AC  = 0
Ellipse: x^2/a^2 + y^2/b^2 = 1. Note: B^2-4AC  = 0
Parabola: 4py = x^2 or 4px = y^2. Note: B^2-4AC  < 0
Hyperbola: x^2/a^2 - y^2/b^2 = 1 or y^2/a^2 - x^2/b^2 = 1. Note: B^2-4AC  > 0
Asymptotes: y = \pm (b/a)x or (x = \pm (a/b)y)

Control points
Taylor Series
an infinite sum of terms calculated from the values of its derivatives at a single point
f(x) = \sum_{n=0}^{\infty} \frac{(x-a)^n}{n!} f^n(a)
Mean Reverting Process
See Link to Mean-Reverting Process

Written by curious

May 18, 2010 at 9:57 am

Posted in quant-finance

TECH: Gang of Four (23 design patterns)

Creational Patterns (ABFPS)

  1. Abstract Factory Creates an instance of several families of classes
  2. Builder Separates object construction from its representation
  3. Factory Method Creates an instance of several derived classes (aka Virtual Constructor)
  4. Prototype A fully initialized instance to be copied or cloned
  5. Singleton A class of which only a single instance can exist

Structural Patterns (ABCDFFP)

  1. Adapter Match interfaces of different classes
  2. Bridge Separates an object’s interface from its implementation
  3. Composite A tree structure of simple and composite objects
  4. Decorator Add responsibilities to objects dynamically
  5. Facade A single class that represents an entire subsystem
  6. Flyweight A fine-grained instance used for efficient sharing
  7. Proxy An object representing another object. Delegate to the “real” object.

Behavioral Patterns (CCIIMMOSSTV)

  1. Chain of Resp. A way of passing a request between a chain of objects
  2. Command Encapsulate a command request as an object
  3. Interpreter A way to include language elements in a program
  4. Iterator Sequentially access the elements of a collection
  5. Mediator Defines simplified communication between classes
  6. Memento Capture and restore an object’s internal state
  7. Observer A way of notifying change to a number of classes
  8. State Alter an object’s behavior when its state changes
  9. Strategy Encapsulates an algorithm inside a class
  10. Template Method Defer the exact steps of an algorithm to a subclass
  11. Visitor Defines a new operation to a class without change

Written by curious

May 17, 2010 at 3:09 pm

Posted in design-patterns

QUANT: Mean Reverting Processes

Stochastic Differential Equation
dX_t = k(m - X_t)dt + v dW_t

  1. long term mean, m
  2. speed of reversion, k
  3. instantaneous volatility, v

\mathbb{E}[X_t] = X_0 e^{-kt} + m(1-e^{-kt})

Long term mean, for large t
\lim_{t\to\infty} \mathbb{E}[X_t] = m

\text{Var}[X_t] = \frac{v^2}{2k}(1-e^{-2kt})

Long term variance, for very large t
\lim_{t \to \infty} \text{Var}[X_t] = \frac{v^2}{2k}

Written by curious

May 13, 2010 at 3:30 pm