« first day (700 days earlier)      last day (3316 days later) » 

12:00 AM
There are 1276 unanswered questions
@Barmar And he equally wouldn't understand the protocol at Code Review. Don't recommend bad questions to other sites. Just close them for whatever appropriate close reason. Is this question Too Broad? Is it Unclear? Choose one of those close reasons and don't recommend people ask bad questions on other sites and force other sites to also have to deal with a poor question. — nhgrif 2 mins ago
 
@nhgrif
I'm flagging this answer as a non-answer, as it's really your question. The correct thing to do is to edit your question to include this "answer", and let the community post answers. If you then yourself find a better solution and want to share it, then you can post a self-answer. Stack Overflow isn't a discussion forum, it's a Q&A - we like our questions embedded in the "Question" part ;) — Mat's Mug 2 mins ago
FYI
 
If your intent is to improve the code in this "answer", and the code in this answer is working as intended, then posting this question for a review at Code Review might be a good idea. Please be sure to read our help center first though. — nhgrif 1 min ago
 
That custom close reason is horrendous.
It's only a code review question (borderline) if you see the answer.
If he deletes the answer, does his question stop being a code review question and is ready to be re-opened?
 
0
Q: Guess the Number

Hosch250Continuing with my VB.NET experience, I wrote a quick guess-the-number game. Any improvement suggestions? Module GuessTheNumber Sub Main() Do PlayGame() Loop Until Not ExitGame() Console.ReadLine() End Sub Private Sub PlayGame() Dim minN...

 
if the answer is deleted but the question isn't edited, then the question becomes plain off-topic / "unclear what you're asking"
if the answer is edited into the question (and then deleted), then it's a fine question
 
12:06 AM
I'll write my calculator in C#, if I get time, and port it to VB.
Then post both separately.
 
And that's why the custom close reason is bad.
Because the custom close reason actually has nothing to do with the question.
They're voting to close the question because of an answer.
 
I didn't VTC, I flagged the non-answer for moderator attention although I have enough rep to edit the answer into the question.
 
How does that make sense?
 
it doesn't
 
But editing the answer into the question changes the question.
 
12:08 AM
exactly. that's why I didn't do it and flagged instead
 
I flagged too.
 
23 mins ago, by Mat's Mug
that question is a mess
 
But it's not, not an answer...
His question can be slightly more clear and his answer is a perfectly great answer to the question
 
I flagged the close reason.
 
it's not an answer, it's the question
 
12:08 AM
No...
The question is "Given the following input, I need to generate this output (in PHP)"
 
then it's a gimmeh-teh-codez question and is off-topic
 
It's too broad.
 
The way I see it is it is a good CR Q if the code is in the Q, not the A.
 
exactly
 
Well
you should vtc as unclear since it is unclear.
But if it were edited to what I just said, then it's too broad.
 
12:10 AM
not until I know whether my answer flag helped
 
But it's not a review request, and his answer isn't a question.
 
1
Q: Guess the Number

Hosch250Continuing with my VB.NET experience, I wrote a quick guess-the-number game. Any improvement suggestions? Module GuessTheNumber Sub Main() Do PlayGame() Loop Until Not ExitGame() Console.ReadLine() End Sub Private Sub PlayGame() Dim minN...

 
His answer could make for a question here, but his answer does answer his off-topic question.
 
well, off-topic anyway
 
OK, I'm done with VB for now.
I am MOST CERTAINLY not going to port my app to VB.
 
12:15 AM
If the question is the question, and the self-answer is as intended, then I'd vote to close as too broad, it's a "gimmeh-teh-codez" question. But I'd rather find reasons to keep questions opened, so I deem the self-answer as intended to be part of the question, making it a perfectly fine post, albeit with a NAA selfie answer. But I'm voting to put this post on hold as unclear what you're asking because it's a mess. I'll retract/vote-to-reopen when this question is edited. — Mat's Mug 13 secs ago
 
@Hosch250 This is what main.m looks like for an iOS app in Objective-C
#import <UIKit/UIKit.h>
#import "AppDelegate.h"

int main(int argc, char * argv[]) {
    @autoreleasepool {
        return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
    }
}
entire file.
 
Oh.
I have most of my code-behind in one file.
The rest is in a second, but I am looking into making this a whole separate page.
 
similarly, the Rubberduck entry point merely assigns a private field:
        public void OnConnection(object Application, ext_ConnectMode ConnectMode, object AddInInst, ref Array custom)
        {
            try
            {
                _app = new App((VBE)Application, (AddIn)AddInInst);
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.Message, "Rubberduck Add-In Could Not Be Loaded", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
 
OK, I get the point.
Why do you do it like this?
 
separation of concerns, and abstraction levels
 
12:20 AM
It seems to make more sense to have the .xaml page, the .xaml.cs page, and the pageVM.cs
I have my VM properties in one file, and another file for using them.
 
in a WPF application the entry point is in application.xaml.cs IIRC, right?
 
Yes.
 
there shouldn't be much code there
 
The only changes I made there was a startup prompt to rate the app.
 
hmm
 
12:22 AM
I looked it up on the web, and that is where you are supposed to put it.
I took it off an MSDN blog post.
 
The only time I have ever edited main.m for an iOS project was when I was subclassing UIApplication.
 
OK, I just found another blog post.
This says to load it in the PageLoaded event for the main page.
I'll change this later, supper is going on now.
 
@Hosch250 that means PageLoaded does something that loads it - it doesn't mean you have to write all the code there, right?
 
I'm trying to find where this app-loading conversation started
The way I see it you were talking about something meta and then suddenly out of nowhere you all switched to app-loading
Curious
 
@JeroenVannevel coordinated context-switching ftw
 
12:31 AM
Hosch is posting VB questions. His first snippet which he posted in chat had everything in Sub Main()
...
Did I miss the star-fest?
3
 
LOL
 
...
@nhgrif: the persistent troll
 
@nhgrif - shooting for outspoken ;-)
 
anyone else noticed we're down to 94% answered? #ZombiesAreWinning
 
Woah! What an epic answer!! If you liked answering this question, know that there's Code Review, a Stack Exchange site dedicated to reviewing code in questions all similar to this one, where the OP presents their working code and answerers make it better. See you on CR! :) — Mat's Mug 1 min ago
 
12:40 AM
@Mat'sMug Yes....
 
@Duga stumbled on that one while reviewing my recent flags.. that migrate flag was declined, so I'm hoping to migrate the reviewer instead of the question now
 
yesterday, by RubberDuck
Wait. When did this happen?
yesterday, by RubberDuck
user image
 
12:56 AM
Anyone got a second to help understand an HTML / CSS thing with me?
(i.e. educate me....).
Duga?
 
lol
not sure I can be helpful
 
I see a 45-degree slope redline on a chart, so yeah I guess ;)
 
See the "Show Data" at the bottom left?
Click that.
I want to know why the table is not centered.
 
I'll look at the source in a minute, on my phone atm
 
1:01 AM
Yeah, that won't help ;-)
I am amazed you see the line....
'enable' the slowest series in the legend, and be amazed....
 
@rolfl I know HTML/CSS to a certain level.
@nhgrif Vetoed.
@Mat'sMug I don't need to do anything there, if I want something done when the page is loaded (like a popup), that is the place to do it.
 
Huh, it's not showing at all on my phone.
 
Chrome?
 
Yeah
I get the text/title, and that's it.
nothing that requires JS in order to work.
 
I get everything I can see on my laptop
 
1:05 AM
ffox on phone is ok
 
Chrome on Samsung S4
 
although the animations are slow.
still resizing
rotate phone is a problem.
 
I don't see where you're telling it you want the table centered...
 
@Hosch250 What should margin: 0 auto; do for a table element?
 
@rolfl Not sure exactly, try it. What are you trying to do?
 
1:09 AM
What is vetoed?
 
@Mat'sMug Note, the border of the table is red....
it is centered....
but the rows inside it do not fill the table width.
 
@nhgrif Trying for the job.
 
I see that. but it's the black one you want centered, right?
 
@rolfl Where's the code?
Try padding
 
Ctrl-U
 
1:10 AM
I am on phone at store
 
Drop down the "Show Data" item
Bottom left.
 
You want that centered?
 
.details {
    width: 100%;
    border: 2px solid black;
    padding: 5px;
    background-color: lightgray;
}
IMO would be here
wait no
 
@Mat'sMug - #data, not .details
 
yeah saw that
aren't you missing a #data tr style?
meh, I know nothing
 
1:15 AM
I have flipped the default load system, it loads now as "showing".
 
@rolfl No luck, I think it might be because you load the table with the JS.
 
I have been playing ^^^ it's a
I am actuallly OK to make it left only.......
but I was expecting centered, and there's a weird gap between the table body (shaded yellow now, and the edge.
 
display: float makes it centered on my browser
#data table {
  border:2px solid red;
  border-collapse:collapse;
  display:float;
  font-size:12px;
  margin:0 auto;
  width:auto;
}
just don't ask me why or if it's good practice to do that ;)
#YayFirebug
 
Hmmmm....
that is odd..... I am flummoxed.
At least I now know something more ;-)
I think I will revert it all back to the left margin again.... and just leave it alone.
 
Programming bootcamps... I've never heard of them before.
 
1:28 AM
@Mat'sMug - reload it now....
then, do me a favour - drag the tab out of your tab-bar...
and then resize the window.
make it narrower ... and watch the graphs change.
then click the blue "slowest" checkbox on the left.... and watch it all adjust.
 
that's mesmerizing :)
 
Yeah, there's something to it.....
 
Windows+Left, wait, Windows+Right, wait, Windows+Left, wait, ...
 
OK, abandining trying to figure out the center thing, time to get the scales to have useful units.
It can just stay at the left.
 
if JS and UI interest you, I suggest looking into this framework: dev.sencha.com/ext/5.1.0/examples/kitchensink/#all
 
1:36 AM
I am finding that they don't interest me ;-)
 
lol
 
But, you should see this: github.com/mbostock/d3/wiki/Gallery
 
wow, and I thought I was on to something with my whopping 32 stars!
impressive
 
0
Q: Is this implementation of Quicksort good?

QuincunxFor fun, I decided to implement the quickest Quicksort I could. This is what I came up with. How can I make it better? I know that it's slower for sorted and already reversed lists (through testing), but I'm not certain why. What I do know is that this algorithm reverses the list past the pivot,...

 
ah-HA! one down! NonReturningFunctionInspection false positives - fixed! oooooh yeah!
and ProcedureNotUsedInspection turns out being much, much more complicated than I originally thought it would be
I think I'll just limit it to standard modules. Objects complicate everything.
 
1:51 AM
I sometimes see there are two answers for a question and no votes, doesn't people vote others answers ?
 
I do
but some answerers come from some other SE-site-that-shall-not-be-named and have a ...different mindset
 
I guess not everyone does that,
@Mat'sMug Ah
Drama SE ?
 
lol
 
SO.
 
shhhh!
 
1:53 AM
Yeah, I vote on most of them.
Talking about SE sites, I accidentally typed "codreview.stackexchange.com" a while ago.
It asked me if I wanted to propose it on Area 51.
 
huh?
oh
cod-review
 
Call of Duty ?
 
The site to review Cod, Cod cooking, and everything Cod.
 
if I type "cod" in my browser's address bar it takes me to CR
 
@JaDogg I was thinking this:
 
1:55 AM
If I type 'c' it takes me here
 
@JaDogg right
@Hosch250 that fish is looking at me strange
 
Oh?
 
Fish review
 
fishy-code review
 
1:57 AM
I smell something fishy happening.
Or is it phishy?
 
@Hosch250 only if you're not on the site you think you are ;)
 
@Mat'sMug What if it reviews code used for phishing?
 
yeah, never log-in at codreview
 
Like, open source viruses?
 
@Hosch250 Does my site looks just like facebook ? kinda reviews
 
2:00 AM
lol
 
@Mat'sMug @nhgrif I got the code out of the startup file and into the default page file.
 
I'm about to give up on that one - variable 'description' is never assigned:
Dim description As String
If Not RequestUserInput(prompt:=GetResourceString("AddCategoryMessageText"), _
                        title:=GetResourceString("AddPromptTitle"), _
                        outResult:=description, _
                        default:=GetResourceString("DefaultCategoryDescription")) _
Then
    Exit Sub
End If
is it a false positive?
 
@Mat'sMug What's up?
It isn't assigned.
 
it's passed ByRef to RequestUserInput, which does assign it
 
So, are you trying to trace the code execution and find that it is assigned?
 
2:06 AM
I can know that description is passed as parameter outResult of method RequestUserInput (only because of the named parameter syntax though) - and I already know that outResult is declared ByRef
so technically I could say "that parameter is ByRef, just assume it's assigned and call it a day
 
So scan the RequestUserInput method, or whatever VB calls them.
That doesn't sound too hard - if you are doing it right.
 
problem is if description is passed without naming the parameter; I have to implement some way of mapping arguments to parameters by index
 
Huh? How can you pass a variable to an unnamed parameter?
Like, as an item in an array?
 
@Hosch250 there's already an inspection verifying whether outResult is being assigned. If it wasn't assigned, I'd have an inspection result saying Parameter 'outResult' can be passed by value
@Hosch250 naming parameters isn't the "typical" way of calling methods in VB
normally you call DoSomething Param1, Param2, Param3
 
I see.
I was thinking of the name for it in RequestUserInput
@Mat'sMug Eh? Then why didn't you tell me that?
I was doing it C# style and using parenthesis.
 
2:11 AM
in VB.NET you need the parentheses though
that's VBA
 
Oh, I see.
 
;)
 
Stupid things.
:)>
There, that is a nice tongue.
 
:p
 
So, what you need to do is scan it and say "variable 'x' is passed ByRef to method 'y'"
Then, go scan method "y" and see if variable 'x', which is passed to y's variable "z" and see if "z" is ever assigned.
 
2:16 AM
nah, too much processing.
 
What I would do is get the method signature for RequestUserInput
Then I would say "passed-in variable 'x' maps to method variable 'y'"
Then, just scan the method and see if 'y' is ever assigned.
No need to store indexes or anything.
 
oh but I do.
how else am I going to implement a Reorder Parameters refactoring?
 
Still no need, AFAIS.
Just find every call of the method, and reorder their parameters at once in that call.
Keep everything separate - don't reorder parameters with the same code that checks if variables are assigned.
 
of course not
 
I have a feeling I'm missing something.
 
2:20 AM
probably the Declarations symbol table ;)
 
I wish I knew the code base better.
I'll try to learn it somewhat this summer.
 
cool
 
But, there is one obstacle.
I want to get this release of my app done, and get quizzes in by the end of summer.
I have about 3.5 months.
And until I understand the code base like I'd written every line myself, it'll be hard to recommend ways to clean the whole picture up.
 
I guess :)
 
I can still help with new features and classes, though.
I mean, once I understand a section/class/method, I can work on it.
And write new ones that interact with them.
If I hadn't gotten votes on my VB questions, I bet I'd get tumbleweed.
 
2:26 AM
well you got a fizzbuzz review!
 
Yup.
I'll accept it later, unless a better one comes along.
 
of course!
 
solarium:~/git/MicroBench/output> wc ../src/main/resources/net/tuis/ubench/scale/UScale.html
  738  1629 28349 ../src/main/resources/net/tuis/ubench/scale/UScale.html
1 HTML document with JS and CSS, and 28349 characters.
30000 chars in a review... I am screwed.
 
:)
 
"Please review: <code-dump>"
 
2:33 AM
I think the 4 char indent counts as well, so, that's 4*738 lines.
 
put the CSS on a separate post?
 
Wants a more in-depth review:
6
Q: Simplifying asynchronous "executeAsync" method along with "onFailure" callback

davidI have a system in which user id is "sharded" across all the machines which means each machine is responsible for certain user id data. I am working on a library which will take DataKey builder object which contains user id, timeout, and some other stuff. I will be using this user id to figure ou...

 
I was thinking of a snippet.
 
right
 
hey guys
 
2:34 AM
hi!
 
hi!
 
has anyone worked with AsyncRestTemplate before in Java?
I do have a question related to that for CR
somehow my main method is getting messed up
I have put all the junk in same method which I should not be doing
 
I'm off to do the dishes, see you later.
 
later @Hosch250!
 
Spring Fling.
never used spring.
 
2:40 AM
I am using http client provided by spring which is AsyncRestTemplate and it returns back a Future which is ListenableFuture guava
it is pretty simple just like another http client but it provides more control as it returns back the future
 
@david I would probably split this into a method somehow so you don't duplicate it:
String localSecondaryHostname = null;
String remoteSecondaryHostname = null;
if (!DataUtils.isEmpty(mappings.secondaryHostIdToPartitionMapping)) {
    String localSecondaryHostId = mappings.secondaryHostIdToPartitionMapping.get(localDataCenterPath).get(shardId);
    localSecondaryHostname = mappings.hostIdToMachineMapping.get(localDataCenterPath).get(
            Integer.parseInt(localSecondaryHostId));
    String remoteSecondaryHostId = mappings.secondaryHostIdToPartitionMapping.get(remoteDataCenterPath).get(shardId);
Anyway, I'm really off now.
 
yeah, I am thinking of putting it in a separate method but not able to understand what's the right way to do that. Meaning how should I put up a class which I can use it properly
Danikov answer provided a suggestion but that is assuming that I am working with ExecutorService and I can extend Task class which is futuretask as he was confuse when I talk to him offline
so there must be some good way to encapsulate the logic
which I have in executeAsync method
 
@Mat'sMug - it's coming together now.... See: git.tuis.net/ubench
Specifically, git.tuis.net/ubench/BinarySearch.html is a good one.
The title is wrong, but it's a binary search in different size arrays.
this should eb an O(log n) operation, and Simon correctly identifies that, and applies the correct parameters to get the curve to closely match the reality
 
check/uncheck the slowest series ;)
 
^^ exactly
then bring in the average (remove the slowest).
 
2:55 AM
pretty sleek
 
Amazing how the timescales mess like that.
I have the units changing and everything.
 
yeah just noticed
goes from ms to ..us whatever that is
 
micro seconds.
1000 us to a ms.
1000 ns to a us.
 
that's crazy benchmarking
 
Also neat, is the ArraysSort.
People often 'quibble' about the difference between O(n) and O(n log n) performance.
 
2:57 AM
oh wow
 
Simon correctly identifies n log n performance, but, n is not far off ;-)
 
wait, if you select only O(n) and O(n log n), the chart flatlines
 
Yeah, there's no data....
The Y scale is based on the largest 'data' point.
the O curves are function-based not data based.
 
yet there is if you bring in the average
 
Yes, the average is data-based.
 

« first day (700 days earlier)      last day (3316 days later) »