@Mr_Bad_Example said:
*(They stopped making baby oil out of actual babies in the early 1900s.)
Been saying that'd lead to overpopulation since the early 1910s. And here we are, 6.5 billion and growing!
@Mr_Bad_Example said:
*(They stopped making baby oil out of actual babies in the early 1900s.)
Been saying that'd lead to overpopulation since the early 1910s. And here we are, 6.5 billion and growing!
@ropata said:
This is why condescension towards and contempt for one's intellectual inferiors are not only important, but downright necessary for survival in modern times. Some of you have occasionally asked how I can be so tranquil about the persistent illogic expressed with such mind-numbing regularity by the atheists, feminists, science fetishists and other critics who are occasionally so kind as to grace us with their attentions, but the truth is that I find the experience to be almost meditational. Call it the Art of Enlightened Condescension or the Zen of Contempt, whatever you like, but the only other serious option is to withdraw into a hermit's cave and never communicate with the larger part of humanity again.
Enjoyable read until he lost me at the last paragraph.
"persistent illogic expressed with such mind-numbing regularity by the atheists, feminists, science fetishists and other critics"?
Err, what? Never mind the heaping together in one pile of the three - all of which can have their moment of irrationality, seeing they are human. From the context he puts them on par with the mouthbreathers who can't operate a ticket machine. Ah well, followed the link... Christian libertarian and member of the Southern Baptists... perfect rationalists, I see.
To not say anything about just how Christian his attitude is. Jesus must be really pleased with him...
Glasshouse, meet stones! The stones the Bible says you're not supposed to throw unless you're without sin.
As part of my thesis I had a similar situation and did resolve it with JOINs as it was easy to handle, but I looked very seriously at this approach:
http://www.dbmsmag.com/9603d06.html
http://www.dbmsmag.com/9604d06.html
http://www.dbmsmag.com/9605d06.html
http://www.dbmsmag.com/9606d06.html
where the author deals with tree structures in databases (not just linear). As it's part of a column, there's sometimes other stuff he talks about, so you have to jump to the right sections.
HTH
@Mr_Bad_Example said:
*(They stopped making baby oil out of actual babies in the early 1900s.)
Been saying that'd lead to overpopulation since the early 1910s. And here we are, 6.5 billion and growing!
As others have stated in my defense: no, I really do not see how I should presume that peanut salting/packing/processing equipment would also be used for other (actual) nuts.
But, I thought I'd add, just to confuse things (and I had to have a specialist in nutritional medicine explain it to me to understand):
I love Indian food. I eat it often.
If you take any average Indian recipe, you will see it is full of nuts in the sauces, nutsy and legumy! I'm still alive after years of Indian food.
Which had actually led me to believe it was a pure "all in my head" allergy - psychosomatic, if you will. I once got sick off *something* (insect bite?), had nuts, made wrong connection.
Until the day I had a bad episode off a dish with raw nuts in it, and i didn't know they were there. Was told by a sheepish looking cook after I recovered and asked. And it was a dish you wouldn't even expect nuts in - was their "personal touch". Or attempted murder, I dunno...
Enter the specialist, who explained to me that the allergy is brought about by a protein (always comes down to those buggers in the end), which breaks down when nuts are ground/chopped and then cooked in the spicy sauces. The sauce coating also helps cover whatever vestiges of the protein remain. No protein, no allergic reaction.
Peanuts and nuts have different proteins (in the same way some people are allergic to cats but not other animals - different proteins that you react to), so you can react to one not the other.
What's interesting - getting back to the labeling WTF the long way around - is that apparently when those companies switch between the product the machines process, they must not use (sufficient) heat when cleaning them in between. Otherwise these nasty proteins would break down and it would no longer be an issue.
Though I am in agreement with the poster who wrote about the increase in over-sensitive kids as a result to totally pampered immune systems, thanks to anti-bactericidal soaps, antibiotics for colds and what not. Heck, in our house, if we drop food it's ours if we're faster than the dogs in getting to it (good luck with that...)! Dirt builds character!
Exemplum gratum: I am allergic to nuts (the type that grows on trees) and the effect of eating any is my throat starting to swell shut. It can get really ugly to try a tracheotomy on me in a metal cylinder screaming along at 40,000ft. Heck, some moronic sky marshal might mistake my flailing for a terrorist attack and shoot me.
Whereas, I can eat legumes (peanuts and pistacchios, "nuts" that grow on bushes) just fine.
Having no desire to either be shot or have my neck be operated on with a ball-pen, I'm happy for the warning.
In my experience the ones that aren't just of the "memorise where to put your little tickmark" type are far more valuable.
CISSP and similar are still highly regarded, GIAC used to be and still may be. I think Sun java certs aren't just memorising, others may know more. Higher level Cisco certs are often listed in job ads that I see.
MCSE? Meh!
Mike
I just graduated with my Masters two weeks ago. More to show myself that I still could (in my 40s) than to hope to gain better employment chances.
My wife was supportive and stayed so - barely. Much longer and I'd have been looking at divorce papers now. And a nervous breakdown due to double workloads.
In other words: think twice if you really want it. Maybe you want to move more into research? Teaching/lecturing at uni (which I may do a bit down the road, once I've recovered), that generally requires a Masters, at least.
Mike
Wow, not THAT is a blast from the past... IDL...
Early on in my career (80s) I was sales engineer/product specialist for a package called PV-WAVE, effectively a commercial version of IDL with a GUI 'n'stuff. Ran on MicroVAXen, IIRC, and SunOS.
Loved working with it, especially at trade shows where I would take nifty astronomical images and do all kinds of stuff with them.
Now, it's been forever but wasn't one of the things about IDL that you could do operations like the one you list on just about anything? I mean *anything*, including having "a" be a 500MB 3-dimensional array of environmental data? Which could come from just about any source.
So, is "a" a scalar? Or some vector data in a form such that mathematically a != ~(~a) ?
Ah, memories... now THERE was a WTF company if there ever was.
I remember when they flew the entire international staff to the US HQ for a "world sales meeting" with parties and what not. Two days after they had laid off 50% of US staff. So, we were told in effect, to party hard only when it was international staff members and act subdued while interacting with US team members.
That's only a slight exageration - see, the products were selling well outside the US, or rather still had a good sales pipeline in the cycle, so all the outside-US sale droids had made quota and then some. But, the US market was in recession, they had had a string of bad products that failed (but hadn't entered the international market yet anyway), and the company was being mis-managed into the ground. Same old, same old, in other words.
The one product that was doing pretty well everywhere was bought from the outside - above-mentioned PV-WAVE. Or I think it did - I bailed a short time later, with the writing on the wall.
I don't know if anybody really cares, but in the spirit of closure, I wanted to add that after some futzing on and off on this issue, I hobbled together a solution. It may not win any prizes, but it works well and the resulting code was fairly clean.
In the end I created a simple wrapper class "ANDClause" (OK, sue me for unimaginative naming) which will hold both parametrised markers and the DB parameter. Surrounding them is a collection wrapper.
This ultimately allowed me to reduce and refactor my web method to little more than
ANDClauseCollection andClauses = new ANDClauseCollection();
andClauses.Add(new ANDClause("reference_no = ?", DB2DbType.VarChar, 15, UpperCaseAndFixApostrophe( refNo)));
andClauses.Add(new ANDClause("last_name = ?", DB2DbType.VarChar, 30, UpperCaseAndFixApostrophe( lastName)));
andClauses.Add(new ANDClause("first_name LIKE ?", DB2DbType.VarChar, 30, UpperCaseAndFixApostrophe( firstName+"%")));
andClauses.Add(new ANDClause("birth_date = DATE(CAST(? AS VARCHAR(15)))", DB2DbType.VarChar, 15, UpperCaseAndFixApostrophe( birthDate)));
return GetDataSet(AssembledCommand(_vncSelect, andClauses));
(The upper case et al WTF is because the legacy database this needs to talk to is so old it can't deal with lower case characters)
When adding clauses to the collection, checking is done whether there are valid values in each (seeing as the main use is for web search forms).
AssembledCommand makes use of a method in the collection class, QueryCommand(), that throws out the whole shebang of all the possible AND clauses in a nice clean SELECT...WHERE...AND...AND... chunk.
private DB2Command AssembledCommand(string dbSelect, ANDClauseCollection clauses)
{
string queryCoda = " FETCH FIRST " + _maxRecords.ToString() + " ROWS ONLY";
return clauses.QueryCommand(dbSelect, queryCoda);
}
<shrug>I'm still a little surprised that there isn't a "standard" way of doing what I thought is a common task. So I can't help thinking I re-invented the wheel. But at least other can use this and even understand the code without running screaming.</shrug>
Mike
Well, after a day of hacking away at this, I came up with a solution, but I don't think it will win any beauty prizes....
Here's an excerpt. It works, but I can't help thinking there's got to be a better way!
public DataSet VNCQueryAsDataSet(string refNo, string lastName, string firstName, string birthDate)
{
string vncWhereClause = " WHERE 1=1 ";
List<DB2Parameter> parameterList = new List<DB2Parameter>();
if (!String.IsNullOrEmpty(refNo))
{
vncWhereClause += AppendANDSubclause("reference_no = ?");
parameterList.Add(AddParameterWithValue(refNo, DB2DbType.VarChar, 15));
}
if (!String.IsNullOrEmpty(lastName))
{
vncWhereClause += AppendANDSubclause("last_name = ?");
parameterList.Add(AddParameterWithValue(lastName, DB2DbType.VarChar, 30));
}
if (!String.IsNullOrEmpty(firstName))
{
vncWhereClause += AppendANDSubclause("first_name LIKE ?");
parameterList.Add(AddParameterWithValue(firstName+"%", DB2DbType.VarChar, 30));
}
if (!String.IsNullOrEmpty(birthDate))
{
vncWhereClause += AppendANDSubclause("birth_date = DATE(CAST(? AS VARCHAR(15)))");
parameterList.Add(AddParameterWithValue(birthDate, DB2DbType.VarChar, 15));
}
return GetDataSet(AssembledCommand(_vncSelect, vncWhereClause, parameterList));
}
private DB2Parameter AddParameterWithValue(string paraValue, DB2DbType db2Type, int length)
{
string parameterName = "@p_" + _paramIndex++.ToString();
DB2Parameter paraMarker = new DB2Parameter(parameterName, db2Type, length);
paraMarker.Value = UpperCaseAndFixApostrophe(paraValue);
return paraMarker;
}
private string AppendANDSubclause(string subclause)
{
return @" AND (" + subclause + ") ";
}
The last two methods are merely helpers as a results of refactoring for better readability, what with all the munging of strings. Some field declarations are not visible here:
The _paramIndex is a class static field. I use it to auto-create parameter marker names.
The base where clause is initialised with "WHERE 1=1" to always have some clause, even if all form fields are passed in empty. Then there's the ugly if{} blocks for every form field passed as parameter into the method. Any suggestion on how to improve this gratefully accepted! If a field is not empty, then its sub clause for the WHERE statement is appended in parameter marker form. The parameter and its value are kept in a simple generic list.
Once all is munged together, it's all dumped into a method to turn it into a Command object:
private DB2Command AssembledCommand(string dbSelect, string query, List<DB2Parameter> paramList)
{
string queryCoda = " FETCH FIRST " + _maxRecords.ToString() + " ROWS ONLY";
DB2Command assembledCommand = new DB2Command(dbSelect + query + queryCoda);
assembledCommand.Parameters.Clear();
assembledCommand.Parameters.AddRange(paramList.ToArray());
return assembledCommand;
}
Again, queryCoda is just used as local variable for readability. Everything is pasted together, including the parameter list which is added in bulk to the DB2Command.
I guess I achieved what I set out to do - injection proofing the code and using parametrised database queries.
Strong doubts remain how maintainable this is...
Mike