Cygwin

Like many enterprise developers I use both Windows and Linux. Sometimes I really want to be able to use POSIX text processing tools on Windows, for example when troubleshooting pipe delimted data files used in batch system interfaces. I often have to research issues with pipe delimited transaction logs, and awk can be used to filter out the records of interest, eg.

awk -F| '($3==276||$3==259) && $5=="Payment " { OFS="|"; print $0 }' < transaction_log

Using a command line text tool like this can be much more efficient than importing text files into Excel for filtering. Other text tools I use heavily include find, grep, sed, tr and wc.

POSIX tools for Windows include SUA (aka. Interix, aka. SFU)  and MKS toolkit but I prefer Cygwin or Cygwin/X

Under Cygwin I used to use rxvt, but now I’ve switched to mintty which is similar to PuTTY. X can be started from a mintty session as follows:

xwin -multiwindow -clipboard

cx_Oracle callfunc()

I like wrapping database queries in stored procedures: it keeps the SQL in the database, where Oracle can track its dependencies and flag if some change makes it invalid.  Here’s an example using Oracle’s demo schema SCOTT:

CREATE OR REPLACE PACKAGE emp_extract_k
AS
   TYPE emp_t
   IS
      RECORD( ename  varchar2( 10 ), hiredate date, sal     number( 7, 2 ) );
   TYPE emp_csr_t IS REF CURSOR
      RETURN emp_t;
   FUNCTION get_emps
      RETURN emp_csr_t;
END;
/
CREATE OR REPLACE PACKAGE BODY emp_extract_k
AS
   FUNCTION get_emps
      RETURN emp_csr_t
   IS
      c   emp_csr_t;
   BEGIN
      OPEN c FOR SELECT   ename, hiredate, sal FROM scott.emp;
      RETURN c;
   END;
END;/

Now suppose I want to take the output from a stored procedure like the one above and write it to a CSV file.  In Python this is trivially easy:

 import cx_Oracle
 import csv
 reportName = 'emp_extract_k.get_emps'
 connection = cx_Oracle.connect(userid)
 cursor = connection.cursor()
 rs = cursor.callfunc(reportName, cx_Oracle.CURSOR)
 fd = open(reportName+'.csv', 'w')
 csvFile = csv.writer(fd)
 header = []
 [header.append(col_defn[0]) for col_defn in rs.description]
 csvFile.writerow(header)
 for r in rs:
  csvFile.writerow(r)
 fd.close()

Wakoopa

After just over three months using Wakoopa I am now apparently an expert, having used 200+ applications and websites during over 500+ hours logged on a PC.  Much of that time was spent with Quest TOAD, munging Oracle data and researching issues: a couple of weeks I was the heaviest user from Wakoopa and I filled out a review and screenshot.  The biggest disappointment was the 3D desktop I tried, but Wakoopa did suggest I try Notepad++ again, and I’ve switched from EditPlus for now.  It’s great to browse the categories and see what software is actually used by other members, and what might be the next great tool or package.

VBScript will never die, just fade away

I was looking for an official announcement of the end of life of VBScript but could not find one.  Instead I stumbled across the following MSDN blog post with a vague reference: "I believe that it was [at the] IT Forum in Nov 2005 that this was announced."  A colorful blog post from Ryan Stemkoski made me laugh, the comments are interesting also.  The closest I could find to an official Microsoft announcement was a blog post five years ago by Eric Lippert, who admitted to being the last person to ever add a feature to VBScript, in November 2000.

Granite Telecommunications

I met this week with Rob Hale, CEO of Granite Telecommunications.  Granite Telecom is an enterprise wireline wholesaler specializing in providing consolidated billing and service for multi-location businesses: 3/4 million lines from Verizon, Qwest, AT&T; and others to 10,000 customers in over 100,000 locations.  The company was established in 2002 and ranked in the Inc. 500 in 2007 and 2008: revenues in 2009 are expected to approach $400M.  Customers include USPS, Walmart, CVS, 7-Eleven, McDonalds, Verizon, Sprint, Comcast, GE and over half the Fortune 100.  Interestingly Rob’s previous business, Network Plus (NPLS), was also a telecom wholesaler, growing from its inception in 1990 to a public IPO in 1999 to 300,000 lines, 75,000 customers and $284M sales before overspending on network hardware, being forced into bankruptcy in February 2002 and having its assets sold to Broadview Networks for $16M.  Granite was started four months later and is still debt free.

Windows Utilities

CNET has an excellent article on free Windows utilities at download.com.  Featured tools include Firefox, Thunderbird, OpenOffice, Gimp, Paint.NET, MediaMonkey, 7-zip, Foxit, Pidgin, Smart Defrag, WinDirStat and Process Explorer.

Process Explorer is part of the Windows Sysinternals Suite available from Microsoft for power users.

Microsoft also provide free downloads of their Live Essentials applications, which include Messenger, and Writer for offline blog editing.  Google Picasa, however, is much better than Windows Live Photo Gallery.

Wakoopa have a utility and community site for tracking member application usage.  Application rankings and reviews are available by category.

Adding a surrogate key to an Oracle table

This works for me for a mid-sized table.

ALTER TABLE foo ADD ( foo_id integer )
/
CREATE SEQUENCE foo_id_seq
/
CREATE OR REPLACE TRIGGER before_update_foo
   BEFORE INSERT OR UPDATE
   ON FOO
   REFERENCING OLD AS old NEW AS new
   FOR EACH ROW
DECLARE
   l_foo_id   foo.foo_id%TYPE;
BEGIN
   IF :new.foo_id IS NULL
   THEN
      SELECT   foo_id_seq.nextval INTO l_foo_id FROM dual;

      :new.foo_id := l_foo_id;
   END IF;
END;
/
UPDATE   foo
   SET   foo_id = NULL
/
COMMIT
/
CREATE UNIQUE INDEX foo_ak
   ON foo( foo_id )
/
ALTER TABLE foo MODIFY ( foo_id NOT NULL )
/
ALTER TABLE foo ADD (CONSTRAINT foo_ak UNIQUE (foo_id))
/

Windows on over 95% of new netbooks

According to this press release Britain’s largest chain of computing superstores has dropped Linux from netbook sales in stores.

Brandon LeBlanc, Windows Communication Manager at Microsoft posted an article stating that

“We’ve seen Windows share on [netbooks] in the U.S. go from under 10% of unit sales during the first half of 2008 to 96% as of February 2009, according to the latest NPD Retail Tracking Service data.”

The pros and cons of Windows vs. Linux may be debatable, but I have not seen yet any challenge to this statistic.

Email Strategy

Should you upgrade Microsoft Exchange or switch to an alternative? It depends what you want. In addition to hosting your own solution it is now possible to outsource to a SaaS provider, providing management and investors are comfortable with the idea. Requirements to consider:

  • Compatibility with Microsoft Outlook. All mail servers support IMAP and POP to access and download mail, but fewer solutions support Microsoft’s various proprietary protocol and extensions (eg. MAPI/RPC) used by more advanced features of Outlook. Open source implementations are still a work in progress.
  • Storage management. Traditionally mail servers have supported a mailbox of up to 1-2GB, but what happens when a user accumulates more than that?
  • Spam filtering and support for e-discovery. Postini addresses this well upstream from your corporate mail server and eliminates this as an issue.
  • Smartphone integration. More proprietary protocols are used to synchronize smartphones using Windows ME or Blackberry OS.
  • Cost.

Solutions to consider:

  • Google. Google offers a hosted solution with IMAP. Premier edition offers 25GB storage and 99.9% uptime (=8-9 hours/year downtime) for $50/yr.
  • Yahoo Zimbra. Competing solutions similar to Zimbra include Zarafa, Axigen and Scalix (fka. HP OpenMail). Zimbra gets the best reviews, however.
  • MailStreet and Apptix have received good reviews for providing hosted Microsoft Exchange email services. MailStreet charges around $8/mo. including Outlook licence and 2GB storage.

Looking into the future Open-Xchange is closest to providing an open source solution including MAPI/RPC.

Posts navigation

1 2 3 7 8 9 10 11 12 13
Scroll to top