For me, if the "if" is only one line, I will bracket it up too. It keeps things from "leaking". Also, it reminds me of my BASIC days. If "else" only has one line, I'll bracket it too.
if (foo) {bar()} else {baz();}
I should be using a ternary, but I can't parse those right
I had the worst time with them (so simple seeming, right?) until I hit on:
Question ? Yes : No (At least the Swift pattern). Something in my brain went "Ooooooh okay!" then.
For me, if the "if" is only one line, I will bracket it up too. It keeps things from "leaking". Also, it reminds me of my BASIC days. If "else" only has one line, I'll bracket it too.
if (foo) {bar()} else {baz();}
I should be using a ternary, but I can't parse those right
I had the worst time with them (so simple seeming, right?) until I hit on:
Question ? Yes : No (At least the Swift pattern). Something in my brain went "Ooooooh okay!" then.
I like to format them as:
Question
? Yes
: No
+1
Options
Monkey Ball WarriorA collection of mediocre hatsSeattle, WARegistered Userregular
I love the ternary operator, but I get why they are controversial, and if I am working under a style guide or a language that forbids them, I can live with that.
"I resent the entire notion of a body as an ante and then raise you a generalized dissatisfaction with physicality itself" -- Tycho
I love the ternary operator, but I get why they are controversial, and if I am working under a style guide or a language that forbids them, I can live with that.
I don't mind them for simple things, but if you're nesting a bunch of code in a ternary I think they are messy and become hard to read very fast.
e: And yes, if's as expressions is a nice language feature.
I love the ternary operator, but I get why they are controversial, and if I am working under a style guide or a language that forbids them, I can live with that.
I don't mind them for simple things, but if you're nesting a bunch of code in a ternary I think they are messy and become hard to read very fast.
e: And yes, if's as expressions is a nice language feature.
I think they're great for expressions, like the rvalue in an assignment or a cout.
Basically, if I'm going to do the same action and the conditional just determines what value I pass into the action, a ternary helps make the "verbs" clear.
this is a shot in a million, but in MSSQL Server, has anyone ever heard of a situation where an MSSQL Server database could fail to properly execute a stored procedure due to the weight of the parameters sent to the procedure, and do so without any apparent error?
We've got a legacy stack that stores images in an MSSQL instance, and about one in a thousand or so times, the images will fail to record (it will just make an empty row with a primary key and no other data)
We've put NUMEROUS layers of "make sure these images exist, have bytes, etc" between the client application and the database, but we still get occasional random empty rows
this is a shot in a million, but in MSSQL Server, has anyone ever heard of a situation where an MSSQL Server database could fail to properly execute a stored procedure due to the weight of the parameters sent to the procedure, and do so without any apparent error?
We've got a legacy stack that stores images in an MSSQL instance, and about one in a thousand or so times, the images will fail to record (it will just make an empty row with a primary key and no other data)
We've put NUMEROUS layers of "make sure these images exist, have bytes, etc" between the client application and the database, but we still get occasional random empty rows
Hmmmm, not really gonna happen at that level silently.
You sure it’s the SP actually inserting the empty row?
this is a shot in a million, but in MSSQL Server, has anyone ever heard of a situation where an MSSQL Server database could fail to properly execute a stored procedure due to the weight of the parameters sent to the procedure, and do so without any apparent error?
We've got a legacy stack that stores images in an MSSQL instance, and about one in a thousand or so times, the images will fail to record (it will just make an empty row with a primary key and no other data)
We've put NUMEROUS layers of "make sure these images exist, have bytes, etc" between the client application and the database, but we still get occasional random empty rows
Hmmmm, not really gonna happen at that level silently.
You sure it’s the SP actually inserting the empty row?
We are reasonably certain, because the table also contains other data, which is consistent and traceable. We know this data comes from our users, and there is only one way our users can interact with this server.
In addition to the numerous checks on the client application which sends the images over, on the ASP.NET code that actually calls the SP, we've written a check which verifies that the param is in fact not null and has bytes at the exact moment prior to calling the SP
and yet, every so often, we see rows where these columns end up NULL
Someone's made a 3d engine in pure CSS. (yes, just CSS, no JS or anything. It works much the way you'd expect, except that he put a bunch of extra effort into get lightmaps and shadows to work, and it looks a lot more impressive as a result):
Well, let the grind begin. I am reading The Algorithm Design Manual by Skiena currently. Anyone have any interview study tips for someone looking to work for a company that starts with G and rhymes with frugal?
I expect this will take me a few months before I'm ready. Current plan is to make it through Skiena and possibly pick up Crack the Coding Interview. My initial goal is to be able to do leetcode hards in 45 minutes, possibly cut it down to 30 minutes if I can.
Steam: Spawnbroker
0
Options
Monkey Ball WarriorA collection of mediocre hatsSeattle, WARegistered Userregular
I'm only just getting into programming, partly because my boss left. He built our web tools and now I'm the only one left in my department. So I'm frantically trying to figure stuff out. It's good in a way because I've been wanting to learn to program, but his way was pretty old school - the most recent web app was built with VB and ASP and it uses frames - and I don't particularly want to put my efforts into learning older tech. But I have to to keep stuff running!
Anyway, I found a function in the DAO.vb file (which I guess is what ends up in the DLL?) that I need to make a minor change to, but I don't want to deploy the whole solution to the web server because I have no idea if it had any undeployed changes that would break things.
(I should also mention he didn't use source control OR a test server. I've created a test site and am seeing about versioning)
Anyway, all I want to do is get the minor change out to the server by itself. Is there a way to do that? You can't seem to right-click > publish (I'm using Visual Studio) like you can with the asp files. I tried to build and then just drop the DLL over the old DLL on the server (on the test one, mind), but no dice.
I'm sure it's something very easy and obvious but I just don't have the knowledge structure/building blocks to understand it yet.
If it's old ASP you have to deal with IIS stuff to redeploy it I think. Restarting IIS sometimes does what you need it to do I think.
IIS restart should indeed do what you want once you've got the DLL in the right place.
With regards to the unknown amount of undeployed changes that could screw with things, you might want to look into the testing technique known as Golden Master. It's a bit of a ball ache and time consuming to run, but it's your best bet at testing legacy code. Especially since you have no versioning available.
I don't know how to tell if it's old SAP or not, but I can say that I've deployed the whole project on the test server and it worked okay and my changes were reflected, I just don't want to do it on the live server that way because of the aforementioned chance of untested changes that were being made.
Or maybe I'm misreading and you mean if I manually drop the DLL out there I'll need to restart the IIS?
I'll give that Golden Master a google and see what it's about, thanks!
I also noticed there is an option in VS where I can right-click and "replace file with server version" so I could probably just do that to the ASP files and be pretty safe if it works as it sounds.
So this is more macro construction than programming, but man am I happy with the kludged together thing I just built in LaTeX.
I'm building a "State of the Art" survey for my research, and there are a few requirements.
1: I need a table that has all of the systems that I survey examined in the taxonomy that I'm creating.
2: Those systems should be numbered, so that I can reference them elsewhere in the text.
3: I need a way of noting when I'm referencing the systems from the table that's distinct from a normal citation (e.g. saying "The system seen in x (# on the table)")
The way that a colleague of mine did it was to have the system number circled, so that it's easy to tell when I'm referencing a system that's on the table.
So because I hate doing the tiny stuff like cross-checking the number of the system to make sure that I'm referencing correctly, I wanted something that would:
1: Automatically keep track of each system's row number in the table.
2: Be able to reference that number elsewhere in the document
3: Not be a pain in the ass to use.
The end result is like 12 macros linked together where I just need to type in "\tableref{Title}{RefTitle}", where the reftitle is the more easily-referenced title (e.g. "Full Name of System" might be shortened to "Sys"). The \tableref macro uses a different circle-drawing macro that uses the normal \ref command with the keyword to reference the output of the macro that the table runs that references the built-in row-counting macro. It's a horribly beautiful mess of stuff
It's going to hopefully save at least the hour and a half that I spent making it.
Khavall on
0
Options
Monkey Ball WarriorA collection of mediocre hatsSeattle, WARegistered Userregular
edited February 2019
I have very fond memories of carefully crafting math homework LaTex files in college, because my whole life every math homework I've ever turned in has been barely readable chickenscratch, but I found LaTex and xypic and now LOOK HOW BEAUTIFUL THE MATH IS, EVERYONE HAIL OUR FEARLESS LEADER DONALD KNUTH.
Monkey Ball Warrior on
"I resent the entire notion of a body as an ante and then raise you a generalized dissatisfaction with physicality itself" -- Tycho
I have very fond memories of carefully crafting math homework LaTex files in college, because my whole life every math homework I've ever turned in has been barely readable chickenscratch, but I found LaTex and xypic and now LOOK HOW BEAUTIFUL THE MATH IS, EVERYONE HAIL OUR FEARLESS LEADER DONALD KNUTH.
I did my Algorithms and AI classes with Word's equation tool. Probably should've learned LaTex instead
0
Options
Monkey Ball WarriorA collection of mediocre hatsSeattle, WARegistered Userregular
I have very fond memories of carefully crafting math homework LaTex files in college, because my whole life every math homework I've ever turned in has been barely readable chickenscratch, but I found LaTex and xypic and now LOOK HOW BEAUTIFUL THE MATH IS, EVERYONE HAIL OUR FEARLESS LEADER DONALD KNUTH.
I did my Algorithms and AI classes with Word's equation tool. Probably should've learned LaTex instead
Earlier on I did that as well. It will do quite well in a pinch. But later my linear algebra prof introduced me to LaTeX and I never looked back.
Monkey Ball Warrior on
"I resent the entire notion of a body as an ante and then raise you a generalized dissatisfaction with physicality itself" -- Tycho
Posts
I had the worst time with them (so simple seeming, right?) until I hit on:
Question ? Yes : No (At least the Swift pattern). Something in my brain went "Ooooooh okay!" then.
aka 1 crash after 2.2 weeks of heavy use in primitive conditions
looks like the hardest longest rewrite of my life has paid off
and it just seems like programmers went from thinking "there's no way the user will be that much of a jerk" to "the user is a total jerk holy shit"
https://github.com/arialdomartini/morris-worm/blob/master/worm.c#L26
nice
*it's probably actually a decompilation, not the original source
I don't mind them for simple things, but if you're nesting a bunch of code in a ternary I think they are messy and become hard to read very fast.
e: And yes, if's as expressions is a nice language feature.
Nice
?
I think they're great for expressions, like the rvalue in an assignment or a cout.
Basically, if I'm going to do the same action and the conditional just determines what value I pass into the action, a ternary helps make the "verbs" clear.
I sometimes feel like people take "concise" way too far and forget about readability.
I feel a mention of https://en.wikipedia.org/wiki/Obfuscated_Perl_Contest is topical.
Edit: Or worse, from the C inspiration for it:
That is (or at least is an excerpt of) a chess engine.
The above calculates pi by examination of its own area.
*goes to BDSM site during work hours*
I was not proud of it but I wanted to do it just because
We've got a legacy stack that stores images in an MSSQL instance, and about one in a thousand or so times, the images will fail to record (it will just make an empty row with a primary key and no other data)
We've put NUMEROUS layers of "make sure these images exist, have bytes, etc" between the client application and the database, but we still get occasional random empty rows
Hail Hydra?
http://steamcommunity.com/id/pablocampy
Hmmmm, not really gonna happen at that level silently.
You sure it’s the SP actually inserting the empty row?
Insert obligatory "isn't all Perl obfuscated?" joke
The exact quote is: "The only language that looks the same before and after RSA encryption."
I believe this is called "i care more about clean git commits than readable code"...
That's one of those teeny things I like about Go, it actually requires a trailing comma on the last item in a multi-line array/whatever.
We are reasonably certain, because the table also contains other data, which is consistent and traceable. We know this data comes from our users, and there is only one way our users can interact with this server.
In addition to the numerous checks on the client application which sends the images over, on the ASP.NET code that actually calls the SP, we've written a check which verifies that the param is in fact not null and has bytes at the exact moment prior to calling the SP
and yet, every so often, we see rows where these columns end up NULL
https://keithclark.co.uk/labs/css-fps/nojs/
For a good laugh, check it out in Edge.
firefox is technically correct but it runs like utter ass
edge runs fine it just doesn't support some very unused CSS texture mapping that breaks it
I expect this will take me a few months before I'm ready. Current plan is to make it through Skiena and possibly pick up Crack the Coding Interview. My initial goal is to be able to do leetcode hards in 45 minutes, possibly cut it down to 30 minutes if I can.
Oh wow. I just assumed that's how it was, because lol CSS. But, yes, it runs much smoother in Chrome than Firefox.
Cmon Firefox, you need to step it up a notch!
I'm only just getting into programming, partly because my boss left. He built our web tools and now I'm the only one left in my department. So I'm frantically trying to figure stuff out. It's good in a way because I've been wanting to learn to program, but his way was pretty old school - the most recent web app was built with VB and ASP and it uses frames - and I don't particularly want to put my efforts into learning older tech. But I have to to keep stuff running!
Anyway, I found a function in the DAO.vb file (which I guess is what ends up in the DLL?) that I need to make a minor change to, but I don't want to deploy the whole solution to the web server because I have no idea if it had any undeployed changes that would break things.
(I should also mention he didn't use source control OR a test server. I've created a test site and am seeing about versioning)
Anyway, all I want to do is get the minor change out to the server by itself. Is there a way to do that? You can't seem to right-click > publish (I'm using Visual Studio) like you can with the asp files. I tried to build and then just drop the DLL over the old DLL on the server (on the test one, mind), but no dice.
I'm sure it's something very easy and obvious but I just don't have the knowledge structure/building blocks to understand it yet.
Thanks!
IIS restart should indeed do what you want once you've got the DLL in the right place.
With regards to the unknown amount of undeployed changes that could screw with things, you might want to look into the testing technique known as Golden Master. It's a bit of a ball ache and time consuming to run, but it's your best bet at testing legacy code. Especially since you have no versioning available.
http://steamcommunity.com/id/pablocampy
Or maybe I'm misreading and you mean if I manually drop the DLL out there I'll need to restart the IIS?
I'll give that Golden Master a google and see what it's about, thanks!
I also noticed there is an option in VS where I can right-click and "replace file with server version" so I could probably just do that to the ASP files and be pretty safe if it works as it sounds.
I'm building a "State of the Art" survey for my research, and there are a few requirements.
1: I need a table that has all of the systems that I survey examined in the taxonomy that I'm creating.
2: Those systems should be numbered, so that I can reference them elsewhere in the text.
3: I need a way of noting when I'm referencing the systems from the table that's distinct from a normal citation (e.g. saying "The system seen in x (# on the table)")
The way that a colleague of mine did it was to have the system number circled, so that it's easy to tell when I'm referencing a system that's on the table.
So because I hate doing the tiny stuff like cross-checking the number of the system to make sure that I'm referencing correctly, I wanted something that would:
1: Automatically keep track of each system's row number in the table.
2: Be able to reference that number elsewhere in the document
3: Not be a pain in the ass to use.
The end result is like 12 macros linked together where I just need to type in "\tableref{Title}{RefTitle}", where the reftitle is the more easily-referenced title (e.g. "Full Name of System" might be shortened to "Sys"). The \tableref macro uses a different circle-drawing macro that uses the normal \ref command with the keyword to reference the output of the macro that the table runs that references the built-in row-counting macro. It's a horribly beautiful mess of stuff
It's going to hopefully save at least the hour and a half that I spent making it.
I did my Algorithms and AI classes with Word's equation tool. Probably should've learned LaTex instead
Earlier on I did that as well. It will do quite well in a pinch. But later my linear algebra prof introduced me to LaTeX and I never looked back.