
I'm finally done with every certification I need. Seriously the alphabet soup I've taken seemed to never end! Thanks again to everyone who has helped, I wouldn't be here without all of the support.
Programming in languages older than you are is fun...and now I need to start your IV.

double PIE = 3.141592654;No, that code did not pass the review.

public static string RemoveSpecialCharacters(string str)
{
StringBuilder sb = new StringBuilder();
for (int i = 0; i < str.Length; ++i)
{
if ((str[i] >= '0' && str[i] <= '9')
|| (str[i] >= 'A' && str[i] <= 'Z')
|| (str[i] >= 'a' && str[i] <= 'z')
|| (str[i] == '.' || str[i] == '_'))
sb.Append(str[i]);
}
return sb.ToString();
}
static Regex replacer = new Regex(@"[^a-zA-Z0-9_.]+", RegexOptions.Compiled);
public static string RemoveSpecialCharacters(string str)
{
return replacer.Replace(str, String.Empty);
}
static bool[] allowedChars = new List<bool>(
from ii in Enumerable.Range(0, 128)
let c = (char)ii
select (c >= '0' && c <= '9')
|| (c >= 'A' && c <= 'Z')
|| (c >= 'a' && c <= 'z')
|| (c == '.')
|| (c == '_')
).ToArray();
public static string RemoveSpecialCharacters(string str)
{
StringBuilder sb = new StringBuilder(str.Length);
for (int ii = 0; ii < str.Length; ++ii)
{
if (str[ii] < allowedChars.Length && allowedChars[str[ii]])
sb.Append(str[ii]);
}
return sb.ToString();
}
public static string RemoveSpecialCharacters(string str)
{
int idx = 0;
char[] chars = new char[str.Length];
foreach (char c in str)
{
if ((c >= '0' && c <= '9')
|| (c >= 'A' && c <= 'Z')
|| (c >= 'a' && c <= 'z')
|| (c == '.') || (c == '_'))
{
chars[idx++] = c;
}
}
return new string(chars, 0, idx);
}
This unit was dispatched to a 76yo M C/C SOB x2 days. Pt found seated in chair, w/ patent airway, no obvious respiratory distress, and no apparent life threatening airway. Pt states concern for pneumonia. Pt denies CP. Rhonchi bilateral lower lobes. HR 62, BP 128/70, RR 18, SaO2 97% r/a. Placed on O2 @ 2lpm via NC. SOB gradual w/o pain, worse with exertion, better with rest, "can't catch breath." Pt has no PMD, denies any prior PMD visits, no meds, NKDA. Pt seated fowlers on stretcher, seatbelts secured, taken via stretcher to ambulance. 3-lead monitor shows sinus brady, frequent PVCs, ST elev II/III. 12L ECG shows 2mm ST elev II/III/aVF w/ reciprocal changes I/aVL, ST depression V2-V5. Pt vital signs unchanged, denies CP. Feels "better" w/ O2. 4x 81mg ASA PO. Code STEMI alert given to receiving hospital, no questions. Care transferred to Cath Lab, written and verbal report given to receiving nurse.We got to watch the cath lab at work:
public MyType()
{
Check.Invariant(argumentInvariant1);
// ...
Check.Invariant(argumentInvariantN);
// 1. ACQUIRE
this.AcquireUnmanagedResource();
// 2. Set up our base properties from the resource
this.RetrieveConfiguration();
}
~MyType()
{
this.Dispose(false);
}
public void Dispose()
{
this.Dispose(true);
GC.SupressFinalize(this);
}
private void Dispose(bool disposing)
{
if (!this.isDisposed)
{
// RELEASE
this.ReleaseUnmanagedResource();
if (disposing)
{
this.DisposeManagedResources();
}
}
}
Now, if #2 should fail we will release the unmanaged resource and not leak anything. Keep in mind this will require a Dispose method which is resistant to an inconsistant object state. However, the design contract for IDisposable basically requires this anyways.public MyType()
{
Check.Invariant(argumentInvariant1);
// ...
Check.Invariant(argumentInvariantN);
try
{
// 1. ACQUIRE
this.AcquireUnmanagedResource();
// 2. Set up our base properties from the resource
this.RetrieveConfiguration();
}
catch(Exception)
{
// RELEASE
this.Dispose(true);
throw; // propagate the exception
}
}