• Home
  • About
  • Recommended Reading
  • Career Advice

My Distributed Life

Musings of a Geek/Husband/Father

Programming

File Size to String in JavaScript

March 23, 2012 by Garett Leave a Comment

Recently, I needed to figure out a way to convert the size of a file, which is being returned in bytes, to a string representation.  So, given a file size in bytes like 349792 the string “342KB” would be returned.  Inspired by the following StackOverflow post, I came up with this JavaScript version. function fileSizeToString(size) … [Read more…]

Posted in: JavaScript Tagged: JavaScript, Programming

Retrieving a Windows Service’s Key Name Using It’s Process ID

May 9, 2009 by Garett Leave a Comment

I was recently asked by a friend how to retrieve the name of a running windows service from the Service Control Manager (SCM) database. He wanted to do this from .NET, using the process id of the service. I started to think of different ways that this could be accomplished and came up with a … [Read more…]

Posted in: .NET Tagged: .NET, Programming

Recent Posts

  • File Size to String in JavaScript
  • Fix – Visual Studio 2010 SP1 Breaks SSMS Intellisense
  • Weekly Reading 1–Remote Façade Pattern
  • Internet Explorer Finally Supports SVG
  • Running a 64-bit Guest Virtual Machine on a 32-bit Host

Recent Comments

  • Computer Geeks jacksonville on Running a 64-bit Guest Virtual Machine on a 32-bit Host
  • Jonathan on Switching From Windows to Mac
  • Garett on Sharpening My Developer Saw
  • Robin Smith on Sharpening My Developer Saw
  • Jonathan on Sharpening My Developer Saw

Archives

  • March 2012
  • April 2011
  • January 2011
  • March 2010
  • February 2010
  • November 2009
  • August 2009
  • June 2009
  • May 2009

Categories

  • .NET
  • Education
  • JavaScript
  • Learning
  • Mac
  • Miscellaneous
  • Personal
  • Reading
  • SVG
  • Uncategorized
  • Virtualization

Meta

  • Log in
  • Entries RSS
  • Comments RSS
  • WordPress.org

Copyright © 2023 My Distributed Life.

Omega WordPress Theme by ThemeHall.