Click here to Skip to main content
16,005,316 members

The Weird and The Wonderful

   

The Weird and The Wonderful forum is a place to post Coding Horrors, Worst Practices, and the occasional flash of brilliance.

We all come across code that simply boggles the mind. Lazy kludges, embarrassing mistakes, horrid workarounds and developers just not quite getting it. And then somedays we come across - or write - the truly sublime.

Post your Best, your worst, and your most interesting. But please - no programming questions . This forum is purely for amusement and discussions on code snippets. All actual programming questions will be removed.

 
GeneralRe: Need to vent... Pin
Chris Meech30-Dec-08 9:45
Chris Meech30-Dec-08 9:45 
GeneralRe: Need to vent... Pin
Deflinek30-Dec-08 20:45
Deflinek30-Dec-08 20:45 
GeneralRe: Need to vent... PinPopular
kenrentz31-Dec-08 6:06
kenrentz31-Dec-08 6:06 
GeneralRe: Need to vent... Pin
supercat94-Jan-09 8:39
supercat94-Jan-09 8:39 
GeneralRe: Need to vent... Pin
ToddHileHoffer5-Jan-09 7:04
ToddHileHoffer5-Jan-09 7:04 
GeneralRe: Need to vent... Pin
Douglas Dean7-Jan-09 4:52
Douglas Dean7-Jan-09 4:52 
GeneralRe: Need to vent... Pin
Megidolaon23-Feb-09 23:20
Megidolaon23-Feb-09 23:20 
GeneralRe: Need to vent... Pin
Timothy Byrd24-Feb-09 8:18
Timothy Byrd24-Feb-09 8:18 
Megidolaon wrote:
What is the point of
if (node.Attributes["Publish"].InnerText.Trim().Contains(s))
{
    return;
}

A check for containting a single letter and then doing nothing?


No, that loop checks if the node text contains one of the non-translatable strings and if so, bails.


Megidolaon wrote:
Maybe the XML contains trailing spaces?
Unless you trim them, the XML Nodes' InnerText wouldn't equal the DictionaryEntries with same


You are correct, however within a given call to TranslateNode(), the xml node stays the same. Until it gets translated from the dictionary. Oh crap, there's yet another bug in there that I hadn't noticed - it can double translate.

Anyway, the phrase node.Attributes["Publish"].InnerText.Trim() should be invariant, and I assume it takes some processing. So a line like:

string xmlText = node.Attributes["Publish"].InnerText.Trim();

and then refering to that string wold have been more efficient,and easier for me to read, I think.

-- T
Rantgreat way to clear asp.net form fields Pin
freddy rios29-Dec-08 15:05
freddy rios29-Dec-08 15:05 
GeneralGood if paid by number of lines! Pin
Asad Abbasi29-Dec-08 5:11
Asad Abbasi29-Dec-08 5:11 
GeneralRe: Good if paid by number of lines! [modified] Pin
PIEBALDconsult29-Dec-08 5:41
mvePIEBALDconsult29-Dec-08 5:41 
GeneralRe: Good if paid by number of lines! Pin
hammerstein0529-Dec-08 6:28
hammerstein0529-Dec-08 6:28 
GeneralRe: Good if paid by number of lines! Pin
singh.iz.king29-Dec-08 13:34
singh.iz.king29-Dec-08 13:34 
GeneralRe: Good if paid by number of lines! Pin
Megidolaon22-Feb-09 23:21
Megidolaon22-Feb-09 23:21 
GeneralRe: Good if paid by number of lines! Pin
Luc Pattyn29-Dec-08 16:13
sitebuilderLuc Pattyn29-Dec-08 16:13 
GeneralRe: Good if paid by number of lines! Pin
LarryDM1-Jan-09 22:31
LarryDM1-Jan-09 22:31 
GeneralDevil's advocate Pin
supercat94-Jan-09 8:29
supercat94-Jan-09 8:29 
GeneralRe: Good if paid by number of lines! Pin
Rauhotz14-Jan-09 12:55
Rauhotz14-Jan-09 12:55 
GeneralRe: Good if paid by number of lines! Pin
itsravie3-Mar-09 3:18
itsravie3-Mar-09 3:18 
GeneralRe: Good if paid by number of lines! Pin
Divyang Mithaiwala3-Apr-09 23:24
Divyang Mithaiwala3-Apr-09 23:24 
GeneralMaking shortcuts even shorter Pin
gnjunge26-Dec-08 4:45
gnjunge26-Dec-08 4:45 
GeneralRe: Making shortcuts even shorter Pin
Sauce!27-Dec-08 18:04
Sauce!27-Dec-08 18:04 
GeneralRe: Making shortcuts even shorter Pin
gnjunge27-Dec-08 20:56
gnjunge27-Dec-08 20:56 
GeneralRe: Making shortcuts even shorter Pin
Tony Pottier27-Dec-08 23:52
Tony Pottier27-Dec-08 23:52 
GeneralRe: Making shortcuts even shorter Pin
Malli_S28-Dec-08 20:50
Malli_S28-Dec-08 20:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.