April 2007 Archives

Yahoo quotes

| | No TrackBacks

[Yahoo documentation of quote fields]

[External documentation of fields]

PurposeValue
Symbols
Namen
Last Trade (With Time)l
Last Trade (Price Only)l1
Last Trade Dated1
Last Trade Timet1
Last Trade Sizek3
Change and Percent Changec
Changec1
Change in Percentp2
Ticker Trendt7
Volumev
Average Daily Volumea2
More Infoi
Trade Linkst6
Bidb
Bid Sizeb6
Aska
Ask Sizea5
Previous Closep
Openo
Day's Rangem
52-week Rangew
Change From 52-wk Lowj5
Pct Chg From 52-wk Lowj6
Change From 52-wk Highk4
Pct Chg From 52-wk Highk5
Earnings/Sharee
P/E Ratior
Short Ratios7
Dividend Pay Dater1
Ex-Dividend Dateq
Dividend/Shared
Dividend Yieldy
Float Sharesf6
Market Capitalizationj1
1yr Target Pricet8
EPS Est. Current Yre7
EPS Est. Next Yeare8
EPS Est. Next Quartere9
Price/EPS Est. Current Yrr6
Price/EPS Est. Next Yrr7
PEG Ratior5
Book Valueb4
Price/Bookp6
Price/Salesp5
EBITDAj4
50-day Moving Avgm3
Change From 50-day Moving Avgm7
Pct Chg From 50-day Moving Avgm8
200-day Moving Avgm4
Change From 200-day Moving Avgm5
Pct Chg From 200-day Moving Avgm6
Shares Owneds1
Price Paidp1
Commissionc3
Holdings Valuev1
Day's Value Changew1,
Holdings Gain Percentg1
Holdings Gaing4
Trade Dated2
Annualized Gaing3
High Limitl2
Low Limitl3
Notesn4
Last Trade (Real-time) with Timek1
Bid (Real-time)b3
Ask (Real-time)b2
Change Percent (Real-time)k2
Change (Real-time)c6
Holdings Value (Real-time)v7
Day's Value Change (Real-time)w4
Holdings Gain Pct (Real-time)g5
Holdings Gain (Real-time)g6
Day's Range (Real-time)m2
Market Cap (Real-time)j3
P/E (Real-time)r2
After Hours Change (Real-time)c8
Order Book (Real-time)i5
Stock Exchangex

Photo stamps

| | No TrackBacks

Third party python packages

| | No TrackBacks

Python analytics

| | No TrackBacks

These use the numpy library, I believe. I adapted them to work in a more vanilla python way as I could not get my head around numpy.

Exponential moving average

def ema(s, n):
    """
    returns an n period exponential moving average for
    the time series s

    s is a list ordered from oldest (index 0) to most recent
    (index -1) n is an integer

    returns a numeric array of the exponential moving average
    """
    s = array(s)
    ema = []
    j = 1
    #get n sma first and calculate the next n period ema
    sma = sum(s[:n]) / n
    multiplier = 2 / float(1 + n)
    ema.append(sma)
    #EMA(current) = ( (Price(current) - EMA(prev) ) xMultiplier) + EMA(prev)
    ema.append(( (s[n] - sma) * multiplier) + sma)
    #now calculate the rest of the values
    for i in s[n+1:]:
        tmp = ( (i - ema[j]) * multiplier) + ema[j]
        j = j + 1
        ema.append(tmp)
    return ema

Simple moving average

def movavg(s, n):
    """
    returns an n period moving average for the time series s
       
    s is a list ordered from oldest (index 0) to most recent (index -1)
    n is an integer

        returns a numeric array of the moving average

    See also ema in this module for the exponential moving average.
    """
    s = array(s)
    c = cumsum(s)
    return (c[n-1:] - c[:-n+1]) / float(n-1)

Excel: Find unique values in column

| | No TrackBacks

Excel: Find unique values in column

Sub FindUniqueValues()
    Call Rows("1:1").Insert(Shift:=xlDown)
    Range("A1").Value = "Email"
    Range("B1").Value = "Unique"
    Call Columns("A:B").Sort(Key1:=Range("A2"), _
        Order1:=xlAscending, Header:=xlYes, _
        OrderCustom:=1, MatchCase:=False, _
        Orientation:=xlTopToBottom, _
        DataOption1:=xlSortNormal)
        
    Dim wks As Worksheet
    Set wks = ThisWorkbook.ActiveSheet
    Dim startCell As Range, endCell As Range:
    Set startCell = Range("B2")
    Set endCell = wks.Cells.SpecialCells(xlCellTypeLastCell)
    startCell.FormulaR1C1 = "=RC[-1]<>R[1]C[-1]"
    Dim r As Range
    Set r = Range(startCell, endCell)
    Call startCell.AutoFill(Destination:=r)
    Call wks.Calculate
    Set r = Columns("A:B")
    Call r.AutoFilter
    Call r.AutoFilter(Field:=2, Criteria1:="TRUE")
End Sub

n Guilty Men

| | No TrackBacks
"Better that ten guilty persons escape than that one innocent suffer," says English jurist William Blackstone.  The ratio 10:1 has become known as the "Blackstone ratio." Lawyers "are indoctrinated" with it "early in law school." "Schoolboys are taught" it. In the fantasies of legal academics, jurors think about Blackstone routinely.

[n Guilty Men]

Python libraries for scientific and numerical work

| | No TrackBacks

numpy provides the underlying data structures (array and matrices among other things) you require. This will handle all your vector stuff, reading/writing to and from files, "loop macros", etc.

scipy provides a set of scientific programming libraries, including stats, fft and many other things. Have a look around and see if it already does what you want.

matplotlib takes care of all your plotting needs, and plays nice with numpy and scipy.

Doom as a tool for system administration

| | No TrackBacks

Prompting for database connection

| | No TrackBacks

Add a COM reference to:
Microsoft OLE DB Service Component 1.0 Type Library
Microsoft ActiveX Data Objects 2.7 // any 2.5 or higher version is fine

You can then write code like:

//
// Prompt for a totally new connection string
//
private void button1_Click(object sender, EventArgs e)
{
    bool Cancelled = false;
    string ConnectionString = string.Empty;

    MSDASC.DataLinks d = new MSDASC.DataLinks();
    d.hWnd = (int)this.Handle;
    ADODB._Connection c = (ADODB._Connection)d.PromptNew();
    if (c == null)
        Cancelled = true;
    else
    {
        Cancelled = false;
        ConnectionString = c.ConnectionString;
    }
}

//
// Edit a connection string
//
private void button2_Click(object sender, EventArgs e)
{
    bool Saved = false;
    string ConnectionString = "Provider=SQLOLEDB.1;Integrated
Security=SSPI;Persist Security Info=False;User ID=sa;Initial
Catalog=Northwind;Data Source=.";

    MSDASC.DataLinks d = new MSDASC.DataLinks();
    d.hWnd = (int)this.Handle;
    object c = new ADODB.Connection();
    ((ADODB._Connection)c).ConnectionString = ConnectionString;
    Saved = d.PromptEdit(ref c);
    if (Saved)
    {
        ConnectionString = ((ADODB._Connection)c).
          ConnectionString;
    }
}

Using the Visual Studio Connection String Dialog

| | No TrackBacks

Using the Visual Studio Connection String Dialog

SQL Server 2005 GUID primary keys

CREATE TABLE Employee 
            (EmployeeID uniqueidentifier DEFAULT NEWSEQUENTIALID())

How books work: Gutenberg explains

| | No TrackBacks

Screen: overhead volume breakout

| | No TrackBacks

Screen: overhead volume breakout

  • Search for last down day with a large range and high volume (2x 20-day MA volume)
  • Watch point is that day's open
  • Wait for stock to clear that point

Microsoft communities

| | No TrackBacks

Dondero High School music

| | No TrackBacks
The annual Pop Concert was a beloved institution at Dondero High School from 1971-2006. It was directed by music instructor Rick Hartsoe for 35 years, assisted by Jan Stewart since 1983. The A Capella Choir and student instrumentalists traditionally presented 20 popular songs per concert: ten full choir pieces chosen for their harmonic and instrumental interest, and ten solos of the students' choosing. The nine soloists were student-selected via an audition process, and the top soloist each year was obliged to perform an encore.

[Dondero High School music]

Trading websites

| | No TrackBacks

Rent or buy?

| | No TrackBacks

Is it better to rent or buy?
Calculator compares renting and buying for a specific rental versus a specific home purchase.

Yahoo Canada

| | No TrackBacks

Python and sqlite package

| | No TrackBacks

Python and sqlite package

Moby Word list

| | No TrackBacks

[HDB 2008-06-04] This seems to have moved to an unidentified location. Or, more likely, it has been removed from the internet. It's really useful. I wish I'd downloaded it when I had the chance.

[Moby Word list]

PathCompactPathEx: API for shortening paths

| | No TrackBacks

PathCompactPathEx()

[DllImport("shlwapi.dll", CharSet = CharSet.Auto)]
static extern bool PathCompactPathEx(
    [Out] StringBuilder pszOut, 
    string szPath, int cchMax,
    int dwFlags);

static string PathShortener(string path, int length)
{
    StringBuilder sb = new StringBuilder();
    PathCompactPathEx(sb, path, length, 0);
    return sb.ToString();
}

StockDigg

| | No TrackBacks

Trading links

| | No TrackBacks

USB phone recorder

| | No TrackBacks

Python and databases

| | No TrackBacks

Python and databases

Coding Horror links

| | No TrackBacks

Coding Horror links

  • Is Your Database Under Version Control?

    The database is a critical part of your application. If you deploy version 2.0 of your application against version 1.0 of your database, what do you get? A broken application. And that's why your database should always be under source control right next to your application code. You deploy the app, and you deploy the database. Like peanut butter and chocolate, they are two great tastes that taste great together.

  • Cool Gifts for Geeks: 2006 Edition
  • PowerPoint presentations
  • Code smells
  • The Last Configuration Section Handler.. Revisited
  • FizzBuzz
  • So I set out to develop questions that can identify this kind of developer and came up with a class of questions I call "FizzBuzz Questions" named after a game children often play (or are made to play) in schools in the UK. An example of a Fizz-Buzz question is the following:

    Write a program that prints the numbers from 1 to 100. But for multiples of three print "Fizz" instead of the number and for the multiples of five print "Buzz". For numbers which are multiples of both three and five print "FizzBuzz".

    Most good programmers should be able to write out on paper a program which does this in a under a couple of minutes. Want to know something scary? The majority of comp sci graduates can't. I've also seen self-proclaimed senior programmers take more than 10-15 minutes to write a solution.

  • When Understanding Means Rewriting

    It's not that developers want to rewrite everything; it's that very few developers are smart enough to understand code without rewriting it.

  • How Not To Become a Rockstar Programmer

    The only way to get better at writing code is to write code. So study "good code*" all you want, but write as much code as you can.

  • The Ultimate Code Kata

    It's an important distinction [between doing your programming job and practicing programming]. I may drive to work every day, but I'm far from a professional driver. Similarly, programming every day may not be enough to make you a professional programmer. So what can turn someone into a professional driver or programmer? What do you do to practice?

Using Fiddler with Firefox

| | No TrackBacks
[Using Fiddler with Firefox]

All you need to do is:

  • Open FireFox options
  • Go to General | Connection Settings
  • Use the Manual proxy configuration option
  • Set t 127.0.0.1 Port 8888

Who Is This Person? [Firefox Add-ons]

| | No TrackBacks

Who Is This Person? [Firefox Add-ons]

With the Who Is This Person? Firefox extension, highlight a name on a web page and with a click look up someone's personal details in LinkedIn, Wikipedia, Technorati, Yahoo Person Search, Google News, TailRank and more. Useful!

Coding Horrors favorites

| | No TrackBacks

S3Fox Organizer for FireFox

| | No TrackBacks

S3Fox Organizer for FireFox

S3Fox Organizer for Amazon(S3Fox) v0.4: (NEW!) This firefox extension(browser plugin) provides an user friendly interface for Amazon's S3 (Simple Storage Service) . Its interface is very much similar to the FTP interface that lists local folders in the left panel and S3 buckets/files/folders in the right panel. Files/folders can be moved from the local computer to Amazon's storage space and vice versa.

S3Fox

FireFox addins

| | No TrackBacks

IPCop

| | No TrackBacks

Firefox addin for stock charts

| | No TrackBacks
Firefox addin for stock charts. Selection symbols from text of web page, right-click, select 'Open Stock Charts', and you get stock charts of the selected symbols.

[Description]
[Download from stocktickr.com]

Speeding up FireFox the right way

| | No TrackBacks

Technical trading strategies

| | No TrackBacks

Stock Charts Firefox Extension

| | No TrackBacks

FireFox secrets

| | No TrackBacks

Keyboard equivalents of Remote Desktop

| | No TrackBacks

Speed up FireFox

| | No TrackBacks

Trading blogs

| | No TrackBacks

FireFox fetch text extension

| | No TrackBacks
Faster fox (performance and network tweaks for Firefox)
  • Prefetching
    Fasterfox uses idle bandwidth times to pre-fetch and cache the links on your current page.
  • Network Tweaks
    You set how Fasterfox controls simultaneous connections, pipelining, caching and more.
  • Pop-up Blocker
    It blocks Flash plug-in pop-ups now.
  • Page Load Timer
    This tests the effectiveness of your settings.

DownThemAll

| | No TrackBacks
FireFox addin to download files from web page. DownThemAll lets you download all the links or images contained in a webpage.

[LifeHacker description]
[Mozilla download link]

Mozilla addons

| | No TrackBacks

Secrets of Firefox 1.0

| | No TrackBacks

Top 15 Firefox Extensions

| | No TrackBacks

FireFox addin for showing file type of link

| | No TrackBacks
FireFox addin for showing file type of link, such as PDF, RSS feed, XML, mailto link, Word doc, Excel doc,  ZIP file, etc., all cued with an icon inline.

[Description at bolinfest.com]

FireFox addins for passwords

| | No TrackBacks

Websites for definitons and neologisms

| | No TrackBacks

Websites for definitons and neologisms

Alphabetize procedures/subs

| | No TrackBacks

Alphabetize procedures/subs

Also, you might be interested something to sort imports/using's.

Pages

OpenID accepted here Learn more about OpenID
Powered by Movable Type 4.32-en

About this Archive

This page is an archive of entries from April 2007 listed from newest to oldest.

March 2007 is the previous archive.

May 2007 is the next archive.

Find recent content on the main index or look in the archives to find all content.