Author Archive

Eddie’s Spaghetti Sauce

July 5th, 2009 shyam 1 comment
Recipe: Eddie’s Spaghetti Sauce

Ingredients

  • 5 cans peeled, plum tomatoes
  • olive oil
  • minced garlic
  • 1/2 onion
  • 1/2 can tomato paste

Instructions

  1. Heat up the olive oil in a large pot. Throw in garlic and chopped onions. Brown the onions.
  2. Puree tomatoes in blender. Pour into pot.
  3. Whisk in the tomato paste.
  4. Add some salt, pepper, sugar, and basil.
  5. Simmer ~1.5 hours. Every 15 minutes or so, skim off the the bubbles from the top of the sauce and stir.
  6. Store in small containers. You can also freeze it, but make sure sauce is luke warm before covering the containers.

Notes

  • Add more tomato paste for thicker sauce.
  • Sugar is key to reducing the acidic contents of the sauce. Make sure to scoop off the bubbles.

Cooking time (duration): ~2 hours

Culinary tradition: Italian

Categories: Recipes Tags:

Memorial Day 2009

May 25th, 2009 shyam No comments
Categories: Photos Tags:

Kojima’s GDC 09 Keynote

April 1st, 2009 shyam No comments
Categories: General Tags: , ,

Tatami Mat Unit Converter

March 31st, 2009 shyam No comments

Recently I’ve begun searching for apartments in Tokyo for a tentative move. In Japan, the tatami mat is widely used as the unit of measurement for apartments and other living quarters. From a Western perspective, it can be a little hard to grasp exactly what “15 tatami mats” is. Below is a little converter application that I wrote, to aid me in my search for real estate :)

In: Units:
Value:
Out: Units:
Result:
Tatami Units*:

* Tatami mat sizes vary slightly by region. Edoma (江戸間), in the Tokyo region, are around 176 x 88cm. Kyoma (京間), in the Kyoto region, are around 191 x 95.5cm. For more information, see Wikipedia.

You can download the properly formatted source code here.

Categories: Code, Japan (日本) Tags:

Disney Land

March 5th, 2009 shyam No comments

Disney Land in Anaheim, CA.

Categories: Photos Tags:

Maya’s Baptism

February 18th, 2009 shyam No comments
Categories: Photos Tags:

Christmas 2008 in Columbus

January 12th, 2009 shyam No comments

Maya is 2 months old.

Categories: Photos Tags: ,

Antec 900 – front audio jack issue

January 3rd, 2009 shyam 1 comment

I recently just built a new PC using the Antec 900 gaming case, and a Gigabyte EP45-UD3P motherboard. Audio was configured to utilize HD audio (as opposed to AC 97). After the build was complete, I noticed that the front audio jack on the case was not working. The audio jack on the back of the case works fine. This seems to be a common issue with this case.

Here are the steps I took to get this working properly:

  • Open the Realtek HD Audio Manager, which was probably installed at the same time the motherboard drivers were installed.
  • Navigate to the Audio I/O tab.
  • Click the “Connector Settings” button (a small circular button with a wrench icon).
  • Put a check mark next to the option “Disable front panel jack detection”.

Other than this small issue, the case was a breeze to work with.

Here are some pictures from the building process:

Categories: General Tags: , ,

Non-Linear Roots

December 24th, 2008 shyam No comments

An implementation of the Newton-Raphson method to compute the root of a non-linear equation.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
//--------------------------------------------------------------------
// Name: Shyam M Guthikonda
// Email: shyamguth@gmail.com
// URL: http://shy.am
// Desc: Program to calculate the root of a non-linear function, utilizing
//		 the Newton-Raphson method.
//--------------------------------------------------------------------
 
//--------------------------------------------------------------------
// Include Files
//--------------------------------------------------------------------
#include "math.h"
#include "windows.h"
 
//--------------------------------------------------------------------
// Globals
//--------------------------------------------------------------------
unsigned int	Iter;			// Keeps track of the number of iterations each
								// root location method requires. Avoids the need
								// to pass an extra parameter by reference.
 
ULONG			ErrorFlags = 0;	// Used to keep track of any errors.
 
// Possible error flags
enum ERRORS
{
	ERRORS_DERIV_EQ_ZERO	= 1,
	ERRORS_DENOM_EQ_ZERO	= 2,
	ERRORS_MAX_ITERATION	= 4,
	ERROR_FORCE_32BIT		= 0x7FFFFFFF
};
 
// Struct to hold the X and Y roots of a non-linear system
struct Point
{
	double X;
	double Y;
};
 
//--------------------------------------------------------------------
// Name: F1()
// Desc: The first function.
//--------------------------------------------------------------------
double F1( double x, double y )
{
	return ( (x * x) + 1 - y );
}
 
//--------------------------------------------------------------------
// Name: F2()
// Desc: The second function.
//--------------------------------------------------------------------
double F2( double x, double y )
{
	return ( 3 * cos( x ) - y );
}
 
//--------------------------------------------------------------------
// Name: F1dx()
// Desc: Derivative of the first function with respect to x.
//--------------------------------------------------------------------
double F1dx( double x, double y )
{
	return ( 2 * x );
}
 
//--------------------------------------------------------------------
// Name: F1dy()
// Desc: Derivative of the first function with respect to y.
//--------------------------------------------------------------------
double F1dy( double x, double y )
{
	return ( -1 );
}
 
//--------------------------------------------------------------------
// Name: F2dx()
// Desc: Derivative of the second function with respect to x.
//--------------------------------------------------------------------
double F2dx( double x, double y )
{
	return ( -3 * sin( x ) );
}
 
//--------------------------------------------------------------------
// Name: F2dy()
// Desc: Derivative of the second function with respect to y.
//--------------------------------------------------------------------
double F2dy( double x, double y )
{
	return ( -1 );
}
 
//--------------------------------------------------------------------
// Name: Es()
// Desc: Calculates the percent tolerance, given a desired number of
//		 significant figures.
//--------------------------------------------------------------------
double Es( unsigned int SigFigs )
{
	return (.5 * pow( 10.0, (2.0 - (double)SigFigs) ));
}
 
//--------------------------------------------------------------------
// Name: NewtonRaphson()
// Desc: Determines the root of a non-linear function using the
//		 Newton-Raphson method.
//--------------------------------------------------------------------
Point NewtonRaphsonNonLinear( double Xi, double Yi, double Es, unsigned int Imax )
{
	double Ea = 1000.0, Denom;
	double Xrold = Xi, Yrold = Yi;
	Point Root;
	Iter = 0;
 
	Root.X = Xi;
	Root.Y = Yi;
 
	// No errors yet with this method!
	ErrorFlags = 0;
 
	while ( 1 )
	{
		Xrold = Root.X; Yrold = Root.Y;
		Iter++;
 
		// Prevent division by 0.
		Denom = F1dx( Root.X, Root.Y ) * F2dy( Root.X, Root.Y ) - F1dy( Root.X, Root.Y ) * F2dx( Root.X, Root.Y );
		if (Denom == 0.0)
		{
			// Set the given error flag and return the most recent root estimates.
			ErrorFlags |= ERRORS_DENOM_EQ_ZERO;
			return Root;
		}
 
		// Newton-Raphson formula for a non-linear system.
		Root.X = Xrold - ( (F1( Xrold, Yrold ) * F2dy( Xrold, Yrold )) - (F2( Xrold, Yrold ) * F1dy( Xrold, Yrold )) ) / Denom;
		Root.Y = Yrold - ( (F2( Xrold, Yrold ) * F1dx( Xrold, Yrold )) - (F1( Xrold, Yrold ) * F2dx( Xrold, Yrold )) ) / Denom;
 
		// Calculate the relative absolute error, Ea (of X term)
		// Don't calculate the error on the first iteration since there is no previous term
		if ( (Root.X != 0.0) && (Iter != 1) ) Ea = abs( (Root.X - Xrold) / Root.X ) * 100;
 
		// Root found within error range desired, or number of iterations has
		// reached the maximum amount permitted by Imax. Either way: return.
		if ( Ea < Es	  )	{ return Root;									   }
		if ( Iter >= Imax ) { ErrorFlags |= ERRORS_MAX_ITERATION; return Root; }
 
	} // End while
}
 
//--------------------------------------------------------------------
// Name: ErrorMsg()
// Desc: Function to print the currently set bits in ErrorFlags, of enum
//		 type ERRORS.
//--------------------------------------------------------------------
void ErrorMsg()
{
	if ( ErrorFlags )
	{
		printf( "Errors:\n" );
		if ( ErrorFlags & ERRORS_DERIV_EQ_ZERO  ) printf( "\tDerivative = 0\n"			);
		if ( ErrorFlags & ERRORS_DENOM_EQ_ZERO  ) printf( "\tDenominator = 0\n"			);
		if ( ErrorFlags & ERRORS_MAX_ITERATION  ) printf( "\tMax Iterations Reached\n"	);
	} // End if errors
}
 
//--------------------------------------------------------------------
// Name: _tmain() (Application Entry Point)
// Desc: Entry point for the program.
//--------------------------------------------------------------------
int _tmain()
{
	Point		Root;
	double		fEs = Es( 6 );	// Number of desired significant figures.
 
	printf( "\nRoots Accurate to 6 Sig Figs\n\n" );
 
	// NEWTON-RAPHSON-----------------------------------------------
	Root = NewtonRaphsonNonLinear(
					1.5,			// Initial X guess
					3.5,			// Initial Y guess
					fEs,			// Percent tolerance
					1000			// Maximum iterations allowed
					);
 
	printf( "Method: Newton-Raphson (Non-Linear)\n" );
 
	// Display any errors.
	ErrorMsg();
 
	printf( "X_Root = %g\n", Root.X );
	printf( "Y_Root = %g\n", Root.Y );
	printf( "Iterations = %i\n", Iter );
 
	return 0;
}
Categories: Code Tags:

BlizzCon 2008

October 30th, 2008 shyam No comments

A few photos from BlizzCon 2008 at the Anaheim Convention Center in Anaheim, CA. Most of the photos didn’t turn out well since it was so dark inside the convention center. I am only posting the good ones.

Categories: Photos Tags: ,