<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: What is a Senior Developer?</title>
	<atom:link href="http://thelimberlambda.com/2010/02/09/what-is-a-senior-developer/feed/" rel="self" type="application/rss+xml" />
	<link>http://thelimberlambda.com/2010/02/09/what-is-a-senior-developer/</link>
	<description>Eric Smith&#039;s technical musings</description>
	<lastBuildDate>Thu, 24 May 2012 08:07:08 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: "Fish" (David B. Trout)</title>
		<link>http://thelimberlambda.com/2010/02/09/what-is-a-senior-developer/#comment-167</link>
		<dc:creator><![CDATA["Fish" (David B. Trout)]]></dc:creator>
		<pubDate>Sat, 01 Oct 2011 23:35:48 +0000</pubDate>
		<guid isPermaLink="false">http://skepticabin.wordpress.com/?p=236#comment-167</guid>
		<description><![CDATA[#include 
#include 
void main() { printf(&quot;2.16\n&quot;); _getch(); }

(why waste time coding an algorithm (or cpu time executing it) to calculate a value that is already known?)]]></description>
		<content:encoded><![CDATA[<p>#include<br />
#include<br />
void main() { printf(&#8220;2.16\n&#8221;); _getch(); }</p>
<p>(why waste time coding an algorithm (or cpu time executing it) to calculate a value that is already known?)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Henning Makholm</title>
		<link>http://thelimberlambda.com/2010/02/09/what-is-a-senior-developer/#comment-137</link>
		<dc:creator><![CDATA[Henning Makholm]]></dc:creator>
		<pubDate>Wed, 12 May 2010 03:41:57 +0000</pubDate>
		<guid isPermaLink="false">http://skepticabin.wordpress.com/?p=236#comment-137</guid>
		<description><![CDATA[My first instinct would be to simply try for all relevant N whether the sign of the difference reverses between N*0.01-0.005 and (N+1)*0.01-0.005. This was prompted directly by the &quot;rounding not truncating&quot; comment, which tells me that correct rounding is of particular importance for this customer.

I would avoid the standard floating-point based algorithms because they might yield a result whose uncertainty happened to straddle a x.xx5 boundary, which I&#039;d need to correct and/or check for explicitly, complicating things beyond what a quick test of basic programming ability ought to require.

If a linear search were deemed too inefficient, I&#039;d probably escalate to integer bisection to find the right N in N*0.01-0.005.

(No, actually my FIRST first instinct would be
  10 PRINT &quot;2.16&quot;
given that the program takes no input anyway and I already know the correct output).]]></description>
		<content:encoded><![CDATA[<p>My first instinct would be to simply try for all relevant N whether the sign of the difference reverses between N*0.01-0.005 and (N+1)*0.01-0.005. This was prompted directly by the &#8220;rounding not truncating&#8221; comment, which tells me that correct rounding is of particular importance for this customer.</p>
<p>I would avoid the standard floating-point based algorithms because they might yield a result whose uncertainty happened to straddle a x.xx5 boundary, which I&#8217;d need to correct and/or check for explicitly, complicating things beyond what a quick test of basic programming ability ought to require.</p>
<p>If a linear search were deemed too inefficient, I&#8217;d probably escalate to integer bisection to find the right N in N*0.01-0.005.</p>
<p>(No, actually my FIRST first instinct would be<br />
  10 PRINT &#8220;2.16&#8243;<br />
given that the program takes no input anyway and I already know the correct output).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anhar</title>
		<link>http://thelimberlambda.com/2010/02/09/what-is-a-senior-developer/#comment-136</link>
		<dc:creator><![CDATA[Anhar]]></dc:creator>
		<pubDate>Wed, 28 Apr 2010 20:52:53 +0000</pubDate>
		<guid isPermaLink="false">http://skepticabin.wordpress.com/?p=236#comment-136</guid>
		<description><![CDATA[Continued.. 

Another difference is &#039;learnt&#039; vs &#039;understanding&#039;, I remember for one of my Engineering Degree examinations, I had a brain freeze and forgot all the important equations (Mathematical Modelling and Analysis of Mechanical Systems). Lucky for me I understood the topic enough to derive the equations from first principles.

Further, to add being a &#039;Girl&#039; is logically irrelevant!

PS apologies about my grammar, English is only my third language. I only learnt to read/write English in two weeks.]]></description>
		<content:encoded><![CDATA[<p>Continued.. </p>
<p>Another difference is &#8216;learnt&#8217; vs &#8216;understanding&#8217;, I remember for one of my Engineering Degree examinations, I had a brain freeze and forgot all the important equations (Mathematical Modelling and Analysis of Mechanical Systems). Lucky for me I understood the topic enough to derive the equations from first principles.</p>
<p>Further, to add being a &#8216;Girl&#8217; is logically irrelevant!</p>
<p>PS apologies about my grammar, English is only my third language. I only learnt to read/write English in two weeks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anhar</title>
		<link>http://thelimberlambda.com/2010/02/09/what-is-a-senior-developer/#comment-135</link>
		<dc:creator><![CDATA[Anhar]]></dc:creator>
		<pubDate>Wed, 28 Apr 2010 20:43:15 +0000</pubDate>
		<guid isPermaLink="false">http://skepticabin.wordpress.com/?p=236#comment-135</guid>
		<description><![CDATA[There is a difference between knowing how to solve a problem and solving a problem. 

Sure I learnt about LASER theory and built radio&#039;s when I was only seven BUT I thats only because I had learnt to do that.

So the real question is not what you how to solve, its how you solve what you don&#039;t know.]]></description>
		<content:encoded><![CDATA[<p>There is a difference between knowing how to solve a problem and solving a problem. </p>
<p>Sure I learnt about LASER theory and built radio&#8217;s when I was only seven BUT I thats only because I had learnt to do that.</p>
<p>So the real question is not what you how to solve, its how you solve what you don&#8217;t know.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric Smith</title>
		<link>http://thelimberlambda.com/2010/02/09/what-is-a-senior-developer/#comment-134</link>
		<dc:creator><![CDATA[Eric Smith]]></dc:creator>
		<pubDate>Wed, 28 Apr 2010 20:36:05 +0000</pubDate>
		<guid isPermaLink="false">http://skepticabin.wordpress.com/?p=236#comment-134</guid>
		<description><![CDATA[Knowing what I know now, pretty-much no-one who&#039;s done the assessment so far would have managed to get this one.  Only four out of around 40 candidates have managed to get the Quicksort question right.]]></description>
		<content:encoded><![CDATA[<p>Knowing what I know now, pretty-much no-one who&#8217;s done the assessment so far would have managed to get this one.  Only four out of around 40 candidates have managed to get the Quicksort question right.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cheryl</title>
		<link>http://thelimberlambda.com/2010/02/09/what-is-a-senior-developer/#comment-133</link>
		<dc:creator><![CDATA[cheryl]]></dc:creator>
		<pubDate>Wed, 28 Apr 2010 20:07:32 +0000</pubDate>
		<guid isPermaLink="false">http://skepticabin.wordpress.com/?p=236#comment-133</guid>
		<description><![CDATA[You don&#039;t expect Newton&#039;s method?

When I was a freshman engineer at Cornell, our CS100 course required solving a problem just like this for homework. 

What do you call someone who can write a program to solve for the roots of some basic equations?

(a) &quot;Senior Developer
(b) Freshman Engineer.

SHEESH.  I&#039;m a GIRL and I could do that when I was frickin&#039; SEVENTEEN.]]></description>
		<content:encoded><![CDATA[<p>You don&#8217;t expect Newton&#8217;s method?</p>
<p>When I was a freshman engineer at Cornell, our CS100 course required solving a problem just like this for homework. </p>
<p>What do you call someone who can write a program to solve for the roots of some basic equations?</p>
<p>(a) &#8220;Senior Developer<br />
(b) Freshman Engineer.</p>
<p>SHEESH.  I&#8217;m a GIRL and I could do that when I was frickin&#8217; SEVENTEEN.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Someone</title>
		<link>http://thelimberlambda.com/2010/02/09/what-is-a-senior-developer/#comment-122</link>
		<dc:creator><![CDATA[Someone]]></dc:creator>
		<pubDate>Sun, 21 Mar 2010 05:16:56 +0000</pubDate>
		<guid isPermaLink="false">http://skepticabin.wordpress.com/?p=236#comment-122</guid>
		<description><![CDATA[Might as well uselessly provide my Java solution:

&lt;code&gt;

	public double solveEquation() {
		// Initial Equation: x * log(x) = x * x - 3
		// Which is: 
		//     f(x) = -x ^ 2 + x * log (x) + 3
		// Derivative (for Newton&#039;s appproximation): 
		//     f&#039;(x) = -2x + 1 + log(x)
		
		double initialGuess = 1.1;
		for (int i = 0; i &lt; 10; i++) {
			logger.debug(&quot;Current guess: &quot; + initialGuess);
			initialGuess = initialGuess - 
				(-1 * initialGuess * initialGuess + initialGuess * java.lang.Math.log(initialGuess) + 3) / 
				(-2 * initialGuess + 1 + java.lang.Math.log(initialGuess));
		}
		initialGuess = roundToDigit(initialGuess, 2);
		logger.debug(&quot;Returning: &quot; + initialGuess);
		return initialGuess;
	}

	public double roundToDigit(double number, int digit) {
		double power = java.lang.Math.pow(10, digit);
		return java.lang.Math.round(number * power) / power;
	}
	
&lt;/code&gt;]]></description>
		<content:encoded><![CDATA[<p>Might as well uselessly provide my Java solution:</p>
<p><code></p>
<p>	public double solveEquation() {<br />
		// Initial Equation: x * log(x) = x * x - 3<br />
		// Which is:<br />
		//     f(x) = -x ^ 2 + x * log (x) + 3<br />
		// Derivative (for Newton's appproximation):<br />
		//     f'(x) = -2x + 1 + log(x)</p>
<p>		double initialGuess = 1.1;<br />
		for (int i = 0; i &lt; 10; i++) {<br />
			logger.debug(&quot;Current guess: &quot; + initialGuess);<br />
			initialGuess = initialGuess -<br />
				(-1 * initialGuess * initialGuess + initialGuess * java.lang.Math.log(initialGuess) + 3) /<br />
				(-2 * initialGuess + 1 + java.lang.Math.log(initialGuess));<br />
		}<br />
		initialGuess = roundToDigit(initialGuess, 2);<br />
		logger.debug(&quot;Returning: &quot; + initialGuess);<br />
		return initialGuess;<br />
	}</p>
<p>	public double roundToDigit(double number, int digit) {<br />
		double power = java.lang.Math.pow(10, digit);<br />
		return java.lang.Math.round(number * power) / power;<br />
	}</p>
<p></code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anhar</title>
		<link>http://thelimberlambda.com/2010/02/09/what-is-a-senior-developer/#comment-111</link>
		<dc:creator><![CDATA[Anhar]]></dc:creator>
		<pubDate>Sat, 13 Mar 2010 01:24:57 +0000</pubDate>
		<guid isPermaLink="false">http://skepticabin.wordpress.com/?p=236#comment-111</guid>
		<description><![CDATA[Hello Again, decided to implement into actual code:

here is the RootFinder Class:

public class RootFinder
{
	private double _x0 = 100;

	public void CalculateRoot(double Px)
	{
		if (Math.Round(EvaluateSolution(Px), 4) == 0) {
			Console.WriteLine(string.Format(&quot;Solution :{0}&quot;, Px));
			return;
		}

		object _x0 = Px - ((Px * Math.Log(Px) - Math.Pow(Px, 2) + 3) / (Math.Log(Px) - 2 * Px + 1));
		Console.WriteLine(string.Format(&quot;Xn+1 :{0}&quot;, _x0));

		CalculateRoot(_x0);
	}

	private double EvaluateSolution(double Px)
	{
		//To do: Use Maths Parser to pass evalution function as a parameter
		return (Px * Math.Log(Px)) - (Px * Px) + 3;
	}
}

and inside a console:


class SolverOutput
{

	void Main()
	{
		string tmpStr;
		RootFinder fx = new RootFinder();

		Console.WriteLine(&quot;Please enter an intial guess&quot;);
		tmpStr = Console.ReadLine;

		if (IsNumeric(tmpStr.ToString)) {
			fx.CalculateRoot(Convert.ToDouble(tmpStr));
		}

		Console.ReadLine();
	}
}

test it out, only takes around a few iterations to solve.]]></description>
		<content:encoded><![CDATA[<p>Hello Again, decided to implement into actual code:</p>
<p>here is the RootFinder Class:</p>
<p>public class RootFinder<br />
{<br />
	private double _x0 = 100;</p>
<p>	public void CalculateRoot(double Px)<br />
	{<br />
		if (Math.Round(EvaluateSolution(Px), 4) == 0) {<br />
			Console.WriteLine(string.Format(&#8220;Solution :{0}&#8221;, Px));<br />
			return;<br />
		}</p>
<p>		object _x0 = Px &#8211; ((Px * Math.Log(Px) &#8211; Math.Pow(Px, 2) + 3) / (Math.Log(Px) &#8211; 2 * Px + 1));<br />
		Console.WriteLine(string.Format(&#8220;Xn+1 :{0}&#8221;, _x0));</p>
<p>		CalculateRoot(_x0);<br />
	}</p>
<p>	private double EvaluateSolution(double Px)<br />
	{<br />
		//To do: Use Maths Parser to pass evalution function as a parameter<br />
		return (Px * Math.Log(Px)) &#8211; (Px * Px) + 3;<br />
	}<br />
}</p>
<p>and inside a console:</p>
<p>class SolverOutput<br />
{</p>
<p>	void Main()<br />
	{<br />
		string tmpStr;<br />
		RootFinder fx = new RootFinder();</p>
<p>		Console.WriteLine(&#8220;Please enter an intial guess&#8221;);<br />
		tmpStr = Console.ReadLine;</p>
<p>		if (IsNumeric(tmpStr.ToString)) {<br />
			fx.CalculateRoot(Convert.ToDouble(tmpStr));<br />
		}</p>
<p>		Console.ReadLine();<br />
	}<br />
}</p>
<p>test it out, only takes around a few iterations to solve.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve Sperandeo</title>
		<link>http://thelimberlambda.com/2010/02/09/what-is-a-senior-developer/#comment-108</link>
		<dc:creator><![CDATA[Steve Sperandeo]]></dc:creator>
		<pubDate>Fri, 12 Mar 2010 11:33:07 +0000</pubDate>
		<guid isPermaLink="false">http://skepticabin.wordpress.com/?p=236#comment-108</guid>
		<description><![CDATA[Here&#039;s my hideous c++ solution (I&#039;m a php web developer by day, but thought it&#039;d be fun to solve this with c++):

@main.cpp contents:

#include 
#include 


using namespace std;

/**
* Takes a double and returns and int that has been rounded to the given precision
* eg.  115.165, 2 returns 11517
*
* @return int
*/
int round( double number, int precision ){

	double returned = pow( 10.0, precision );
	returned *= number;
		
	if( (returned + 0.5) &gt;= (int(returned) + 1) ){
		return int(returned + 1.0);
	}else{
		return int(returned);
	}
	
}

int main(){

	double x;
	double y;
	const double precision = 2;
	const double step = pow( 10.0, precision * -1 );
	
	for( x = 0.0; x &lt; 1000; x += step ){

		y = x * log(x) - x*x + 3;

		if( round(y, precision) == 0 ){
			cout &lt;&lt; x &lt;&lt; &quot;  &quot; &lt;&lt; y &lt;&lt; &quot; Solved&quot; &lt;&lt; endl;
		}

	}
	
	return 1;
	
}



Compile in shell with g++:

$ g++ -Wall -O3 -o Solver main.cpp
$ time ./Solver
2.16  -0.00216624 Solved

real    0m0.012s
user    0m0.010s
sys     0m0.000s


Criticisms and improvements are very welcomed.  Anyone know of a good place for more little problems like this?  Had been eying http://www.springer.com/computer/theoretical+computer+science/foundations+of+computations/book/978-0-387-30770-1 for some time, but haven&#039;t gotten around to buying it yet.

Nice article, btw :-).]]></description>
		<content:encoded><![CDATA[<p>Here&#8217;s my hideous c++ solution (I&#8217;m a php web developer by day, but thought it&#8217;d be fun to solve this with c++):</p>
<p>@main.cpp contents:</p>
<p>#include<br />
#include </p>
<p>using namespace std;</p>
<p>/**<br />
* Takes a double and returns and int that has been rounded to the given precision<br />
* eg.  115.165, 2 returns 11517<br />
*<br />
* @return int<br />
*/<br />
int round( double number, int precision ){</p>
<p>	double returned = pow( 10.0, precision );<br />
	returned *= number;</p>
<p>	if( (returned + 0.5) &gt;= (int(returned) + 1) ){<br />
		return int(returned + 1.0);<br />
	}else{<br />
		return int(returned);<br />
	}</p>
<p>}</p>
<p>int main(){</p>
<p>	double x;<br />
	double y;<br />
	const double precision = 2;<br />
	const double step = pow( 10.0, precision * -1 );</p>
<p>	for( x = 0.0; x &lt; 1000; x += step ){</p>
<p>		y = x * log(x) &#8211; x*x + 3;</p>
<p>		if( round(y, precision) == 0 ){<br />
			cout &lt;&lt; x &lt;&lt; &quot;  &quot; &lt;&lt; y &lt;&lt; &quot; Solved&quot; &lt;&lt; endl;<br />
		}</p>
<p>	}</p>
<p>	return 1;</p>
<p>}</p>
<p>Compile in shell with g++:</p>
<p>$ g++ -Wall -O3 -o Solver main.cpp<br />
$ time ./Solver<br />
2.16  -0.00216624 Solved</p>
<p>real    0m0.012s<br />
user    0m0.010s<br />
sys     0m0.000s</p>
<p>Criticisms and improvements are very welcomed.  Anyone know of a good place for more little problems like this?  Had been eying <a href="http://www.springer.com/computer/theoretical+computer+science/foundations+of+computations/book/978-0-387-30770-1" rel="nofollow">http://www.springer.com/computer/theoretical+computer+science/foundations+of+computations/book/978-0-387-30770-1</a> for some time, but haven&#039;t gotten around to buying it yet.</p>
<p>Nice article, btw :-).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anhar</title>
		<link>http://thelimberlambda.com/2010/02/09/what-is-a-senior-developer/#comment-106</link>
		<dc:creator><![CDATA[Anhar]]></dc:creator>
		<pubDate>Thu, 11 Mar 2010 21:32:36 +0000</pubDate>
		<guid isPermaLink="false">http://skepticabin.wordpress.com/?p=236#comment-106</guid>
		<description><![CDATA[Many thanks Eric!

That did the trick, the Newton–Raphson method solved it really fast. e.g when I put an initial guess of 6, it converges in 4 iterations. Naturally a better guess like 3 does it in 3 iterations.

Your right about having the derivative, thankfully apart from my Log vs Ln mistake my derivate (calculated on the back of mail envelope) was correct :)]]></description>
		<content:encoded><![CDATA[<p>Many thanks Eric!</p>
<p>That did the trick, the Newton–Raphson method solved it really fast. e.g when I put an initial guess of 6, it converges in 4 iterations. Naturally a better guess like 3 does it in 3 iterations.</p>
<p>Your right about having the derivative, thankfully apart from my Log vs Ln mistake my derivate (calculated on the back of mail envelope) was correct :)</p>
]]></content:encoded>
	</item>
</channel>
</rss>

