tag:blogger.com,1999:blog-69983891866885408912024-03-21T10:26:10.864-07:00StinkySQL - Software is hardSoftware so bad that you'll want to start a web-site about it.Anonymoushttp://www.blogger.com/profile/12957398167771699029noreply@blogger.comBlogger50125tag:blogger.com,1999:blog-6998389186688540891.post-56035005726871828572012-05-26T23:00:00.001-07:002012-05-26T23:04:20.581-07:00Wait a sec, did I read that right?<h2>
I thought this would have been fine ...</h2>
<blockquote>
I had to read this several times, have some coffee, stop drinking for a week and then mouth out the individual syllables out loud. Yes, it really does say this.</blockquote>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhH-pkD_8y8BRqTuPy6qkvCCsJhlJMtsuQGlbEM1Q0kilVBQg-s8CzMgPgackjbsmDuWxprEes1R0i_Ulnfrk_a4v27HqVKigW_6t2pg7ncQvjKpl7ocylNWqQyfdIvEL3UxzAIMjTKVxjp/s1600/MSMGError.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="167" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhH-pkD_8y8BRqTuPy6qkvCCsJhlJMtsuQGlbEM1Q0kilVBQg-s8CzMgPgackjbsmDuWxprEes1R0i_Ulnfrk_a4v27HqVKigW_6t2pg7ncQvjKpl7ocylNWqQyfdIvEL3UxzAIMjTKVxjp/s320/MSMGError.png" width="320" /></a></div>
<br />
<blockquote>
Honestly, there's no shopping here. Start a project to use MSMQ and then try to directly set the correlationId of a message. Easily repeatable.</blockquote>
<h3>
<blockquote>
No man is an island, no company is perfect, software is hard.</blockquote>
</h3><div class="blogger-post-footer">(c)StinkySQL</div>Anonymoushttp://www.blogger.com/profile/12957398167771699029noreply@blogger.com0tag:blogger.com,1999:blog-6998389186688540891.post-29135868333124753132011-03-06T08:47:00.000-08:002011-03-06T08:47:49.727-08:00Soft Issues - everyone's got 'em<h2>Things humans are good at:</h2><blockquote>So I'm playing with Microsoft's Visual Studio 2010 and the entity framework. One of the nifty new features I noticed when making a new "<i>ADO .NET Entity Data Model</i>" was the option to "<i>Pluralize or singularize generated object names</i>". The created items then just make more sense and it is a welcome addition.</blockquote><blockquote><br />
Never mind the fact that my database table "<i>Octopi</i>" did not translate to "<i>Octopus</i>" as we would all expect. That is an edge case for sure and I don't really use Octopi that much. My issue is how it took my table named "<i>Movies</i>" and ended up with the singular model name "<i>Movy</i>". You could argue that the spelling is kinda cute, but you couldn't argue it is correct. </blockquote><br />
<h3><br />
<blockquote>I'm just saying ...</blockquote></h3><div class="blogger-post-footer">(c)StinkySQL</div>Anonymoushttp://www.blogger.com/profile/12957398167771699029noreply@blogger.com0tag:blogger.com,1999:blog-6998389186688540891.post-63178500144409200492010-12-14T21:11:00.000-08:002010-12-14T21:11:29.927-08:00You couldn't handle the text fileOK - so the deal is to figure out why a simple 2300 line SQL query that took 1:08 to run in the SQLServer Management tool during testing, is running for over an hour on another site and doesn't seem to be any where near completion. They can see it running, but nothing is changing in the database. Testing was on a copy of the same database. Two other running remote databases that are smaller are also not complete and running forever.<br />
<br />
Guess?<br />
<br />
Turns out PRINT statements can be evil if you use enough of them. The update SQL was outputing some good-old-fashioned debugging information using PRINT "something" generously. These were withing a cursor, that was then in a loop that ran another loop - each of these with their own generous set of debugging data for the world to review upon completion.<br />
<br />
While reviewing the output, I noticed that there were quite a few of them. In management studio, you can see the number of lines. In this case, it was over five million. Lines. Figure each line had 20-30 characters on it. This wasn't an issue in the GUI, but the SMO used had to marshall all that data somewhere. Takes some time. If you run it remote across the country, well, that's a long drive.<br />
<br />
We killed the job, remoted locally and ran it in th GUI on the target server. Done in 1:10. Go figure.<br />
<br />
Further testing showed that <br />
a) even the GUI couldn't actually save the output results it showed. It would get an exception error.<br />
b) SMO would probably eventually finish some day on its own - but no one in testing wanted to wait to see and killed it after two hours<br />
c) Taking the print statements out allowed the SMO to finish in 1:20<br />
<br />
Couldn't find any Microsoft reference on a MAX text results size ...<div class="blogger-post-footer">(c)StinkySQL</div>Anonymoushttp://www.blogger.com/profile/12957398167771699029noreply@blogger.com0tag:blogger.com,1999:blog-6998389186688540891.post-60917255155729476862010-11-11T23:39:00.000-08:002010-11-11T23:39:33.398-08:00It gets easier with the title ...The SENIOR DB developer removing duplicates swore that this was going to be much faster:<br />
<blockquote>DELETE #someLocalTempTable<br />
WHERE CONVERT(VARCHAR(20),SomePKIDEN_Id) <br />
+ NamesStringColumn <br />
+ CONVERT(VARCHAR(20),SomeFKIDEN_Id) <br />
+ CONVERT(VARCHAR(20),SomeOtherFKIDEN_ID)<br />
IN (<br />
SELECT CONVERT(VARCHAR(20),SomePKIDEN_Id) <br />
+ NamesStringColumn <br />
+ CONVERT(VARCHAR(20),SomeFKIDEN_Id) <br />
+ CONVERT(VARCHAR(20),SomeOtherFKIDEN_ID) <br />
FROM ##AGlobalTempTable <br />
)</blockquote><br />
<br />
<br />
AS OPPOSED TO THIS:<br />
<blockquote>DELETE t<br />
FROM #someLocalTempTable t (NOLOCK)<br />
JOIN ##AGlobalTempTable s (NOLOCK)<br />
ON t.SomePKIDEN_Id = s.SomePKIDEN_Id<br />
AND t.NamedStringColumn = s.NamedStringColumn<br />
AND t.SomeFKIDEN_Id = s.SomeFKIDEN_Id<br />
AND t.SomeOtherFKIDEN_ID= s.SomeOtherFKIDEN_ID</blockquote>Fast correlated sub-queries. Nice concept.<br />
<i> </i><div class="blogger-post-footer">(c)StinkySQL</div>Anonymoushttp://www.blogger.com/profile/12957398167771699029noreply@blogger.com0tag:blogger.com,1999:blog-6998389186688540891.post-50336199499724593982010-03-04T20:18:00.000-08:002010-03-04T20:18:01.517-08:00I swear I don't make this up ...This is the latest software configuration option. It has a yes/no setting.<br />
<br />
<i>AllowBadAddressOnValidation</i><br />
<br />
<br />
<br />
<br />
<i>LOL </i><div class="blogger-post-footer">(c)StinkySQL</div>Anonymoushttp://www.blogger.com/profile/12957398167771699029noreply@blogger.com0tag:blogger.com,1999:blog-6998389186688540891.post-33135456712140423012009-10-15T20:46:00.000-07:002009-10-15T20:46:48.656-07:00Bugs that make money Here is a find from "P", a potential bug had the database fields been used as intended. Its a big change in reporting that QA has never seen so you know it is in some very obscure code path. Something to be said for code review!<span style="font-family: Arial; font-size: x-small;"><span style="font-family: Arial; font-size: 10pt;"><o:p><br />
</o:p></span></span><br />
<br />
<blockquote><div class="MsoNormal" style="margin-bottom: 0.0001pt; margin-left: 17.6pt; margin-right: 0.9pt; text-indent: -9pt;"><span style="color: black; font-family: Arial; font-size: x-small;"><span style="color: black; font-family: Arial; font-size: 10pt;">I'm looking at a stored procedure that's reporting $$ for a Revenue report by multiplying Rate * Total, instead of Rate * Quantity (which is the same as just Total).<o:p></o:p></span></span><br />
</div></blockquote><br />
So what we are looking at is the potential of ordering 50 $1 gift cards, but reporting $2500 for the entry. Just the kind of thing to get you over that bumpy quarter. ;)<div class="blogger-post-footer">(c)StinkySQL</div>Anonymoushttp://www.blogger.com/profile/12957398167771699029noreply@blogger.com0tag:blogger.com,1999:blog-6998389186688540891.post-29684339095336149622009-09-16T21:31:00.000-07:002009-09-16T21:38:31.312-07:00No we won't learnNot more than a couple days of dealing with an obscure OSQL parsing bug (see link) that we should have known about, we QA-catch another that we already knew about.<br /><br />If you fully qualify a table in another database and give it an alias, OSQL command parsing will not use the alias. That is you cannot<br /><blockquote>SELECT something FROM foobarDB.dbo.footable AS otable WHERE otable.someColumn IS NULL</blockquote>The "otable.xxx" will cause an error as it cannot find that alias.<br />2005 et.al. seem to be fine.<div class="blogger-post-footer">(c)StinkySQL</div>Anonymoushttp://www.blogger.com/profile/12957398167771699029noreply@blogger.com0tag:blogger.com,1999:blog-6998389186688540891.post-91699509372923535112009-08-06T06:53:00.000-07:002009-08-06T06:59:42.599-07:00Will we ever learn?A while back I posted about a Microsoft <a href="http://stinkysql.blogspot.com/2007/10/go-speedracer-go.html">bug</a> in 2000 server installations. Caused a production error again, then this was followed by another (SELECT 1 FROM SYS.SYSINDEXES) the next day.<br /><br />Turns out it is related to the OSQL/ISQLW/ISQL installed and not the server. You can run this same script from a machine with the 2005 tools installed and point to the 2000 server and there is no error. As we deploy using processes that run the file via an isql.exe -I command line, it is a big deal.<br /><br />Point is then, when we are testing for compatibility of our scripts, we can't run it from the 2005 management studio. We will get a false positive. We have to run it through the local version of the tools!<br /><br />ERROR 1<br />PRINT 'The error is in parsing the GO incorrectly'<br />/*<br />This is a comment<br />GO<br />*/<br /><br />ERROR 2<br />--The error here is the prefix of the SYS. that will not parse correctly<br />SELECT * FROM SYS.SYSINDEXES<div class="blogger-post-footer">(c)StinkySQL</div>Anonymoushttp://www.blogger.com/profile/12957398167771699029noreply@blogger.com0tag:blogger.com,1999:blog-6998389186688540891.post-39223887840597056272009-08-01T05:58:00.000-07:002009-08-01T06:00:55.147-07:00Summary of SummerA friend of mine, a life-long resident of Los Angeles California, moved Minneapolis Minnesota and I was giving him some perspective on the seasons where I grew up. Discovered something myself in doing so.<br /><br /><blockquote>"The thing I grew up with and remember the strongest about the seasons was that when it was the middle of Summer you could hardly wait for winter, and when it was the middle of Winter, you could hardly wait for Summer. Seasons all have their good and bad points, you just have to learn to take advantage of them when they are there. The biggest thing I miss is that change. I have been living in a 22 year long Summer now and its more than a bit annoying. I miss the beauty of the trees in the Fall, fresh fallen snow and the quiet it brings in the Winter, the smell of mud in the spring after the first good thaw. Hmmm, can't think of anything nice about Summer. Oh well."</blockquote><div class="blogger-post-footer">(c)StinkySQL</div>Anonymoushttp://www.blogger.com/profile/12957398167771699029noreply@blogger.com0tag:blogger.com,1999:blog-6998389186688540891.post-41001868924340640952009-07-30T11:21:00.001-07:002009-07-30T11:21:34.863-07:00Just listen to me foolYou cannot have a valid process until you have a process that you manage. That means making sure it happens and listening for changes that are needed and adapting to them.<div class="blogger-post-footer">(c)StinkySQL</div>Anonymoushttp://www.blogger.com/profile/12957398167771699029noreply@blogger.com0tag:blogger.com,1999:blog-6998389186688540891.post-3024538071258967052009-05-28T22:26:00.001-07:002009-05-28T22:28:53.007-07:00It could be a rumor ...My favorite programmer asks: Which genius put this into the common library?<br /><br />return bool.Parse("true");<br /><br />instead of<br /><br />return true;<br /><br /><br /><br />I don't care where you come from, that's funny!<div class="blogger-post-footer">(c)StinkySQL</div>Anonymoushttp://www.blogger.com/profile/12957398167771699029noreply@blogger.com0tag:blogger.com,1999:blog-6998389186688540891.post-2813408908021335822009-05-25T13:19:00.000-07:002009-05-25T13:20:22.096-07:00Open Letter to all Credit facilitiesI find your security challenge questions and requirements an invasion of my privacy. You don't need to know anything about me in that detail. As an industry with everyone asking this kind of information, I am being forced to expose MORE data about myself then ever before and I find that MOST offensive.<br /><br />Find another way or foist your draconian rules on those who have been lax enough to be victimized by fraud - not generate data for future attacks for all.<br /><br />SS<div class="blogger-post-footer">(c)StinkySQL</div>Anonymoushttp://www.blogger.com/profile/12957398167771699029noreply@blogger.com1tag:blogger.com,1999:blog-6998389186688540891.post-547977976548115452009-05-13T16:48:00.000-07:002009-05-13T16:53:22.436-07:00I'm all a-twitterOne of our loggin file tables can only display 50 characters, so when someone logged the message:<br /><br /> "A copy group can't be set to verified. Please rotate the spot before verifying."<br /><br /><br /><br />The users sees<br /><br />"A copy group can't be set to verified. Please rot"<div class="blogger-post-footer">(c)StinkySQL</div>Anonymoushttp://www.blogger.com/profile/12957398167771699029noreply@blogger.com0tag:blogger.com,1999:blog-6998389186688540891.post-43765499949054113612009-04-28T12:58:00.000-07:002009-04-28T13:00:41.667-07:00Bad Table!<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCGJCZyn5Lic4DXCqRapkv-fTZzb3YsBl4qeqIgMWm5KIHLtBiMS4ypbRxApegk3iZCFs_m3cMRmVJNMWgwWNYrVYCiMYWQ5F-rZrFsJrhxADLYkg1r-39iz0zz2FnjHDyPcwchRskVRt8/s1600-h/BadTable.bmp"><img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 304px; height: 204px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCGJCZyn5Lic4DXCqRapkv-fTZzb3YsBl4qeqIgMWm5KIHLtBiMS4ypbRxApegk3iZCFs_m3cMRmVJNMWgwWNYrVYCiMYWQ5F-rZrFsJrhxADLYkg1r-39iz0zz2FnjHDyPcwchRskVRt8/s320/BadTable.bmp" alt="" id="BLOGGER_PHOTO_ID_5329834408271248434" border="0" /></a><br />Someone knowing that I do SQL sent me this ...<br /><br /><br /><br /><br /><a href="http://www.straightlinedesigns.com/">Source</a><div class="blogger-post-footer">(c)StinkySQL</div>Anonymoushttp://www.blogger.com/profile/12957398167771699029noreply@blogger.com0tag:blogger.com,1999:blog-6998389186688540891.post-84417755335698599412009-04-12T12:48:00.000-07:002009-04-12T12:49:32.941-07:00Counter Rant on R&BThe Ruby Yacht of Omar Khayyam can be found in Moosylvania, on the waters of Veronica Lake, near the Isle of Lucy, not far from Whynchataka Peak. One can also visit Bullwinkle’s alma mater Wossamotta U. or Rocket J. Squirrel’s alma mater, The Cedar Yorpantz Flying School. R&B was my favorite cartoon when I was little, then it disappeared for about a decade or so, then some network started rerunning it, and the reruns were even funnier because I had collected enough information during that decade to understand all (or most) of the jokes that flew right over my head when I was little.<br /><br /> <br /><br />The whole thing is so littered with cultural, historical, and cold war references that they should probably put out a set of DVD’s with a footnote option that allow you to turn on explanatory text at the bottom of the screen, like footnotes in other classic literature such as I was forced to read in high school and college. I wouldn’t need the footnotes for R&B but a lot of people would, especially younger or dumber ones.<br /><br /> <br /><br />Regarding the ‘Title or: Subtitle’ format, I’m not sure if it was ever a common practice before Bullwinkle. The other well known example is the complete title ‘Dr. Strangelove or: How I Learned to Stop Worrying and Love the Bomb’. R&B came out in 1959 and Dr. S was released in 1964. When I lived in Menomonie and they were talking about starting up the draft again, my roommates and I and a ‘Hell no We Won’t Go – or – I Always Wanted to See Canada’ party. We even made and displayed a title sign at the party, magic marker gloriously emblazoned on tan cardboard. They liked R&B too.<div class="blogger-post-footer">(c)StinkySQL</div>Anonymoushttp://www.blogger.com/profile/12957398167771699029noreply@blogger.com0tag:blogger.com,1999:blog-6998389186688540891.post-71035913985521164022009-04-08T03:24:00.000-07:002009-04-08T03:28:30.384-07:00On Rocky and BullwinkleI have to explain a lot more references in conversations these days. At first it was funny, now its disturbing. I found myself trying to explain Mr. Peabody just two weeks ago. There are no current cultural references to engage this level of humor with so the attempt falls flat. Now it has to be simple, abrupt and fit in a five second sound-byte to be valid. Everyone knows Gilligan though, that's safe. I pick Maryann by the way - always have. Don't know anyone who picks Ginger so why even ask. Really.<br /><br />The wife sat down with the kids every night for several weeks and they went through the entire Monty Python Collection. All of it. They then did the same with the entire original Star Trek series and have just finished all the movies of the same genres. We feel strongly that this will give then a good religious, political and moral grounding in life. I probably should get the original R&B also so we have someone to talk to about it when we are in the old folks home.<br /><br />Maybe Faulty Towers also, and some Bob Newhart. Yeah. That would cover it.<div class="blogger-post-footer">(c)StinkySQL</div>Anonymoushttp://www.blogger.com/profile/12957398167771699029noreply@blogger.com0tag:blogger.com,1999:blog-6998389186688540891.post-86558181192268752442009-03-30T13:08:00.000-07:002009-04-29T07:41:43.783-07:00Red Velvet Cake - au natural<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgoOfEHpomsP45ESBeVs0Z8aGeSbTyOKyspT2Snfj9do0NzUJPG79lheCmt4NPyQwTNOr_JAJtYCxPI7v-8Me0pMqy0a80jgDj-rVlFQvU2cGiNdjHYcYohyphenhyphenCHD9r9OHlTsZNRIoAFevwnf/s1600-h/IMG00954.jpg"><img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 320px; height: 240px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgoOfEHpomsP45ESBeVs0Z8aGeSbTyOKyspT2Snfj9do0NzUJPG79lheCmt4NPyQwTNOr_JAJtYCxPI7v-8Me0pMqy0a80jgDj-rVlFQvU2cGiNdjHYcYohyphenhyphenCHD9r9OHlTsZNRIoAFevwnf/s320/IMG00954.jpg" alt="" id="BLOGGER_PHOTO_ID_5330123444992344130" border="0" /></a><br />A new desert store opened up in the neighborhood and the best they had was a red velvet cupcake. Then the email thread started about what makes it red. Turns out that before Dutch processed cocoa became widely available the reaction of acidic vinegar with the butter milk would tend to turn the cocoa a reddish color. Most people now use food coloring or beets. The challenge then was to make it without coloration and see what you get.<br /><a href="file:///C:/Users/Public/Pictures/Blackberry/">file:///C:/Users/Public/Pictures/Blackberry/</a><br />Turns out is is a reddish brown in the end - but not crazy blood red like you see in the pictures surfing for this one. Takes under two hours including the trip to the store. I recommend starting the icing early so that it's first step can cool while you work, and do the cupcakes 'cause they're just the right size.<br /><br /><br />RED VELVET BATTER<br />3 or 4 tlbs unsweetened cocoa powder<br />1 or 2 ounces red food coloring (left this out - man that is a LOT OF COLOR!!!)<br />1 cup buttermilk<br />1 tsp salt (sea salt preferred)<br />1 tsp vanilla extract<br />1 cup oil (I used sesame)<br />2 cups powdered sugar<br />2 eggs (large)<br />2 1/2 cups all-purpose flour, sifted (I did not sift, I am lazy. Used 2cups and stopped when it looked a PDGC or pretty darned good consistency)<br />1 1/2 tsp baking soda<br />1 tsp white vinegar<br /><br /><br />Grease two 9 inch round pans (I made 21 paper cupcakes)<br />preheat oven to 350 degrees F.<br />Make a paste of cocoa and food coloring (I just looked at the cocoa and thought RED)<br />set aside<br /><br /><br />Combine the buttermilk, salt and 1 teaspoon vanilla<br />In a large bowl, cream together the oil and 2 cups sugar until light and fluffy (by hand!)<br />Beat in the eggs one at a time. then stir in the cocoa mixture<br />Beat in the buttermilk mixture alternately with the flour, mixing just until incorporated. (you'll be tired if you do this by hand and won't over mix)<br />Stir together baking soda and vinegar (separate from anything else because its like those volcano experiments you do with your kids) then gently fold into the cake batter<br />Pour the batter into prepared pans (cupcake tins for us, don't fill over 3/4 or 7/8 of the cupcake papers as there is about 40% rise)<br />Bake in preheated oven for 30 minutes (cupcakes you better check at 15 - mine tool 18 and I know our oven is old and slow) or until a toothpick inserted into the center of the cake comes out clean<br />Allow to cool completely before frosting (cause it would just melt all over!)<br />Refrigerate until ready to serve (we ate ours in the first 10 minutes)<br /><br /><br /><br /><br />STANDARD ICING<br />1 cup milk<br />5 tbls all-purpose flour<br />1 cup powdered sugar<br />1 cup butter<br />1 tsp vanilla extract<br /><br /><br />In a saucepan, combine the milk and 5 tbls flour (that I did not use in the batter above cause I didn't really measure)<br />cook over low hear, stirring constantly, until mixture thickens (it will flip over suddenly then you will need to take it off the heat and keep stirring until the pan your using cools - that can still burn it)<br />Set aside to cool completely (refrigerators work well for this)<br />Cream together butter, 1 cup sugar and 1 teaspoon vanilla until light and fluffy (or your arms fall off)<br />stir in the cooled milk and flour mixture, beating until icing reaches spreading consistency (which doesn't take long)<br /><br /><br />I don't have the original source recipe location. If you recognize it let me know and I will cite it appropriately.<div class="blogger-post-footer">(c)StinkySQL</div>Anonymoushttp://www.blogger.com/profile/12957398167771699029noreply@blogger.com0tag:blogger.com,1999:blog-6998389186688540891.post-85450819238837698892009-03-26T21:26:00.000-07:002009-03-26T21:30:46.718-07:00My favorite ranter<p class="MsoNormal"><span style="font-family:Arial;font-size:85%;"><span style="font-size: 10pt; font-family: Arial;">My friend KB who-should-have-everything-he-ever-says-published-but-is-never-published says:<br /></span></span></p><p class="MsoNormal"><span style="font-family:Arial;font-size:85%;"><span style="font-size: 10pt; font-family: Arial;">Well I remember a night, all those years ago, down at ‘Bachelors 3’ when we were sitting around as usual and I predicted the impending extinction of the guitar as the dominant instrument in popular rock music. Not an unreasonable prediction given the popularity of the euro-synth pop, synth laden dance pop, and a general adoption of synthesizers as instruments rather than the 70’s use of synthesizers as, well, whatever Keith Emerson and Rick Wakeman were doing with them. Well, I was wrong. Just about everybody in the music business worth listening to now, new and old, still uses guitars.<o:p></o:p></span></span></p> <p class="MsoNormal"><span style="font-family:Arial;font-size:85%;"><span style="font-size: 10pt; font-family: Arial;"><o:p> </o:p></span></span></p> <p class="MsoNormal"><span style="font-family:Arial;font-size:85%;"><span style="font-size: 10pt; font-family: Arial;">On the same night, or another night just like it, I didn’t make a second prediction. But I was talking about investments, mutual funds, the financial world in general with (or at) Greg. While doing so, I was waving my arms around and being generally more animated than should be necessary while talking about such matters. Now, everyone does that.<o:p></o:p></span></span></p> <p class="MsoNormal"><span style="font-family:Arial;font-size:85%;"><span style="font-size: 10pt; font-family: Arial;"><o:p> </o:p></span></span></p><div class="blogger-post-footer">(c)StinkySQL</div>Anonymoushttp://www.blogger.com/profile/12957398167771699029noreply@blogger.com0tag:blogger.com,1999:blog-6998389186688540891.post-23595348747897450502009-03-09T17:19:00.000-07:002009-03-26T22:00:49.187-07:00That's not real food you're eatingGot a bug that we don't make a log entry for a module in one case. Turns out they are reading the text of the log to determine how to make calculations for one of their reports.<br /><br />Who bases $ calculations on log entries? It's not real data. I think Joe Celko would have a good rant over that.<br /><br />The reasoning was that the comparison between created date and updated date was unreliable. Instead of a trigger band-aid which would have left their code the same after the reliability issue was resolved, this solution was devised.<br /><br />Two days and many man-hours of research later we found that the reason they had no log was that someone updated the database through an Ad-Hoc SQL query. The log is generated through the GUI changes.<div class="blogger-post-footer">(c)StinkySQL</div>Anonymoushttp://www.blogger.com/profile/12957398167771699029noreply@blogger.com0tag:blogger.com,1999:blog-6998389186688540891.post-62391510564790157322009-03-06T12:00:00.001-08:002009-03-06T12:05:10.426-08:00Exactly how did you test that?The comment found in the code of an old stored procedure states the following:<br /><br />--Using dynamic SQL (faster than static SQL for large tables)<br /><br /><br />To add to the confusion, the procedure neither had dynamic SQL nor returned more than one record.<div class="blogger-post-footer">(c)StinkySQL</div>Anonymoushttp://www.blogger.com/profile/12957398167771699029noreply@blogger.com0tag:blogger.com,1999:blog-6998389186688540891.post-88322546041138322702009-02-27T15:26:00.000-08:002009-03-13T19:09:20.550-07:00Wonky and still logically incorrectThis is another result from the school of cut-and-paste polymorphism. The original IF statement checked for two items in an OR condition, explaining the apparent redundancy in the second IF - but not why anyone would check @@error twice and expect the same value...<br /><br /><blockquote><br />IF (@@error <> 0)<br /><br />BEGIN<br /><br />IF @@error <> 0<br /><br /> BEGIN<br /><br /> Set @intResultCode = @@error<br /><br /> Set @chvResultText = 'Error when registering the Station/Date. ' +<br /><br /> (SELECT description from master..sysmessages where error = @intResultCode and msglangid = 1033)<br /><br /> END<br />END<br /></blockquote><br /><em>Because @@ERROR is cleared and reset on each statement executed, check it immediately following the statement being verified, or save it to a local variable that can be checked later. </em><a href="http://msdn.microsoft.com/en-us/library/ms188790.aspx">Source: MSDN</a><div class="blogger-post-footer">(c)StinkySQL</div>Anonymoushttp://www.blogger.com/profile/12957398167771699029noreply@blogger.com0tag:blogger.com,1999:blog-6998389186688540891.post-32690994672944386372009-01-30T12:48:00.000-08:002009-04-29T07:47:43.304-07:00Mushroom velouté with buttermilk 'blini'<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjO76Q6iQYCISBH4L8zeZXtI4kssxAJZEWtYCjX48FsgtDyab4LKvG73LHabkL1NDvy-c_uBGuz755pW9QjWLE-Kpd_Y1TtoqHiD6vBFjWYHVE2v8EG6Ir440NmlzLCPlHhLhwr-aXnf5UO/s1600-h/MushhroomV.jpg"><img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 320px; height: 198px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjO76Q6iQYCISBH4L8zeZXtI4kssxAJZEWtYCjX48FsgtDyab4LKvG73LHabkL1NDvy-c_uBGuz755pW9QjWLE-Kpd_Y1TtoqHiD6vBFjWYHVE2v8EG6Ir440NmlzLCPlHhLhwr-aXnf5UO/s320/MushhroomV.jpg" alt="" id="BLOGGER_PHOTO_ID_5330125000293426322" border="0" /></a><br /><h3>Click on the title for the original LA TIMES publication of this. Then go and make it - if you don't you're a wimp.</h3><br /><br /><div class="firstpara"><p> Mushroom velouté with buttermilk 'blini'</p></div><p><b>Total time: </b>2 hours, 15 minutes</p> <p><b>Servings: </b>8</p> <p><b>Note: </b>Crème fraîche is available at Trader Joe's, Whole Foods, Bristol Farms, Gelson's and most well-stocked markets. </p> <p><b>Buttermilk "blini"</b></p> <p> 1/2 cup flour</p> <p> 3/4 teaspoon sugar</p> <p> 1/2 teaspoon baking powder</p> <p> 1/4 teaspoon salt</p> <p> 1/8 teaspoon baking soda</p> <p>6 tablespoons buttermilk</p> <p>1 egg, lightly beaten, divided</p> <p>1 tablespoon melted butter</p> <p>Oil for the griddle</p> <p><b>1. Combine the flour, </b>sugar, baking powder, salt and baking soda in a medium bowl. Combine the buttermilk, 2 tablespoons beaten egg and the butter in a small bowl. (Set aside the remaining egg for use in the soup.) Make a well in the center of the dry ingredients; add the liquid ingredients. Stir just until blended.</p> <p><b>2. Heat a griddle </b>or skillet over medium heat with just enough oil to coat the bottom of the pan. Spoon 1 teaspoon of batter onto the griddle or skillet for each "blini." Cook 30 seconds to 1 minute on each side until both sides are dark golden brown. Repeat until all the batter is used, adding oil to the pan as necessary. Makes about 30 "blini." Reserve in a warm place until ready to use. </p> <p><b>Soup and assembly</b></p> <p>4 tablespoons butter, divided</p> <p>1 cup diced leeks</p> <p> 1/2 cup diced celery</p> <p>1 teaspoon minced garlic</p> <p>1 pound cremini mushrooms, trimmed and sliced</p> <p> 1/2 pound oyster mushrooms, trimmed and sliced</p> <p>6 cups chicken broth</p> <p>1 small bay leaf</p> <p>1 (2-inch) sprig fresh rosemary</p> <p>1 tablespoon flour</p> <p> 1/4 cup heavy cream</p> <p> 2 tablespoons beaten egg (reserved from blini recipe above)</p> <p>Salt</p> <p>White pepper</p> <p> Scant 2 tablepoons crème fraîche</p> <p>1 teaspoon thinly sliced chives</p> <p>8 sprigs parsley</p> <p><b>1. Melt 3 tablespoons </b>of the butter in a large sauce pot over low heat. Add the leeks and celery and sauté about 5 minutes, stirring often, until tender. Add the garlic and cook 1 minute, or until the garlic is fragrant.</p> <p><b>2. Add the mushrooms </b>and sauté until all the vegetables are tender, about 10 minutes.</p> <p><b>3. Add the chicken broth</b>, bay leaf and rosemary and bring to a boil, then reduce the heat and simmer, loosely covered, for 45 minutes. Remove bay leaf and rosemary. </p><div class="blogger-post-footer">(c)StinkySQL</div>Anonymoushttp://www.blogger.com/profile/12957398167771699029noreply@blogger.com0tag:blogger.com,1999:blog-6998389186688540891.post-31287205362730565852009-01-19T15:58:00.000-08:002009-01-19T16:01:30.015-08:00Why we need code reviewsThe ever diligent programmer P noted this bit of code today:<br /><br /><ul><li>throw(new ArgumentException(errorMessage, "It is a very twisted intersection!"));</li></ul>I would hate to be the person reading through the error logs a year from now ...<div class="blogger-post-footer">(c)StinkySQL</div>Anonymoushttp://www.blogger.com/profile/12957398167771699029noreply@blogger.com0tag:blogger.com,1999:blog-6998389186688540891.post-67417301277199005222008-12-18T14:23:00.000-08:002008-12-18T14:27:39.487-08:00Simplify Simplify Simplify<span style="font-family: verdana; font-weight: bold;">Here is the code as found ::</span><br /><blockquote>private string FormatTime(object DateTimeValue)<br /> {<br /> string result = " ";<br /> if (DateTimeValue != null)<br /> {<br /> DateTime dt = DateTime.Parse(DateTimeValue.ToString());<br /> if (dt.Hour < 10)<br /> result = FILLER_NUMBER + dt.Hour.ToString() + ":";<br /> else<br /> result = dt.Hour.ToString() + ":";<br /><br /> if (dt.Minute < 10)<br /> result += (FILLER_NUMBER + dt.Minute.ToString() + ":");<br /> else<br /> result += (dt.Minute.ToString() + ":");<br /><br /> if (dt.Second < 10)<br /> result += (FILLER_NUMBER + dt.Second.ToString());<br /> else<br /> result += dt.Second.ToString();<br /> }<br /><br /> return result;<br /> }<br /></blockquote><br /><br /><span style="font-family: verdana; font-weight: bold;">Here is the refactored version::</span><br /><br /><blockquote>return DateTime.Parse(DateTimeValue.ToString()).ToString("HH:mm:ss");</blockquote><div class="blogger-post-footer">(c)StinkySQL</div>Anonymoushttp://www.blogger.com/profile/12957398167771699029noreply@blogger.com0tag:blogger.com,1999:blog-6998389186688540891.post-50636318304412145722008-12-12T09:58:00.000-08:002008-12-12T10:14:07.371-08:00The wheels of the object go round and roundNotice that if dsSTData were null you will allocate it, but not use it to look up the ThingyMin :)<br /><br /><blockquote>public int ThingyMin<br /> {<br /> get<br /> {<br /> int _ThingyMin = 0;<br /> if (dsSTData == null)<br /> {<br /> this.dsSTData = ONAME.ProdName.Common.Business.CONAMESystemDataList.STs;<br /> }<br /> else<br /> {<br /> foreach (System.Data.DataRow row in sSTData.Tables[this.DEFAULT_TABLE].Rows)<br /> {<br /> if (Convert.ToInt32(row[0]) == this._STID)<br /> {<br /> _ThingyMin = int.Parse(row[OllCommon.COL_THINGY_MIN].ToString());<br /> break;<br /> }<br /> }<br /> }<br /> return _ThingyMin;<br /> }<br /> }<br /> <br /></blockquote><div class="blogger-post-footer">(c)StinkySQL</div>Anonymoushttp://www.blogger.com/profile/12957398167771699029noreply@blogger.com0