The Official Status Thread
-
I fail at parentheses!
Filed under: I should probably do more LISP in my free time to torture myself
-
Original code:
ht["TransmitDate"] = Convert.ToDateTime(System.DateTime.Now).ToString("yyyyMMdd");
Current code:
ht.Add("TransmitDate", Convert.ToDateTime(System.DateTime.Now).ToString("yyyyMMdd"));
-
Original code:
ht["TransmitDate"] = Convert.ToDateTime(System.DateTime.Now).ToString("yyyyMMdd");
Current code:
ht.Add("TransmitDate", Convert.ToDateTime(System.DateTime.Now).ToString("yyyyMMdd"));
Yeah, I'd just simplify that to:
ht.add("TransmitDate", System.DateTime.Now.ToString("yyyMMdd"));
Because the
Convert.ToDateTime
is really unnecessary.
-
Current status: archived 4,204 files from 2011, 4,179 files from 2012, and 4,500 files from 2013 so that I didn't have to dig through 15,620 files.
-
Current status: files moved, looking at more code:
if(ht["ReportDate"].ToString() != string.Empty) ht["ReportDate"] = Convert.ToDateTime(ht["ReportDate"]).ToString("yyyyMMdd");
-
Status: Performing UI regression testing on our in-house product because the company I work for is too cheap to employ a QA team in addition to a dev team.
-
Someone loves their rectangular brackets. What happens if you try to read a key that doesn't exists?
Let me guess, it inserts it, and then you have shit you didn't want in there.
-
It comes from an SP that always returns it, so the key existing isn't a big issue. If it's not there, then you have a bigger problem on your hands.
The worst part is if it's DBNull.Value, it will blow up on .ToString(), but not only that, if it's "something", then it will blow up on Convert.ToDateTime().
I could write a slew of WTF articles on this app, it seems.
-
Current status:
/* Sorting through a whole bunch of SVN commit messages formatted like this. */
-
Wow, it's entertaining.
StreamWriter sw = null; StreamReader sr = null; try { using (new Impersonator(username, domain, password)) { // ... } } catch (Exception ex) { Logger.LogErrorToText(ex.ToString()); httpResponse.Redirect("Error.aspx?Msg=" + ex.Message); } finally { if (sw != null) sw.Close(); if (sr != null) sr.Close(); }
-
Gotta really make sure that StreamWriter gets closed.
-
Gotta really make sure that StreamWriter gets closed.
At least there are null checks, so it has that going for it... I guess...
-
At least there are null checks, so it has that going for it... I guess...
I could have sworn that the finally block was checking and closing sw twice when I first looked at that post, but it doesn't show any edits. I must be going crazy ...
-
It's bad because the custom Impersonator class inherits from IDisposable, just like StreamReader and StreamWriter, but they only use the
using
keyword for one of the three.We use the Impersonator class quite a bit in our code, so there's no doubt that part was copypasta'd into this app.
-
This is special.
//Should probably be combined with Escape static private string RemoveSpecialChars(string content) { //content = Regex.Replace(content, @"\r\n"," "); // Replaces \r\n with space [redacted] content = Regex.Replace(content, @"[^\u0020-\u007E]", " "); //Removes all special characters (leaves only 32-126 decimal) content = content.Replace(@"\", @"\E\"); //Escape characters according to [redacted]. ORDER IS SIGNIFICANT!!! This line must go first content = content.Replace(@"|", @"\F\"); content = content.Replace(@"^", @"\S\"); content = content.Replace(@"&", @"\T\"); content = content.Replace(@"~", @"\R\"); return content; }
-
Current status: wondering how quickly I'd uninstall an IDE that only allowed me to use about a third of the screen width before it wrapped by code.
-
Very special:
protected void Page_Error(object sender, EventArgs e) { if (!Response.IsRequestBeingRedirected) { Logger.LogErrorToText(e.ToString()); Response.Redirect("Error.aspx?Msg=" + Server.GetLastError().Message); } }
-
Someone loves their rectangular brackets. What happens if you try to read a key that doesn't exists?
Let me guess, it inserts it, and then you have shit you didn't want in there.
foreach (DataColumn dc in dr.Table.Columns) { ht[dc.ColumnName] = dr[dc.ColumnName]; }
Brillant.
-
rdr is a
SqlDataReader
:hasVal = rdr.GetString(rdr.GetOrdinal("val")).Trim() != string.Empty;
-
Current status: dealing with a person that uses yyyy-mm-dd in commit messages, but dmyyyy in output filenames.
EDIT: they're also using vertical pipe delimited text files to set the format of the data structure. Oh man.
EDIT 2: one commit added jQuery for a multi-select dropdown, as well as a traditional JS datepicker. Brillant.
-
Taking a break for 10 minutes before I work all night. Release: T - 8 hours.
-
-
Smells like teen frustration.
-
Just pondering an evil thought, twitch plays a MUD, or twitch plays dwarf fortress.
-
Twitch plays dwarf fortress probably wouldn't work because it moves forward in time while you're not in a menu.
Unless they did adventure mode, but either way they'd have the problem of s and S being two different hotkeys (lie down and sprint in adventure mode).
-
You have obviously never watched twitch plays pokemon.
-
Pokemon only has what, 6 buttons? maybe 8?
You can type a paragraph in Dwarf Fortress and it'll do something. Not anything related to the paragraph you typed, but it'll do something.
-
That's not to say Twitch Plays Dwarf Fortress would be bad if you were able to pull it off. In fact, it would be just like Dwarf Fortress - incredibly fun if you're able to do it right, but really really boring and confusing if you aren't.
-
Definitely has never watched twitch plays anything.
-
Smells like teen frustration.
DBA doing .NET
Current status: relaxing after going to a brewery in one of the beer Meccas of the world. oh wait, that's right, I live here.
-
Current status: trying to work with github.com. I can't believe how bad it is. It's the worst piece of software that I've ever used. I'm trying to sync with my account, and every single last piece of documentation, code, and software gives me no option to. It's absolutely not usable..
-
Sync how?
You should just have to git clone or git pull your repos.
-
I'm assuming that post you replied to was a parody of NCIS.
-
At least it's not VB/GUI/IP tracking.
-
At least it's not VB/GUI/IP tracking.
Or a virus for ancient alien technology written in (I think) C#. Or killer robot OS written in JavaScript... no, wait, I can go with that one.
Filed under: Stargate
-
It sucks when you can recognise the language. It really sucks if you've ever gone... I recognise that code.
-
Status: Happy that work isn't as busy as yesterday.
Fridays are just the best days~
-
Current status: dealing with crap like this:
Error Message: Redirect URI cannot contain newline characters.
Seriously:
httpResponse.Redirect("Error.aspx?Msg=" + ex.Message);
UrlEncode
? Why is ex.Message being passed in the raw like that?
-
Status: Bathroom manglers day 8. They have turned up, done some work and then left to go back to the shop to do something... but left the radio on, loudly.
-
-
Status: Springtime for Hitler is running through my head. I'm resisting the urge to sing it aloud at work because no one else seems to be a Mel Brooks fan.
Filed under: Godwin's Law...?
-
Status: Now dreading the rest of what should've been a lighter work day, where the office is going bowling over lunch, due to the junior dev getting chewed out by the project manager in earshot of everyone in the office.
-
Status: counting down the minutes until it's weekend
-
Status: counting down the minutes until it's weekend
Abut 38 here... That's about 4 DiscoHours.
-
-
Status: Took a not-too-old second-hand car for a test-drive and it survived. Think I will buy it.
Status: Started to clean out shed as old car can now get abused.
-
UrlEncode
? Why is ex.Message being passed in the raw like that?Because the developer is a DBA that doesn't understand .NET design.
-
Sync how?
You should just have to git clone or git pull your repos.
I have a local git repository that I want on my github account. The Windows app is far less than intuitive, it's pretty much useless. And all of the help docs tell me to use the sync button that doesn't exist.
-
Oh, yeah, that's a bit of a pain. Make an empty repo on github.
$ cd your_local_repo $ git remote add origin git@github.com:USERNAME/REPO_NAME.git $ git push origin master
-
Oh, yeah, that's a bit of a pain. Make an empty repo on github.
$ cd your_local_repo $ git remote add origin git@github.com:USERNAME/REPO_NAME.git $ git push origin master</blockquote>
I was trying to avoid command line, but now I'm resigned to it. I was just being lazy since it was for a personal site, nothing work related.