July 7, 2017 at 4:41 am
DesNorton - Friday, July 7, 2017 2:45 AMEirikur Eiriksson - Thursday, July 6, 2017 6:56 AMWe can always make this a little more interesting
😎DECLARE @Num INT =15;
SELECT
ISNULL(UNCOMPRESS(NULLIF(SIGN(@Num % 3),1) + 1181317754),N'')
+
ISNULL(UNCOMPRESS(NULLIF(SIGN(@Num % 5),1) + 1114995322),N'');...and now the interviewer is crying😛
Indeed. You have introduced me to a new SQL function, yet I cannot find any documentation on it.
Could you please point me in the direction of some documentation on the UNCOMPRESS function.
I am only able to find info on COMPRESS and DECOMPRESS which are SQL 2016 functions. However, the UNCOMPRESS seems to work on my SQL 2014 instance.
UNCOMPRESS is an undocumented internal function that unpacks a binary to a string format, does the same as CONVERT with the format parameter set to 0.
This code I posted is obviously an exercise in obscurity 😉
😎
July 7, 2017 at 4:48 am
My problem with FizzBuzz is I hardly ever have reason to use the symbols (like the modulo operator) in my current job. So I literally don't know them. I'd either need a BOL copy available to me to resolve the question or I'd do some over-engineered wacky CASE statement (after changing the INT to a NUMERIC so I could check the digits after a decimal) that would probably get me dropped from the interview queue.
On the other hand, I also wouldn't be claiming to be a SQL developer or an expert. While I do some SQL development, I'm a DBA, not a developer.
July 7, 2017 at 5:14 am
If the candidate knows the syntax, great. If not, I am expecting them to say something like "I do not use it often, so I do not know the syntax. However, in pseudo code, I will do it like this."
By the time a candidate gets to a face-2-face interview, they have already undergone a telephonic interview, and been given a spec to produce some WORKING code in a limited time period. The spec provides a scenario, and table design, with some sample data. It also provides a set expected outcome.
July 7, 2017 at 5:18 am
DesNorton - Friday, July 7, 2017 5:14 AM..... The spec provides a scenario, and table design, with some sample data. It also provides a set expected outcome.
....if only all the questions on this site did this 😀😀
________________________________________________________________
you can lead a user to data....but you cannot make them think
and remember....every day is a school day
July 7, 2017 at 5:30 am
Brandie Tarvin - Friday, July 7, 2017 4:48 AMMy problem with FizzBuzz is I hardly ever have reason to use the symbols (like the modulo operator) in my current job. So I literally don't know them. I'd either need a BOL copy available to me to resolve the question or I'd do some over-engineered wacky CASE statement (after changing the INT to a NUMERIC so I could check the digits after a decimal) that would probably get me dropped from the interview queue.On the other hand, I also wouldn't be claiming to be a SQL developer or an expert. While I do some SQL development, I'm a DBA, not a developer.
If I was the interviewer, I wouldn't mind telling you which is the modulo operator as it's an uncommon operator. Your alternative solution wouldn't drop you from the interview as it shows that you can find different options to achieve things. I'd also wouldn't ask this for a position that's not focused on development.
July 7, 2017 at 5:42 am
One of the resumes I'm looking at says he has 20 years of "expert level experience." It's a pretty impressive resume, but the last job he had ended in May. Given the dearth of good DBAs in Jacksonville and the serious need for them (really, there are more jobs than there are good DBAs around here), my first thought was "Why is an expert over a month without a new job?".
Major red flag there for me, given the current job market. If it were the other way around, few jobs but lots of skilled DBAs, I wouldn't be asking myself that.
July 7, 2017 at 6:03 am
Brandie Tarvin - Friday, July 7, 2017 5:42 AMOne of the resumes I'm looking at says he has 20 years of "expert level experience." It's a pretty impressive resume, but the last job he had ended in May. Given the dearth of good DBAs in Jacksonville and the serious need for them (really, there are more jobs than there are good DBAs around here), my first thought was "Why is an expert over a month without a new job?".Major red flag there for me, given the current job market. If it were the other way around, few jobs but lots of skilled DBAs, I wouldn't be asking myself that.
'Major red flag' seems like a bit of an overreaction. Maybe he went on holiday for a month, to recharge.
The absence of evidence is not evidence of absence.
Martin Rees
You can lead a horse to water, but a pencil must be lead.
Stan Laurel
July 7, 2017 at 6:30 am
Brandie Tarvin - Friday, July 7, 2017 4:48 AMMy problem with FizzBuzz is I hardly ever have reason to use the symbols (like the modulo operator) in my current job. So I literally don't know them. I'd either need a BOL copy available to me to resolve the question or I'd do some over-engineered wacky CASE statement (after changing the INT to a NUMERIC so I could check the digits after a decimal) that would probably get me dropped from the interview queue.
There's a way to do it without modulo, using SQL's default of integer division. Not particularly clear what you're doing and why though.
DECLARE @Num INT = 12
SELECT (@Num/3) * 3 - @Num, (@Num/5) * 5 - @Num
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
July 7, 2017 at 6:35 am
UNCOMPRESS is an undocumented internal function that unpacks a binary to a string format, does the same as CONVERT with the format parameter set to 0.
And I'm sure figuring out int representations of any 4-symbol world come natural to you.
On an interview you'd easily put correct numbers into your code, just for amusement.
_____________
Code for TallyGenerator
July 7, 2017 at 6:40 am
ChrisM@Work - Thursday, July 6, 2017 8:08 AMEd Wagner - Thursday, July 6, 2017 7:59 AMEirikur Eiriksson - Thursday, July 6, 2017 7:02 AMGrant Fritchey - Thursday, July 6, 2017 6:40 AMThom A - Thursday, July 6, 2017 6:07 AMGilaMonster - Thursday, July 6, 2017 5:55 AMDesNorton - Wednesday, July 5, 2017 11:13 PM@Grant FritcheyI believe that congratulations are in order, sir.
Or condolences, whiskey and a shoulder to cry on. 🙂
How about a monkey Shoulder?
Now we're talking!
Should go nice with Ed's pig shoulder
😎
(from the smoker :D)It turned out great. The shoulders had one of the best crusts I've ever developed, pulled easily and had great flavor. The pork loin had a nice, deep smoke ring and, because I smoked it to temperature, didn't dry out at all. My grand experiment was smoked macaroni and cheese and it got rave reviews. All in all, the many-hour vigil was well worth it.
A few weeks ago now I picked up the same smoker Neil Burton was raving about and since then I've had the chance to fire it up three or four times. Each time has been quite a learning experience, especially maintaining a low, steady temperature. Some of the results have been spectacular, but only the chicken so far. Whole legs soaked overnight in spices and maple syrup were particularly good smoked with oak logs, as was a large corn-fed chicken, spatchcocked.
I'd love to know how you do a whole pork shoulder, it sounds just awesome - but if the small-ish joint I tried is anything to go by, you can say goodbye to crispy crackling, which is highly prized over here.
I'm more than happy to share my recipe. I have to get offline to go do some work on my house, but I'll get back online tonight.
I never made it to a computer last night, but I'm done.
I start with a whole boneless pork shoulder, patted dry. I first rub it with kosher salt. Other than flavor, this helps to bring water-soluble proteins to the surface of the meat.
I then coat it liberally with a rub (a mixture of spices and herbs) - you can make it yourself or buy one. I use a combination of salt, thyme, smoked paprika, chili pepper, black pepper and brown sugar. Depending on your taste, you can add cayenne and other flavors. I'm sure search engines will yield lots of rub recipes, but you'll learn over time what you and your family enjoys most.
For the fire, I like apple wood because it provides good flavor, but also because I have a couple of large, old apple trees in my front yard that supply wood. However, you can use apple, pear, hickory or just about any other smoking wood. I find that in my smoker, oak tends to burn hotter than I like, so I avoid it. The wood should be well-dried. I start the fire and let it go for 20 to 30 minutes to get up to temp. Plan on adding wood every couple of hours throughout the cooking process. I also use a dual-probe BBQ thermometer (https://www.amazon.com/Ivation-Long-Range-Wireless-Thermometer/dp/B00ANCXJR6) to monitor the temperature of the air inside the smoker. The controls on it could be better, but it works. There are others available.
I then set the shoulders right on the grate and let it go. My target temp for the air inside the smoker is 200 F to 210 F. I think 230 F is too hot. I want to smoke it low and slow for that great smoked flavor. I keep underlining the word air because I'm not monitoring the temperature of the meat. The meat will be cooked to temperature long before the smoking is done, but I smoke by time. I go for about 14 hours, but you can pull it after 12 hours if you're going to serve it a day or 2 later. The reason for the very long time is that you want to break down all that connective tissue in the shoulder. The long, low heat breaks down the collagen into gelatin. It lets you pull it apart with two forks and produces that great texture that's famous in good BBQ.
When it's done, take it off and let it rest, covered with aluminum foil, for an hour on the counter. If you're going to serve it another day, cover it well and put it in the fridge. To reheat it, add enough water to your roasting pan to come between 1/4 and 1/3 the way up the shoulder. Add the shoulder and bake at 300 F for a couple of hours. When done, don't throw away the water, which has been transformed into a smokey broth. To "pull" the pork, simple shred it using two forks. Depending on the crust (also called bark) you've developed on the exterior of the meat, you might need to cut it in half and pull it from the inside. Be sure to pull or cut up the crust and mix it in with the rest of the pulled pork. If you like, you can sprinkle some of the smokey broth over the pork and mix it in. If not, it's a serious flavor base for homemade BBQ sauce.
For shoulders, I go by time. For cuts like pork tenderloin, I go by temp (145 F) because they'll dry out if you go longer. Tenderloins can be reheated the same as the shoulder, but don't overcook them; I use that same probe thermometer in the center of the tenderloin.
To address the issue of sauce, for me, it's always optional. I have a bottle or two available and let each individual decide for themselves at dinner.
I know this is a long post with a lot of info and I hope it wasn't too long. The key points are to rub it well, smoke it low and slow, let it rest and pull it while it's hot. I know that 12 to 14 hours is a lot of time, but for me, it's worth it. I learned a lot by doing it the first time. Enjoy!
July 7, 2017 at 6:40 am
Brandie Tarvin - Friday, July 7, 2017 5:42 AMOne of the resumes I'm looking at says he has 20 years of "expert level experience." It's a pretty impressive resume, but the last job he had ended in May. Given the dearth of good DBAs in Jacksonville and the serious need for them (really, there are more jobs than there are good DBAs around here), my first thought was "Why is an expert over a month without a new job?".Major red flag there for me, given the current job market. If it were the other way around, few jobs but lots of skilled DBAs, I wouldn't be asking myself that.
Maybe interviewers keep asking him the FizzBuzz question. 🙂
I wouldn't consider that a red flag. There are all sorts of reasons he isn't employed yet; commute, type of work, or, as Phil said, maybe he's taking advantage of some down time.
July 7, 2017 at 6:43 am
Eirikur Eiriksson - Friday, July 7, 2017 4:41 AMUNCOMPRESS is an undocumented internal function that unpacks a binary to a string format, does the same as CONVERT with the format parameter set to 0.
This code I posted is obviously an exercise in obscurity 😉
😎
Thank you.
So, who has a list of undocumented functions ????
July 7, 2017 at 6:44 am
GilaMonster - Friday, July 7, 2017 6:30 AMBrandie Tarvin - Friday, July 7, 2017 4:48 AMMy problem with FizzBuzz is I hardly ever have reason to use the symbols (like the modulo operator) in my current job. So I literally don't know them. I'd either need a BOL copy available to me to resolve the question or I'd do some over-engineered wacky CASE statement (after changing the INT to a NUMERIC so I could check the digits after a decimal) that would probably get me dropped from the interview queue.There's a way to do it without modulo, using SQL's default of integer division. Not particularly clear what you're doing and why though.
The idea in my head is to find out if there is a remainder after dividing by 3 or 5 or 15. If everything after the decimal is zero, I can assume it divides evenly. If there are other numbers, I assume it's not evenly divisible by these numbers.
Of course, your simplier solution didn't occur to me. So now I'm feeling particularly ridiculous for trying to over-engineer this whole thing.
July 7, 2017 at 7:19 am
DesNorton - Friday, July 7, 2017 6:43 AMEirikur Eiriksson - Friday, July 7, 2017 4:41 AMUNCOMPRESS is an undocumented internal function that unpacks a binary to a string format, does the same as CONVERT with the format parameter set to 0.
This code I posted is obviously an exercise in obscurity 😉
😎Thank you.
So, who has a list of undocumented functions ????
I'm not even sure that Microsoft has one. :hehe:
July 7, 2017 at 7:24 am
Luis Cazares - Friday, July 7, 2017 7:19 AMDesNorton - Friday, July 7, 2017 6:43 AMEirikur Eiriksson - Friday, July 7, 2017 4:41 AMUNCOMPRESS is an undocumented internal function that unpacks a binary to a string format, does the same as CONVERT with the format parameter set to 0.
This code I posted is obviously an exercise in obscurity 😉
😎Thank you.
So, who has a list of undocumented functions ????
I'm not even sure that Microsoft has one. :hehe:
I know they haven't documented DBCC TIMEWARP(). Nowhere...
Viewing 15 posts - 59,161 through 59,175 (of 66,738 total)
You must be logged in to reply to this topic. Login to reply