« first day (314 days earlier)      last day (2866 days later) » 

00:01
RELOAD!
[retailcoder/Rubberduck] 2 commits. 2 opened issues. 6 issue comments.
[rolfl/MicroBench] 1 commit.
[skiwi2/Duga] 3 commits.
3
[Vogel612/BloggingPlatform] 1 opened issue.
00:13
@Duga @Duga wins!
 
1 hour later…
01:48
@RubberDuck what's that?
Commit message on my project for class.
> What was the hardest part of this assignment?
> Writing code that I'm going to throw away when I could be working on my open source project.
No lie. I actually submitted that.
Grumpy duck
I almost gave them this.
> Ignoring all of the Resharper warnings so the n00bs don't fail me because they don't understand the code.
01:50
hahahaha
say, how do you like R# so far? I mean, what features are you using the most?
Extract method. By and far my favorite feature.
I can inline something without losing my groove and click click extract it.
you know it's baked in VS even without R# right? ;)
I also really like that it tells me when I'm doing something stupid with an Enumerable.
ah, yes
Yeah, but R# makes it sooooooooo easy.
01:54
tried Ctrl+T yet?
Unless there's a keybinding I don't know of.
Ctrl+R,M
@Mat'sMug Did now!
I think that one is my favorite. GoTo anything
I like that.
I really haven't had a ton of time to just play with it.
Clean up usings is really nice too.
01:55
and Alt+Shift+L, to locate your current code file in the solution explorer
Hack away until it's done, then just clean the whole works at once.
I'm almost to a point where I just trust it to clean up everything everywhere without even looking.
Hmmmm...... maybe I shouldn't have turned this in.
        private static T GetSelection<T>(IEnumerable<T> collection)
        {
            Console.WriteLine("Select {0}", typeof(T).Name);

            var i = 1;
            foreach (var item in collection)
            {
                Console.WriteLine("[{0}] {1}", i, item.ToString());
                i += 1;
            }
            Console.WriteLine();

            int index;
            if (int.TryParse(Console.ReadLine(), out index))
            {
                if (index <= collection.Count())
I didn't even think about it, but I bet that's gonna confuse the hell out of whoever grades my homework.
well you have mixed concerns here...
This is what I've been up to by the way.
Yeah. I know. I thought about it, but I wanted to keep it simple.
I already spent too much damn time on it.
I'd extract all these static methods into their own class
and make them non-static
Not allowed to use classes yet. (Says the guy who used generics for it)
02:02
this is too harsh for a CR answer, right?
> I don't mean to be harsh, but the whole code looks over-engineered with good intentions, but you seem to have written factories and abstractions for the sake of writing them more than for solving an actual problem.
heck, no it's not.
No it's not.
And brother, I'd kill to be bored right now. Lol
02:21
I'm 1 vote short of a [sql] tag badge...
oh look, a post!
0
A: Classes for reading data from Sql Server into objects

Mat's Mug public readonly int DatabaseID; public readonly int SchemaID; public readonly int TableID; public readonly string TableName; public readonly DateTime CreatedDate; public readonly DateTime ModifiedDate; public readonly string Description; I like that they're immutable. Very very much. But fiel...

:D
 
3 hours later…
04:54
hmm ..@Duga seems to be offline
05:46
#VBA #Rename #Refactoring is real. And it's shipping next release. Soon. Very soon. http://t.co/D02DLyHROS
 
2 hours later…
07:52
0
Q: Select Case w/Public Functions - Need efficiency

fonzy16I am looking to enhance my VBA skills and efficiency with the code below. It currently executes at about 20 minutes. I just recently learned how to use public functions but this project is very robust and I haven't been able to make it more efficient. I've cut off two Case requirements {Auto -...

 
2 hours later…
09:37
@Mat'sMug Really? :(
Website isn't reachable indeed
@Mat'sMug lol
 
3 hours later…
12:40
@StackExchange dupe, but that one has an answer on it. Flagged it. Ugh.
12:51
@Rossco wrote a very nice review though.
1
A: Select Case w/Public Functions - Need efficiency

RosscoI like to start off by saying that your formatting is pretty good. Well done. But there are a few things to simplify your code and make it easier to understand. From there it will be easier to manage and even improve the performance. Also, the use of functions to solve smaller problems is goo...

 
1 hour later…
13:59
@RubberDuck Thought that looked really familiar, and yes, @Rossco did write a nice answer
14:19
I think they might have blocked chat at work =(
Whew... all good now.
@RubberDuck Yeah, I was worried for a minute, too. Much better that SE is having issues than work is blocking!
14:45
Who has had experience using Shared workbooks in a production environment?
@cheezsteak I have. Don't do it. Use a google doc instead....
@RubberDuck Sounds about right. I've used Google docs, haven't tried shared Excel...
I understand that's probably not an option, not everyone is using Google Apps.
So, what's up @cheezsteak?
@RubberDuck Google doc's is not an option.
I figured as much.
So, let me guess. Either the workbook moves at the pace of a snail, or you need some VBA behind the scenes?
14:57
Basically all of the scripting that I did has been deployed to the rest of the team in a shared workbook.
So file assignments and progress is tracked in this shared workbook.
However there have been some glitches were I will add some records and save then come back and it's they're gone.
You're not going to like what I have to say.
So, I won't. I'll just leave this here.
2
A: Excel 2013 collaboration with Excel 2003

teylynShared workbooks are dangerous. They will become corrupt, and once they show problems, they are impossible to troubleshoot. Excel was not designed for simultaneous multi-user editing. If you require that functionality, look for another tool. Excel is not the solution. One way to aggravate the he...

I am just concerned how well Excel is handling conflicts with rows moving and being deleted.
Basically, it's not and this tool should have been built in Access or something similar.
figured as much.
Sorry man. I don't like bearing bad news.
15:03
Most people are using 2010 but at least one person is using 2013
That really isn't the problem then. Shouldn't be at least. They're both xml format.
The problem is Excel is really really bad at the shared workbook thing.
If you need to lock records while they're being edited, you need a database, not a spreadsheet.
I'll see how much I can do in Access. It's about time I moved to it anyways.
time to write a powershell script to just make hourly backups
Good luck buddy. I have a feeling you're gonna need it the next few days.
How well does VBA code port to Access from Excel?
Assuming it doesn't involve Range etc
@cheezsteak I'm not sure about 'porting', but I'm developing Access code that generates Excel spreadsheets and PowerPoint slides, so it's all gravy.
In Access, Dim XLObject as Excel.application
You can then treat XLObject just like you would your "application" when coding in Excel
15:16
If I have a bunch of VBA classes that have nothing to do with Excel, how well can they move to Access?
Like VBEX
Ssl error from GitHub?!
No warranties expressed or implied, but I think you'll be OK.
If they're explicitly tied to Excel function, the XLObj should take care of it with some minor recoding.
@cheezsteak They'll move perfectly fine to Access more than likely. Think of them more as VB6 code than excel code.
The only trouble you'll have is stuff that's working directly with the Excel Object model. But then there's this
5 mins ago, by FreeMan
In Access, Dim XLObject as Excel.application
You'll just need to be sure you include the reference to MS Excel X.0 Object Library in your Access application.
Whatever version(s) of Excel you have on your machine
16:20
I just answered a VBA zombie... but I'm capped for the day and I need checkmarks to get to 200... is @Chrismas007 here?
16:37
@Mat'sMug Maybe that will help. You earned it.
Awesome! ...just 5 short now :)
Confirmed that we were loosing data whenever someone sorted and deleted rows. If i delete row 1 and some else reverses the sorting then when we both save the data on the last row might be lost.
@cheezsteak Have you considered using Access instead of Excel? Data tables are much less prone to that kind of problems than a spreadsheet would... I think anyways.
2 hours ago, by cheezsteak
I'll see how much I can do in Access. It's about time I moved to it anyways.
16:55
Ahh ok, good man.
Never used access before though. i can write simple query's but that's it.
Every developer needs SQL experience though
Time to do it with a gun to my head
Just one word of warning on Access. No matter what MS says, Access is good for 5-7 concurrent users.
Get to 15 and you'll start getting data corruption.
At that point, it's time to roll the back-end onto a SQL server of some sort & use Access for the front end only.
That ^
Speaking of coding with a gun to your head.... NSFW
17:01
We grew an Access DB at my last place from about 10 concurrent with occasional data issues to > 50 concurrent. Fortunately around the 15 user mark, we got the data onto SQL Server.
Still had issues until I wrote a .bat file to give each user his own copy of the Access front end, in addition to the server back end
Typically giving each user their own front end will let you extend the number of concurrent users out pretty far.
I think we had about 20 or 25 (active) users on the access back end at once point.
With a distributed front end. Didn't have any trouble, things just slowed down a bit.
17:18
Would have been interesting to give that a try.
The server back end opened up stored procedures, functions, and views, though, so there was definite benefit gained there, too.
Why can't companies just invest in databases? :(
2
@FreeMan
@skiwi Damn good question. Why can't mine invest in free software?
Ohhh wait...
You're stuck with closed-source software that just happens to be friends with your boss
Closed source software that was written before my boss' boss was born.
Not the new system yet...
Just running old @Duga software for the Github webhook there
Do you know if it's possible to direct webhooks to a static IP address that tries to connect to multiple hosts in case one is down?
17:29
... interwebz sayz what now?
@RubberDuck Huh?
@skiwi Oh. I just know next to nothing about the web to be totally honest.
Just enough to be dangerous with a copy of Aptana.
How do I flag an SO question to be moved to CR?
You have to flag for moderator attention.
OK, thx.
17:52
Look at that! #Rubberduck helps clean up some code... https://twitter.com/stackcodereview/status/587718847437938688
I'm going to start mailing this link to my co-workers...
One of them just sent me a book via chat and has still yet to even remotely describe the error or the code causing it.
I'm ignoring the chat messages at this point.
@StackExchange HashTag-Rubberduck now!
@Mat'sMug Now? I've been doing that for ages... =;)-
Oh! Wait.... @StackExchange is following the hashtag!
Lol! No, I RT'd :)
Wait, is it?
18:07
LOL.. I'm tired.. leave me be. I was confused.
18:22
@Rubberduck203 #Rubberduck code ìnspections are pretty handy for reviewing #VBA code on @StackCodeReview! http://codereview.stackexchange.com/a/87103/23788
#Rubberduck-FTW
why can't I paste a url into the Twitter phone app?
because..... reasons
well it sucks!
@Mat'sMug from here, your comment The solution is to declare variables as close as possible to their usage, and to avoid that wall-of-declarations at the beginning of a procedure.
isn't it?
18:32
Maybe I'm just old, but having all the Dim at the top of a procedure makes the most sense to me. Makes it easier to find them if you're not sure what you're looking at, especially if you use something fairly early and often in a function
not if your procedure spans 2 pages...
if your code is made of procedures & functions that do one thing, you can't have a wall of declarations at the top...
Maybe it's just based on what you're used to. I hate having Dim buried in the middle of code somewhere, it's like surprise!
sometimes it takes a fair bit of code to do just one thing.
If your function is 5 or 6 lines of code + declarations, I'm okay with putting them all at the top, but.... at the size of 100 or 200 LoC? No. Declare them close to their use.
^^ that
There have actually been studies about how reducing the "live time" of variables reduces defects in code.
18:35
^^ not applicable to VBA though
Why is my book not handy so that I can look up the numbers?
@Mat'sMug How so?
because locals are scoped at procedure, regardless of where you declare them. you could put them all at the bottom if you wanted..
Harumph! I guess I'm just old, then.
wait no, not true
they're scoped at procedure, but assuming Option Explicit they need to be declared before they're used.. even though Dim isn't an executable statement. #DamnVBA
#JustSayNoToHashtagsAtSO
18:41
@FreeMan I used to declare at the top, too. they taught that in school, that's how I learned, too. But C# #CSharp changed everything.
;)
is more StackExchange-ish, right
Is that a general C thing, or specific to C# that you've applied to everything else?
general .net design guidelines - good for too, so I don't see a reason for it not to be good for and as well.
@Mat'sMug It's not necessarily about the scope when I say "live time".
I can see having malloc() and free() as close to each other as possible in C, but not necessarily for other languages, where you don't have an explicit free()
good for and pretty much every other language I know of (I don't know /)
18:47
It's the distance between where it's declared and it's last usage measured in line count.
it's more about readability/maintainability than anything else
Having that space smaller is less chance of inadvertently changing it.
@RubberDuck and to forget it's not used anywhere...
@RubberDuck On pg248, live time is between when the var is initialized & last used, not when it's defined (via Dim in VBA)
That makes sense to initialize a counter right before use. It's odd to me to declare it in the middle of code. Makes pain for my slightly CDO brain...
18:53
I'm not saying to go change all your code @FreeMan. Just backing up my thought process.
I'm human, I don't like change any more than the rest. It was that one statement that struck me as odd.
seems that code is much more organized with all the declarations at the beginning of a procedure, rather than scattered throughout...
19:06
@RubberDuck :)
19:45
@RubberDuck @Mat'sMug Did you see when Hosch was working in SEDE?
(next door)
not really
@sᴉɔuɐɹɥԀ kinda, why?
Man... why is chrome just eating up all the memory?
2
With the possible exception of mashing potatoes, VBA is the best way to do anything. — Gary's Student 18 mins ago
3
I bet I could even mash poatoes given a bit of time and effort.
20:07
Adding my 2c to the flamewar I slept through. ;-)
Code Complete is a great book, I reckon its helped me write much better code.
Also re the declaration-assignment-usage question. Code Complete 2 does have examples in VB.Net supporting its recommendation to shorten variable lifetimes as much as possible.
But you have to keep in mind that VBA is different from most other (modern?) languages in that declaration and assignment are separate things.
@Rossco and I hate that about the language.
In VB.Net you would write Dim meaningOfLife As Integer = 42 whereas in VBA it would be separate statements.
Yeah... that ^
And in dynamic languages there is no declaration.
Unless you do something ugly.
Dim life As Long: life = 42
Which is still technically two statements.
20:11
Yes all of the above.
You out-typing me.
I have considered doing the multiple statement on a single line to make it similar to VB.Net etc. But have questioned whether it is uglier.
Idk how I feel about it. I've done it both ways.
@RubberDuck I tasked him to write a query to return a new user's first question if it was answered within 24 hours. Pretty simple right? :)
@RubberDuck And yes I hate it too. Everytime I come back to VBA it gets me. I write a bunch of code with declaration and assignment and then have to debug it immediately when I try to compile it.
Maybe. I don't know the schema all that well.
20:16
> , MIN(q.Id) AS [Q Id]
You probably shouldn't do that.
It's going to be right 99.99999999% of the time, but there's room for error if it gets reseeded.
Always reviewing
Ah, good point
Anyway, seems straight forward enough.
Here is what he came up with (and data is wrong): codereview.stackexchange.com/questions/87111/…
Way overkill ;)
I'm waiting for him to figure it out by himself before showing him mine
@sᴉɔuɐɹɥԀ Error 404
@Rossco You must not have enough rep to see deleted questions... here:
WITH FirstQs(QCreationDate, PostId, UserId)
AS
(
  SELECT
  MIN(p.CreationDate) [CreationDate]
  ,MIN(p.Id) [PostId]
  ,MIN(u.Id) [UserId]
  FROM Users u JOIN Posts p ON u.Id = p.OwnerUserId
  WHERE (p.PostTypeId = 1)
  GROUP BY u.Id
),

FirstQsA(ACreationDate, APostId)
AS
(
  SELECT
  MIN(p.CreationDate) [ACreationDate]
  ,MIN(p.Id) [APostId]
  FROM Posts p, FirstQs
  WHERE (p.PostTypeId = 2 AND p.ParentId = PostId)
)

SELECT UserId
,MIN(QCreationDate)
,MIN(ACreationDate)
,PostId[Post Link]
,APostId[Post Link]
20:18
ok I thought it might be a privileges thing.
Would be better if it told me that rather than 404 it.
'The page you requested has been deleted...'
Yeah, I get that on SO pretty often
Oh hey @RubberDuck @Mat'sMug are you guys including a code inspection to catch trying to assign a object reference to a variable without using Set? Its probably my #1 mistake since its not necessary in so many other environments.
And I always get a dumb error message (can't remember what it is off the top of my head).
@Rossco I'm not sure if that's on the road-map yet or not.
@Rossco If it's not a compile error, (IIRC it's runtime, right?) ...then it's a very good inspection idea! Only thing is that it might only work with types (i.e. classes) defined in the project, or with variables declared as Object
We welcome any and all feature requests though. =;)-
20:30
...or if there's a New keyword in the assignment
The caveat would be "static" types with a PredeclaredId attribute
..but then if they're define in the same project, RD would correctly pick it up as being a reference type
Yup. This can work. =)
"Runtime error 91: Object or with block variable not set" would be the error message I think
one thing we don't quite handle, is cross-project references.
I mean, the IdentifierReferenceListener isn't taking into account project references, so a project referencing another project.. wait, that hasn't been tested.
> 24+50 downloads BTW
> Next is 108 commits ahead of Master
TTFN
time to... huh?
Sub DoSomething()
    Dim foo As MyClass
    foo = New MyClass
End Sub
This compiles?
yes! I just verified!
Way to drop the ball guys....
Wow.
That should not.
R# picks up a number of compile-time errors without even building - right?
@RubberDuck is #Rubberduck starting to feel like a R# for VBA by now? ;)
It started to feel like R# when you introduced the extract method. I think rename takes it to a whole new level.
20:52
it does
Can't wait to really test that out.
wait till you start using it!
it even renames Textbox1 in the designer ...just by right-clicking Textbox1 in Textbox1.Text = "foobar"
and then Sub Textbox1_TextChanged() turns into Sub RenamedBox_TextChanged()
#Magic
2
1
Q: Assignment of value to variable not working in VBA

j_needs_helpI am currently writing a program that contains a two dimensional newton raphson sub. it starts like this: Sub newton11() Dim x As Double, z As Double, tolerance As Double Dim error_x As Double, error_z As Double Dim iteration As Integer iteration = 0 tolerance = 0.05 x = Range("h19").value z =...

We need an Excel-specific inspection to locate implicit references to ActiveSheet and ActiveWorkbook. These two plague way too much VBA code.
interesting
looks like v1.4 (or 2.1?) will be all about new refactorings :)
21:21
@RubberDuck shouldn't that raise a type error because you aren't using set
@cheezsteak at runtime. #91
which makes it a very valuable Rubberduck code inspection :)
Mile long todo list. Lol. +1 @Mat'sMug. Kill it with fire.
I think I can get some code written after I do my peer reviews tonight.
About damn time
2
hitting the 18th is unrealistic, right?
@Mat'sMug Yeah that's why I asked about it. It gets me every time.
Dim wb As Workbook
wb = ActiveWorkbook
@Mat'sMug Is that using things like Cells(1,2)?
oh, right - Cells is an implicit reference to ActiveSheet, too
21:31
Yeah the macro recorder does that, I like to fully qualify references like that personally.
that and .Select
I've added a footnote to #384
and...
> To further complicate matters...

The inspection's quickfix should reuse the generated sheetReference throughout the procedure, not just at the issue site; it's not uncommon for a procedure to refer to ActiveSheet in several places. The fix should be "procedure-scope" ...heck, if possible, the inspection itself should be "procedure-scope".
Which prompts me to ask whether there is an inspection planned to flag Select lines as a warning to the user (and give them a hyperlink to somewhere useful)?
You might use Select when debugging (I find its easier than outputting cell addresses) but there are limited other uses for it.
nope. up until now we didn't have anything application-specific
Ah of course, I'm thinking too much about Excel.
I'd like to only enable (run) them when the host application is Excel - that'll require a bit of tweaking, but we have that information already
maybe even introduce a new enum, so that we can regroup application-specific inspections by host app in the settings box
21:37
Sounds reasonable to do that grouping.
    - Code Inspections
        - Office
            - CodeQualityIssues
            - LanguageOpportunities
            - MaintainabilityAndReadabilityIssues
            - NamingAndStyle
        - Excel
            - CodeQualityIssues
        - Access
            - CodeQualityIssues
            - NamingAndStyle
...
Yeah Mug. No way I can get SCI done before I get back from Florida at the end of the month. I'll be happy to have it done by my birthday at this point.
and when's your b-day?
ok wtf
TTQW
later!
6/3
Enjoy!
eh, I'm 06/12!
21:44
Hey Gemini!
@j_needs_help are you checking the value while the yellow line is on it, or after you've stepped to the next line? — RubberDuck 19 secs ago
21:55
@Mat'sMug Hahahah

« first day (314 days earlier)      last day (2866 days later) »