|
I think a web service query would have been even better!
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
_________________________________________________________
My programs never have bugs, they just develop random features.
|
|
|
|
|
I supported an ASP classic application written by someone in almost the exact same way. Might it possibly be written by the same person idiot?
"A democracy is nothing more than mob rule, where fifty-one percent of the people may take away the rights of the other forty-nine." - Thomas Jefferson
"Democracy is two wolves and a lamb voting on what to have for lunch. Liberty is a well-armed lamb contesting the vote." - Benjamin Franklin
Edbert
Sydney, Australia
|
|
|
|
|
|
Where the code easy could be optimized to simply say: User.Allowed = UserAllowed;.
The question would be whether there would likely be any requirement to do something different in the true and false cases.
Incidentally, on some processors, if the source operand is of type bit, the "var1 = var2;" statement may be implemented a number of different ways (for the following examples, the destination is also of type bit; each line is a possible implementation):
var1 = 0; if (var2) var1 = 1;
var1 = 1; if (!var2) var1 = 0;
if (!var2) var1 = 0; if (var2) var1 = 1;
if (var2) var1 = 1; if (!var2) var1 = 0;
if (var2) var1 = 1; else var1 = 0;
if (!var2) var1 = 0; else var1 = 1;
If var1 is volatile, the first two ways are clearly distinct from the rest. If var1 and var2 are both volatile, the third and fourth ways are also distinct from the fifth and sixth (if var1 starts out 1, and if var2 changes from 0 to 1 between the two 'if' tests, var1 could change twice as a result of the assignment). The fifth and sixth ways are almost identical to each other, except that each will be faster in one case than the other (though one would have to examine the compiled code to know which was faster in each case).
|
|
|
|
|
I reserve my judgment and give the title idiot sparingly and in this case the person is truly an idiot (and no, he's had 10+ years of dev experience).
If you had seen the code he wrote you would agree too.
"A democracy is nothing more than mob rule, where fifty-one percent of the people may take away the rights of the other forty-nine." - Thomas Jefferson
"Democracy is two wolves and a lamb voting on what to have for lunch. Liberty is a well-armed lamb contesting the vote." - Benjamin Franklin
Edbert
Sydney, Australia
|
|
|
|
|
Just trying to get a list of websites for IIS7.
First we start here:
TempVBS2(WINSYSDIR ^ "inetsrv" ^ "appcmd.exe list site /text:site.name > " + FOLDER_TEMP ^ "site.names");
Next interesting bit in function TempVBS2:
if (LaunchAppAndWait(WINSYSDIR ^ "CScript.exe", SUPPORTDIR ^ "tmpbat2.vbs \"" + strCommand + "\" " + FOLDER_TEMP ^ "Magic.bat", LAAW_OPTION_HIDDEN + LAAW_OPTION_WAIT + LAAW_OPTION_WAIT_INCL_CHILD) < 0) then
Ok so now lets run some VBScript:
myCmd = argObj(0)
batFile = argObj(1)
myCmd = Replace(myCmd, "'", Chr(34))
Set oFSO = WScript.CreateObject("Scripting.FileSystemObject")
Set oTS = oFSO.CreateTextFile(batFile)
oTS.WriteLine myCmd
oTS.Close
cmdCmd = "cmd /C " & batFile
Set oShell = CreateObject("WScript.Shell")
Call oShell.Run(cmdCmd, 0, True)
Great!! At this point its 50/50 whether or not the command actually ran. Assuming it did we then:
if (OpenFile(nFileHandle, FOLDER_TEMP, "site.names") < 0) then
abort;
endif;
ret = ListCreate(STRINGLIST);
while (GetLine(nFileHandle, sLine) = 0)
ListAddString(ret, sLine, AFTER);
endwhile;
if (CloseFile(nFileHandle) < 0) then
abort;
endif;
And VOILA!! We have our list of websites. Simple, elegant, mind-numbing.
By the way if anyone is interested this is mostly InstallScript.
|
|
|
|
|
Just wrote this 5 minutes ago...
Got a panel that displays a bunch of thumbnails of images. You can highlight these by mousing over them.
In the MouseMove event for the panel, I had this...
queueHighlight determinines which slide is currently highlighted.
queueOffset determines the start position of what is visible.
slideHovered is calculated from MouseEventArgs.X based on the thumbnail width.
if ((slideHovered + queueOffset) != queueHighlight)
{
if (queueHighlight != (slideHovered + queueOffset))
{
queueHighlight = (ushort)(slideHovered + queueOffset);
forceRender(HymnMgrTarget.QueueList);
}
else
{
queueHighlight = (ushort)(slideHovered + queueOffset);
}
}
I added the outer block when I first wrote the method. When tweaking it just then, I managed to add the inner if block, and only when I ran it and noticed that nothing had changed, did I realise my error.
this.Edit(reason:="oops");
Ninja (the Nerd)
Confused? You will be...
|
|
|
|
|
|
At least you spotted and admitted it!
Weight loss Target
Weight at start [1/Feb/2009] 127kg
Weight now [31/Jul/2009] 107.7kg
Target weight : 80kg
Only 28 TO go hope to be there by March Wish me luck!
|
|
|
|
|
My thoughts exactly. If there were more developers with your kind of humility it would make the rest of our jobs much easier.
Thanks
|
|
|
|
|
|
Yep, I've read that before.
I've thought of putting a Ferrari logo on my car so it will go faster.
|
|
|
|
|
or the ricers who duct tape a coffee can to the muffler of their Civic.
|
|
|
|
|
"I checked it out," James explained, "but it had too many functions. In my experience, that means it'll be slow. My class only has 3 functions, so it's much more efficient."
LOL!!! QUOTED!!! I'm so going to make that argument to one of my teachers at university and see how they react
GSoC 2009 student for SMW!
---
My little forums: http://code.bn2vs.com
---
70 72 6F 67 72 61 6D 6D 69 6E 67 20 34 20 6C 69 66 65!
|
|
|
|
|
It is true, because it is on The Interweb! err... net!
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
_________________________________________________________
My programs never have bugs, they just develop random features.
|
|
|
|
|
When has seniority ever meant smarter?
|
|
|
|
|
Never?
You have the thought that modern physics just relay on assumptions, that somehow depends on a smile of a cat, which isn’t there.( Albert Einstein)
|
|
|
|
|
From the Visual SourceSafe documentation[^]:
Visual SourceSafe defines a label as a string of up to 31 characters. Any of the following is a valid label: "1.0", "2.01b", "Final Beta", and "Approved for QA". Label names cannot start with a capital "L" or "#s".
At least it's documented...
|
|
|
|
|
I've seen a number of assemblers which will not accept as labels any string five digits or fewer which end in 'H' or 'h', and whose earlier characters are all in [0-9][A-F][a-f]. A consequence of a silly choice for notating hex numbers (I much prefer leading-dollar-sign notion).
|
|
|
|
|
Sometimes I wonder!!
You have the thought that modern physics just relay on assumptions, that somehow depends on a smile of a cat, which isn’t there.( Albert Einstein)
|
|
|
|
|
Chalk it up to another reason why to never use Visual SourceShredder.
|
|
|
|
|
View the complete horror here: http://svn.openstreetmap.org/applications/utils/wiki-extensions/SlippyMap-local/SlippyMap.class.php[^]
Some snippets:
if ( isset( $argv['lat'] ) ) {
$lat = $argv['lat'];
} else {
$lat = '';
}
if ( isset( $argv['lon'] ) ) {
$lon = $argv['lon'];
} else {
$lon = '';
}
if ( isset( $argv['z'] ) ) {
$zoom = $argv['z'];
} else {
...
Should use array_key_exists and probably simply loop through, and do ${$varName} = $value or something similar.
$error = wfMsg( 'slippymap_heightbig' ) . '<br>';
} else if ( $height < 100 ) {
$error = wfMsg( 'slippymap_heightsmall' ) . '<br>';
} else if ( $lat > 90 ) {
$error = wfMsg( 'slippymap_latbig' ) . '<br>';
} else if ( $lat < -90 ) {
$error = wfMsg( 'slippymap_latsmall' ) . '<br>';
} else if ( $lon > 180 ) {
$error = wfMsg( 'slippymap_lonbig' ) . '<br>';
Extremely nice redundancy.
$output .= '<script type="text/javascript">';
$output .= "var lon= ${lon}; var lat= ${lat}; var zoom= ${zoom}; var lonLat;";
$output .= 'var map; ';
$output .= 'addOnloadHook( slippymap_init ); ';
$output .= 'function slippymap_resetPosition() {';
$output .= ' map.setCenter(lonLat, zoom);';
$output .= '}';
You are NOT dreaming. This is JavaScript getting echo'd line by line!!
GSoC 2009 student for SMW!
---
My little forums: http://code.bn2vs.com
---
70 72 6F 67 72 61 6D 6D 69 6E 67 20 34 20 6C 69 66 65!
|
|
|
|
|
But the code works so well!
This statement is false.
|
|
|
|
|
This isn't quite a coding horror: I have no example code to show you.
But, it is an example of when systems designers get it wrong.
I had to go to my local library today - a book I reserved had arrived. When I got there I was suprised to see that all booking in and out was being done by hand - normally they use a bar code scanner.
Why? The internet connection had gone down.
Not a major problem, just call up the support team...
Except all the phones are VOIP. No internet, no phones.
Not a major problem, just use a mobile...
Except the telephone directory is on-line. No internet, no idea what number to call to get it back...
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
Ask the janitor what he unplugged.
|
|
|
|