« first day (1042 days earlier)      last day (3273 days later) » 

15:00
@Vogel612 No, I was searching for the () -> {} part. You can't be the first to write that.
@Mast RAS Syndrome
eh, it's like OOP programming
or aspect-oriented AOP
TDD-driven is the best though
oh cool I was actually able to remove it after cleaning the duplication at the other call site
-1
A: Generating 'Decent' numbers

Ezequiel González GarcíaThe problem is this A Decent Number has the following properties: Its digits can only be 3's and/or 5's. The number of 3's it contains is divisible by 5. The number of 5's it contains is divisible by 3. If there are more than one such number, we pick the largest one. Ouput in console Print the...

help; answerer "explained" his answer...
via... translating it to english.
@Pimgd That's both NAA and VLQ IMO.
15:06
Thanks for clarifying. Unfortunately it's still an independent solution that doesn't relate to the OP in any way and, as such, doesn't constitute a code review. — Mat's Mug ♦ 6 secs ago
@Mast loop the answer
"how do you find" -> "I think there might be room for improvement."
language barrier
Just install your OS in English and you'll learn soon enough.
Kaz
Kaz
@Mat'sMug New project's finished (2k LoC). I decided *not* to post the whole thing this time ^^
15:12
lol
Kaz
Kaz
Correction, 1.6k LoC written directly for this project, plus another 1.6k LoC of general methods I keep adding to.
No harm in uploading the 1.6k general methods with a small part of the other 1.6k as example use-case.
2
0
Q: (^|)(Get|Total|Aggregated|Summary|Data|Report) - #NamingIsHard

KazThe following is the top-level procedure for aggregating, analysing and reporting my company's submitted business from 2015 - present. Reviewing the entire project is unfeasible, so I am just seeking opinions on Variable/Method naming and general readability. For reference, CLS_Data_Report is a ...

0
Q: Can my cache be more thread safe?

poixenI have been working on a cache that can handle multiple reads at the same time, but the write is blocking. Is this code overkill by using a ConcurrentHashMap and a ReentrantReadWriteLock? Could I get away with just the lock? Are there any other optimizations I could make. Papa Bless! public...

The devs like you, they raised the character limit once already for you. Let's do it again!
4
@CaptainObvious Holy mother of titles...
The status 99 part is... Legacy, the application owner doesnt remember. — Reaces 2 mins ago
15:15
@CaptainObvious trust me when I tell you. either it's thread-safe or it's not. there's no such thing as "somewhat thread-safe".
3
@CaptainObvious wat
@CaptainObvious gettotalaggregatedsummarydatareport-namingishard
URL does not like you.
3
@Mat'sMug actually... there kinda is.... sometimes.
lalalalalala... my rubberduck doesn't agree
the three dreaded words strike again
@Mat'sMug well you're doing funky stuff in half-global state..
@Vogel612 can you glance over my answer to that SQL one and see if that's what you had in mind?
15:18
@Vogel612 rebooting system now?
@Vogel612 I'm open to ideas :)
it's not global, it's not singleton, it's constructor-injected in SingletonScope. define funky.
2
@Mat'sMug Superman coding
@PinCrash looks awesome
Is it a global? Is it a singleton? No! It's constructor-injected!
15:19
I'm seeing stars.
4
Kaz, is that you?
@Pimgd that's 4 words, if you mean what I think you mean
no I'm talking about "possibly race condition"
I just uploaded 2k commits to a remote repo. took TFS 2 hours to download each changeset. Took 3 minutes to upload it to a remote Git repo. TFS vs Git.
@Vogel612 Ah, you mean "safe code thread"
@Vogel612 "Possibly your location" hahah, loved that one
err
Kaz
Kaz
15:20
@Mast A justified assumption, but alas, I am out of stars.
@Kaz now you are
@Mat'sMug as soon as I get Rubberduck to run on my machine, I can try to take a look and venture into the dangerous abyss of multithreading
such conditions, Race PITA. to debug a
6
I really need to see it work and have that "ah-HA!" moment
15:22
do threads have needles
no but they sting anyway
2
friday comedy in 2nd monitor is best
0
Q: while loop with comma operator verses duplicate code verses "break;"

MichaelAfter reading a great answer about the comma operator in C/C++ (What does the comma operator do), I wanted to know which is the most readable, maintainable, preferred way to implement a while loop. Specifically a while loop whose condition depends on an operation or calculation, and the conditio...

@Captain it's "versus", not "verses"
15:25
also it's stub code
Kaz
Kaz
I feel like my naming is getting slightly too verbose: KeepOrRemoveArrayRowsWhereComparisonIsTrue()
while(s.len() > 5)  // might be false the first pass
{
   //do something
   read_string(s); // subsequent calls to update the condition
}
also it's closed
The hammer was faster than me.
while(1)           // this looks like trouble
{
   read_string(s);
   if( s.len() > 5 ) {
       break;     // hmmm, where else might this loop exit?
   }
   //do something
}
VTC broken code they don't work the same
15:25
@Pimgd Yuck.
@Kaz no you're doing too much stuff at once
Or in a method name is a huge red flag
@Kaz wat
split keeping and removing into separate methods
@Kaz KeepOrRemoveMatchingArrayRows
and suddenly you have KeepWhere()and RemoveWhere()
15:27
Like, what the hell is WhereComparisonIsTrue without an argument
^ that
Kaz
Kaz
I left the arguments out, because that would be long
long cat func is long
figures.. Your method is doing too much
that's why the arg-list is long and that's why the name is long
KISS :)
SortByProvidedArgumentInAscendingDirection(/*no arguments*/)
Mr. Programmer, why did you leave the arguments out?
"Because it'd make the function signature too long"
wut
Kaz
Kaz
15:29
@Pimgd 'Public Function KeepOrRemoveArrayRowsWhereComparisonIsTrue(ByRef sourceArray As Variant, ByVal colIndex As Long, ByVal operator As ComparisonOperator, ByVal comparisonValue As Variant, ByVal hasHeaders As Boolean, ByVal keepOrRemoveOnTrue As KeepOrRemove, Optional ByRef arrayOfRemovedRows As Variant) As Variant'
Satisfied?
Yes, very much so.
@Kaz hear that? that's the sound of a puppy dying
4
It sounded more like a few rodents and a lawnmower to me
Could you extract the comparison into its own function, and call that? (or pass it around to the big sub (if VBA allows (which it may not)))
@Kaz how about "filterArrayRowsWhereComparisonIsTrue" returning 1 array
and then being able to remove the the array
like some sort of "subtract this array from the array you have"
keepOrRemoveOnTrue As KeepOrRemove
so it picks one of the two on true
and it picks neither on false
15:32
@Kaz Baaaad! Bad bad bad bad!
@PinCrash that would require first order functions, which VBA doesn't really have
s/doesn't really/really doesn't
2
Kaz
Kaz
@Mat'sMug TS
@Mat'sMug call by name?
@Vogel612 Hey, no namecalling!
15:33
you Pimgd!
@Vogel612 works
You Vogel six one two!
@Mat'sMug that's not really first order functions, but it's closer than java was 'til 8
lol, hear that JAVA?
on that note, Phrancis is right.
you should extract comparison operator and comparison value into a separate Predicate object
Kaz
Kaz
15:35
@PinCrash There is a separate comparison function for actually comparing values.
Ooh that's nice
You might not be able to do function pointers
Kaz
Kaz
@Vogel612 That sounds, interesting.
but that doesn't stop you from using strategy pattern
10
Q: Generating and calling code on the fly

Mat's MugDelegate This class module defines what I'm calling, in this context, a Delegate - here a function that can take a number of parameters, evaluate a result, and return a value. Close enough to the actual "delegate" thing I find. Example usage Set x = Delegate.Create("(x) => MsgBox(""Hello, "" & x

somewhat relevant / possibly useful overkill
also, @Kaz you'll be happy to hear that Rubberduck 2.0 will help you experiment with renaming functions on a whim. 1.4.3 might already do it, but so many bugs have been fixed since July that I don't even consider 1.4.3 release-ready...
Kaz
Kaz
@Mat'sMug Considering I had to uninstall it to get my VBA projects to run properly again, I'm tempted to agree with you.
15:39
:(
Kaz
Kaz
(might not have been Rubberduck's fault directly, but removing it did certainly fix the imminent problems)
then it's RD's fault.
You hear that @RubberDuck?
@Mat'sMug is shifting blame
If the problem looks like a duck, walks like a duck and sounds like a duck, it's probably not made of rubber.
3
Going to rob the hardware store, going to be fun.
15:41
...
if the police calls, we'll quote you on that
What if the hardware store calls?
lol...
it seems the web-presence of the newest rightmost right-wing party in Germany has been hacked :D
@Mast Not yet. I have lots of ideas. For some things, a collaborator would be helpful to keep things moving along.
friday 16:45
time to start the sprint
codereview.stackexchange.com is for improvements of working code; StackOverflow is for improving broken code. — Blazemonger 1 min ago
16:05
0
Q: If Not ComparisonIsTrue(thisPost, ComparisonOperator.Equals, goodCode) then Me.Answer

KazThis is a follow-on to a global enum for comparison operators. I wanted to pass a logical expression E.G. >= someValue as a parameter to a function, so I made an Enum and an accompanying function to analyse logical expressions. Is my approach a good way to implement this functionality in VBA? ...

@CaptainObvious !true, why not false?
Kaz
Kaz
@Pimgd Good point
adjusted answer...
... wondering whether goodCode is a constant
but it can't be because good code supports change
now we're getting into Matchers..
that's complicated
16:09
How Can Code Have Morals If Human Morality Is Undefined
@Pimgd it can't....
that's the inherent problem with Asimov's laws of robotics
So how do you know it's Good Code, then?
Maybe it's evil.
if it has no morality it's neither Good nor Evil.
it just is
Maybe it wants to be good but it has to perform fast so it can make enough money to feed its family, even sacrificing correctness in a few corner cases
it just has to, in order to survive, even if some people don't make it into Arstotzka
Hail Arstortzka.
Papers, Please
16:13
=D
jailing people because your son needs medicine after you couldn't afford heating
0
Q: Filtering Arrays by values in a specific Column

KazThe following function, as evidenced by its name KeepOrRemoveArrayRowsWhereComparisonIsTrue is probably trying to do too much. How can I better structure/refactor/split it to be cleaner whilst retaining the original intent: "Here's an array, filter it based on the values in this column"? Pub...

don't hate the player, hate the player's algorithm
I'm voting to close this question as off-topic because it's not about non-functioning code. This is more approriate for CodeReview but check their guidelines first. — Paulie_D 24 secs ago
Kaz
Kaz
I think, at this point, I'm probably out of functions I can post without overlapping my previous questions today.
16:17
@CaptainObvious FGITW answer goooo
okay now to look at it for real
@Kaz you really want a FGITW for that OR in your method name?
What the hell.
that code
can you do boolean equals in VBA
ahhhh vba syntax is hard
4
I'll just write stupid code instead
0
A: Filtering Arrays by values in a specific Column

Pimgd Select Case keepOrRemoveOnTrue Case KeepOrRemove.keep removeCounter = 0 For ix = startRow To UB1 sourceValue = sourceArray(ix, colIndex) If IsNull(sourceValue) Then sourceValue = 0 If IsNull(comparisonValue) Then...

There you go
            Dim remove as Boolean
            remove = False

            If keepOrRemoveOnTrue = KeepOrRemove.remove Then
                remove = True
            End If
ewwwwwwww
lol, semicolons in VBA
@JeroenVannevel lulz
@Mat'sMug I call that VB#
VBA is hard
it's like doing everything you've been thought not to do
16:26
Assuming this all compiles and works correctly, it looks like it might fit better on CodeReview.SE. — Jerry Coffin 7 secs ago
remove = False is redundant
... can't I just
Dim remove as Boolean = keepOrRemoveOnTrue == KeepOrRemove.remove
you know, nice and short java-ish
but you could do
16:27
"IFF"
@Pimgd that's ternary
Dim remove as Boolean: remove = (keepOrRemoveOnTrue = KeepOrRemove.remove)
^ actually you shouldn't need the colon...
Also dear lord the font on that place
@Mat'sMug yoink
IIRC you can initialize dimmed variables directly...
16:28
not in VBA
in VB.NET, but not in VBA/VB6
@Vogel612 but what if they're bright
IMO VBA's biggest problem is that it's using the same token for comparison and assignment.
other than that it's a very decent [although dated] language
VBA is taking Code Reuse the wrong way
Select Case
@Pimgd no...
Case A
Case B
16:30
you're taking VBA Code Reuse the wrong way
They're not reusing code, they're reusing keywords
that's because "switch" has "witch" in it
2
@Vogel612 Oh, but you do!
@Mat'sMug agreed there! I can ignore a lot of it's flaws, but that one.... it's evil and ambiguous and wrong.
especially if you're writing an EBNF grammar for the damn thing
s/R/F
=;)-
16:33
whatever
Extended Backus-Naur Form, yea yea
whatever .g4 format is
that's just a type 2 Chomsky in disguise
Vogel do you use german keyboard layout
16:34
yea I do, why?
I recently saw a picture which showed a Y in the bottom left
is that KWERTY?
@Pimgd correct
@Mat'sMug QWERTZ
but it was a shot from the back, so you saw it upside down
I had to google tons
omg and I thought azerty was frakked
16:35
right beside <>|
but eventually
I have a question directed @ people who work in corporate teams... if anyone fits that bill here
hmm so it's just Y<->Z
@Mat'sMug "U"A"O
.... right, I have ctrl+shift disabled at work.
@Mat'sMug and umlauts where you have braces
16:36
You don't have Control
You have a Struggle instead
@Vogel612 that's like the fr-CA layout
can you guys who work in multiple teams see other projects? like if you are in team A and work on project A, can you see project B which is being worked on in team B?
or whatever Strg stands for
@DanPantry depends...
some projects in the issue-tracker are public, some aren't
... also what's up with shift... down...?
16:37
in general only related teams see related projects
@Vogel612 So I work in internal apps and I have a colleague who works in customer facing stuff. Both projects use the same technology. But I can't see their project, and they can't see mine.
@Pimgd that's CAPS
@DanPantry that sounds like a stupid idea
Which sucks because as they use the same tech, we can't knowledge share
17:05
wow... 3 answers today.
I'm on a spree
@Vogel612 Nice!
Nice @Vogel612
0
Q: Need comments on my own thread pool using boost::thread

duong_dajgjaI would like to make a portable thread pool using boost::thread. Some one could tell me to look at boost::thread_group and boost::asio. I know, but I am not really familiar with these things so I don't know if they are suitable for my purpose. Please give me comments on what I supposed to do her...

in VBA Rubberducking, 32 mins ago, by Vogel612
coverage is back
in VBA Rubberducking, 1 min ago, by Vogel612
and it dropped by a measly 20%
#fun
lol
So, my credit limit increased to £1k. I guess I can buy a Mac now
17:18
more like you can get screwed over by the bank CC company even more now
That too
What is the point of having LastUpdate datetime fields in tables if the only way they will ever be accurate is if you manually update them each time you write to a record. /rant
@PinCrash cough TRIGGER cough
it's probably better than attaching a history-table on everything
17:22
@PinCrash ? ;D
I tend to like the history tables, but for all the wrong reasons (out of necessity)
@DanPantry TS
@PinCrash I have DateInserted and DateUpdated columns in ALL my tables. But the only write operations happening on my DB's happens overnight with an SSIS package. During the day, only SELECT is done on them.
DateInserted and DateUpdated are nothing but an annoyance in a transactional db. they're tremendously useful in a data store though </BoldAndProbablyWrongStatement>
17:33
yesterday, by Vogel612
In the latest news, people are discussing var for java...
@Donald.McLean me too!
@Mat'sMug lol - no writes during business hours yeah right ;D
the writes happen in the source systems
the operational DB isn't even a database
it's a file-based system written in BASIC in the 80's and running on a linux box
youch
that's the very definition of legacy right there
yup
and it's being maintained/modified DAILY
17:39
Do I even want to know how Sage comes into this mess?
@Mat'sMug That is almost as old as my mother.
Not as old as me - as old as my mother.
@DanPantry that doesn't make me much younger...
@Vogel612 lol, Sage is used by the accounting dept. I need to make a process to transfer purchase orders from that legacy system into Sage.
> A final note is that the word var is proposed to be a reserved type name and not a Java keyword. This means that code that uses var as a variable, method, or package name will not be affected; code that uses var as a class or interface name will be affected (but these names violate the Java naming conventions anyhow)
that's dumb. Java tries to be like C#, and fails miserably.
0
Q: Saving and Loading data with SQLite

Mike HuntI'm in the process of learning SQLite in C# and I've come up with some generic methods for finding and updating data. I would appreciate any pointers with the design of my methods and/or my SQL syntax. FYI: I'm using System.Data and Mono.Data.SqliteClientfor C# Mono 2.0 (Unity3D). Here is an ex...

        using (var dbCommand = dbConnection.CreateCommand ())
        {
            dbCommand.CommandText = string.Format ("SELECT {0} " +
                                                   "FROM {1} " +
                                                   "WHERE {2} = @whereValue", selectHeader, tableName, whereHeader);
@Mat'sMug meh..
17:43
@CaptainObvious I don't think that's how you're supposed to do this...
@PinCrash go write an answer ;)
Surely C# has prepared statements... right?
@Mat'sMug Java draws inspiration from C# and adjusts it to fit into the Java ecosystem better
@PinCrash of course
PreparedStatements can be obtained from Connections IIRC
Gotcha, found the doc for SqlCommand.Prepare on MSDN
the introduction of var in C# didn't break any existing code, respectful or not of naming conventions.
17:48
I'm voting to close this question as off-topic because It is about working code and should ask at codereview.stackexchange.comJens 34 secs ago
@Mat'sMug I strongly challenge that
one does not introduce a new keyword named var without breaking some variable names in code-bases
if you're using var as a variable name in your codebase, then you're already doing something else wrong
100
A: Why can I create a class named "var"?

Sam Holdervar is not a keyword according to this list. it is a contextual keyword, so from the context the compiler is be able to decide which is your class and which is the contextual keyword, and no confusion arises. a contextual keyword is: used to provide a specific meaning in the code, but it is...

17:49
@AlienHerbNite correct, but unfortunately var is incredibly common
@Mat'sMug so it's strictly speaking not a keyword in the original sense...
keyword is "contextual"
Actually, variables named var won't break
sidenote: the behaviour described in the JEP is exactly that of a contextual keyword
this line of code compiles:
something that seems absent from the Java implementation, yet is crucial cornerstone of C#'s
17:50
var var = 10;
@Mat'sMug no keywords in themselves are not contextual.
there is contextual keywords.
and there is reserved words
then the feature is half-baked
@Mat'sMug you just want to hate on it, right?
var f = () -> { };
^
(lambda expression needs an explicit target-type)
^^ fail
var f = (Runnable) () -> {};
the whole idea of introducing var in C# was to allow the concept of anonymous types
var fun = () => {};
the whole idea of introducing var in Java seems to be to halfway mimick C#
> Cannot convert lambda expression to type 'Program.var' because it is not a delegate type
same problem
java steals from c#, c# steals from f#, f# based on ocaml, ocaml ded
2
17:54
@JohanLarsson meh...
which part is meh?
@Mat'sMug is that inherently wrong?
@JohanLarsson c# stealing from f#
especially since it existed before f#
seriously?
@Vogel612 not necessarily, but where are the anonymous types?
in general all major languages are making a move into the functional direction
@Mat'sMug not sure what you're getting at...
17:56
Let me know when C# steals whitespace indentation from F#.
aka the very reason for the existence of var in C#...
I'm lloking forward to when records are stolen
@Mat'sMug I'm sorry you'll have to explain that to me a little... what is an anonymous type?
Will remove one of the sad parts of c#
var foo = new { Name = "Bob" }; // what type am I?
@Vogel612 Name one feature added to c# after f# that is not ~stolen~.
Steal is a poor word, of course it is good to use nice things.
@Mat'sMug something extending Object

« first day (1042 days earlier)      last day (3273 days later) »