- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
If you can't put in easter eggs or other fun stuff, test data is one of the places where you can have lots of fun. It also eliminates issue like the OP.
I regularly test with Mr. Zeuax, first name Beaux.
Admin
In C++ templates, the compiler generates the code at compile time, so you still get compiler type checking and code optimization. C# generics do none of this. Note my example:
long i = Cast<long>("I Like Canaries!");
This not only compiles, but signal my intent to cast "I Like Canaries!" to a long. I'm not sure where this could ever be useful.
Admin
Ahhh, Agile Development in action.
Admin
On Linux, no less.
Admin
And the cycle of WTF is complete.
Admin
When we last met, I was but the learner. Now, I am the master.
Admin
TRWTF is that they didn't use BobX.
Admin
What does Linux have to do with this? From what I can tell, this looks like C-Pound, which certainly and thankfully does not run on Linux (except using Wine).
Admin
Or mono if Im not mistaken.
Admin
It's a canary because you know, based on this idiocy, that the code base is indeed deadly.
Admin
Ah. Now I see.
Admin
TRWTF is that they didn't implement this function in VB
Public Function IsInRole(ByVal Role As String) As Boolean Try Return StrComp(Left(Username, 3), Role, vbBinaryCompare) == 0; Catch ex As ArgumentNullException Throw Catch ex As ArgumentException Throw Catch ex As NotSupportedException Throw Catch ex As Reflection.TargetInvocationException Throw Catch ex As MethodAccessException Throw Catch ex As MemberAccessException Throw Catch ex As Runtime.InteropServices.InvalidComObjectException Throw Catch ex As Runtime.InteropServices.COMException Throw Catch ex As TypeLoadException Throw End Try End Function
Admin
Admin
Don't forget the error if the string has less than 3 characters!
Admin
If the cat's been in there for 108 years, I don't think even quantum mechanics can save it. There, I've just disproved Heisenberg.
Admin
Admin
Are you sure you are in the right place? This thread is where recent Comp-Sci graduates insult VB-users and management. No DBA skills are required....
Admin
TRWTF is that people are still arguing about fixed roles, when it's been known since at least 1623 that they change with time; as the Bard said, "one man in his time plays many parts."
CAPTCHA: conventio, as in Conventio exits stage left.
Admin
When I started my job, I had to legally change my name to "Employee167" (Obviously, I am the 169th person to work here after my boss, his name is "The Boss" and "Admin Guy" who is our admin guy)
It means that we don't have to worry about learning new names when people come and go. You can also reuse logins when replacing an employee.
"Hi everyone, this 'Employee128' she will be working in data entry to replace 'Employee128' who is away on maternity leave."
It solves so many issues !!!
Captcha "dolor" - seriously, now you are just making these up!
Admin
I know "long pig" is a euphemism for human flesh, used in reference to those cultures that practice (or used to practice) cannibalism. No idea what a "long canary" actually is.
Flamingo, maybe.
Admin
Wasn't Conventio the manager of the nunnery in As You Like It?
Admin
Usually when the code is bad also the tests are bad. Who on earth tests systems with unified data?
Admin
Hmm, look at the code:
You see that? Java capitalisation in a C# application! What you can see is that 'Username' comes from a C# developer, and the 'IsInRole' method was later added by a Java developer.
This clearly proves that, as soon as you step over to the Dark Side, your code immediately suffers.
Or it could be, of course, that the developer is an utter twit.
Admin
There are a lot of new idea,it gives me inspiration.I think I will also inspired by you and think about more new ideas
Admin
这是一个很好的,常识article.Very帮助一谁是发现此part.It的resouces一定会帮助教育我。
Admin
好文章,每一个点是与我们分享您的智慧好enough.Thanks 。
Admin
我完全同意你的博客帖子oppinion.this是非常令人鼓舞的人谁想要了解这些议题。
Admin
That was until Emperor Palpatine aka "Emp-Pal" came and demanded full access on that battle station !
CAPTCHA: ratis, lat. a bone deformation illnes forcing you to scurry around like a rat.
Admin
FTFY. See http://www.oracle.com/technetwork/java/codeconventions-135099.html#367 for why.
Admin
You might, but I can't seem to do anything.
Admin
What? convenient? What if the users user-name didn't start with "Emp"? They wouldn't get the right privileges... how convenient.
Admin
Really, is there any other kind?
Admin
If you extend this with versioning it really sounds a lot like ENVY.
Admin
Seems someone took the agile philosophy of 'Do the simplest thing that can possibly work' past breaking point.
Admin
What about creating a role named “Emperor” that can do anything. Do you see the flaw now?
Admin
Duh, the frist comment covered that.
Admin
I just found out after 20 years that DBA stands for Database Administrator. I always assumed it stood for "Don't Bother Asking" because that is the response I most frequently hear from them.
Admin
What if you had a user name that started with Adm, a common abbreviation for Administrator? Do you see the joke now?
Admin
But pray tell, shouldn't 'Username' and 'roleName' have the same capitalisation? Hmm?
And the code example is in C#, so WTF are you coming up with a Java page?
Admin
Admin
C#, Java. Tom-ate-o tom-art-o.
Admin
There are excellent SQL discussions on here all the time.
DELETE FROM dbo.Comments WHERE UserName='Constant Coder';
Admin
I haven't written code in over 15 years, but...
Seems like the function returns true only if the USER has the same start as the ROLE. So it would work fine for the test cases where the role is EMPLOYEE and the test user name is also EMPLOYEE, but for real users it would likely always fail.
What was needed here is to look up the user in the roles table and see if that role which is assigned matches the role that's being requested.
Admin
If you're Luca Cardelli (developer of ML), I'd say you have a Very Odd sense of humor!
Admin
Reminds me of some ill formed grep statement on our multi million dollar machines that checked if the username was 'root', of course, mr 'grootmans' also got root access...
Admin
And as these things go, Dhr. Grootmans was probably a janitor or, worse even, a manager.
Admin
Admin
Also because your original post made no sense: "the 'IsInRole' method" would never have been "added by a Java developer." -- and the link could help you understand why.
Admin
Admin
That's odd. Your post changed when I observed it.