Posts made by CarnivorousHippie
-
RE: ASPeers, can we agree to stop this shit?
@jasmine2501 said:
<asp:HyperLink Text="Legal" runat="server" CssClass="lbl" NavigateUrl="~/CMS.aspx?id=11"></asp:HyperLink>
<asp:Label Text="|" runat="server" ></asp:Label>
<asp:HyperLink ID="HyperLink1" Text="Privacy" runat="server" CssClass="lbl" NavigateUrl="~/CMS.aspx?id=6"></asp:HyperLink>
<asp:Label ID="Label1" Text="|" runat="server"></asp:Label>
<asp:Label Text="© 2012 My Damn Company, LLC. All rights reserved." runat="server" Style="padding-right: 28px; color: #7B7B7B;"></asp:Label>Learn some fucking HTML, bitch.
What is wrong with this?
<a href="~/CMS.aspx?id=11" class="lbl">Legal</a> | <a href="~/CMS.aspx?id=6" class="lbl">Privacy</a> | © 2013 My Damn Company, LLC. All rights reserved.
Seriously, who is teaching that first style? I see it way too much.
Agreed, a lot of asp.net to not add value to html. Of course, if you were gonna add some i18n, then it would be not-so-useless.
-
RE: To turn or not to turn, that is the question.
@Zemm said:
Driving on the left is more natural and safer. Keep you right hand on the steering wheel, most people are right eyed, etc.
When I drive, my right hand is on the wheel. My left arm is perched on the window, so my left hand is usually idle, or playing in the wind, or maybe holding a beverage.
-
RE: Senior developer
@Medinoc said:
Wait... If the text is fixed witdth, then it's not supposed to have only 211 spaces before the file name.
Unless you mean he was looking for 212 actual spaces anywhere (InStr, strstr(), String.IndexOf(), etc.) rather than offset 212 in the line?
ding ding ding ding
-
Senior developer
Helping* another senior** developer with a task that he's been working on way too long. The task is to read one text file that contains a list of other filenames, and then verify the existence of those files. His solution was to iterate over each line of the file, identify the target filename, and then iterate over the directory to find the matching filename. *facepalm*
But no, the fun doesn't stop there. His method of extracting the filename was to (VB) Split the line and access the Xth array element. Nothing abnormal about that, but X was 212, and this file could not be that big. Then I saw that the file is fixed-width and that he was Splitting on a space, and he had empirically determined that the filename he was looking for was at that position.
Before the evil instinct took hold to ignore it and let his code fail miserably, I mentioned that it would fail if the next line had, say, only 211 spaces before the filename. I wish I hadn't.
_____
* "Helping" as in nudging him in the right direction, then waiting to see if he can make progress, and then re-nudging when he fails.
** I believe "senior" is in his title; it reflects how long he's been with the company and nothing more.
-
RE: Lets build a vehicle "model" in Excel!
@morbiuswilters said:
corn now being a Federally-protected endangered species.
@morbiuswilters said:
The contractor's painful rickets from a corn-only diet
If corn were an endangered species, then the Sierra Club would have taken down Big Corn, and the contractor would not have been able to afford black-market corn and would have instead eaten baby seal.
-
RE: Fun with single quotes
@Jaime said:
@CarnivorousHippie said:
What alternative to "inline SQL" are you thinking of? Calling "exec sp_foo 'bar', 'baz'" still counts as inline as I choose to understand the term.
Anybody who thinks "inline SQL" and "stored procedure" are mutually exclusive understands the term differently than you do. Since The_Assimilator offered stored procedures as an alternative to inline SQL, he is in that group.Also, your definition of inline SQL isn't very useful, as calling "exec sp_foo @bar, @baz" is still inline SQL by your definition, but injection safe. Heck, your definition allows "sp_executesql 'exec sp_foo @bar, @baz', '@bar varchar(20) @baz varchar(20)', @bar='bar', @baz='baz'" to be called inline SQL, making the term meaningless.
I didn't see Assimilator offer stored procedures as an alternative, or even mention them.
My definition of "inline SQL" (for the purposes of this discussion) is orthogonal to being injection-safe. (Again, different concern.) Generally speaking, if I'm building a SQL string in application code instead of using an Command object or hitting a datalayer, then...
You know, you're right. The adjective 'inline' is redundant. If you're using SQL statements in code, of course it's inline.
-
RE: Fun with single quotes
@Jaime said:
@CarnivorousHippie said:
@Jaime said:
Apparently, it does ...How many times do this have to be said... Parameterizing protects against SQL Injection, stored procedures do not. Properly parameterized inline SQL in injection-proof, stored procedures called without parameterization are vulnerable to SQL Injection.
It didn't need to be said at all. Using parameters to thwart SQL injection and using stored procedures to separate data/interface are different concerns.
@The_Assimilator said:
I'm very disappointed you haven't purposely injected SQL to drop one of the main tables or even the DB. You only need to do it once, because after the system has been down for 3 days and they've been crapped on constantly during that time, they'll never write inline SQL again.
... The_Assimilator is merging those concerns together. It's not an uncommon problem, about 75% of the people I talk to get it wrong.
What alternative to "inline SQL" are you thinking of? Calling "exec sp_foo 'bar', 'baz'" still counts as inline as I choose to understand the term.
-
RE: Fun with single quotes
@Jaime said:
]How many times do this have to be said... Parameterizing protects against SQL Injection, stored procedures do not. Properly parameterized inline SQL in injection-proof, stored procedures called without parameterization are vulnerable to SQL Injection.
It didn't need to be said at all. Using parameters to thwart SQL injection and using stored procedures to separate data/interface are different concerns.
-
RE: Fun with single quotes
@Jaime said:
You still have to parameterize stored procedure calls or you'll have exactly the same problem. Stored procedures do nothing to mitigate SQL injection.
My first thought was, "Duh! Who's gonna go through the trouble of implementing procs and not do that?"
My next thought was, "Duh, my boss."
-
RE: Fun with single quotes
@boomzilla said:
I think they got confused when they heard about "Worse is better."
Or about "object-oriented". Or about "data abstraction". Or about... well, the list goes on.
-
RE: Fun with single quotes
@KattMan said:
Bad move really, just use parameterized queries and don't worry about it.
Just getting them to use stored procedures instead of building SQL in ASP pages is a battle I''ve long since given up on.
-
Fun with single quotes
The internally-developed case management system here has had an issue for the longest time with single quotes; namely, if you enter a note like:
I've rendered the foo and John'll approve.
What gets displayed in the system is:
I''ve rendered the foo and John''ll approve.
Obvious issue with inserting data in SQL, but no one has bothered to try to fix it for years. Until now. Now, of course, you get:
I''''ve rendered the foo and John''''ll approve.
-
RE: We don't do code reviews..
@Speakerphone Dude said:
It does make sense to have a SQL expert review SQL code, even if he is not an expert in source control. And the guy is also right to review the whole stored procedure, and not just your changes, because it is a unit of code, it won't get partially executed in production. *You* may feel that your changes are not impacting something else, but there is a reason why *he* is the DBA.
I'm of the opinion that the DBA shouldn't be responsible for reviewing SQL code by default; your senior developers ought to have enough SQL expertise to write and review sprocs. The DBA ought to be busy doing SQL Servery stuff like maintaining server health, rebuilding indexes, performing backups, and trying to get the other half of the company off of MySql already, dammit.
-
RE: Make sure it's initialized!
<sarcasm>
What's wrong with this?
if (devID != null) var = System.Convert.ToBase64String(Hasher.GenerateHash(System.Text.Encoding.UTF8.GetBytes(String.Format("{0}{1}", devID, Acme.Utility.ByteToHex(devID)))));
Oh yeah, paid per line...
</sarcasm>
-
RE: At White Castle...
@Zemm said:
@PJH said:
@da Doctah said:
I'd have thunk that too. Saying "No glass shards" implies that competiors have glass shards, but da Doctah's quote is probably too specific for them to get away with that."Contains fewer shards of broken glass than the better-selling brand of bean soup!"
Isn't that only 'justifiable' if the better-selling brand of bean soup has had a non-zero number of shards in it (and assuming the brand making the claim has had zero?)Claiming that product A has no glass shards, no added salt/sugar, no GMO, etc., does not imply that any other product does. (People are free to infer it, but that's not the same.) I've eaten monkey entrails off the chest of an Elbonian hooker zero times; that doesn't mean that some other person has done so.
"Contains fewer shards of glass" is different. That states that given the number X (where X is an element of N) of glass shards in my bean soup, there exists some other bean soup that contains at least X+1 glass shards.
-
RE: At White Castle...
@serguey123 said:
The only things this proves is that you are an bored OCD person without a calculator. A more valuable way to waste your time is to use a calculator and then use your brainpower in something more useful (hint: watching horseporn is more useful than this.
@serguey123 said:
How basic is basic? Elementary school math? Because that is the only everyday use of math you can get. Also the brain tend to remember the stuff you use so if you remember you use it, if you don't then your brain tends to drop it and focus on horse porn.
I'm seeing a pattern here. I hope Zunesis doesn't chime in; he's probably an authority on horse porn.
-
RE: At White Castle...
@boomzilla said:
@da Doctah said:
Remember, this is a world where you can sell more jars of your peanut butter by plastering "Cholesterol Free!" across the label in big red letters.
Don't forget the marshmallow packaging that says, "A Fat Free Food."Throw "asbestos-free", "mercury-free", "arsenic-free", and "fewer bug parts by volume than the competitor's brand" on the label, and you've got the perfect food.
-
RE: At White Castle...
@kilroo said:
1 Cheeseburger
No Vanilla
Hopefully, this didn't spur the line cook to believe that "with vanilla" was the default setting for the Hardees Thickburger.
Although, you can get a bacon shake, so why not?
-
RE: At White Castle...
@toon said:
@CarnivorousHippie said:
Maybe I'm a moron, but that just doesn't make any sense whatsoever to me. ABack to point: Thinking skeptically without thinking critically is akin to "I think your position is flawed. I can't provide a cogent argument to demonstrate it, but I choose to believe it anyway." Hence, we still have those who profess that the earth is flat.
skepticperson who believes something she thinks is flawed, is a logical paradox, unless I'm much mistaken. And I don't mean the kind that has people puzzled because they see something is wrong but can't put their finger on what, btw: I mean the other kind.Is your "person" the same as your "she"? If so, that's not what I meant; I meant that person A (the uncritical skeptic) thinks that persons B's position is flawed, yadda yadda. Change "akin to" to "akin to thinking in this manner:"
Or, maybe your issue is that "I can't provide a cogent argument to demonstrate it" implies that I can't even prove it to myself, so my own position must be flawed. If so, I stipulate that if I'm not thinking critically, then I'm not that concerned with the validity of the argument.
Ooh, I'm having flashbacks to Formal Logic. Make it stop!
-
RE: At White Castle...
@FrostCat said:
@CarnivorousHippie said:
CTND .12
Yes, they print the Change To the Next Dollar on the receipt in case the carhops (that might be a clue) need to make change.
You know that means "Cash TeNDered", not Change to The Next Dollar, right?
Given that (a) I didn't give the carhop 12 cents, and (b) the receipt was printed before any cash was tendered at all, I stick with my explanation.
But since you bring it up, the receipt also has printed on it "CARD PAID 3.88". Apparently in this case, I paid with a credit card beforehand.
-
RE: At White Castle...
@blakeyrat said:
@CarnivorousHippie said:
I admit some creative license here, but many (not all) dictionary definitions of 'skeptic' liken it to merely exhibiting doubt or questioning 'accepted' fact. Perhaps a bastardization of the original Greek?
Oh well here's the problem. You see, I live in the 21st century, and I use 21st century definitions of words. I didn't realize I was talking to a fucking ancient Greek. Christ, what the hell is wrong with people on this forum.Sorry, I should have said "many (not all) modern dictionary definitions of 'skeptic' liken it to merely exhibiting doubt or questioning 'accepted' fact". I didn't think I needed to specify that.
Back to point: Thinking skeptically without thinking critically is akin to "I think your position is flawed. I can't provide a cogent argument to demonstrate it, but I choose to believe it anyway." Hence, we still have those who profess that the earth is flat.
-
RE: At White Castle...
@blakeyrat said:
By "strictly speaking" of course you mean "if I'm a pedantic dickweed".
Absolutely right on the pedantic dickweedery; I'm just pointing out the distinction between "can't" and "don't want to", as it's relevant to me.
@blakeyrat said:
I believe there is a negative value in computer science programs requiring calculus, when it's almost entirely useless for jobs relating to computer science. It just, for no reason, destroys the self-esteem of students who are good at logic and programming but terrible at calculus.
Agreed, to a point. The same argument might be applied to literature, social sciences, etc.; college would have been easier if I didn't have to write a paper on "My Kinsman, Major Molineux".
@blakeyrat said:
Doing thinking like, "how much change do I give back" is exactly the reason we built things like computers in the first place.
The same type of thinking is also the reason we were able to build things like computers in the first place. I'm hoping that one of today's kids gets around to inventing the teleporter, and I'm betting it won't be one of the 16 year olds that can't subtract from 100.
@blakeyrat said:
@CarnivorousHippie said:
Change that to 'critical thinking' ("you're wrong and I can explain") and I'd agree. Skeptical thinking ("you're wrong and I'm right") is what he practices now.
I don't see a difference between the two. The skeptic would never say "you're wrong and I'm right" unless they knew they were right, in which case it's the same as scenario A, yes?
I admit some creative license here, but many (not all) dictionary definitions of 'skeptic' liken it to merely exhibiting doubt or questioning 'accepted' fact. Perhaps a bastardization of the original Greek?
@blakeyrat said:
That's a lack of wisdom and not at all what we're talking about here.
Or, a gross miscalculation of risk and reward. Once it was mentioned that the cop's video recorder would demonstrate his folly, the wisdom quickly took over.
-
RE: At White Castle...
@morbiuswilters said:
@CarnivorousHippie said:
@serguey123 said:
@CarnivorousHippie said:
(1) I'm concerned that they learn elementary math skills (and making change is exactly that) because otherwise, when they have kids, the parents will be ill-equipped to reinforce the importance of these same skills. I adopted one at age 14 who came from this environment, and even now at age 18, he's only able to do elementary math.
This skill, along with so many others (like handwriting) is pretty much dead outside school. Although it is important that your kids do well in school is more important that they do well in life, so perhaps focusing on a different skillset is in order.
Somewhat agreed that math in the concrete after school is ... less than alive. In the abstract, it's developing the discipline to reason about simple math (and then reason about problem solving, causality, etc.) that I'm talking about.
The problem being that most basic math education is just rote memorization with no emphasis on critical thinking or practical application. So a lot of otherwise-intelligent people go through school thinking "Math Sucks!" and not realizing that it's actually math instruction which sucks. Until one day a friend who knows math demonstrates the elegant beauty of the discipline and makes it interesting by giving some history to go along with the formulas and they suddenly realize that math is actually really cool (and not nearly as difficult as they were lead to believe by incompetent text books and instructors).
+1
-
RE: At White Castle...
@serguey123 said:
@CarnivorousHippie said:
(1) I'm concerned that they learn elementary math skills (and making change is exactly that) because otherwise, when they have kids, the parents will be ill-equipped to reinforce the importance of these same skills. I adopted one at age 14 who came from this environment, and even now at age 18, he's only able to do elementary math.
This skill, along with so many others (like handwriting) is pretty much dead outside school. Although it is important that your kids do well in school is more important that they do well in life, so perhaps focusing on a different skillset is in order.
Somewhat agreed that math in the concrete after school is ... less than alive. In the abstract, it's developing the discipline to reason about simple math (and then reason about problem solving, causality, etc.) that I'm talking about.
-
RE: At White Castle...
@blakeyrat said:
I can't do math without a calculator.
I'm willing to bet that's not true, strictly speaking. Do you use a calculator to figure out how many minutes it is until <arbitrary timestamp>?
I don't worry that they choose not to calculate change (Except for tutoring others, I don't recall ever having to do calculus after college, so arguably that skill is irrelevant for me). I worry that they don't recognize any value in knowing how.
@blakeyrat said:
Step back. Think about your assumptions. If someone tells you, "man these kids won't get anywhere in life if they can't make change," your brain should instantly respond with, "what... is that true? Prove it."
Strawman. I don't argue that they "won't get anywhere in life if they can't make change," but that their potential is widened if their default setting is not "let someone/thing else do the thinking for me".
@blakeyrat said:
Teaching your kids skeptical thinking will get them a hell of a lot further in life than making change.
Change that to 'critical thinking' ("you're wrong and I can explain") and I'd agree. Skeptical thinking ("you're wrong and I'm right") is what he practices now. That's why he thought he could get away with lying to a judge.
-
RE: At White Castle...
@morbiuswilters said:
@CarnivorousHippie said:
I'm going to say I'd prefer to have the change printed, either as customer or server. As a customer, it would seem to make it much more likely I will get the correct change. As a server, sure, I could do the math in my head, but why would I want to? I'm getting paid minimum wage to carry sacks of grease around for smug asshole customers, am I really wanting to engage my brain to do trivial arithmetic when a computer can do it better, faster and cheaper? Also, if you are doing hundreds a day you are going to make a mistake some time, even if you are good at elementary arithmetic; repetitive, tedious tasks are the easiest to make a mistake on.I have a fast-food receipt from 2008 taped to my cube wall which I keep as a reminder... It's for $3.88 (two breakfast burritos), and printed near the bottom is:
CTND .12
Yes, they print the Change To the Next Dollar on the receipt in case the carhops (that might be a clue) need to make change.
This is why I no longer feel squeamish about using a credit card for a $4 meal.
I have no idea why any of you are complaining about this. Making change isn't even a useful life skill unless you're working a dead-end cashier job, so why are you concerned if people learn it or not? It's like saying "OMG, I went to the mechanic today and he had some kind of wrench powered by air that doesn't require you to use your muscle.. what is this world coming to??"
Hell, we're in IT; our entire job is to automate repetitive tasks. I use a calculator for almost all arithmetic or binary/octal/decimal/hex conversions. Could I do it in my head? Sure, but why would I want to? There seems to be this retarded quasi-machismo amongst tech people about who can waste the most amount of time doing arithmetic in their head. It's pointless mental masturbation.I see your point, but:
(1) I'm concerned that they learn elementary math skills (and making change is exactly that) because otherwise, when they have kids, the parents will be ill-equipped to reinforce the importance of these same skills. I adopted one at age 14 who came from this environment, and even now at age 18, he's only able to do elementary math.
(2) This $3.88 breakfast was typical for me, and once (maybe on this occasion) I gave the cashier $10.13 because I only had a ten and change and wanted to get rid of some of it... and (after a confused look) got back the original 13 cents and then the $6.12.
-
RE: At White Castle...
@rpjs said:
The other day at a Hale and Hearty Soups in Manhattan I tended a $20 bill for a purchase of $9.77. The girl at the till hit the $50 button for the amount tendered, so the till indicated she give change of $40.23. She spotted that she'd made a mistake, and apologised, and then left the till before I could say anything. She brought back a calculator to work out what the change should have been...
Americans shouldn't feel too bad though - I've witnessed similar muppetry in my home country of England as well.
I have a fast-food receipt from 2008 taped to my cube wall which I keep as a reminder... It's for $3.88 (two breakfast burritos), and printed near the bottom is:
CTND .12
Yes, they print the Change To the Next Dollar on the receipt in case the carhops (that might be a clue) need to make change.
This is why I no longer feel squeamish about using a credit card for a $4 meal.
-
RE: It doesn't need refactoring
@snoofle said:
... he claimed that it made sense to him, and that it doesn't need refactoring ...
Quite right. It doesn't need refactoring; it needs reauthoring, preferably by a different author.
@snoofle said:
A peer ...
Ah, this is obviously some strange usage of the word 'peer' that I wasn't previously aware of.
-
RE: .net parameters
@tdb said:
@Peraninth said:
If you change "public class temp" to "public struct temp" and nothing else, the value after calling Foo will be 6. Would you, tdb, after reading the link above expect this behavior? I call bullshit on anyone who says this behavior wouldn't completely surprise them coming from a C/C++ background.
Not sure what you're getting at here? I did say the C# behavior is confusing for someone with a C/C++ background (like me). My post was offering a counterexample to CarnivorousHippie's claim that all languages would treat pass-by-value the same way as C#. It was also trying to explain to others that the major source of the confusion is that the same syntax can result in different behavior depending on which kind of type it is.
Disclaimer: My claim is not based on experience or even familiarity with all languages, but just on the definition on passing by val/ref. YMMV.
-
RE: .net parameters
@tdb said:
@CarnivorousHippie said:
This isn't new; doesn't every language that supports pass-by-reference semantics (which excludes java) do this?
Passing an object by value pushes the pointer to the blob of memory where the object exists onto the stack, so the callee can change the state of the object in any way it wants, but it can't change the value of the pointer in the caller. If passed by reference, then the stack gets a pointer to a pointer to the object, and you can change the pointed-to value (such as assigning a new object).
No. Consider the following code in C (also valid in C++):
struct foo { int x; };
void func(foo f)
{
/* func gets its own copy of the struct */
f.x = 42;
}void main()
{
struct foo f;
f.x = 1;
func(f);
/* f.x is still 1 here */
}
The main WTF in the OP seems to be that C# uses the same syntax for declaring different things;
bar b;
may get you a stack object or a pointer, depending on what bar is. As a consequence, it's not clear (from the syntax) exactly what is being passed by value. This is probably not confusing for someone who has used C# for years, but for someone with a C or C++ background it is.Disclaimer: I haven't actually written a single line of C# code, I'm just using information others have posted here.
I should have used "reference type" instead of "object". As I've termed things, struct != object. Passing a struct (by value) pushes a copy of the struct on the stack, just like passing 3 by value pushes a copy of 3 on the stack.
Can't say I have a C background, unless you count college (I haven't touched C since 93), but even then I had no confusion about by-val/by-ref; must have been the semester of assembly.
-
RE: .net parameters
This isn't new; doesn't every language that supports pass-by-reference semantics (which excludes java) do this?
Passing an object by value pushes the pointer to the blob of memory where the object exists onto the stack, so the callee can change the state of the object in any way it wants, but it can't change the value of the pointer in the caller. If passed by reference, then the stack gets a pointer to a pointer to the object, and you can change the pointed-to value (such as assigning a new object).
For instance, I do something like this in VB6 (yes) all the time:
Private Sub IterateInSomeUsefulWay(ByVal rst as ADODB.Recordset)
Knowing full well that the current record is going to change in the process.
-
RE: The name game
Perhaps embed the ascii of some appropriate text (such as the old name, or something rude) into the GUID. They'll never know.