« first day (1838 days earlier)      last day (128 days later) » 

12:01 AM
RELOAD!
[rubberduck-vba/Rubberduck] 5 commits. 3 issue comments. 804 additions. 5434 deletions.
[Zomis/xploria-perms] 2 commits. 4353 additions. 3308 deletions.
[Minesweeper] Games Played: 88, Bombs Used: 62, Moves Performed: 13010, New Users: 12
 
 
11 hours later…
10:33 AM
#LateToTheParty
 
10:49 AM
@IvenBach Love it!! Thank you!!
#ditchesStylus
 
11:40 AM
0
Q: How to use dictionaries to optimize VBA code currently using arrays and loops to update a table based on another one?

PBPBSub UpdateManualUpdates() Application.ScreenUpdating = False Dim lookUpSheet As Worksheet, updateSheet As Worksheet Dim valueToSearch As String Dim i As Long, t As Long Set lookUpSheet = Worksheets("Manual price changes") Set updateSheet = Worksheets("Price Build-up") Dim lookUp...

 
12:11 PM
@QuackExchange VtC. Except I can't. (Not enough rep)
flags instead
 
ditto
Welcome to Code Review! Please take a moment to edit your post to 1) properly format the code: select all and press Ctrl+K to add the 4-space indent that formats it as a code block; 2) make the title summarize the purpose of the code, as stated in the watermark text of the title field; and 3) walk reviewers through your code, present it to readers - "code dump" posts don't tend to do very well on this site, where reviewers easily spend 30, 60, 90 minutes and more crafting an answer: tell us about the data, the context, why and how things are done. Cheers! — Mathieu Guindon 1 min ago
Code dumps on CR have always felt like "here crowd, review this!"
I'll spend 5 seconds making my question, and you can spend an hour answering it
 
12:42 PM
 
ahhh I love my console :)=
 
I'm currently on Office 2016 and they're moving us to Office365. Are there any known issues with VBA between the two?
 
evince is19_script1[2345].pdf does what you expect it to
 
where issues = thingsThatBreak
 
you mean aside from the fact that the web office doesn't have it?
 
12:49 PM
well, yeah, that would be a bit of an issue!
recommended reading so I can get a link to the boss to delay the migration until I've managed to prepare?
what's the "web office"?
 
@FreeMan office.com
basically they built everything except access and publisher as webapps and sell it with Office 365
some licenses for 365 don't even include the option to install the client app
 
hrm...
 
which is a shame, because the webapps lack a lot of features compared to the client apps
 
I sure hope they haven't done that to us.
^^ I can only imagine
 
soo ... the client apps still have VBA, the web version doesn't
 
12:53 PM
OK. got it.
 
example lacking feature: You can't edit the animation queues and order in PP-Web
need to click for every single animation
 
That's why they'd say you should use javascript instead
 
javascript instead of VBA?
 
But of course, the full parity isn't there, too.
Yeah
 
yea, because that allows them to do the computation on your machine
everything else would require server involvement, which is $$
 
12:54 PM
oy.
 
In theory, if all your VBA did was calculating stuff or custom formula, it'd be easily ported to JavaScript
 
though they could of course just implement the VBA Runtime in JS, right? 😃 /s
 
consults with kid in college - you taken any javascript classes? Still have the books?
 
but in practice, I think VBA is solemn just VBA - they'll do stuff like interact with filesystem or automate some other application
 
I hope nobody gives any serious JS classes...
 
12:55 PM
Rubberduck365 - realtime transpile VBA to javascript!
 
because the language JS is explained rather easily
 
Hm, don't you want someone to give a serious JS class?
well, the language itself is simple. Its behavior.... not so simple.
 
I'd prefer a proper webdev class
to have a JS only class seems to be not enough to fill a proper uni course
and if you would push it to be a full-fledged class it becomes a trivia class about the quirks of the language and the engines
not really the point of college or uni classes
@FreeMan linkey
 
IDK - I think about the fact that it's very common to bring in 100s of development tools just to work with JS, and if you're using something like TypeScript, you're now quite far away from just vanilla JS. You then have to understand stuff like module pattern among others to effectively debug and troubleshoot JavaScript written by those tall stack of tools
It never really stays "just JS" for very long
And from what I've seen, a common response to a malfunction is just to swap out one JavaScript library for another because they have no idea why it's malfunctioning.
 
yea ... but is that class still on Javascript then?
or on "the web development toolstack and whatever the heck it is on right now"
the problem with JS is that it's fucking garbage for basically everything that it's used for nowadays and it's fiendishly difficult to abstract the quirks of the language
JS is the new PHP, and I still don't understand why people haven't started vocally hating on it in the "mainstream"
relatedly: I'm too young to be such a curmudgeon
5
 
1:07 PM
@Vogel612 thanky!
Internal contacts seem to be hard to come by, but I've found a name and fired off an email to find out what, exactly, they're rolling out to us.
I'm not opposed to learning me some JS (and descending into the above described levels of hell), but I'd like to know that's where I'm going before my existing code just stops working and everything is on fire
"everything is on fire" kinda the very definition of hell, isn't it?
 
@Vogel612 not necessarily... just port VBA to WebAssembly :-)
 
19 mins ago, by Vogel612
though they could of course just implement the VBA Runtime in JS, right? 😃 /s
 
@Vogel612 Good point. Toolchain isn't really language. However, I would not be surprised that compared to other languages, JS needs much more tools just to "work".
 
webassembly would skip JS altogether
 
@this ~heavy sigh
yea, JS is a bit of a clusterfuck in that regard
 
1:15 PM
@mansellan Even if they ported the VBA, you still have the problem of not porting the automation code. That never will be portable.
Can you imagine running Set oApp = New Outlook.Application on a web server?!?
 
heh sure, what's the worst thing that could happen ;-)
 
Do While TRUE
  Set objApp = New Outlook.Application
Loop
^DOS!
 
@this actually, it wouldn't be on the server, it'd be client-side (just without JS fucking things up)
 
@mansellan Oh, okay. So new security holes, then.
@FreeMan Need a collection or dictionary.
 
oh yes. yes indeed. a new sandbox to destroy :-)
 
1:19 PM
the problem with that is: you want to have IO in VBA
 
Set col = New VBA.Collection
Do While TRUE
  col.Add New Outlook.Application
Loop
 
indeed, wasn't a serious suggestion :-)
 
^ that should DOS
(though probably not as fast as other approaches because of Outlook's single-instance quirk)
 
yea, you're just filling memory with the same pointer over and over
 
2:02 PM
oh goody.
Now I get to document & justify all the VBA I've written to be allowed to have the desktop versions so I can continue to support them.
I'm most certain that my management will back me, I just have no idea if they'll try to absorb it into "IT" instead of leaving it with me, or get mad because I've made a "data warehouse" instead of using our official "EDW" (Electronic DW).
le sigh...
I'm getting so stinkin' pessimistic
 
@FreeMan 365 desktop is just a Win32 desktop install of the latest & greatest; VBA isn't affected, but the Excel object model may have members (and features) that don't [yet] exist in the "normal" 3-year releases (e.g. 2016, 2019, etc.)
@FreeMan if you have any VBA code that needs to manipulate more than just the active workbook, you have a rock-solid undefeatable reason to have a desktop install
 
2:20 PM
I'm not worried about my management backing me on it at all. I'm just curious to see what "real" IT thinks of our "shadow" IT.
Plus, now I have to write up some documentation and everyone knows how much programmers love them some documentation! :(
 
@MathieuGuindon MRE?
 
^those can be shockingly not horrible!
Son's in the Army and we had some on a hiking trip when I went to visit.
 
@Hosch250 Nah, it was min-reprex IDK what it is now
 
3:20 PM
Is it just me or this is a... Sql injection framework??
3
Q: Extending functionality of existing classes without breaking consumer code

Aashish UpadhyayHere is a set of classes that are used to build where clause for SQL Server and Oracle for different field types e.g. text, numeric and date. public interface IConditionBuilder { bool CanHandle(FilterAction filterAction); string BuildCondition(SearchCondition filterCondition); } public...

 
3:38 PM
@FreeMan my favorite was always the cheese tortalini
also, never eat the peanut butter
or the eggs
 
@FreeMan Thank @phrancis over at Coding Projects and Vue.js Heaven :)
 
dangit
i randomly joined a new room
thats what i get for clicking on the random stuff you guys put in here
 
@Vogel612 :Shakes-head: Like others at the pond you just got an early head start.
 
4:03 PM
Jun 7 at 16:44, by IvenBach
yesterday, by IvenBach
21 hours ago, by IvenBach
CoworkerWalkingIntoGlassDoor++;
 
snrk.
at some point they have to learn, right?
 
mumble :shrug: mumble mumble
 
aight... time to learn how to properly debug c programs
~sigh
 
Re-reading the post again with knowledge is way different than the first time around.
 
@IvenBach good read but not so helpful when you need to know how to debug X using Y tools.
 
4:12 PM
yea...
 
Debugging VBA? Easy. Debugging C#? Easy. Debugging C/C++... um. I'll have to say I have only have some fuzzy ideas and may involve some flailing
 
mostly I need to work out gdb
but it's getting there
I like how adding debug information to a gcc-compiled program is just adding -g to the compilation args
and gdb just works with it
sigh... and of course it was floating point arithmetic (or rather the distinct lack thereof) again
const float smoothing[3] = { 1/4, 1/2, 1/4 };
^^ @IvenBach question: What's missing there?
 
@IvenBach haha that's awesome
 
@this When one is wholly ignorant as to what's involved achieving the end goal #HHCIB ranks pretty high.
I've only seen C++ code and never tried to understand any of it.
@Vogel612 an explicit cast on each member of the array?
 
@IvenBach almost
the problem is that casting doesn't actually change the result of the calculation...
 
4:26 PM
... srsly
 
got another idea?
 
smoothing[3] contains 4 element?
 
no
it contains 3 elements
the correct fix is to make at least one of the operands in the divisions a float
const float smoothing[3] = { 1/4.f, 1.f/2, 1/4.0f };
 
@IvenBach technically a cast on the operand would have worked. A cast on the expression, OTOH, would be too late.
 
const float smoothing[3] = { clfoat(1/4), ... }; couldn't work?
 
4:32 PM
no, because 1/4 = 0
so it's still 0.0
 
:derp: because Int32?
 
it's c, soo ... because int
 
Wow, nice.
 
But my underlying assumption is that int = Int32.
 
In C#, that would've been double.
I remember dealing with that in C++, though.
 
4:33 PM
I deal with that all the time w/ T-SQL. CAST(lame/dumb AS money) doesn't work, so it has to be CAST(lame AS money)/CAST(dumb AS money). Excessive but it ensures there's no surprises
 
@IvenBach generally speaking that's not a bad assumption, but C is ... weird
 
This time around I had an idea as to what the problem was.
 
because hardware, the C language spec does not state the number of bits in an int
 
Asking me a year ago I'd have probably had no clue.
 
C => a car body with an engine, no doors, no seat belts, no protection from elements, no tranmission
 
4:34 PM
@Vogel612 so an int could be int8, int16, int32, int64 or whatever depending on what you're working with?
 
worse, actually, but yes
 
Spoonfeed me why it could be worse?
C doesn't define what int8 is?
 
well, you're assuming word-sizes of powers of two
 
You could have an int3?
 
A C compiler could (and would) deal with platforms where int is int20
 
4:36 PM
You could have a 3-bit integer.
 
@IvenBach that might be asking for trouble, actually
 
I tend to think of C being more driven by conventions rather than contracts
 
That's another thing you're assuming. You're thinking in bytes. C can work with bits.
 
From that alone I know my big boy pants would just drop all the time with C.
 
that's why when you look at C program, you'll see all kind of custom data types just to avoid those surprises.
e.g. never use jsut int but INT or MY_INT or whatever
 
4:37 PM
#TIL
 
so you end up spending a good time learning conventions of a program.... hence the bare bone car analogy
 
@this int_least32_t is pretty useful
 
everyone's going to be installing their version of tranmissions, seat belts, doors, chassis, etc.
huh. Never saw that one before.
 
Sound like dropping a Ford engine in a Toyota frame with a Dodge transmission...
 
it's the "smallest defined integer type with at least 32 bits"
C99 apparently defined a ton of useful types: en.cppreference.com/w/c/types/integer
 
4:41 PM
@Vogel612 but why "smallest" part, though?
That makes the size indeterminable, doesn't it?
 
well, that's what sizeof is there for, right?
 
I suppose so, but you're now moving stuff to runtime.
 
the smallest part is to allow people to save memory where possible without forcing a specific integer type
no, that's compilation time
because the type must be defined during compilation
 
Oh? The whole time I thought it was a runtime operation
esp. that it's very common idiom in C to pass around the size of a structure as a mean of versioning
 
SE just rolled out a new badge.
 
4:44 PM
@this huh... it is?
 
I see it all the time in Windows API
they would have some kind of structure and they'd add new fields to the end of the structure
let me see if I can find an example
 
that part is clear, but what about removing fields from the struct?
 
I believe in those cases, they would just make it "reserved"
and tell via the documentation to just ignore the field
Particularly this:
> For compatibility reasons, the Places Bar is hidden if Flags is set to OFN_ENABLEHOOK and lStructSize is OPENFILENAME_SIZE_VERSION_400.
for those reserved fields, I bet if you dug up a older documentation of the same structure, it'll tell you what they do but would have worked only in older versions of Windows.
 
5:20 PM
@IvenBach Indeed, I shall thank @phrancis!
 
5:34 PM
"I don't have it that way in the actual code" has to be the single most annoying thing to read in an answer comment on CR
 
@MathieuGuindon are you going to tell me that you can't read others' mind nor project your body into the location where they are at?
;-)
 
IKR?
but the funny thing is that this is the SQL injection framework OP
"my real code doesn't do "'" + value + "'"" ....yeah ok, ....doesn't make any difference whatsoever: this entire code should burn
 
6:00 PM
Sql = "DECLARE @s varchar(255) = '" & myStuff & "';"
Sql = Sql & "EXEC dbo.mySafeStoredProcedure @s;"
conn.Execute sql
#TotallyNotInjecting
 
@Hosch250 ORLY?
 
Two, actually.
 
ORLY, ORLY??
 
I got the silver one twice on CR.
 
FWIW, one of my first questions on SO was a tumbleweed. #FunTimes
 
6:16 PM
Frankly, I'm shocked I've only got one
 
6:42 PM
@this The horror. No rainbow pony welcome and you still went back?
Parents must have raised you to be thick skinned.
 
to be fair, there was a long period of hiatus between that question and my subsequent activity
but I do remember chuckling at it when I got it. it was a fairly obscure question.
 
@this 12 days until an answer and said answer is +6.
That's not what I'd call obscure :)
 
IIRC, tumbleweed was 7 days
and it certainly didn't get up to 6 immediately. That was much more gradual, I think.
like one a year?
 
7:34 PM
In SSIS, I presumed that column mapping was done by column name not column order.
However, it seems that it's done by column order, especially if the file name in the flat file connection manager is parameterized since I cannot see columns once that's happened. is that correct?
 
> The biggest problem with this code, is that it exists
heh, that made me chuckle @MathieuGuindon. Especially liked the fact it came after a bunch of improvement ideas, that was a nice touch :-)
It's 2019, and people are still concatenating SQL. Sigh.
 
and building super-complicated frameworks to do so
 
user image
2
^ would save some time :-)
 
7:49 PM
meh. it's hopeless.
@MathieuGuindon Noted. Yes it doesn't take care of parameters and I don't think it can be changed also. — Aashish Upadhyay 2 hours ago
> I don't think it can be changed
i.e. sunk cost fallacy forces us to use this bloated abomination forever
 
^^ sunk cost fallacy, nailed it
 
at that point you can only wish for bobby tables to happen
 
yeah, at least if bobby tables happens, it doesnt end up on the dark web
unless bobby tables happened after the dark web...
 
FWIW, I had to do something similar (creating a dynamic search thing). Ended up passing the parameters as a XML document, pushing it into a temporary table, which is then joined to sys.columns to verify the parameter name, building dynamic SQL from the temporary table, and using sys.sp_executesql with parameters. That was lot of layers just to avoid concentation directly with user's input. #FunTimes
Even so, I still wonder in back of my head that I've leaked a sql injection attack.
Fortunately, it was for a LAN use, so the concern is less pressing. I'd be sweating profusely had it been a web application.
 
8:19 PM
@MathieuGuindon Your neck vein is throbbing again.
 
Your fiery passion to correct bad code settle down to glowing embers?
 
I don't think it can be changed - read up on the Sunk Cost Fallacy - string-concatenating WHERE clauses is a plague that needs to be eradicated with all the firepower you can throw at it. It will cost more in the long run to keep doing that, than rewriting everything to implement data access code properly, and that's been proven many times over - just ask any company victim of a data breach. String-concatenating WHERE clauses is a very serious security issue. — Mathieu Guindon 14 mins ago
 
@IvenBach eloquent
 
no, I just moved on :)
 
8:21 PM
@IvenBach this is not about bad code... it's about sucky people :D
 
@BigBen That's not a word used on me very often.
 
I mean, short of rewriting the OP's dangerous code, there's not much more I can do. Maybe a "TOLD YA!" in a year's time, we'll see.
 
You could always repsond: "I guess there's nothing to be done now that your tables have been deleted. This post might have helped before that occurred."
Probably comes off as too passive-aggressive though.
 
meh. they know now. what they do with that knowledge is up to them.
 
> See, I like Irish whiskey, and code like this makes me want to order a double. What happens when context.Text is Elizabeth O'Connor? Or Patrick O'Neil?
Oh I'm dying laughing right now.
 
8:27 PM
it's quite a brutal review
 
I don't currently use SQL but I'm always trying to learn best practices.
 
at least they can now run to their manager and say "some random stranger on the Internet is saying there's a massive security issue and we should burn this code with fire"
and then hear "pfft. we've never been hacked before. carry on."
 
^
I hear that far too often. Makes me cry.
 
the only appropriate response to that is "can I quote you on that? on Twitter?"
 
8:40 PM
> PSA: WE CONCATENATE OUR WHERE CLAUSES AND WE HAVE NEVER BEEN HACKED. SQL INJECTION PREVENTION IS A SCAM.
 
8:54 PM
@Vogel612 you there?
 
re-re-watching a series
soo ... basically :)
 
I'm getting some exposure to $PS1 of bash.
ivenbach@workstation MINGW64 ~/source/repos/Git Essential Training/Chapter 10/10_09/explore_california (master)
$ echo $PS1
\[\033]0;$TITLEPREFIX:$PWD\007\]\n\[\033[32m\]\u@\h \[\033[35m\]$MSYSTEM \[\033[33m\]\w\[\033[36m\]`__git_ps1`\[\033[0m\]\n$
 
ohh cool. lots of color
 
I'm trying to tease apart the regex command input.
That's default what bash is configured with.
I'm good with how it's configured. I want to understand that configuration.
 
so the stuff in brackets is setting different colors
 
8:58 PM
linuxnix.com/linuxunix-shell-ps1-prompt-explained-in-detail is my key but I'm not quite there it groking.
Does a set color last until another set color is used?
 
$TITLEPREFIX should be ivenbach@workstation MINGW64
@IvenBach yes
$PWD is the working directory
 
\n is newline?
 
yeap
oh no wait...
 
Is it required to ` escape the [` and ] chars?
 
\u is the user, \h is the hostname
hmm ... soo. Apparently I don't understand PS1 syntax
 
9:04 PM
You'n me both.
 
echo $PS1
%f%b%k$(build_left_prompt)
 
just don't use PS
 
@this nooo, PS is the best
 
:ding-ding: "Round One. Fight!"
 
agh.
 
9:08 PM
hahahhahaha
 
for the record: PS commands and arguments are a mess...
also zsh is just waaaaaaayyyy cooler
 
Well I don't fully understand it but I have a better idea.
 
 
1 hour later…
10:19 PM
Merge conflicts are a lot less mystical now that I know what's going on.
 
10:44 PM
git stash [push [-p|--patch] [-k|--[no-]keep-index] [-q|--quiet]
	     [-u|--include-untracked] [-a|--all] [-m|--message <message>]
	     [--] [<pathspec>…​]]
:click: Counting [ and ] makes it self evident that just git stash is implicitly pushing it onto the stash stack.
@pond again so many thanks for helping me get to this point.
 
11:13 PM
 

« first day (1838 days earlier)      last day (128 days later) »