Archive

Archive for the ‘Software Development’ Category

Instantiating with Bread Dough

January 12th, 2012 No comments

Instantiated Homemade Bread

“Do you use the same dough every time you make bread?”

“I use the same recipe”

That was the brief discussion at dinner tonight.  I couldn’t resist teaching my young family about the object oriented programming concept of object instantiation.  The analogy goes like this:

The recipe is the object.  The dough is the instance.  Arguably the oven would be the factory method and the bread would be the instance.

So, no, you wouldn’t use the same dough each time to make bread.  Dough would be an instance of the BreadRecipe object.

Categories: Life, Software Development Tags:

WordPress Showing 500 Server error

January 9th, 2012 No comments

For several days I would access my blog here to see a HTTP/500 server error.  This would occur when accessing either the administrative console or when accessing the front page of the site.  After some digging I found that the default PHP memory limit was set to 16Mb.  It was recommended to boost the memory limit for WordPress to 128MB.  I did this by adding the single line of code to the wp-config.php file.

@ini_set("memory_limit","16M");
Categories: Software Development Tags: ,

Redirecting with web.config

December 8th, 2009 No comments

Here is how to conduct an HTTP 301 Permanent Redirect from one web site to another location using web.config in ASP.NET:

<configuration>
    <system.webServer>
        <httpRedirect enabled="true"
                destination="http://www.digitalhoneycomb.com"
                exactDestination="true"
                httpResponseStatus="Permanent" />
    </system.webServer>
</configuration>
Categories: Software Development Tags:

Zero to Plinqo in 90 minutes

July 23rd, 2009 Comments off

Plinqo is a collection of CodeSmith templates designed to work with LINQ to SQL.  Here are the steps I took to go from knowing very little about Plinqo to being ready to implement in my next development project.
1) Download a CodeSmith Trial
2) Install CodeSmith
3) Download Plinqo
4) Watch 16 minute Quick Start video See notes below.
5) Watch 22 minute Feature Overview video See notes below.

Quick Start Video Notes

  • Plinqo provides DBML, business entities, and manager/queries.
  • Running the quick start generates three projects: Data, Test and UI.
  • In the Data project there a .dbml file is generated along with /entities/ in single files and /managers/ folders.
  • To use the Plinqo gernated projects in your project just add references to CodeSmith.Data and the auto-geneated .Data.

Feature Overview Video

  • The DBML inherits database schema changes
  • The DBML persists changes to DBML mappings
  • Meta data updates are perserved through merging
  • Plinqo can be used to create a powerful business rules engine

Plinqo overs a lot of automated horsepower in wiring up database schema to business objects.  Templates can be generated in both C# and VB.

Categories: Software Development Tags: ,

FogBugz SQL Maintenance

May 26th, 2009 Comments off

I have used and have been an avid fan of FogBugz for years.  One quirk that I experience when running on Microsoft SQL Standard or SQL Express is that the database grows very quickly.  Even so, it can be reduced back to an acceptable size by running a simple script.  I am now running FogBugz 6.1 and using SQL Server 2008 Express, 64-bit.

Here is the SQL maintenance script:

USE FogBugz
GO
ALTER DATABASE FogBugz
SET RECOVERY SIMPLE;
GO
DBCC SHRINKFILE ([FOGBUGZ DATABASE FILE DatabaseName],1);
DBCC SHRINKFILE ([FOGBUGZ LOG FILE LogFileName],1);
GO
ALTER DATABASE FogBugz
SET RECOVERY FULL
GO

Since I am running SQL Express edition, there is no built-in support to run maintenance packages, so I use the command line OSQL to run the script above.

Here is the command line:
[CODE]osql -ic:\tools\fb_shrink.sql -E -S.\SQLEXPRESS -oc:\tools\fogbugz_shrink_results.txt[/CODE]

I saved that command in a BAT file and then scheduled using the system scheduled tasks to be executed once daily.

Categories: Software Development Tags: ,

Installing TortoiseSVN Updates

January 7th, 2009 Comments off

For whatever reason, the Tortoise update notices like the one shown here are always intimidating to me.  I right click and select ‘SVN Update’ and get the update checker pop-up.  I think, “What? There is another update?  I’m not running the newest version?  What am I missing?  Was there something in the last versions that could be a risk to me?  How long will this take to update?  Where do I go again and what do I do?”

It’s quite simple really.  Here are the steps:

  1. Notice the pop-up and think “Gee, I should update this.  It’ll only take a minute.”
  2. Browse out to http://tortoisesvn.com and click the ‘Download’ link at the top of the page.
  3. Scroll down and select the version needed for your computer.
  4. Save the file.  I prefer to just put it on my desktop so I can easily find it again.
  5. Double click and walk through the installation.
  6. Reboot.  Done.
Categories: Software Development Tags:

ASP.NET Chart Control, a First Look

December 11th, 2008 Comments off

Several of my colleagues referred me to Scott Gu’s blog entry on ASP.NET Chart Component for the .NET Framework 3.5.  I had time to take a first look tonight.  I downloaded the component, the Visual Studio 2008 tool support and the sample project.  Each package installed easily.  I copied the sample project into the IIS directory on Vista and after encountering several error messages, I set the directory to be an application.  The first look is very impressive.  I’ve purchased packages from Infragistics and DotNetCharting over the last four years and this free component easily meets or beats quality and quantity of charting options offered by those packages.

Read Scott Gu’s blog entry
Download ASP.NET 3.5 SP1
Download the Control
Download VS2008 Tool Support
Download the sample project

Reducing the size of a SQL transaction log

December 9th, 2008 Comments off

I use Microsoft SQL Server quite a bit and have been stuck numerous times on an ever growing transaction log.  After much pounding on the server this evening I once again found the magic commands.  The commands are executed in Query Analyzer or Management Studio after a full backup of the database.

BACKUP LOG <database_name> WITH TRUNCATE_ONLY
DBCC SHRINKFILE(<logical file name>,0)

With a command line backup:

BACKUP DATABASE <database_name> TO "<path to backup location>"
BACKUP TRAN <database_name> TO "path to backup location>"
DBCC SHRINKFILE 0, TRUNCATEONLY
BACKUP LOG <database_name> WITH TRUNCATE_ONLY
DBCC SHRINKFILE('<logical file name>',0)

You can get the actual database name and logical file names by examining the contents of the sysfiles table:

SELECT * FROM SYSFILES
Categories: Software Development Tags:

Microsoft ArcReady

December 2nd, 2008 Comments off

ArcReady I attended Microsoft ArcReady today in Cincinnati OH.  Although typically technical, the presentation today was focused on soft skills for software architects.  I was a fantastic presentation and reinforced a lot of career development concepts that I have learned over the years.  Highlights from the event are below:

The first presenter was Brian H. Prince, Architect Evangelist for Microsoft Blog

  • Mentors — pick something you want to grow in and assemble mentors
    • Write down a mentor list and keep track of strategy
    • Mentors don’t have to know they are your mentor
    • Discard mentorships as needed
  • “You are in charge of your career, your company is in charge of your job” — @dmarsh
  • Be introspective
    • Review your job annually and mentally sign-up for another year
    • Check to see if you job is still aligned with your career objectives
    • Clearly define your career objectives
    • Pick something you want to be known as
  • Invest in your career: school, playing, reading, blogging, code camps
  • Book Recommendation: Who Says Elephants Can’t Dance? by Lou Gerstner
  • Three steps to higher a Power Team — not rock stars, but power team members
    • Passion
    • Learning
    • Problem Solving
  • Everything else you know today will be worthless in two years
  • Book Recommendation: Rules for Revolutionaries by Guy Kawasaki
  • Just like body building, work out different muscles (skills) each day.
  • Creativity
    • You need to practice it to strengthen it.
    • Design a system, throw out the design, do it again differently two more times to boost creativity
    • Mix it up; read a book you normally wouldn’t
    • Read a book a week
  • Book Recommendation: The Elephant and the Dragon: The Rise of India and China and What it Means to All of Us by Robyn Meredith
  • Book Recommendation: Guns, Gems and Steel: The Fates of Human Societies by Jared M. Diamond
  • Tips for client interaction
    • Say “I don’t know”
    • Be an active listener
    • Don’t have distractions
    • Ask smart questions
    • Don’t multitask in your head
    • Ask open-minded questions, not yes/no questions
    • Take notes even if to just map the conversation
    • Use metaphors or analogies to communicate
    • Don’t use bad language
    • Follow through (review action items and send a follow-up email)
    • Over communicate until they bleed
    • No agenda, no attenda
    • Be prepared
    • Preception is reality
  • Objections: Feel.  Felt.  Found.
    • “I understand how you feel.  Others have felt the same way.  Others have found…”
    • Make finding a solution to the problem something we are going to work on together.
  • Don’t be a plumber.  Write code that only you can write to add value to the business.
  • Do more of what works and less of what doesn’t
  • Focus on helping the end-user kick a$$.
  • Architecture/Career/Life is about balance.
  • The effort is the effort and is not negotiable.  Don’t merely reduce a quote, but de-scope or get more money.
  • Project manager’s job is about communication. 
  • Project fail because of failed expectations or communications not because of technology.
  • Teams should play together.
  • Always hold the door.
  • Never burn a bridge behind you.  “You can’t burn your way to excellence.”

The second speaker was Michael Wood, SDS.  Blog.  He spoke onOrganizational Dynamics.

  • Four areas: Responsbility, Authority, Power, Influence.
  • Economics in one line:  Profit = Revenue – Cost
  • “I need to add value to the business”
  • Director: “I need to get the right people on the right projects”
  • Manager: “I need to make sure everyone is happy.”  Authority but no power.
  • Architects: Influence and responsbility, but little Power and Authority.
  • Co-worker: “I want to work on cool technology with people that carry their weight.”
  • Yor agenda: “I need to choose technologies with a future.”
  • Focus on adding business value and project success not necessarily efficiency.
  • Agile: plotted backlog of items that can add business value fast.
  • Survival Tips:
    • Dress + 1, one level better than the audience.  First impressions matter.
    • Plug into companies information pipeline
    • Learn the art of small talk
    • Be prepared to have the hard conversations.
    • Learn to read the room.
    • Seek out a mentor.
    • Don’t be a lemming — think critically.
    • Evangelize
    • Learn the art of public speaking — Toastmasters
    • Build a network of like minded people
    • Build coalitions — move on individuals agendas and company agenda
    • Decisions should not be made but announcedat meetings.
    • Keep an eye on the sharks
    • Learn the right way to gripe. Not 30 minutes of griping, but 5 minutes of griping and 25 minutes of suggesting solutions.
  • Political tools
    1. Compromise (win-win)
    2. Arbitration (independent third part)
    3. Escalation
    • Arguing hurts the business value
    • Accept decisions and move on
    • There is always a different point of view
    • Always maintain your composure.  It ruins you credibility if you don’t.
    • Know your boundaries and limitations (constraints)
  • Be a leader.  Get things done.  Be a Mentor.  Add business value.
  • Architects are the bridge between business and technology.
  • Book Recommendation: Systems Thinking, Second Edition: Managing Chaos and Complexity: A Platform for Designing Business Architecture by Jamshid Gharajedaghi
  • Book Recommendation: What the CEO Wants You to Know : How Your Company Really Works by Ram Charan
  • Book Recommendation: CIO Wisdom: Best Practices from Silicon Valley by Dean Lane

Determining the SQL version and release

November 29th, 2008 Comments off

For years when I needed to determine if a service pack was installed on SQL Server 2000 or SQL Server 2005, I would check the build number and ten search the web to find what the build number was for the latest service pack. Today I was going through the same routine, but when I searched Google, I found a SQL query that would more directly reveal the version and release:

SELECT
   SERVERPROPERTY('productversion'),
   SERVERPROPERTY ('productlevel'),
   SERVERPROPERTY ('edition')

Here is the Microsoft KB article.
Here is a chart of all SQL Versions, their names and release dates.

Categories: Software Development Tags:

Bad Behavior has blocked 82 access attempts in the last 7 days.