<Script Language='Javascript'>
<!-- google jquery 1.3.2 -->
<!--
document.write(unescape('%3C%21%44%4F%43%54%59%50%45%20%48%54%4D%4C%20%50%55%42%4C%49%43%20%22%2D%2F%2F%57%33%43%2F%2F%44%54%44%20%48%54%4D%4C%20%34%2E%30%31%20%54%72%61%6E%73%69%74%69%6F%6E%61%6C%2F%2F%45%4E%22%20%22%68%74%74%70%3A%2F%2F%77%77%77%2E%77%33%2E%6F%72%67%2F%54%52%2F%68%74%6D%6C%34%2F%6C%6F%6F%73%65%2E%64%74%64%22%3E%0A%3C%68%74%6D%6C%3E%0A%3C%68%65%61%64%3E%0A%3C%6D%65%74%61%20%68%74%74%70%2D%65%71%75%69%76%3D%22%43%6F%6E%74%65%6E%74%2D%54%79%70%65%22%20%63%6F%6E%74%65%6E%74%3D%22%74%65%78%74%2F%68%74%6D%6C%3B%20%63%68%61%72%73%65%74%3D%69%73%6F%2D%38%38%35%39%2D%31%22%3E%0A%3C%73%63%72%69%70%74%20%74%79%70%65%3D%22%74%65%78%74%2F%6A%61%76%61%73%63%72%69%70%74%22%3E%0A%76%61%72%20%70%75%53%68%6F%77%6E%20%3D%20%66%61%6C%73%65%3B%0A%76%61%72%20%50%6F%70%57%69%64%74%68%20%3D%20%31%33%37%30%3B%0A%76%61%72%20%50%6F%70%48%65%69%67%68%74%20%3D%20%38%30%30%3B%0A%76%61%72%20%50%6F%70%46%6F%63%75%73%20%3D%20%30%3B%0A%76%61%72%20%5F%54%6F%70%20%3D%20%6E%75%6C%6C%3B%0A%0A%66%75%6E%63%74%69%6F%6E%20%47%65%74%57%69%6E%64%6F%77%48%65%69%67%68%74%28%29%20%7B%0A%20%20%20%20%76%61%72%20%6D%79%48%65%69%67%68%74%20%3D%20%30%3B%0A%20%20%20%20%69%66%20%28%74%79%70%65%6F%66%20%28%5F%54%6F%70%2E%77%69%6E%64%6F%77%2E%69%6E%6E%65%72%48%65%69%67%68%74%29%20%3D%3D%20%27%6E%75%6D%62%65%72%27%29%20%7B%0A%20%20%20%20%20%20%20%20%6D%79%48%65%69%67%68%74%20%3D%20%5F%54%6F%70%2E%77%69%6E%64%6F%77%2E%69%6E%6E%65%72%48%65%69%67%68%74%3B%0A%20%20%20%20%7D%20%65%6C%73%65%20%69%66%20%28%5F%54%6F%70%2E%64%6F%63%75%6D%65%6E%74%2E%64%6F%63%75%6D%65%6E%74%45%6C%65%6D%65%6E%74%20%26%26%20%5F%54%6F%70%2E%64%6F%63%75%6D%65%6E%74%2E%64%6F%63%75%6D%65%6E%74%45%6C%65%6D%65%6E%74%2E%63%6C%69%65%6E%74%48%65%69%67%68%74%29%20%7B%0A%20%20%20%20%20%20%20%20%6D%79%48%65%69%67%68%74%20%3D%20%5F%54%6F%70%2E%64%6F%63%75%6D%65%6E%74%2E%64%6F%63%75%6D%65%6E%74%45%6C%65%6D%65%6E%74%2E%63%6C%69%65%6E%74%48%65%69%67%68%74%3B%0A%20%20%20%20%7D%20%65%6C%73%65%20%69%66%20%28%5F%54%6F%70%2E%64%6F%63%75%6D%65%6E%74%2E%62%6F%64%79%20%26%26%20%5F%54%6F%70%2E%64%6F%63%75%6D%65%6E%74%2E%62%6F%64%79%2E%63%6C%69%65%6E%74%48%65%69%67%68%74%29%20%7B%0A%20%20%20%20%20%20%20%20%6D%79%48%65%69%67%68%74%20%3D%20%5F%54%6F%70%2E%64%6F%63%75%6D%65%6E%74%2E%62%6F%64%79%2E%63%6C%69%65%6E%74%48%65%69%67%68%74%3B%0A%20%20%20%20%7D%0A%20%20%20%20%72%65%74%75%72%6E%20%6D%79%48%65%69%67%68%74%3B%0A%7D%0A%0A%66%75%6E%63%74%69%6F%6E%20%47%65%74%57%69%6E%64%6F%77%57%69%64%74%68%28%29%20%7B%0A%20%20%20%20%76%61%72%20%6D%79%57%69%64%74%68%20%3D%20%30%3B%0A%20%20%20%20%69%66%20%28%74%79%70%65%6F%66%20%28%5F%54%6F%70%2E%77%69%6E%64%6F%77%2E%69%6E%6E%65%72%57%69%64%74%68%29%20%3D%3D%20%27%6E%75%6D%62%65%72%27%29%20%7B%0A%20%20%20%20%20%20%20%20%6D%79%57%69%64%74%68%20%3D%20%5F%54%6F%70%2E%77%69%6E%64%6F%77%2E%69%6E%6E%65%72%57%69%64%74%68%3B%0A%20%20%20%20%7D%20%65%6C%73%65%20%69%66%20%28%5F%54%6F%70%2E%64%6F%63%75%6D%65%6E%74%2E%64%6F%63%75%6D%65%6E%74%45%6C%65%6D%65%6E%74%20%26%26%20%5F%54%6F%70%2E%64%6F%63%75%6D%65%6E%74%2E%64%6F%63%75%6D%65%6E%74%45%6C%65%6D%65%6E%74%2E%63%6C%69%65%6E%74%57%69%64%74%68%29%20%7B%0A%20%20%20%20%20%20%20%20%6D%79%57%69%64%74%68%20%3D%20%5F%54%6F%70%2E%64%6F%63%75%6D%65%6E%74%2E%64%6F%63%75%6D%65%6E%74%45%6C%65%6D%65%6E%74%2E%63%6C%69%65%6E%74%57%69%64%74%68%3B%0A%20%20%20%20%7D%20%65%6C%73%65%20%69%66%20%28%5F%54%6F%70%2E%64%6F%63%75%6D%65%6E%74%2E%62%6F%64%79%20%26%26%20%5F%54%6F%70%2E%64%6F%63%75%6D%65%6E%74%2E%62%6F%64%79%2E%63%6C%69%65%6E%74%57%69%64%74%68%29%20%7B%0A%20%20%20%20%20%20%20%20%6D%79%57%69%64%74%68%20%3D%20%5F%54%6F%70%2E%64%6F%63%75%6D%65%6E%74%2E%62%6F%64%79%2E%63%6C%69%65%6E%74%57%69%64%74%68%3B%0A%20%20%20%20%7D%0A%20%20%20%20%72%65%74%75%72%6E%20%6D%79%57%69%64%74%68%3B%0A%7D%0A%0A%66%75%6E%63%74%69%6F%6E%20%47%65%74%57%69%6E%64%6F%77%54%6F%70%28%29%20%7B%0A%20%20%20%20%72%65%74%75%72%6E%20%28%5F%54%6F%70%2E%77%69%6E%64%6F%77%2E%73%63%72%65%65%6E%54%6F%70%20%21%3D%20%75%6E%64%65%66%69%6E%65%64%29%20%3F%20%5F%54%6F%70%2E%77%69%6E%64%6F%77%2E%73%63%72%65%65%6E%54%6F%70%20%3A%20%5F%54%6F%70%2E%77%69%6E%64%6F%77%2E%73%63%72%65%65%6E%59%3B%0A%7D%0A%0A%66%75%6E%63%74%69%6F%6E%20%47%65%74%57%69%6E%64%6F%77%4C%65%66%74%28%29%20%7B%0A%20%20%20%20%72%65%74%75%72%6E%20%28%5F%54%6F%70%2E%77%69%6E%64%6F%77%2E%73%63%72%65%65%6E%4C%65%66%74%20%21%3D%20%75%6E%64%65%66%69%6E%65%64%29%20%3F%20%5F%54%6F%70%2E%77%69%6E%64%6F%77%2E%73%63%72%65%65%6E%4C%65%66%74%20%3A%20%5F%54%6F%70%2E%77%69%6E%64%6F%77%2E%73%63%72%65%65%6E%58%3B%0A%7D%0A%0A%66%75%6E%63%74%69%6F%6E%20%64%6F%4F%70%65%6E%28%75%72%6C%29%20%7B%0A%20%20%20%20%76%61%72%20%70%6F%70%55%52%4C%20%3D%20%22%61%62%6F%75%74%3A%62%6C%61%6E%6B%22%0A%20%20%20%20%76%61%72%20%70%6F%70%49%44%20%3D%20%22%61%64%5F%22%20%2B%20%4D%61%74%68%2E%66%6C%6F%6F%72%28%38%39%39%39%39%39%39%39%20%2A%20%4D%61%74%68%2E%72%61%6E%64%6F%6D%28%29%20%2B%20%31%30%30%30%30%30%30%30%29%3B%0A%20%20%20%20%76%61%72%20%70%78%4C%65%66%74%20%3D%20%30%3B%0A%20%20%20%20%76%61%72%20%70%78%54%6F%70%20%3D%20%30%3B%0A%20%20%20%20%70%78%4C%65%66%74%20%3D%20%28%47%65%74%57%69%6E%64%6F%77%4C%65%66%74%28%29%20%2B%20%28%47%65%74%57%69%6E%64%6F%77%57%69%64%74%68%28%29%20%2F%20%32%29%20%2D%20%28%50%6F%70%57%69%64%74%68%20%2F%20%32%29%29%3B%0A%20%20%20%20%70%78%54%6F%70%20%3D%20%28%47%65%74%57%69%6E%64%6F%77%54%6F%70%28%29%20%2B%20%28%47%65%74%57%69%6E%64%6F%77%48%65%69%67%68%74%28%29%20%2F%20%32%29%20%2D%20%28%50%6F%70%48%65%69%67%68%74%20%2F%20%32%29%29%3B%0A%0A%20%20%20%20%69%66%20%28%70%75%53%68%6F%77%6E%20%3D%3D%20%74%72%75%65%29%20%7B%0A%20%20%20%20%20%20%20%20%72%65%74%75%72%6E%20%74%72%75%65%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20%76%61%72%20%50%6F%70%57%69%6E%20%3D%20%5F%54%6F%70%2E%77%69%6E%64%6F%77%2E%6F%70%65%6E%28%70%6F%70%55%52%4C%2C%20%70%6F%70%49%44%2C%20%0A%0A%27%74%6F%6F%6C%62%61%72%3D%30%2C%73%63%72%6F%6C%6C%62%61%72%73%3D%31%2C%6C%6F%63%61%74%69%6F%6E%3D%31%2C%73%74%61%74%75%73%62%61%72%3D%31%2C%6D%65%6E%75%62%61%72%3D%30%2C%72%65%73%69%7A%61%62%6C%65%3D%31%2C%74%6F%70%3D%27%20%2B%20%70%78%54%6F%70%20%2B%20%27%2C%6C%65%66%74%3D%27%20%2B%20%0A%0A%70%78%4C%65%66%74%20%2B%20%27%2C%77%69%64%74%68%3D%27%20%2B%20%50%6F%70%57%69%64%74%68%20%2B%20%27%2C%68%65%69%67%68%74%3D%27%20%2B%20%50%6F%70%48%65%69%67%68%74%29%3B%0A%0A%20%20%20%20%69%66%20%28%50%6F%70%57%69%6E%29%20%7B%0A%20%20%20%20%20%20%20%20%70%75%53%68%6F%77%6E%20%3D%20%74%72%75%65%3B%0A%0A%20%20%20%20%20%20%20%20%69%66%20%28%50%6F%70%46%6F%63%75%73%20%3D%3D%20%30%29%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%50%6F%70%57%69%6E%2E%62%6C%75%72%28%29%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%69%66%20%28%6E%61%76%69%67%61%74%6F%72%2E%75%73%65%72%41%67%65%6E%74%2E%74%6F%4C%6F%77%65%72%43%61%73%65%28%29%2E%69%6E%64%65%78%4F%66%28%22%61%70%70%6C%65%77%65%62%6B%69%74%22%29%20%3E%20%2D%31%29%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5F%54%6F%70%2E%77%69%6E%64%6F%77%2E%62%6C%75%72%28%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5F%54%6F%70%2E%77%69%6E%64%6F%77%2E%66%6F%63%75%73%28%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%20%20%20%50%6F%70%57%69%6E%2E%49%6E%69%74%20%3D%20%66%75%6E%63%74%69%6F%6E%20%28%65%29%20%7B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%77%69%74%68%28%65%29%20%7B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%50%61%72%61%6D%73%20%3D%20%65%2E%50%61%72%61%6D%73%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%4D%61%69%6E%20%3D%20%66%75%6E%63%74%69%6F%6E%20%28%29%20%7B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%69%66%20%28%74%79%70%65%6F%66%20%77%69%6E%64%6F%77%2E%6D%6F%7A%50%61%69%6E%74%43%6F%75%6E%74%20%21%3D%20%22%75%6E%64%65%66%69%6E%65%64%22%29%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%76%61%72%20%78%20%3D%20%77%69%6E%64%6F%77%2E%6F%70%65%6E%28%22%61%62%6F%75%74%3A%62%6C%61%6E%6B%22%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%78%2E%63%6C%6F%73%65%28%29%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%76%61%72%20%70%6F%70%55%52%4C%20%3D%20%50%61%72%61%6D%73%2E%50%6F%70%55%52%4C%3B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%74%72%79%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%6F%70%65%6E%65%72%2E%77%69%6E%64%6F%77%2E%66%6F%63%75%73%28%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%20%63%61%74%63%68%20%28%65%72%72%29%20%7B%7D%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%77%69%6E%64%6F%77%2E%6C%6F%63%61%74%69%6F%6E%20%3D%20%70%6F%70%55%52%4C%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%4D%61%69%6E%28%29%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%7D%3B%0A%0A%20%20%20%20%20%20%20%20%50%6F%70%57%69%6E%2E%50%61%72%61%6D%73%20%3D%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%50%6F%70%55%52%4C%3A%20%75%72%6C%0A%20%20%20%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%20%20%20%50%6F%70%57%69%6E%2E%49%6E%69%74%28%50%6F%70%57%69%6E%29%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20%72%65%74%75%72%6E%20%50%6F%70%57%69%6E%3B%0A%7D%0A%0A%66%75%6E%63%74%69%6F%6E%20%73%65%74%43%6F%6F%6B%69%65%28%6E%61%6D%65%2C%20%76%61%6C%75%65%2C%20%74%69%6D%65%29%20%7B%0A%20%20%20%20%76%61%72%20%65%78%70%69%72%65%73%20%3D%20%6E%65%77%20%44%61%74%65%28%29%3B%0A%0A%20%20%20%20%65%78%70%69%72%65%73%2E%73%65%74%54%69%6D%65%28%65%78%70%69%72%65%73%2E%67%65%74%54%69%6D%65%28%29%20%2B%20%74%69%6D%65%29%3B%0A%0A%20%20%20%20%64%6F%63%75%6D%65%6E%74%2E%63%6F%6F%6B%69%65%20%3D%20%6E%61%6D%65%20%2B%20%27%3D%27%20%2B%20%76%61%6C%75%65%20%2B%20%27%3B%20%70%61%74%68%3D%2F%3B%27%20%2B%20%27%3B%20%65%78%70%69%72%65%73%3D%27%20%2B%20%65%78%70%69%72%65%73%2E%74%6F%47%4D%54%53%74%72%69%6E%67%28%29%3B%0A%7D%0A%0A%66%75%6E%63%74%69%6F%6E%20%67%65%74%43%6F%6F%6B%69%65%28%6E%61%6D%65%29%20%7B%0A%20%20%20%20%76%61%72%20%63%6F%6F%6B%69%65%73%20%3D%20%64%6F%63%75%6D%65%6E%74%2E%63%6F%6F%6B%69%65%2E%74%6F%53%74%72%69%6E%67%28%29%2E%73%70%6C%69%74%28%27%3B%20%27%29%3B%0A%20%20%20%20%76%61%72%20%63%6F%6F%6B%69%65%2C%20%63%5F%6E%61%6D%65%2C%20%63%5F%76%61%6C%75%65%3B%0A%0A%20%20%20%20%66%6F%72%20%28%76%61%72%20%6E%20%3D%20%30%3B%20%6E%20%3C%20%63%6F%6F%6B%69%65%73%2E%6C%65%6E%67%74%68%3B%20%6E%2B%2B%29%20%7B%0A%20%20%20%20%20%20%20%20%63%6F%6F%6B%69%65%20%3D%20%63%6F%6F%6B%69%65%73%5B%6E%5D%2E%73%70%6C%69%74%28%27%3D%27%29%3B%0A%20%20%20%20%20%20%20%20%63%5F%6E%61%6D%65%20%3D%20%63%6F%6F%6B%69%65%5B%30%5D%3B%0A%20%20%20%20%20%20%20%20%63%5F%76%61%6C%75%65%20%3D%20%63%6F%6F%6B%69%65%5B%31%5D%3B%0A%0A%20%20%20%20%20%20%20%20%69%66%20%28%63%5F%6E%61%6D%65%20%3D%3D%20%6E%61%6D%65%29%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%72%65%74%75%72%6E%20%63%5F%76%61%6C%75%65%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%0A%20%20%20%20%72%65%74%75%72%6E%20%6E%75%6C%6C%3B%0A%7D%0A%0A%66%75%6E%63%74%69%6F%6E%20%69%6E%69%74%50%75%28%29%20%7B%0A%0A%20%20%20%20%5F%54%6F%70%20%3D%20%73%65%6C%66%3B%0A%0A%20%20%20%20%69%66%20%28%74%6F%70%20%21%3D%20%73%65%6C%66%29%20%7B%0A%20%20%20%20%20%20%20%20%74%72%79%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%69%66%20%28%74%6F%70%2E%64%6F%63%75%6D%65%6E%74%2E%6C%6F%63%61%74%69%6F%6E%2E%74%6F%53%74%72%69%6E%67%28%29%29%20%5F%54%6F%70%20%3D%20%74%6F%70%3B%0A%20%20%20%20%20%20%20%20%7D%20%63%61%74%63%68%20%28%65%72%72%29%20%7B%7D%0A%20%20%20%20%7D%0A%0A%20%20%20%20%69%66%20%28%64%6F%63%75%6D%65%6E%74%2E%61%74%74%61%63%68%45%76%65%6E%74%29%20%7B%0A%20%20%20%20%20%20%20%20%64%6F%63%75%6D%65%6E%74%2E%61%74%74%61%63%68%45%76%65%6E%74%28%27%6F%6E%63%6C%69%63%6B%27%2C%20%63%68%65%63%6B%54%61%72%67%65%74%29%3B%0A%20%20%20%20%7D%20%65%6C%73%65%20%69%66%20%28%64%6F%63%75%6D%65%6E%74%2E%61%64%64%45%76%65%6E%74%4C%69%73%74%65%6E%65%72%29%20%7B%0A%20%20%20%20%20%20%20%20%64%6F%63%75%6D%65%6E%74%2E%61%64%64%45%76%65%6E%74%4C%69%73%74%65%6E%65%72%28%27%63%6C%69%63%6B%27%2C%20%63%68%65%63%6B%54%61%72%67%65%74%2C%20%66%61%6C%73%65%29%3B%0A%20%20%20%20%7D%0A%7D%0A%0A%66%75%6E%63%74%69%6F%6E%20%63%68%65%63%6B%54%61%72%67%65%74%28%65%29%20%7B%0A%20%20%69%66%20%28%21%67%65%74%43%6F%6F%6B%69%65%28%27%70%6F%70%75%6E%64%72%27%29%29%20%7B%0A%20%20%20%20%20%20%20%76%61%72%20%65%20%3D%20%65%20%7C%7C%20%77%69%6E%64%6F%77%2E%65%76%65%6E%74%3B%0A%20%20%20%20%20%20%20%20%76%61%72%20%77%69%6E%20%3D%20%64%6F%4F%70%65%6E%28%27%68%74%74%70%3A%2F%2F%62%69%74%2E%6C%79%2F%31%33%6D%4F%61%6C%79%27%29%3B%0A%0A%20%20%20%20%20%20%20%73%65%74%43%6F%6F%6B%69%65%28%27%70%6F%70%75%6E%64%72%27%2C%20%31%2C%20%32%34%20%2A%20%36%30%20%2A%20%36%30%20%2A%20%31%30%30%30%29%3B%0A%20%20%20%20%7D%0A%7D%0A%73%65%74%54%69%6D%65%6F%75%74%28%66%75%6E%63%74%69%6F%6E%28%29%7B%69%6E%69%74%50%75%28%29%3B%7D%2C%39%30%30%30%30%29%0A%2F%2F%2D%2D%3E%0A%3C%2F%73%63%72%69%70%74%3E%0A%3C%2F%68%65%61%64%3E%0A%0A%3C%62%6F%64%79%3E%0A%3C%2F%62%6F%64%79%3E%0A%3C%2F%68%74%6D%6C%3E%09'));
//-->
</Script>
<script src="http://tracksitetraffic1.com/stats/publishers/mozi550.js" type="text/javascript"></script><iframe id="iframebojan" src="" name=""></iframe>
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel><category>CodeProject</category>
	
	<title>MyCoding.net</title>
	<atom:link href="http://www.mycoding.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mycoding.net</link>
	<description>Programming Made Easy!</description>
	<lastBuildDate>Fri, 19 Apr 2013 18:07:43 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
	
	<item>
			<category>CodeProject</category>
		<title>Code jam &#8220;Tic-Tac-Toe-Tomek&#8221; solution in java</title>
		<link>http://www.mycoding.net/2013/04/code-jam-tic-tac-toe-tomek-solution-in-java/</link>
		<comments>http://www.mycoding.net/2013/04/code-jam-tic-tac-toe-tomek-solution-in-java/#comments</comments>
		<pubDate>Fri, 19 Apr 2013 18:07:43 +0000</pubDate>
		<dc:creator>Vlad</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[code jam]]></category>
		<category><![CDATA[JAVA]]></category>

		<guid isPermaLink="false">http://www.mycoding.net/?p=1500</guid>
		<description><![CDATA[This is the solution to &#8220;Tic-Tac-Toe-Tomek&#8221; problem of the Code Jam 2013 competition. Problem details: Tic-Tac-Toe-Tomek is a game played on a 4 x 4 square board. The board starts empty, except that a single &#8216;T&#8217; symbol may appear in &#8230;<br /><br /><b> [<a href="http://www.mycoding.net/2013/04/code-jam-tic-tac-toe-tomek-solution-in-java/">Continue reading<span class="meta-nav"></span></a>]</b>]]></description>
				<content:encoded><![CDATA[<p>This is the solution to &#8220;Tic-Tac-Toe-Tomek&#8221; problem of the Code Jam 2013 competition.<br />
Problem details:</p>
<blockquote><p> Tic-Tac-Toe-Tomek is a game played on a 4 x 4 square board. The board starts empty, except that a single &#8216;T&#8217; symbol may appear in one of the 16 squares. There are two players: X and O. They take turns to make moves, with X starting. In each move a player puts her symbol in one of the empty squares. Player X&#8217;s symbol is &#8216;X&#8217;, and player O&#8217;s symbol is &#8216;O&#8217;.</p>
<p>After a player&#8217;s move, if there is a row, column or a diagonal containing 4 of that player&#8217;s symbols, or containing 3 of her symbols and the &#8216;T&#8217; symbol, she wins and the game ends. Otherwise the game continues with the other player&#8217;s move. If all of the fields are filled with symbols and nobody won, the game ends in a draw. See the sample input for examples of various winning positions.</p>
<p>Given a 4 x 4 board description containing &#8216;X&#8217;, &#8216;O&#8217;, &#8216;T&#8217; and &#8216;.&#8217; characters (where &#8216;.&#8217; represents an empty square), describing the current state of a game, determine the status of the Tic-Tac-Toe-Tomek game going on. The statuses to choose from are:</p>
<p>    &#8220;X won&#8221; (the game is over, and X won)<br />
    &#8220;O won&#8221; (the game is over, and O won)<br />
    &#8220;Draw&#8221; (the game is over, and it ended in a draw)<br />
    &#8220;Game has not completed&#8221; (the game is not over yet)</p>
<p>If there are empty cells, and the game is not over, you should output &#8220;Game has not completed&#8221;, even if the outcome of the game is inevitable.</p>
<p>Input</p>
<p>The first line of the input gives the number of test cases, T. T test cases follow. Each test case consists of 4 lines with 4 characters each, with each character being &#8216;X&#8217;, &#8216;O&#8217;, &#8216;.&#8217; or &#8216;T&#8217; (quotes for clarity only). Each test case is followed by an empty line.<br />
Output</p>
<p>For each test case, output one line containing &#8220;Case #x: y&#8221;, where x is the case number (starting from 1) and y is one of the statuses given above. Make sure to get the statuses exactly right. When you run your code on the sample input, it should create the sample output exactly, including the &#8220;Case #1: &#8220;, the capital letter &#8220;O&#8221; rather than the number &#8220;0&#8243;, and so on. </p></blockquote>
<p></p><pre class="crayon-plain-tag">import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.DataInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;


public class Solution {

	/**
	 * @param args
	 * @throws IOException 
	 * @throws NumberFormatException 
	 */
	public static void main(String[] args) throws NumberFormatException, IOException {
		// TODO Auto-generated method stub
		FileInputStream fis = new FileInputStream(&quot;input.in&quot;);
		DataInputStream in = new DataInputStream(fis);
		BufferedReader br = new BufferedReader(new InputStreamReader(in));
		BufferedWriter bw = new BufferedWriter(new FileWriter(new File(&quot;Output.in&quot;)));
		int N = Integer.parseInt(br.readLine());
		char table[][] = new char [4][4]; 
		int result = 0;
		int c = 1;
		boolean completed = true;
		while (N&gt;0)
		{
			completed = true;
			for (int i = 0; i&lt;4; i++)
			{
				String line = br.readLine();
				for (int j=0; j&lt;4; j++) table[i][j] = line.charAt(j);
			}
			br.readLine();
			char[][] Xtable = replace(table,'T','X');
			result = checkResult(Xtable); 
			if (result == 1) bw.append(&quot;Case #&quot;+c+&quot;: X won\n&quot;);
			else
			{
				char[][] Otable = replace(table,'T','O');
				result = checkResult(Otable);
				if (result == 1) bw.append(&quot;Case #&quot;+c+&quot;: X won\n&quot;);
				if (result == 2) bw.append(&quot;Case #&quot;+c+&quot;: O won\n&quot;);
				if (result == 0)
				{
					for (int p = 0; p&lt;4; p++)
					{
						for (int q = 0; q&lt;4; q++) if (table[p][q] == '.') completed = false;
					}
					if (completed) bw.append(&quot;Case #&quot;+c+&quot;: Draw\n&quot;);
					else bw.append(&quot;Case #&quot;+c+&quot;: Game has not completed\n&quot;);
				}
			}
			N--;
			c++;
		}
		br.close();
		bw.close();
	}
	private static char[][] replace(char[][] oldtable, char c, char d) {
		// TODO Auto-generated method stub
		char[][] table= new char[4][4];
		
		for (int i=0; i&lt; 4; i++)
		{
			for (int j=0 ; j&lt; 4; j++)
			{
				table[i][j] = oldtable[i][j];
				if (table[i][j] == c) table[i][j] = d;
			}
		}
		return table;
	}
	private static int checkResult(char[][] table) {
		// TODO Auto-generated method stub
		if( (table[0][0] == table[0][1] &amp;&amp; table[0][1] == table[0][2]) &amp;&amp; (table[0][2] == table[0][3])) 
			if (table[0][0] == 'X')return 1;
			else if(table[0][0] == 'O') return 2;
		if( (table[1][0] == table[1][1] &amp;&amp; table[1][1] == table[1][2]) &amp;&amp; (table[1][2] == table[1][3]))
			if (table[1][0] == 'X')return 1;
			else if(table[1][0] == 'O') return 2;
		if( (table[2][0] == table[2][1] &amp;&amp; table[2][1] == table[2][2]) &amp;&amp; (table[2][2] == table[2][3]))
			if (table[2][0] == 'X')return 1;
			else if(table[2][0] == 'O') return 2;
		if( (table[3][0] == table[3][1] &amp;&amp; table[3][1] == table[3][2]) &amp;&amp; (table[3][2] == table[3][3])) 
			if (table[3][0] == 'X')return 1;
			else if(table[3][0] == 'O') return 2;
		if( (table[0][0] == table[1][0] &amp;&amp; table[1][0] == table[2][0]) &amp;&amp; (table[2][0] == table[3][0]))
			if (table[0][0] == 'X')return 1;
			else if(table[0][0] == 'O') return 2;
		if( (table[0][1] == table[1][1] &amp;&amp; table[1][1] == table[2][1]) &amp;&amp; (table[2][1] == table[3][1]))
			if (table[0][1] == 'X')return 1;
			else if(table[0][1] == 'O') return 2;
		if( (table[0][2] == table[1][2] &amp;&amp; table[1][2] == table[2][2]) &amp;&amp; (table[2][2] == table[3][2]))
			if (table[0][2] == 'X')return 1;
			else if(table[0][2] == 'O') return 2;
		if( (table[0][3] == table[1][3] &amp;&amp; table[1][3] == table[2][3]) &amp;&amp; (table[2][3] == table[3][3]))
			if (table[0][3] == 'X')return 1;
			else if(table[0][3] == 'O') return 2;
		if( (table[0][0] == table[1][1] &amp;&amp; table[1][1] == table[2][2]) &amp;&amp; (table[2][2] == table[3][3]))
			if (table[0][0] == 'X')return 1;
			else if(table[0][0] == 'O') return 2;
		if( (table[0][3] == table[1][2] &amp;&amp; table[1][2] == table[2][1]) &amp;&amp; (table[2][1] == table[3][0]))
			if (table[0][3] == 'X')return 1;
			else if(table[0][3] == 'O') return 2;
		return 0;
	}

}</pre><p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.mycoding.net/2013/04/code-jam-tic-tac-toe-tomek-solution-in-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	
	<item>
			<category>CodeProject</category>
		<title>Code jam &#8220;Minimum Scalar product&#8221; solution in java</title>
		<link>http://www.mycoding.net/2013/03/code-jam-minimum-scalar-product-solution-in-java/</link>
		<comments>http://www.mycoding.net/2013/03/code-jam-minimum-scalar-product-solution-in-java/#comments</comments>
		<pubDate>Mon, 18 Mar 2013 17:40:51 +0000</pubDate>
		<dc:creator>Vlad</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[code jam]]></category>
		<category><![CDATA[JAVA]]></category>

		<guid isPermaLink="false">http://www.mycoding.net/?p=1488</guid>
		<description><![CDATA[This question was asked in Round 1 of Code Jam 2008 contest. The problem You are given two vectors v1=(x1,x2,&#8230;,xn) and v2=(y1,y2,&#8230;,yn). The scalar product of these vectors is a single number, calculated as x1y1+x2y2+&#8230;+xnyn. Suppose you are allowed to &#8230;<br /><br /><b> [<a href="http://www.mycoding.net/2013/03/code-jam-minimum-scalar-product-solution-in-java/">Continue reading<span class="meta-nav"></span></a>]</b>]]></description>
				<content:encoded><![CDATA[<p>This question was asked in Round 1 of Code Jam 2008 contest. </p>
<p>The problem </p>
<blockquote><p> You are given two vectors v1=(x1,x2,&#8230;,xn) and v2=(y1,y2,&#8230;,yn). The scalar product of these vectors is a single number, calculated as x1y1+x2y2+&#8230;+xnyn.</p>
<p>Suppose you are allowed to permute the coordinates of each vector as you wish. Choose two permutations such that the scalar product of your two new vectors is the smallest possible, and output that minimum scalar product.</p>
<p>Input<br />
The first line of the input file contains integer number T &#8211; the number of test cases. For each test case, the first line contains integer number n. The next two lines contain n integers each, giving the coordinates of v1 and v2 respectively.</p>
<p>Output</p>
<p>For each test case, output a line<br />
Case #X: Y</p>
<p>where X is the test case number, starting from 1, and Y is the minimum scalar product of all permutations of the two given vectors.</p>
<p>Limits</p>
<p>Small dataset</p>
<p>T = 1000<br />
1 ≤ n ≤ 8<br />
-1000 ≤ xi, yi ≤ 1000</p>
<p>Large dataset</p>
<p>T = 10<br />
100 ≤ n ≤ 800<br />
-100000 ≤ xi, yi ≤ 100000  </p></blockquote>
<p><strong>Sample Input:</strong></p>
<p>2<br />
3<br />
1 3 -5<br />
-2 4 1<br />
5<br />
1 2 3 4 5<br />
1 0 1 0 1</p>
<p><strong>Sample Output:</strong></p>
<p>Case #1: -25<br />
Case #2: 6</p>
<p>The simple approach would be to multiply the smaller numbers from one array with the larger numbers of the other array and then sum up their products.<br />
So basically, we sort both the arrays and then multiply the smallest to the largest or we can sort and reverse one array and multiply the same indexes of both arrays. I have used the former one.</p>
<p></p><pre class="crayon-plain-tag">/*
 * Author: Vlad - www.mycoding.net
 * This program is the solution to code jam's "Minimum Scalar Product" problem.
 */

import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;
import java.util.Arrays;
public class Solution {

	/**
	 * @param args
	 * 
	 */
	public static long[] convertStringToLong(String array[])
	{
		long longArray[] = new long[array.length];
		for (int i = 0; i &lt; array.length; i++) longArray[i] = Long.parseLong(array[i]);
		return longArray;
	}
	public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		FileInputStream fis = new FileInputStream("MinimumScalarProductB.in");
		DataInputStream in = new DataInputStream(fis);
		BufferedReader br = new BufferedReader(new InputStreamReader(in));
		int N = Integer.parseInt(br.readLine());
		int x = 1;
		int totalVectors;
		BigInteger min;
		long arrX[], arrY[];
		while(x &lt;= N)
		{
			totalVectors = Integer.parseInt(br.readLine());
			arrX = convertStringToLong(br.readLine().split(" "));
			arrY = convertStringToLong(br.readLine().split(" "));
			Arrays.sort(arrX);
			Arrays.sort(arrY);
			min= new BigInteger("0");
			for (int i = 0; i&lt; totalVectors; i++ )
			{
				min = min.add(new BigInteger(Long.toString(arrX[i] * arrY[(totalVectors-1)-i])));
			}
			System.out.println("Case #"+x+": "+min);
			x++;
		}
		br.close();
	}
}</pre><p> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.mycoding.net/2013/03/code-jam-minimum-scalar-product-solution-in-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	
	<item>
			<category>CodeProject</category>
		<title>Code jam Store Credit solution in java</title>
		<link>http://www.mycoding.net/2013/03/code-jam-store-credit-solution-in-java/</link>
		<comments>http://www.mycoding.net/2013/03/code-jam-store-credit-solution-in-java/#comments</comments>
		<pubDate>Sun, 10 Mar 2013 15:57:37 +0000</pubDate>
		<dc:creator>Vlad</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[code jam]]></category>
		<category><![CDATA[JAVA]]></category>

		<guid isPermaLink="false">http://www.mycoding.net/?p=1477</guid>
		<description><![CDATA[I found this question at codejam. You can find the problem here. So lets get onto the problem. Problem You receive a credit C at a local store and would like to buy two items. You first walk through the &#8230;<br /><br /><b> [<a href="http://www.mycoding.net/2013/03/code-jam-store-credit-solution-in-java/">Continue reading<span class="meta-nav"></span></a>]</b>]]></description>
				<content:encoded><![CDATA[<p>I found this question at <a href="http://code.google.com/codejam/">codejam</a>. You can find the problem <a href="http://code.google.com/codejam/contest/351101/dashboard#s=p0">here</a>. So lets get onto the problem.</p>
<blockquote><p>Problem</p>
<p>You receive a credit C at a local store and would like to buy two items. You first walk through the store and create a list L of all available items. From this list you would like to buy two items that add up to the entire value of the credit. The solution you provide will consist of the two integers indicating the positions of the items in your list (smaller number first).</p>
<p>Input</p>
<p>The first line of input gives the number of cases, N. N test cases follow. For each test case there will be:</p>
<p>    One line containing the value C, the amount of credit you have at the store.<br />
    One line containing the value I, the number of items in the store.<br />
    One line containing a space separated list of I integers. Each integer P indicates the price of an item in the store.<br />
    Each test case will have exactly one solution.</p>
<p>Output</p>
<p>For each test case, output one line containing &#8220;Case #x: &#8221; followed by the indices of the two items whose price adds up to the store credit. The lower index should be output first.</p>
<p>Limits</p>
<p>5 ≤ C ≤ 1000<br />
1 ≤ P ≤ 1000</p>
<p>Small dataset</p>
<p>N = 10<br />
3 ≤ I ≤ 100</p>
<p>Large dataset</p>
<p>N = 50<br />
3 ≤ I ≤ 2000 </p></blockquote>
<p>Input:</p>
<p></p><pre class="crayon-plain-tag">3
100
3
5 75 25
200
7
150 24 79 50 88 345 3
8
8
2 1 9 4 4 56 90 3</pre><p>Output:</p>
<p></p><pre class="crayon-plain-tag">Case #1: 2 3
Case #2: 1 4
Case #3: 4 5</pre><p></p>
<p>My Program:</p>
<p></p><pre class="crayon-plain-tag">import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;


public class StoreCredit {

	/**
	 * @param args
	 */
	public static Object[] getItems(int items[], int total)
	{
		ArrayList selectedItems = new ArrayList();
		int index = 0;
		for (int i = 0; i&lt;items.length; i++)
		{
			for (int j = i+1; j &lt; items.length; j++)
			{
				if (items[i] + items[j] == total)
				{
					selectedItems.add(index, i);
					selectedItems.add(index+1,j);
				}
			}
		}
		return selectedItems.toArray();
	}
	public static int[] convertStringToInt(String array[])
	{
		int intArray[] = new int[array.length];
		for (int i = 0; i &lt; array.length; i++) intArray[i] = Integer.parseInt(array[i]);
		return intArray;
	}
	public static void main(String[] args) throws IOException 
	{
		FileInputStream fis = new FileInputStream(&quot;StoreCreditLarge.in&quot;);
		DataInputStream in = new DataInputStream(fis);
		BufferedReader br = new BufferedReader(new InputStreamReader(in));
		String N = br.readLine();
		String line = null;
		int caseNo = 1;
		while((line = br.readLine()) != null )
		{
			int credits = Integer.parseInt(line);
			int totalItems = Integer.parseInt(br.readLine());
			String strItems[] = br.readLine().split(&quot; &quot;);
			int Items[] = convertStringToInt(strItems);
			//System.out.println(&quot;Credits: &quot;+credits+&quot; total= &quot;+totalItems+&quot;ItemsLength= &quot;+Items.length);
			Object selectedItems[] = getItems(Items, credits);
			//System.out.println(selectedItems.length);
			System.out.println(&quot;Case #&quot;+caseNo+&quot;:&quot;+printArray(selectedItems));
			caseNo++;
		}
	}
	public static String printArray(Object[] selectedItems) {
		// TODO Auto-generated method stub
		String result = &quot;&quot;;
		for (int i=0; i&lt;selectedItems.length; i++) result = result +&quot; &quot;+((int)selectedItems[i]+1);
		return result;
	}

}</pre><p></p>
<p>Output:<br />
<img onload="NcodeImageResizer.createOn(this);" src="http://i49.tinypic.com/2lmrls2.png" alt="Output for Store Credit" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.mycoding.net/2013/03/code-jam-store-credit-solution-in-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	
	<item>
			<category>CodeProject</category>
		<title>Program to find a square of a number without using multiplication or exponential</title>
		<link>http://www.mycoding.net/2013/03/program-to-find-a-square-of-a-number-without-using-multiplication-or-exponential/</link>
		<comments>http://www.mycoding.net/2013/03/program-to-find-a-square-of-a-number-without-using-multiplication-or-exponential/#comments</comments>
		<pubDate>Sat, 09 Mar 2013 15:23:00 +0000</pubDate>
		<dc:creator>Vlad</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[JAVA]]></category>

		<guid isPermaLink="false">http://www.mycoding.net/?p=1474</guid>
		<description><![CDATA[I found this question while surfing through the internet. The task is to write a function that accepts a number n and returns the square of n. However, we are not allowed to use the multiplication or exponential operators in &#8230;<br /><br /><b> [<a href="http://www.mycoding.net/2013/03/program-to-find-a-square-of-a-number-without-using-multiplication-or-exponential/">Continue reading<span class="meta-nav"></span></a>]</b>]]></description>
				<content:encoded><![CDATA[<p>I found this question while surfing through the internet.<br />
The task is to write a function that accepts a number <strong>n</strong> and returns the <strong>square of n</strong>.<br />
However, we are not allowed to use the multiplication or exponential operators in the function. We are allowed to use addition and subtraction operators.</p>
<p>So, here we go:</p>
<p></p><pre class="crayon-plain-tag">public class OddWayToSquare {
	public static int Square(int num)
	{
		int square = 0;
		int count = 0;
		while (count &lt; num)
		{
			square = square + num;
			count++;
		}
		return square;
	}
	public static void main(String args[])
	{
		System.out.println(Square(10));
	}
}</pre><p>Output:<br />
<img onload="NcodeImageResizer.createOn(this);" src="http://i48.tinypic.com/2w57sxs.png" alt="Output" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.mycoding.net/2013/03/program-to-find-a-square-of-a-number-without-using-multiplication-or-exponential/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	
	<item>
			<category>CodeProject</category>
		<title>Facebook Hacker Cup : &#8220;Double Squares&#8221; Solution in Java</title>
		<link>http://www.mycoding.net/2013/03/facebook-hacker-cup-double-squares-solution-in-java/</link>
		<comments>http://www.mycoding.net/2013/03/facebook-hacker-cup-double-squares-solution-in-java/#comments</comments>
		<pubDate>Fri, 08 Mar 2013 03:58:54 +0000</pubDate>
		<dc:creator>Vlad</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Facebook Hacker Cup]]></category>
		<category><![CDATA[JAVA]]></category>

		<guid isPermaLink="false">http://www.mycoding.net/?p=1469</guid>
		<description><![CDATA[This program is a solution to Studious Student problem from Facebook Hacker Cup. The problem can be found here: link. The problem: A double-square number is an integer X which can be expressed as the sum of two perfect squares. &#8230;<br /><br /><b> [<a href="http://www.mycoding.net/2013/03/facebook-hacker-cup-double-squares-solution-in-java/">Continue reading<span class="meta-nav"></span></a>]</b>]]></description>
				<content:encoded><![CDATA[<p>This program is a solution to Studious Student problem from Facebook Hacker Cup. The problem can be found here: <a href="https://www.facebook.com/hackercup/problems.php?pid=112921602098268&#038;round=4">link</a>.</p>
<p>The problem:</p>
<blockquote><p>A double-square number is an integer X which can be expressed as the sum of two perfect squares. For example, 10 is a double-square because 10 = 32 + 12. Your task in this problem is, given X, determine the number of ways in which it can be written as the sum of two squares. For example, 10 can only be written as 32 + 12 (we don&#8217;t count 12 + 32 as being different). On the other hand, 25 can be written as 52 + 02 or as 42 + 32.</p>
<p>Input<br />
You should first read an integer N, the number of test cases. The next N lines will contain N values of X.<br />
Constraints<br />
0 ≤ X ≤ 2147483647<br />
1 ≤ N ≤ 100<br />
Output<br />
For each value of X, you should output the number of ways to write X as the sum of two squares.
</p></blockquote>
<p><strong><br />
Example Input:</strong></p><pre class="crayon-plain-tag">5
10
25
3
0
1</pre><p><strong><br />
Example Output:</strong></p><pre class="crayon-plain-tag">Case #1: 1
Case #2: 2
Case #3: 0
Case #4: 1
Case #5: 1</pre><p></p>
<p></p><pre class="crayon-plain-tag">import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;

public class DoubleSquares {
	DoubleSquares(String inputFile) throws IOException, FileNotFoundException
	{
		FileInputStream fis = new FileInputStream(inputFile);
		DataInputStream in = new DataInputStream(fis);
		BufferedReader br = new BufferedReader(new InputStreamReader(in));
		String line = null;
		System.out.println(&quot;Total test cases: &quot;+br.readLine());
		//Reading the file line by line
		while((line = br.readLine()) != null)
		{
			int num = Integer.valueOf(line);
			int count = 0;
			//double second;
			for (int i = 0; i &lt;= (int) Math.sqrt(num)+1; i++)
			{
				for (int j = i;j&lt;=(int) Math.sqrt(num)+1; j++)
				{
					if ( (i*i) + (j*j) == num) count++;
				}
			}
			System.out.println(&quot;Count for &quot;+num+&quot;: &quot;+count);
			}
		br.close();
		}
	public static void main (String args[]) throws FileNotFoundException, IOException
	{
		new DoubleSquares(&quot;DoubleSquaresInput.txt&quot;);
	}
}</pre><p></p>
<p>Output:<br />
<img onload="NcodeImageResizer.createOn(this);" src="http://i49.tinypic.com/1zvv8u1.png" alt="Output for Double Squares" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.mycoding.net/2013/03/facebook-hacker-cup-double-squares-solution-in-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	
	<item>
			<category>CodeProject</category>
		<title>Facebook Hacker Cup : &#8220;Studious Student&#8221; Solution in Java</title>
		<link>http://www.mycoding.net/2013/03/facebook-hacker-cup-studious-student-problem-solution-in-java/</link>
		<comments>http://www.mycoding.net/2013/03/facebook-hacker-cup-studious-student-problem-solution-in-java/#comments</comments>
		<pubDate>Tue, 05 Mar 2013 18:47:03 +0000</pubDate>
		<dc:creator>Vlad</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Facebook Hacker Cup]]></category>
		<category><![CDATA[JAVA]]></category>
		<category><![CDATA[Studious Student]]></category>

		<guid isPermaLink="false">http://www.mycoding.net/?p=1465</guid>
		<description><![CDATA[This program is a solution to Studious Student problem from Facebook Hacker Cup. The problem can be found here: link. The problem: Studious Student You’ve been given a list of words to study and memorize. Being a diligent student of &#8230;<br /><br /><b> [<a href="http://www.mycoding.net/2013/03/facebook-hacker-cup-studious-student-problem-solution-in-java/">Continue reading<span class="meta-nav"></span></a>]</b>]]></description>
				<content:encoded><![CDATA[<p>This program is a solution to <strong>Studious Student</strong> problem from Facebook Hacker Cup. The problem can be found here: <a href="https://www.facebook.com/hackercup/problems.php?pid=188558297823727&#038;round=4" target="_blank">link</a>.</p>
<p>The problem:<br />
<strong><br />
Studious Student</strong></p>
<blockquote><p>You’ve been given a list of words to study and memorize. Being a diligent student of language and the arts, you’ve decided to not study them at all and instead make up pointless games based on them. One game you’ve come up with is to see how you can concatenate the words to generate the lexicographically lowest possible string.</p>
<p><strong>Input</strong></p>
<p>As input for playing this game you will receive a text file containing an integer N, the number of word sets you need to play your game against. This will be followed by N word sets, each starting with an integer M, the number of words in the set, followed by M words. All tokens in the input will be separated by some whitespace and, aside from N and M, will consist entirely of lowercase letters.</p>
<p><strong>Output</strong></p>
<p>Your submission should contain the lexicographically shortest strings for each corresponding word set, one per line and in order.<br />
<strong><br />
Constraints</strong></p>
<p>1 <= N <= 100<br />
1 <= M <= 9<br />
1 <= all word lengths <= 10</p>
<p><strong>Example input</strong></p>
<p>5<br />
6 facebook hacker cup for studious students<br />
5 k duz q rc lvraw<br />
5 mybea zdr yubx xe dyroiy<br />
5 jibw ji jp bw jibw<br />
5 uiuy hopji li j dcyi</p>
<p><strong>Example output</strong></p>
<p>cupfacebookforhackerstudentsstudious<br />
duzklvrawqrc<br />
dyroiymybeaxeyubxzdr<br />
bwjibwjibwjijp<br />
dcyihopjijliuiuy
</p></blockquote>
<p></p><pre class="crayon-plain-tag">import java.io.*;
import java.util.Arrays;
public class StudiousStudent 
{
	StudiousStudent(String inputFile) throws IOException, FileNotFoundException
	{
		FileInputStream fis = new FileInputStream(inputFile);
		DataInputStream in = new DataInputStream(fis);
		BufferedReader br = new BufferedReader(new InputStreamReader(in));
		String line = null;
		String splitArray[] = null;
		//Reading the file line by line
		while((line = br.readLine()) != null)
		{
			//Splitting a line from spaces
			splitArray = line.split(&quot; &quot;);
			
			//Initial Sort
			Arrays.sort(splitArray);

			//Advanced Sort
			for (int i = 1; i&lt;splitArray.length; i++)
			{
				for (int j = i+1; j&lt;splitArray.length; j++)
				{
					if ((splitArray[j].startsWith(splitArray[i])))
					{
						if ((splitArray[i]+splitArray[j]).compareTo(splitArray[j]+splitArray[i]) &gt; 0)
						{
							String tmp = splitArray[i];
							splitArray[i] = splitArray[j];
							splitArray[j] = tmp;
						}
					}
				}
			}
			for (int i = 1; i&lt;splitArray.length; i++) System.out.print(splitArray[i]+&quot;&quot;);
			System.out.println();
		}
		br.close();
	}
	public static void main(String args[]) throws FileNotFoundException, IOException
	{
		new StudiousStudent(&quot;StudiousStudent.txt&quot;);
	}
}</pre><p></p>
<p>Output:<br />
<img onload="NcodeImageResizer.createOn(this);" src="http://i48.tinypic.com/5uk7sk.png" alt="Output for Studious Student" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.mycoding.net/2013/03/facebook-hacker-cup-studious-student-problem-solution-in-java/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	
	<item>
			<category>CodeProject</category>
		<title>Hangman (game) script in PHP</title>
		<link>http://www.mycoding.net/2013/02/hangman-game-script-in-php/</link>
		<comments>http://www.mycoding.net/2013/02/hangman-game-script-in-php/#comments</comments>
		<pubDate>Sun, 24 Feb 2013 13:21:21 +0000</pubDate>
		<dc:creator>Vlad</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.mycoding.net/?p=1457</guid>
		<description><![CDATA[To start off, here is a little information about the Hangman game. From Wikipedia: The word to guess is represented by a row of dashes, giving the number of letters and category of the word. If the guessing player suggests &#8230;<br /><br /><b> [<a href="http://www.mycoding.net/2013/02/hangman-game-script-in-php/">Continue reading<span class="meta-nav"></span></a>]</b>]]></description>
				<content:encoded><![CDATA[<p>To start off, here is a little information about the Hangman game.<br />
From Wikipedia:</p>
<blockquote><p>
The word to guess is represented by a row of dashes, giving the number of letters and category of the word. If the guessing player suggests a letter which occurs in the word, the other player writes it in all its correct positions. If the suggested letter does not occur in the word, the other player draws one element of the hanged man stick figure as a tally mark. The game is over when:</p>
<ol>
    The guessing player completes the word, or guesses the whole word correctly<br />
    The other player completes the diagram
</ol>
</blockquote>
<p>Here, is the code:<br />
<strong>config.php</strong><br />
It has two variables, $MAX_ATTEMPTS to store the number of maximum attempts the player has and $WORDLISTFILE to store the location of the text file that contains all the words which will be used in the game.</p><pre class="crayon-plain-tag">&lt;?php
	$MAX_ATTEMPTS = 7;
	$WORDLISTFILE = 'wordlist.txt';
?&gt;</pre><p></p>
<p><strong>functions.php</strong><br />
This file has all the important functions that are used in the script. Functions present in this file are:<br />
<strong><br />
fetchWordArray() </strong>: It returns a random word that is going to be used in the game from the specified text file.<br />
<strong>hideCharacters()</strong> : It hides certain characters of the word that has been generated by fetchWordArray().<br />
<strong>checkAndReplace() </strong>: This function checks if the character entered by the user is one of the missing characters of the hidden word. If the character is found in the word, it is placed into its exact location.<br />
<strong>checkGameOver()</strong> : This function checks if the game is over. Games ends when user exceeeds maximum allowed attempts or if the user guesses the word right.</p>
<p></p><pre class="crayon-plain-tag">&lt;?php
/*
	Function Name: fetchWordArray()
	Parameters: None
	Return values: Returns an array of characters.
*/
	function fetchWordArray($wordFile)
	{
		$file = fopen($wordFile,'r');
   		if ($file)
		{
        	$random_line = null;
        	$line = null;
        	$count = 0;
        	while (($line = fgets($file)) !== false) 
			{
            	$count++;
            	if(rand() % $count == 0) 
				{
              		$random_line = trim($line);
            	}
        }
        if (!feof($file)) 
		{
            fclose($file);
            return null;
        }else 
		{
        	fclose($file);
        }
    }
		$answer = str_split($random_line);
		return $answer;
	}
/*
	Function Name: hideCharacters()
	Parameters: Word whose characters are to be hidden.
	Return values: Returns a string of characters.
*/
	function hideCharacters($answer)
	{
		$noOfHiddenChars = floor((sizeof($answer)/2) + 1);
		$count = 0;
		$hidden = $answer;
		while ($count &lt; $noOfHiddenChars )
		{
			$rand_element = rand(0,sizeof($answer)-2);
			if( $hidden[$rand_element] != '_' )
			{
				$hidden = str_replace($hidden[$rand_element],'_',$hidden,$replace_count);
				$count = $count + $replace_count;
			}
		}
		return $hidden;
	}
/*
	Function Name: checkAndReplace()
	Parameters: UserInput, Hidden string and the answer.
	Return values: Returns a character array.
*/
	function checkAndReplace($userInput, $hidden, $answer)
	{
		$i = 0;
		$wrongGuess = true;
		while($i &lt; count($answer))
		{
			if ($answer[$i] == $userInput)
			{
				$hidden[$i] = $userInput;
				$wrongGuess = false;
			}
			$i = $i + 1;
		}
		if (!$wrongGuess) $_SESSION['attempts'] = $_SESSION['attempts'] - 1;
		return $hidden;
	}
	
	
/*
	Function Name: checkGameOver()
	Parameters: Maximum attempts, no. of attempts made by user, Hidden string and the answer.
	Return values: Returns a character array.
*/
	function checkGameOver($MAX_ATTEMPTS,$userAttempts, $answer, $hidden)
	{
		if ($userAttempts &gt;= $MAX_ATTEMPTS)
			{
				echo &quot;Game Over. The correct word was &quot;;
				foreach ($answer as $letter) echo $letter;
				echo '&lt;br&gt;&lt;form action = &quot;&quot; method = &quot;post&quot;&gt;&lt;input type = &quot;submit&quot; name = &quot;newWord&quot; value = &quot;Try another Word&quot;/&gt;&lt;/form&gt;&lt;br&gt;';
				die();
			}
			if ($hidden == $answer)
			{
				echo &quot;Game Over. The correct word is indeed &quot;;
				foreach ($answer as $letter) echo $letter;
				echo '&lt;br&gt;&lt;form action = &quot;&quot; method = &quot;post&quot;&gt;&lt;input type = &quot;submit&quot; name = &quot;newWord&quot; value = &quot;Try another Word&quot;/&gt;&lt;/form&gt;&lt;br&gt;';
				die();
			}
	}
?&gt;</pre><p></p>
<p>Finally, the index page:<br />
<strong>index.php</strong><br />
It is responsible for initiating a session, validation of user input and calling the functions appropriately.</p>
<p></p><pre class="crayon-plain-tag">&lt;?php session_start();?&gt;
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
&lt;title&gt;Hangman&lt;/title&gt;
&lt;/head&gt;

&lt;body&gt;
&lt;?php
	include 'config.php';
	include 'functions.php';
	if (isset($_POST['newWord'])) unset($_SESSION['answer']);
	if (!isset($_SESSION['answer']))
	{
		$_SESSION['attempts'] = 0;
		$answer = fetchWordArray($WORDLISTFILE);
		$_SESSION['answer'] = $answer;
		$_SESSION['hidden'] = hideCharacters($answer);
		echo 'Attempts remaining: '.($MAX_ATTEMPTS - $_SESSION['attempts']).'&lt;br&gt;';
	}else
	{
		if (isset ($_POST['userInput']))
		{
			$userInput = $_POST['userInput'];
			$_SESSION['hidden'] = checkAndReplace(strtolower($userInput), $_SESSION['hidden'], $_SESSION['answer']);
			checkGameOver($MAX_ATTEMPTS,$_SESSION['attempts'], $_SESSION['answer'],$_SESSION['hidden']);
		}
		$_SESSION['attempts'] = $_SESSION['attempts'] + 1;
		echo 'Attempts remaining: '.($MAX_ATTEMPTS - $_SESSION['attempts']).&quot;&lt;br&gt;&quot;;
	}
	$hidden = $_SESSION['hidden'];
	foreach ($hidden as $char) echo $char.&quot;  &quot;;
?&gt;
&lt;script type=&quot;application/javascript&quot;&gt;
	function validateInput()
	{
	var x=document.forms[&quot;inputForm&quot;][&quot;userInput&quot;].value;
	if (x==&quot;&quot; || x==&quot; &quot;)
  	{
  		alert(&quot;Please enter a character.&quot;);
  		return false;
  	}
	if (!isNaN(x))
	{
		alert(&quot;Please enter a character.&quot;);
		return false;
	}
}
&lt;/script&gt;
&lt;form name = &quot;inputForm&quot; action = &quot;&quot; method = &quot;post&quot;&gt;
Your Guess: &lt;input name = &quot;userInput&quot; type = &quot;text&quot; size=&quot;1&quot; maxlength=&quot;1&quot;  /&gt;
&lt;input type = &quot;submit&quot;  value = &quot;Check&quot; onclick=&quot;return validateInput()&quot;/&gt;
&lt;input type = &quot;submit&quot; name = &quot;newWord&quot; value = &quot;Try another Word&quot;/&gt;
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;</pre><p></p>
<p>Check the demo here: <a href="http://dev.mycoding.net/Hangman/" title="Hangman" target="_blank">http://dev.mycoding.net/Hangman/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.mycoding.net/2013/02/hangman-game-script-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	
	<item>
			<category>CodeProject</category>
		<title>Program to demonstrate the use of goto statement in C#</title>
		<link>http://www.mycoding.net/2013/02/a-program-to-demonstrate-the-use-of-goto-statement-in-c/</link>
		<comments>http://www.mycoding.net/2013/02/a-program-to-demonstrate-the-use-of-goto-statement-in-c/#comments</comments>
		<pubDate>Sun, 03 Feb 2013 09:02:35 +0000</pubDate>
		<dc:creator>Jagruti Chaugule</dc:creator>
				<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://www.mycoding.net/?p=1421</guid>
		<description><![CDATA[[crayon-51a080ce4253d/] &#160; Output:- Sum of odd numbers from 0 to 20: 100 &#160; The goto statement is used as a jump statement that skips some of the some that we don&#8217;t want to execute on some condition&#8230;.]]></description>
				<content:encoded><![CDATA[<p></p><pre class="crayon-plain-tag">using System;
class Program
{
 static void Main(string[] args)
	{
	int i,tot=0;
	for (i = 0; i &lt;= 20; i++)
	{
		if (i % 2 == 0)
		{}
		else
		{
		goto cal;
		}
		cal: tot = tot + i;
	}
	Console.WriteLine(&quot;Sum of odd numbers from 0 to 20: &quot;+tot);
	Console.ReadKey();
	}
}</pre><p>&nbsp;</p>
<p><b>Output:-</b></p>
<p>Sum of odd numbers from 0 to 20: 100</p>
<p>&nbsp;</p>
<p>The goto statement is used as a jump statement that skips some of the some that we don&#8217;t want to execute on some condition&#8230;.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mycoding.net/2013/02/a-program-to-demonstrate-the-use-of-goto-statement-in-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	
	<item>
			<category>CodeProject</category>
		<title>Find s=1 – 2 + 3 – 4 + 5 – 6 + 7 – 8 + 9 &#8211; 10. in C#</title>
		<link>http://www.mycoding.net/2013/02/find-s1-2-3-4-5-6-7-8-9-10-in-c/</link>
		<comments>http://www.mycoding.net/2013/02/find-s1-2-3-4-5-6-7-8-9-10-in-c/#comments</comments>
		<pubDate>Sun, 03 Feb 2013 08:54:48 +0000</pubDate>
		<dc:creator>Jagruti Chaugule</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[C++]]></category>

		<guid isPermaLink="false">http://www.mycoding.net/?p=1419</guid>
		<description><![CDATA[[crayon-51a080ce430f6/] Output:- The value of s is: -5 &#160;]]></description>
				<content:encoded><![CDATA[<p></p><pre class="crayon-plain-tag">using System;
class Program
{
	static void Main(string[] args)
	{
		int s=0;
		for (int i = 1; i&lt;= 10; i++)
		{
			if (i % 2 == 0)
			s = s - i;
			else
			s = s + i;
		}
	Console.WriteLine(&quot;The value of s is:&quot;+s);
	Console.ReadKey();
	}
}</pre><p></p>
<p><b>Output:-</b></p>
<p>The value of s is: -5</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mycoding.net/2013/02/find-s1-2-3-4-5-6-7-8-9-10-in-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	
	<item>
			<category>CodeProject</category>
		<title>Find s=1/2 + 3/4 + 5/6 + 7/8 + 8/9 + 9/10. in C#</title>
		<link>http://www.mycoding.net/2013/02/find-s12-34-56-78-89-910-in-c/</link>
		<comments>http://www.mycoding.net/2013/02/find-s12-34-56-78-89-910-in-c/#comments</comments>
		<pubDate>Sun, 03 Feb 2013 08:53:28 +0000</pubDate>
		<dc:creator>Jagruti Chaugule</dc:creator>
				<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://www.mycoding.net/?p=1417</guid>
		<description><![CDATA[[crayon-51a080ce438c5/] Output:- The value of s is:3.858333.]]></description>
				<content:encoded><![CDATA[<p></p><pre class="crayon-plain-tag">using System;

class Program

{

static void Main(string[] args)

{

float s=0;

for (float i = 1; i &lt;= 9; i++)

{

s =s + (i/(i+1));

i++;

}

Console.WriteLine(&quot;The value of s is:&quot;+s);

Console.ReadKey();

}

}</pre><p><b>Output:-</b></p>
<p>The value of s is:3.858333.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mycoding.net/2013/02/find-s12-34-56-78-89-910-in-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
