
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
}
}
This unit was dispatched to a 32yo male w/ self-inflicted unintentional GSW x1 to the hand. Additional information from caller while en route informed pt conscious and alert. Dispatch notified LEO, en route. Arrived on scene to find two bystanders in an open field. Pt found sitting in passenger seat of van with ~5cm hole in the front windshield. No gun visible. LEO arrived ~2 min after EMS, secured .40cal handgun. Pt states he reached for the handgun on the floorboard of the van and it went off accidentally. Pt had a patent airway, no respiratory distress, and displayed his L hand which had no apparent active bleeding. Rapid trauma exam revealed no life threatening injuries. <5cc blood estimated lost. L hand had ~1cm entrance wound on anterior palmar aspect ~3cm from medial border and ~2cm from wrist. ~1cm exit wound on medial border ~3cm from entrance and ~4cm from wrist. Powder burns noted at entrance wound. Skin warm/dry, pupils sluggish, pulse fast/bounding. Pt refused further physical examination. Wound irrigated with sterile water, bandaged, wrapped with gauze. Pt refused further treatment. Pt refused transport. Pt advised of treatment/transport options and injury severity. Pt signed refusal. LEO witnessed refusal.