|
No; you must remember that the BaudRate property expects SI units, so the comment provides the translation to imperial units.
|
|
|
|
|
No. Its not a comment. Rather, it is commented code. This is inferred from the ; at the end.
The programmer just forgot to remove that piece of commented code. 
|
|
|
|
|
I think it means:
"If you're going to muck with this setting, this (9600) was the last good one; in case I forget or die..."
|
|
|
|
|
He/she forgot to mention that this is about setting the baudrate.
|
|
|
|
|
Try this extension method:
public static T Clone<T>(this T obj) where T : ICloneable
{
return (T)(((ICloneable)obj).Clone());
}
In VB:
<Extension()>
Public Shared Function Clone(Of T As IClonable)(ByVal obj As T) As T
Return DirectCast(DirectCast(obj, IClonable).Clone(), T)
End Function
(If the VB syntax is wrong, tell me. I don't use VB any more)
What do you get when you cross a joke with a rhetorical question?
The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism.
Do questions with multiple question marks annoy you???
|
|
|
|
|
|
No, but I found this in my code today:
public static T
Clone<T>
(
this T Connection
)
where T : System.Data.IDbConnection , new()
{
return ( new T()
{
ConnectionString = Connection.ConnectionString
} ) ;
}
I get the feeling that I never even tried to test it. I'm not sure I ever should. But it compiles!
To make matters worse, I found that because I had just written this:
public static partial class LibExt
{
private static readonly System.Collections.Generic.Dictionary<System.Type,System.Reflection.ConstructorInfo> constructors ;
static LibExt
(
)
{
constructors = new System.Collections.Generic.Dictionary<System.Type,System.Reflection.ConstructorInfo>() ;
return ;
}
public static System.Data.IDbConnection
CloneConnection
(
this System.Data.IDbConnection Connection
)
{
System.Data.IDbConnection result ;
System.Type typ = Connection.GetType() ;
if ( !constructors.ContainsKey ( typ ) )
{
constructors [ typ ] = typ.GetConstructor ( System.Type.EmptyTypes ) ;
}
result = (System.Data.IDbConnection) constructors [ typ ].Invoke ( new object [ 0 ] ) ;
result.ConnectionString = Connection.ConnectionString ;
return ( result ) ;
}
}
Which I haven't tested either. 
|
|
|
|
|
Note that this only works if T has an explicit implementation of ICloneable. Otherwise, Clone() will call the instance method and not the extension method.
And you don't need the cast to ICloneable.
return (T)obj.Clone(); will do.
|
|
|
|
|
I used to generate c# switch case blocks that were about 2 or 3 pages long.
Fun times. =)
No, I won't post a sample - it's even uglier than it sounds.
It also sometimes included "goto case" statements
|
|
|
|
|
danah gaz wrote: No, I won't post a sample
Ok, I won't read your sample.
Life is a computer program and everyone is the programmer of his own life.
|
|
|
|
|
Solved
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
 Well it was either leave it or rewrite and debug a complex lexer by hand. The thing *worked perfectly* every single time, and was fast. It was just really, really ugly to look at.
=)
Also, I love that you're A Bastard Programmer from Hell.
I used to read the Bastard Operator from Hell series when I was a kid. Loved it.
"The power cord?" I ask
"Yes... Woopsy"
"No worries at all" I say "Is it all working well now?"
"Yes, I think so. I'm sorry, you WERE right all along"
"Yes, we're getting a lot of this, it's due to the current Global Warming
problem. It causes random thermal expansion and contraction resulting in
temperature induced movement of friction based holding mechanisms.."
I listen carefully. Nothing. In other words, <DUMMY MODE ON>...
"You can fix it permanently tho'" I say
"Really? How?"
"Well it's all to do with lowering salt deposits on the metal contacts"
"Oh!" (Dummy mode irrevocably engaged)
"All you need to do is just take the power plug out deposit some dilute mineral
salts on it. Do you have some dilute mineral salts on you?"
"Uh, no?"
"Ok, no worries, just stick it in your mouth drool into it. But make sure you
wipe the plug first to get rid of any germs, and TURN THE SWITCH OFF ON THE
MONITOR before you do - we don't want a nasty accident!
"Oh. Ok!"
>Fzzzt< >clunk!<
I hang up as the receiver hits the floor. Disk space is too good for them.
|
|
|
|
|
Yup, great stories, and nice short too
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
danah gaz wrote: It also sometimes included "goto case" statements
As well it should.
|
|
|
|
|
Yeah, I mean rolling a large DFA into a switch case is going to involve some gotos or a *lot* of duplicated code, but still, the end result looked like the stuff of nightmares. The code screamed "DON'T YOU DARE TOUCH ME!*
|
|
|
|
|
danah gaz wrote:
It also sometimes included "goto case" statements
I dont get why devs hate goto so much, I dont use it but its not that bad.
TVMU^P[[IGIOQHG^JSH A#@ RFJ\c^JPL>;"[, /|+&WLEZGc
AFXc!L<br />
%^]*IRXD#@GKCQ R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_ADEPABIKRDFVS)EVLQK)JKQUFK[M UKs$GwU#QDXBER@CBN%
R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
-----------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
It's not wrong as such, but using it breaks control flow (such as gotoing out of a loop, or worse, into another loop) and can contribute to maintenance issues and general spaghetti code.
Obviously maintenance isn't really an issue for autogenerated code - as long as you have the tool that generates it whenever you are modifying the source file that creates it, but it is just offensive to one's sensibilities to look at modern code full of goto statements.
|
|
|
|
|
So I made the switch back in August and loved Win10. Ignited some Win fanboyism that I thought I could never again regain. It works and it works well.
... until
In the past two months I keep getting BSOD. Which, really, I can't remember seeing a BSOD is YEARSSS. Yet I have a modern O.S., which is getting a big push from Windows, supposed to be the best thing since sliced bread, and my name brand laptop is < 2 years old. Am I missing something?????
Apparently this is common, a happening to a lot of people with newish Asus and Dell laptops. Here is the windows forum thread about it.
LINK
I guess everyone was right, Don't upgrade yet. Even though the interface is nice and much more user friendly, Windows will do its best to sabotage you.
I'm running Fedora 23 on my other laptop and it's turned it from a Celeron beater to an actually decent machine. That some how worked out of the box perfectly. Windows, for shame.
|
|
|
|
|
It's definitely a crapshoot.
I installed it on my old wolfdale and the only major problem has been my media drives failing. It's not windows' fault. They're the infamous seagate 1TB faildrives - which is why I only used them to store things I could easily replace.
PS: Never buy seagate anything if you are fond of your data. If you want your western digital black to function like a seagate, drop it in a pond, fish it out, run over it a few times, solder random points of the pcb board on the bottom together, and then blowdry the result with a heatgun before putting it in your computer with the sata cable jammed on upside down.
|
|
|
|
|
StampedePress wrote: Ignited some Win fanboyism that I thought I could never again regain It's a trap!
|
|
|
|
|
Seriously, Trust No One! Biggest trap ever, and those who opted out long enough to see the first "Service Pack" crash and burn are laughing at their desks.
The straw that broke the camel's back: My calculator no longer works. ::drops mic::
And I actually liked the way that the calculator looked and functioned, not doing much good if I can't see it or use it...
So that's the new analogy Windows 10 is equivalent to danah gaz's Seagate Drives. Literally this O.S. is performing like it's been run over, drowned and all the other colorful things you mentioned.
And for full clarity I've been working to make sure everything was cushy and ready for Win 10. I've updated my bios, updated all my drivers, everything I could do and that Asus provided to ensure a smooth transition into Win10.. How about this one, my touchpad stops working about 3 minutes after I boot?! And that I was willing to live with because I use a USB mouse anyway. But this picture is getting worse and worse as time goes on. I don't get it...
I never pictured the day Windows would crash and burn. Cause if I'm having trouble, there's no way less tech-ey people will deal with this nonsense at all.
|
|
|
|
|
I have an Asus ROG computer and WinX works perfectly fine on it. Updates and everything. The only issue I have had was an Nvidia developer testing in production (They got some major flak from that).
Nothing else has really gone wrong.
What do you get when you cross a joke with a rhetorical question?
The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism.
Do questions with multiple question marks annoy you???
|
|
|
|
|
I'm going for one last try, it looks like bad RAM may also exhibit some of the problems I've had. Started to get weird ghosting in the boot screens and a growing number of BSOD's. So that may resolve my issues. Then I'll just have to sort out the touchpad driver conflicts (or whatever is going on). Maybe do a fresh install of Win 10 rather than using the upgrade from Win 8.1. And most importantly get that Calc back in action.
Hopefully eventually this will work.
|
|
|
|
|
I have 24 GB RAM in my machine. Bad RAM would cause issues, as would a failing hard drive. Hope you get it working soon.
What do you get when you cross a joke with a rhetorical question?
The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism.
Do questions with multiple question marks annoy you???
|
|
|
|
|
StampedePress wrote: I'm running Fedora 23 on my other laptop ..but you had to try Windows
A low-level format of the disc will remove Windows, after that you can install OS
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|