13:05 ET Dow -154.48 at 10309.92, Nasdaq -37.61 at 2138.44, S&P -19.130 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 13:05 ET Dow -154.48 at 10309.92, Nasdaq -37.61 at 2138.44, S&P -19.1313:05 ET Dow -154.48 at 10309.92, Nasdaq -37.61 at 2138.44, S&P -19.13

.

.

Friday, September 30, 2011

Introduction to Generic Collections - Source: C# Station


Source: http://www.csharp-station.com/Tutorlals/Lesson20.aspx

using System;
using System.Collections.Generic;

public class Customer
{
    public Customer(int id, string name)
    {
        ID = id;
        Name = name;
    }

    private int m_id;

    public int ID
    {
        get { return m_id; }
        set { m_id = value; }
    }

    private string m_name;

    public string Name
    {
        get { return m_name; }
        set { m_name = value; }
    }
}

class Program
{
    static void Main(string[] args)
    {
        List<int> myInts = new List<int>();

        myInts.Add(1);
        myInts.Add(2);
        myInts.Add(3);

        for (int i = 0; i < myInts.Count; i++)
        {
            Console.WriteLine("MyInts: {0}", myInts[i]);
        }

        Dictionary<int, Customer> customers = new Dictionary<int, Customer>();

        Customer cust1 = new Customer(1, "Cust 1");
        Customer cust2 = new Customer(2, "Cust 2");
        Customer cust3 = new Customer(3, "Cust 3");

        customers.Add(cust1.ID, cust1);
        customers.Add(cust2.ID, cust2);
        customers.Add(cust3.ID, cust3);

        foreach (KeyValuePair<int, Customer> custKeyVal in customers)
        {
            Console.WriteLine(
                "Customer ID: {0}, Name: {1}",
                custKeyVal.Key,
                custKeyVal.Value.Name);
        }

        Console.ReadKey();
    }
}

Reflection in C# Introduction - Csharp, c sharp

Source: Csharp.net


http://csharp.net-tutorials.com/reflecdtion/introduction/


Wikipedia says that "In computer science, reflection is the process by which a computer program can observe and modify its own structure and behaviour". This is exactly how Reflection in C# works, and while you may not realize it at this point, being able to examine and change information about your application during runtime, offers huge potential. Reflection, which is both a general term, as well as the actual name of the reflection capabilities in C#, works very, very well, and it's actually not that hard to use. In the next couple of chapters, we will go more into depth about how it works and provide you with some cool examples, which should show you just how useful Reflection is.

However, to get you started and hopefully interested, here is a small example. It solves a question that I have seen from many newcomers to any programming language: How can I change the value of a variable during runtime, only by knowing its name? Have a look at this small demo application for a solution, and read the next chapters for an explanation of the different techniques used.



using System;
using System.Collections.Generic;
using System.Text;
using System.Reflection;

namespace ReflectionTest
{
    class Program
    {
        private static int a = 5, b = 10, c = 20;

        static void Main(string[] args)
        {
            Console.WriteLine("a + b + c = " + (a + b + c));
            Console.WriteLine("Please enter the name of the variable that you wish to change:");
            string varName = Console.ReadLine();
            Type t = typeof(Program);
            FieldInfo fieldInfo = t.GetField(varName, BindingFlags.NonPublic | BindingFlags.Static);
            if (fieldInfo != null)
            {
                Console.WriteLine("The current value of " + fieldInfo.Name + " is " + fieldInfo.GetValue(null) + ". You may enter a new value now:");
                string newValue = Console.ReadLine();
                int newInt;
                if (int.TryParse(newValue, out newInt))
                {
                    fieldInfo.SetValue(null, newInt);
                    Console.WriteLine("a + b + c = " + (a + b + c));
                }
                Console.ReadKey();
            }
        }
    }
}

xmlReader to read then xmlWriter to write out content


The following example navigates through the stream to determine the current node type, and then uses XmlWriter to output the XmlReader content.
StringBuilder output = new StringBuilder();

String xmlString =
        @"<?xml version='1.0'?>
        <!-- This is a sample XML document -->
        <Items>
          <Item>test with a child element <more/> stuff</Item>
        </Items>";
// Create an XmlReader
using (XmlReader reader = XmlReader.Create(new StringReader(xmlString)))
{
    XmlWriterSettings ws = new XmlWriterSettings();
    ws.Indent = true;
    using (XmlWriter writer = XmlWriter.Create(output, ws))
    {

        // Parse the file and display each of the nodes.
        while (reader.Read())
        {
            switch (reader.NodeType)
            {
                case XmlNodeType.Element:
                    writer.WriteStartElement(reader.Name);
                    break;
                case XmlNodeType.Text:
                    writer.WriteString(reader.Value);
                    break;
                case XmlNodeType.XmlDeclaration:
                case XmlNodeType.ProcessingInstruction:
                    writer.WriteProcessingInstruction(reader.Name, reader.Value);
                    break;
                case XmlNodeType.Comment:
                    writer.WriteComment(reader.Value);
                    break;
                case XmlNodeType.EndElement:
                    writer.WriteFullEndElement();
                    break;
            }
        }

    }
}
OutputTextBlock.Text = output.ToString();


The following example uses the XmlReader methods to read the content of elements and attributes.
StringBuilder output = new StringBuilder();

String xmlString =
    @"<bookstore>
        <book genre='autobiography' publicationdate='1981-03-22' ISBN='1-861003-11-0'>
            <title>The Autobiography of Benjamin Franklin</title>
            <author>
                <first-name>Benjamin</first-name>
                <last-name>Franklin</last-name>
            </author>
            <price>8.99</price>
        </book>
    </bookstore>";

// Create an XmlReader
using (XmlReader reader = XmlReader.Create(new StringReader(xmlString)))
{
    reader.ReadToFollowing("book");
    reader.MoveToFirstAttribute();
    string genre = reader.Value;
    output.AppendLine("The genre value: " + genre);

    reader.ReadToFollowing("title");
    output.AppendLine("Content of the title element: " + reader.ReadElementContentAsString());
}

OutputTextBlock.Text = output.ToString();

XML Parser - Parsing XML Documents, Parsing XML Strings - XML DOM Object

Source: http://www.w3schools.com/ml/xml_parser.asp


Note: Internet Explorer uses the loadXML() method to parse an XML string, while other browsers use the DOMParser object.



All modern browsers have a built-in XML parser.
An XML parser converts an XML document into an XML DOM object - which can then be manipulated with a JavaScript.

Parse an XML Document

The following code fragment parses an XML document into an XML DOM object:
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.open("GET","books.xml",false);
xmlhttp.send();
xmlDoc=xmlhttp.responseXML;

Control Characters - escape sequences '\n' (newline) and '\r' (carriage return). C# - csharp - c sharp

escape sequences '\n' (newline) and '\r' (carriage return). 


special characters 


Carriage return, often shortened to return, refers to a control character or mechanism used to start a new line of text.


command codes


.net format string - Example: {date:yyyy-MM-dd},{symbol},{price:0.0000##},{volume},{open},{high},{low}\r\n. 


control characters in ASCII codeUnicodeEBCDIC, or many other codes. 


CONTROL CHARACTERS

How to Determine the Quality of a Men's Dress Shirt - Source: Racked by Elizabeth Licata


What Makes an Expensive Dress Shirt So Expensive, Anyway?

2010_1_tpink.jpg
Shirt gusset image via Thomas Pink
Remember a couple months ago when Thomas Pink gave away shirts at Rockefeller Center and the line stretched for hours and hours? A lot of people wondered what was the big deal about some shirts. Well the Wall St. Journal took a look at what exactly makes an expensive shirt expensive, and it turned into a shopping guide for high-end ready-to-wear shirts with London designer Brian Clarke, who says that most customers don't understand about 75 percent of the elements that go into making a high-quality ready-to-wear shirt.
Fabric, of course, is one of the major differences, but it's possible to treat a cheaper shirt with chemicals that will make the fabric look more luxurious, at least until it's washed. The fabric should feel smooth yet firm, and Clarke recommends holding the shirt up to the light to check the density of the weave. Higher-quality fabric is made of a denser weave that lets through less light than a more inexpensive option.

Next up, check the cuffs and collar for some slack between the outer and inner layers of fabric and interfacing. On a striped shirt, make sure the pocket stripes match up with the background, and that the sleeve stripes match those on the yoke (that part on the upper back, across the shoulders.)
He recommends looking for gussets on the side seams where the tail splits. It will be a little triangle or square of extra fabric, and the ones onThomas Pink shirts are pink. Clarke also says to check the size of the stitches and make sure there are at least 15 per inch, but you'll probably look a little crazy if you are in a store counting all the stitches on all the shirts all day.
There's a lot that goes into making a shirt, and every step has higher- and lower-end options. Apparently it even comes down to what kind of sewing machines are used to make them. Brioni's shirts are sewn on older machines that create only 150 to 300 stitches per minute, while newer machines get up to about 3,000-4,000 stitches per minute. So obviously there's a bunch of reasons behind the higher price tag on certain shirts. Our question for you is: Will anyone notice, and is it worth it if they don't?
· A Shirt's Tale [WSJ]
· Lineblogging: Thomas Pink Shirtpocalypse Rages On [Racked]

google maps xml parse function


XML and Data Parsing

The Google Maps API exports a factory method for creating browser-neutral XmlHttpRequest() objects that work in recent versions of Internet Explorer, Firefox, and Safari. As with all XmlHttpRequests, any retrieved files must be on your local domain. The following example downloads a file called myfile.txt and displays its contents in a JavaScript alert():
var request = GXmlHttp.create();
request.open("GET", "myfile.txt", true);
request.onreadystatechange = function() {
  if (request.readyState == 4) {
    alert(request.responseText);
  }
}
request.send(null);
The API also exports a simpler GDownloadUrl() method for typical HTTP GET requests that eliminates the need for XmlHttpRequest() readyStatechecking. The example above could be rewritten using GDownloadUrl() like this:
GDownloadUrl("myfile.txt", function(data, responseCode) {
  alert(data);
});
You can parse an XML document with the static method GXml.parse(), which takes a string of XML as its only argument. This method is compatible with most modern browsers, but it throws an exception if the browser does not support XML parsing natively.
In this example, we download a static file ("data.xml") that contains a list of lat/lng coordinates in XML using the GDownloadUrl method. When the download completes, we parse the XML with GXml and create a marker at each of those points in the XML document.
Automated Forex Trading Robot Shows Appreciable Trading Results
AZoRobotics
By Andy Choi Forex Associates has launched the latest version of the FA21
v1.19 Automated Forex Trading robot into the market. Along with the latest
version of the software they have also released the related audited results
of the in house mechanize ...
<http://www.azorobotics.com/details.asp?newsID=2116>
See all stories on this topic:
<http://news.google.com/news/story?ncl=http://www.azorobotics.com/details.asp%3FnewsID%3D2116&hl=en&geo=us>

Jennifer Voice Picking At Oriental Trading Company Is Featured In Modern ...
PR Web (press release)
Even highly automated facilities like Oriental Trading need people to
handle product at some point in the fulfillment process. Jennifer helps
ensure those human touch points are as efficient and accurate as possible.
Lucas Systems, Inc., the largest ...
<http://www.prweb.com/releases/2011/9/prweb8842650.htm>
See all stories on this topic:
<http://news.google.com/news/story?ncl=http://www.prweb.com/releases/2011/9/prweb8842650.htm&hl=en&geo=us>

E*Trade Financial Stock Hits New 52-Week Low (ETFC)
TheStreet.com
E*TRADE Financial Corporation, together with its subsidiaries, provides
online brokerage and related products and services primarily to individual
retail investors in the United States. It offers trading products and
services, including automated order ...
<http://www.thestreet.com/story/11264148/1/etrade-financial-stock-hits-new-52-week-low-etfc.html>
See all stories on this topic:
<http://news.google.com/news/story?ncl=http://www.thestreet.com/story/11264148/1/etrade-financial-stock-hits-new-52-week-low-etfc.html&hl=en&geo=us>

=== Web - 3 new results for [automated trading] ===

Introducing the 2011 $100000 Automated Trading Challenge
Hi bomberoneuno, Unfortunately, the strategies is not going to be posted on
any forums. Regards, Jimmy.
<http://forexforums.dailyfx.com/automated-trading-challenges/309187-introducing-2011-100-000-automated-trading-challenge-2.html>

Forums - Hosting for automatic trading algorithms?
I'd like to give automatic trading a try, but I don't have a good internet
connection I can use (I'm always on road, and living in hotels, so fixing
this is not an option) ...
<http://208.234.169.12/vb/showthread.php?threadid=228033>

automated trading - How do you distinguish "significant" moves from ...
Not the answer you're looking for? Browse other questions tagged automated-
trading equity probability algorithm or ask your own question. ...
<http://quant.stackexchange.com/questions/2020/how-do-you-distinguish-significant-moves-from-noise>

q bookmarks

http://www.stockwatch.com/custom/api.aspx

 Herbie Skeete 
ExchangeNews Direct: New Agreement Extends Benefits Of DTCC’s Insurance Analytic Reporting Service To RIIA Membe...
 Herbie Skeete 
ExchangeNews Direct: CFTC Charges Oscar Hernandez And His Florida Companies With Operating $3 Million Commodity ...
 Herbie Skeete 
ExchangeNews Direct: Toronto Stock Exchange, TSX Venture Exchange, TMX Select And Montreal Exchange Closed For T...