|
It's there. Just checked in Word2000 and Word2007. You just have to show the Edit toolbar and it's right there.
Tosch
|
|
|
|
|
Yes, it does have it. When I have to swallow my pride and do any VBA in Access, the search and replace is there and it is useful.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
I'm working on a decompiled version of a pre-compiled ASP.NET 2 web site. While the obscure names are to be expected, I'm not sdo sure that the original code didn't include horrors such as:
if (sQueryType == "NAME")
{
goto Label_00AA;
}
[snip]
Label_00AA:
sQ = sQ + "[Name] LIKE '%" + sQuery + "%'";
goto Label_00EF;
[snip]
Label_00EF:
sE = "";
DataView dvSel = new DataView();
DataView dvNot = new DataView();
[the processing starts here]
<pre> <div style="display:none;" class="CPhogPost"></div>
<div class="ForumSig"> <a href="http://wtfmemes.blogspot.com/">Daily WTF Memes</a> </div>
|
|
|
|
|
That SQL's a tad inefficient! I hope it's not a large table that's being queried...
|
|
|
|
|
Not only that. Think of the SQL injection you could do...
|
|
|
|
|
I don't get it. Where's the horror?
|
|
|
|
|
Goto's used for conditional blocks, mixed in with normal if...then...else blocks.
A SINGLE-PHOTON TURNSTILE, a device in which photons are emitted one at a time under controlled circumstances, has been created by a team of scientists from Stanford (US), Hamamatsu Photonics (Japan), and NTT (Japan). Essentially the researchers use the quantization of electrical conductance to produce a quantization of photon emission. They put together a quantum well (the frontier between two thin semiconductor layers) containing a single electron (other electrons are dissuaded from entering because of a "Coulomb blockade" effect) with a quantum well containing a lone (comparably Coulomb blockaded) hole, and then cycle the voltage across the whole stack of layers in such a way that the lone electron and lone hole meet, mate, and make a lone photon. The resulting device, which operates at mK temperatures, is typically a tiny post some 700 nm tall and with a diameter of 200-1000 nm. (J. Kim et al., Nature, 11 February 1999.)
|
|
|
|
|
But it's decompiled code. You can't expect the same structure that a human coder would produce. Humans code for readability and maintainability. Optimising compilers code for performance. Try looking at the assembler output from a C++ compiler sometime. You can't move for JMP, JNE and JNZ instructions...
|
|
|
|
|
It's still a horror.
A SINGLE-PHOTON TURNSTILE, a device in which photons are emitted one at a time under controlled circumstances, has been created by a team of scientists from Stanford (US), Hamamatsu Photonics (Japan), and NTT (Japan). Essentially the researchers use the quantization of electrical conductance to produce a quantization of photon emission. They put together a quantum well (the frontier between two thin semiconductor layers) containing a single electron (other electrons are dissuaded from entering because of a "Coulomb blockade" effect) with a quantum well containing a lone (comparably Coulomb blockaded) hole, and then cycle the voltage across the whole stack of layers in such a way that the lone electron and lone hole meet, mate, and make a lone photon. The resulting device, which operates at mK temperatures, is typically a tiny post some 700 nm tall and with a diameter of 200-1000 nm. (J. Kim et al., Nature, 11 February 1999.)
|
|
|
|
|
Brady Kelly wrote: It's still a horror.
Still don't see why. The compiler's just doing its job - optimising the code for speed or size as appropriate. It's not supposed to be read by humans, so it doesn't matter in the slightest that it doesn't conform to a human's idea of well-structured code.
|
|
|
|
|
Yuck.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
Sorry Brady, you FAIL. Set Reflector options not to optimize C#. Full of branches/goto's ! In fact you would barely be able to read the non-optimized C# from compilation.
|
|
|
|
|
leppie wrote: Sorry Brady, you FAIL. Set Reflector options not to optimize C#. Full of branches/goto's ! In fact you would barely be able to read the non-optimized C# from compilation.
So I must apply a setting that makes the output barely readable?
|
|
|
|
|
Looks like that might be a good place to test for a SQL injection attack.
|
|
|
|
|
There is way too much code like that, with direct SQL concats. I am only briefed to add two reports to the system, not secure it. Hell, if I were to decode all the decompiled code and use parametrised queries, I could probably buy a new car with the earnings.
|
|
|
|
|
I spotted this gem written by one of our developers that needed to copy an XML node from one XML document (source) into another (target). The variable naming's been changed to make it clearer.
Given 2 XML nodes:
XmlNode sourceNode = source.SelectSingleNode("BOOKS/BOOK[@id='1234']");
XmlNode targetNode = target.SelectSingleNode("COMPANY/BOOKS");
This is the code the developer wrote.
XmlElement bookElement = target.CreateElement("BOOK");
targetNode = targetNode.AppendChild(bookElement);
<big>targetNode.InnerXml = sourceNode.InnerXml;</big>
How performant do you think it would be compared to this?
XmlNode importedNode = target.ImportNode(sourceNode, true);
<big>targetNode.AppendChild(importedNode);</big>
I haven't bothered to do the tests but I guess stringifying some XML and then parsing it back again would be a tad inefficient!
|
|
|
|
|
Yes, I assume so. As once the node is created it's stored in memory ready to be attached to another node, whereas if the XML is "stringified" then I assume the text is parsed, the node generated and copied to memory and then attached.
The other obvious advantage is less code
Regards,
--Perspx
"The Blue Screen of Death, also known as The Blue Screen of Doom, the "Blue Screen of Fun", "Phatul Exception: The WRECKening" and "Windows Vista", is a multi award-winning game first developed in 1995 by Microsoft" - Uncyclopedia
Introduction to Object-Oriented JavaScript
|
|
|
|
|
At least he was trying to use Xml. I'm sick and tired of seeing questions where people are looking for nodes in an Xml document and just treating the whole thing as one big string.
|
|
|
|
|
At least we CAN blame VB for this one!
|
|
|
|
|
Yes, I remember in VB6 days when you had an MSXML2 and MSXML4 documents, stringifying the XML was the only way to copy data across from one to another. The MSXML parser didn't like you mixing different versions.
|
|
|
|
|
DrWheetos wrote: Yes, I remember in VB6 days when you had an MSXML2 and MSXML4 documents
Never, ever admit to remembering VB6 days. Claim you had amnesia or something instead. You'll only get tarred with a brush you don't want.
|
|
|
|
|
Yes, it would be a bit on the inefficient side.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
Yes! buddy
|
|
|
|
|
If your product manager asked you to make a printer-friendly version of a webpage, how would you choose to implement it?
(A) Add a "print" parameter to your query string. In your CGI code, add IF statements where appropriate.
(B) Add a @media print section to the stylesheet.
(C) Write a 200-line Javascript function to walk through the DOM tree to remove unwanted navigational elements.
No points for guessing which choice was made by the previous maintainer of one of the web apps I'm working on now.
modified on Wednesday, August 27, 2008 8:07 PM
|
|
|
|
|
(D) Say, if you want it to print nice, don't use a webpage. Or maybe that's just me.
|
|
|
|