« first day (493 days earlier)      last day (3531 days later) » 

11:02 AM
Incoming SAFQ! (@SimonAndréForsberg Question)
i.e. a question that will probably be auto-flagged as excessively long
0
Q: Advanced and Detailed Minesweeper Probabilities

Simon André ForsbergIn an earlier question, I showed my code for calculating the mine probability for each and every field in a Minesweeper board. But it doesn't stop there. In that very same Minesweeper Analyze project, there is also an algorithm for calculating the probability of each and every number for each and...

and that will probably get a bounty on it in a couple of days because of lack of response...
This time, I will put a bounty on it myself if needed! (Did you hear that @Mat'sMug?)
 
1
Q: Advanced and Detailed Minesweeper Probabilities

Simon André ForsbergIn an earlier question, I showed my code for calculating the mine probability for each and every field in a Minesweeper board. But it doesn't stop there. In that very same Minesweeper Analyze project, there is also an algorithm for calculating the probability of each and every number for each and...

 
11:18 AM
0
Q: Reduce and condense a non standard SessionWizardView

DeependAs I'm slowly getting the hang of Python and Django I'm becoming increasingly worried about the volume/quality of code I have. This is my first time building a Python/Django Application and I'm learning as I go. The only section I'm really looking for help on is the below get_context_data of my...

 
@SimonAndréForsberg your intro has the lenght of an average question (with the full code) ^^
3
 
@chillworld yeah, that sorta just... happens... :)
 
@SimonAndréForsberg to be honest, don't have time to read all that :d
 
It's alright.
It is... quite complicated.
This question is probably the most complicated algorithm you'll ever see me put up for review.
 
@sim better put a real bounty on it then!
 
11:24 AM
a real bounty?
what's a fake bounty?
 
@SimonAndréForsberg something like a measly 200 rep *wink wink*
 
I mean ^^^^ that
 
We'll see.
However, I have a feeling that if I would post a 500 bounty on it, that doesn't guarantee me an answer that's really worth 500. Perhaps the answer would be worth 100, or 250.
But I can't post a bounty on it for a couple of days anyway...
 
Even if you get an answer before then, it should be awarded a significant bounty ;)
 
Probably yes ^^
Depends on the quality of the answer
 
11:29 AM
(a good worthy answer I mean)
 
What I'm mostly interested in is if there's anyone else who has done this before me, or if I'm the first to implement it.
I guess calculating detailed probabilities in Minesweeper is not something people do every day...
 
0
Q: Plus equal operator on an undefined variable produces NaN instead of the added value

Adonis K.Is there a way to use the plus equal operator as seen in the code below and produce 0 instead of NaN? var x; x += 5; x // NaN Is there a way to make this produce 5 instead of NaN? (What I'm saying is, is there a way to make it imply x is 0 instead of undefined without assigning x a value?)

 
5 upvotes on the question so far, I wonder how many of those that has actually read it? :)
 
Mine was after a complete read.
 
Oh, thank you, monkey!
Any spontaneous comments?
 
11:34 AM
I don't like it when people extend HashMap ;-)
The deferred/buffer3ed hashCode is a problem too.
But, there is probably a good reason for it, so I figure I should look at the code more closely
but, I did read all the text, and decided the code would require a day to grok.
 
I'm not sure how much slower it would be if the hashCode would not be buffered.
 
Well, not a day, but a few hours.
 
Yeah, it is complicated...
But hopefully you will also find it interesting :)
It is highly related to my other questions about
 
buffering the hashCode is not the problem, the problem is that it requires you to be disciplined to make sure you recalculate it when you need to.
there are some tricks you can do to avoid that, like a custom hashCode that is an XOR function, so you can recalcilate it with one operation each time you add a value.
and again when you remove a value.
 
I should perhaps use some more Immutable classes.
If I remember correctly, at the moment it gets constructed and then it stays that way.
 
11:40 AM
int valcode  = val.hashCode();
int shift = valcode % 32;
valcode = (valcode >>> shift) | (valcode << (32 - shift))
hashCode ^= valcode;
Call that each time you add or remove a val.
it is naive, but effective.
 
Nice suggestion.
I'll go AFK for a couple of hours, visiting parents, be back later.
 
1
Q: To calculate the total CPU usage as a percentage

gr8odensravenI have been developing the below method to calculate the CPU usage of a Linux system at a point in time, as a percentage of the total number of cores available in the system. #!/bin/bash # Get number of cores from proc cpuinfo CORECOUNT=`grep -c ^processor /proc/cpuinfo` # Use top, skip the fi...

0
Q: Calculating the number of candy bars and gumballs that can be redeemed using coupons

Oompa LoompaThe following question was taken from Absolute Java 5th ed. by Walter Savitch: The video game machines at your local arcade output coupons according to how well you play the game. You can redeem 10 coupons for a candy bar or 3 coupons for a gumball. You prefer candy bars to gumballs. Write a ...

 
12:13 PM
1
Q: Some table_handling tools for lua

SempieI'm writing some table.tools to make table handling a little easier for me. But I'm a beginner with Lua, so you might help me a bit, to make the code better. First of all I would like to get the best usability, but performance is a factor as well. function table.contains(list_to_search_in, comp...

 
Monking again
 
monking
 
@Mat'sMug What? I am lost
 
@doorknob got his bling @Malachi.
 
12:31 PM
They didn't forget 05/16, ...but they forgot to ship our swag '~'
 
well...
there's another load out just now..
seems there were difficulties yet again..
in Tavern on the Meta on Meta Stack Exchange Chat, 6 mins ago, by Tim Post
That's the rest of the contest prizes that were backlogged due to stock / other problems. They're out
@Mat'sMug @Malachi @all_swaggers ▲▲
 
Does anyone know the default font of JavaFX 8 Modena?
 
Monking
 
Monking @DanPantry
 
Question. What would you guys prefer -
public NetworkConnection(Stream stream, IPEndPoint address)
...
or
public NetworkConnection(TcpClient client)
 
12:44 PM
One argument is always better than 2 IMHO
 
Well, the way I see it is that NetworkClient does not need the functionality of TcpClient
 
What does the stream represent?
 
and by accepting a Stream, i can pass in a decorated Stream
 
as in: what values could you pass?
 
Stream represents a bi-directional connection to the client
It would essentially be constructed like
var client = new TcpClient(...);
var stream = new DecoratorOrSomething(client.GetStream());
var connection = new NetworkConnection(stream, ...);
This lets me decorate my stream with a decorator that applies encryption
rather than have to tell the client "hey, you need to encrypt/decrypt this"
 
12:47 PM
I'd personally probably prefer the latter, but would expect an overload for the first...
or rather without the IPEndpoint...
 
If you use the latter, how would you apply encryption?
 
because Streams can also need to be encrypted in non-network contexts.
@JeroenVannevel well you'd send it through the decorator before flushing.
 
@JeroenVannevel Pass in ICryptoTransforms into the Constructor and let the client decrypt encrypt it - which gives it more responsability
or have an IMessageEncoder that would be passed into the constructor of the client
It's that or decorated Stream
@Vogel612 I'd like to have the endpoint so consume the IP information of the connection elsewhere
IMO the NetworkConnection class should be a facade and thus not have to manage encryption decryption and so Stream should be decorated and accepted as a parameter
Just wondering what you guys would prefer if you came across the class in open source
(Java or C#)
 
so you'd go for something like:
 
EncryptedStream : Stream, IPAddress : IPEndPoint -> `NetworkConnection(Stream, IPEndPoint)
 
12:52 PM
NetworkConnection connection = new NetworkConnection(/*see overload of choice*/);
connection.setEncryptionStrategy(IEncryptionProvider);
connection.setStream(Stream);
connection.send(Packet);
 
Is my current solution, and I think that's the most idiomatic
@Vogel612 I really dont' like the idea of that
That's 3 mutators
NetworkConnection is concurrent - and is accessible throughout the application
It needs to present an API that won't modify it
 
then only allow setting them in the constructor...
 
Basically, I want that class to be immutable past construction.
What's the preferred constructor here - Stream, IPEndPoint or TCpClient
 
@DanPantry so like all fields final
 
That's my question :P
 
12:53 PM
but you want to decorate that with an Encryptor so the question is moot
also why not expose both?
 
Because I'm doing TDD and only writing what is necessary :P just wanted to know whether I was re-inventing the wheel by passing in a stream/address instead of just a socket
 
0
Q: A method that generates a Comparator<String>

Kiran MohanGiven below is an exercise from the book "Java SE 8 for the Really Impatient" by Cay S. Horstmann Write a method that generates a Comparator that can be normal or reversed, case-sensitive or case-insensitive, space-sensitive or space-insensitive, or any combination thereof. Your method sh...

 
or if I was making a square wheel ;-)
 
@DanPantry FWIW, if you just want network functionality, it would be dumb to expose a constructor taking a Stream...
 
@Vogel612 It is just for network functionality.
However, the added benefit as well with Stream is that I can mock a stream in C# - I can't mock TcpClient
we don't have cool stuff like Mockito in C#, the mocking framework I have limits me to mocking virtual methods on real classes, or interfaces
My other argument as well is that the NetworkConnection doesnt' need all of the functionality on TcpClient, just the Stream and it's IPEndPoint
I feel like this has been more like an interior monologue.. :p
 
1:08 PM
1
Q: SQL Group and Filter - Refining down a search including Dates

indofraiserThe below process is designed to pick out only AsbestosUPRNs and get the lowest OverallRiskCategory where they have the newest SurveyDate. I just wanted to ensure this is the best way, it seems neat now though as well as second code, which in reality is the same thing, based on two tables. SELE...

1
Q: Javascript constructor and namespace in object literal style

CK LeeIs this a good way to create a class with constructor and namespace in object literal style? var myApp = myApp || {}; myApp.model = { Person: function (name) { this.name = name; } }; myApp.model.Person.prototype = { sayName: function () { alert(this.name); }, ...

 
1:23 PM
@Vogel612 oh I better be getting mine today! I Want my Mug! lol @Doorknob Where do you live? maybe mine hasn't gotten to me yet.....
 
Let's talk LoD
networkConnection.Read().Subscribe(mockObserver.Object)
Does this violate the LoD?:P
 
2
Q: Ideas on how to optimize Node.io server code for self-balancing robot

PaoloI am building a 3D printed self-balancing robot, and use the attached server script to control it. I coded using node.io, express and socket.io. The system is working but I would appreciate some coding suggestions as I am quite new to these programming framework and I would love to understand h...

1
Q: Improvement on Scala Option with Pattern Matching

Matteo PaciniI have this bit of code: //[...] == omitted def createGallery([...]) : Either[String,Gallery] = { def createNewGallery : Gallery = [...] Gallery.findOne("name_query_goes_here") match { case Some(gallery) => Left("A gallery with that name already exists") case None => Right...

 
> When you are already familiar with JAVA, the document C for Java Programmers might provide you a quick conversion course.
 
@DanPantry kinda looks like it..
you should be able to networkConnetion.subscribeRead(mockObserver.Object);
@DanPantry I was busy fixing the unit test and cut that one of our new Trainees got assigned to..
 
@Vogel612 What?
 
1:32 PM
cut -> class under test
 
@Vogel612 You cut your new trainee?
 
@Vogel612 Yeah, I guess I agree. I'm wondering whether to make the type implement IObservable<T>, but that apparently violates the best use case of Rx
@Vogel612 Don't you mean UUT?
 
U != C??
 
No, but cut sounds like you injured someone :p
 
naaah...
 
1:34 PM
Let's say I alter my code I just wrote to something like this
using (var subscription = networkConnection.Read(5, mockObserver.Object))
read 5 bytes and notify the observer when it reads that many
5 could be omitted to read the maximum buffer size
thoughts?
 
that looks broken
that looks so extremely broken....
 
mockObserver.Object = Mock<IObserver<T>>
external library and is just for testing
using(var subscription = networkConnection.Read(5, myObserver))
in reality it would look more like
 
why would you allow Read(Int64 bytes, IObserver<T> observer)??
 
I was just offering alternatives to SubscribeRead
Hmm.. I'll think of something.
 
wouldn't you rather dispatch a readEvent ot all observers?
 
1:37 PM
I'm using something called ReactiveExtensions
which centers on the usage of IObserver<T> in place of dispatching events
IObserver<T> can be thought more alogn the lines of a 'stream' of data, rather than a stream of notifications
So IObserver<T> would be IObserver<byte[]> in this case, rather than IObserver<ReadEvent>
fk it. I'll just write a test suite and my usage of the class and post it for code review later
 
so the observer gets a copy of the actually "read" data??
 
@Vogel612 observer gets a copy of the byte array of read data, yes
 
public byte[] Read(Int64 bytes, IObserver<byte[]> observer)
{
     byte[] data = networkStream.Read(bytes);
     Observer.Stream(data.Copy());
     return data;
}
??
 
it would look more like this
public IDisposable Read(Int16 bytes, IObserver<byte[]> obs)
{
    return Observable.Defer(() => {
        var buffer = new byte[bytes];
        var offset = 0;
        return Observable.FromAsync(() => stream.ReadAsync(buffer, offset, buffer.Length))
            .Do(bytesRead => offset += bytesRead)
            .Select(bytesRead => { /* copy bytes */ })
    }).Subscribe(obs);
}
the returned IDisposable can be Dispose()d to 'unsubscribe' the observer from the observable
The whole chunk of code inside that method basically equates to "create a sequence that every time it is subscribed to will create a new byte buffer, and then run FromAsync and copy the byets into that buffer, and return it"
But thinking about it more, Read should return an IObservable because that allows you to compose stuff more. By returning IDisposable you are limiting the subscriber to do exactly as you say and not letting them compose stuff.. so I think I will violate the LoD here due to best practises of Rx
I'll psot a proper CR later. Maybe that'll give you more of an idea.
 
any VB.NET people around?
 
1:50 PM
o/
 
I think I wrote my Object Initializer wrong, but it looks so right.....
 
That's what he said...
 
here it is after I commented out what didn't work. iSearchID is a parameter
 
My mind's tellin me noooo
but mah body
 
        Using objAdapter As New SqlDataAdapter("sp_JQ_Users_MyData_SearchContentsList", objConnection)
            'With {
            '         objAdapter.SelectCommand.CommandType = CommandType.StoredProcedure,
            '         objAdapter.SelectCommand.Parameters.Add("@SearchID", SqlDbType.BigInt),
            '         objAdapter.SelectCommand.Parameters("@SearchID").Value = iSearchID
            '     }
            'End With
            objAdapter.SelectCommand.CommandType = CommandType.StoredProcedure
 
1:51 PM
mah body's telling me yesss
You don't use { } in vb?
and With is actually wrong
 
it didn't yell at me when I did it like that.
 
With objAdapter.SelectCommand
    .CommandType = CommandType.StoredProcedure
End
 
wish they would have wrote this in C#
 
Not sure about Parameters, though
i don't think it will yet at you for using {} - but you shouldn't
 
thank you let me run this code again.
 
1:54 PM
@Malachi What's up Malachi?
 
@Doorknob when did you get your swag?
 
@Vogel612 does this make more sense, now?
        [Fact]
        public void Read_ObservableReadsFromUnderlyingStream()
        {
            // Don't need to mock stream, and it's easier to use MemoryStream.
            Stream stream = new MemoryStream();
            var scheduler = new TestScheduler();
            var mockObserver = new Mock<IObserver<byte[]>>();
            var bytes = new byte[] { 1, 2, 3, 4, 5 };
            var networkConnection = new NetworkConnection(stream, (IScheduler)scheduler);

            // This does violate LoD but it gives us a lot more flexibility
 
@Malachi Texas, but it's still been a while even if you live outside the US. I had to poke lots of people until I got mine. :-P
 
@RubberDuck dealing with a Legacy Web site/app thing that I am trying to update/upgrade whenever I can
 
@Malachi Right before summer.
 
1:55 PM
@Doorknob I live in South Dakota, and I try not to Poke Bears
2
 
Ahhh, I just caught up. Looks like Dan took care of ya.
 
@RubberDuck not sure on using With with the Parameters object, if you wanna solve that puzzle :-)
 
@DanPantry This seems to be waaaay above my level of C# knowledge
 
@Vogel612: It's actually just all Rx lol - with xUnit for testing and Moq for mocking. Otherwise it just uses standard .NET classes
 
@DanPantry It looks right, but I've never dealt with a database in .Net.
 
1:58 PM
It's still waaay above my level... @Dan ...
 
@Vogel612 :-)
@RubberDuck keep it that way - ADO is a pain :-(
 
Where were you guys when I was trying to figure out how to add unit tests in Xamarin/C#? or any C# for that matter. lol
 
@Malachi always been here. xUnit is the best, but VS requires a plugin to run xUnit tests from within the IDE.
 
@DanPantry I was at home yesterday, I have Xamarin at home, too cheap poor right now for VS
 
@Malachi I was here, but Xamarin sounds greek to me....
 
2:04 PM
@Malachi: VS Express is free.
You just can't use plugins in it.
 
Express is... yeah, that ^.
 
You can always get the xUnit Test Runner (3rd party program that runs tests)
 
@RubberDuck a little bit.... it's mostly for mobile stuff I think
 
Even better still, you should get TeamCity (also free)
@Malachi Xamarin created Mono IIRC?
 
what is TeamCity?
 
2:05 PM
It's C#'s travis-ci
 
@DanPantry yeah.
@DanPantry I got it trying to figure out how to get my XNA game to work....
 
Basically it lets you set up build scripts that include steps like running tests
 
0
Q: Matplotlib: 2D color plot with irregular spaced data (mlab.griddata)

Raphael KleindienstI want to create a colorplot of some irregularly sampled data. I've had some success with the interpolating using matplotlib.mlab.griddata. When I plot the interpolated data (using matplotlib.pyplot.imshow) however, the edges of the domain appear to be left blank. I've attached my code as well th...

 
it supports xunit and whatnot
So you get the benefit of having build scripts AND continuous integration :-)
 
Monking all.
 
2:06 PM
Monking @rolfl
 
Hey Dan
 
Monking
 
Ducking....oh wait that already has a meaning....
3
 
@Malachi about TeamCity, YMMV, I've never used it, only heard of it. Made by Jetbrains so it has to be good
 
0
Q: How far should I go with abstraction?

mickaeldNote: This post has been copied from this StackOverflow topic I've been trying for a while to write clean and testable code, with the help of DI and abstractions. I found myself guilty of service-itis, creating 3 or 4 interfaces for something that clearly doesn't need it. So I decided to relax, ...

 
2:14 PM
Re-monking
 
@Danning, @Simoning, @Rolfling
 
@Malaching?
 
Vogeling? bazolaing? Loking? skiwing? Nialling? Jeroening? Mating/Mugging? Yuushing? amoning? chilling? Phrancing? Corbing? 200ing? Popsing? Webbing?
firdaing
 
firding?
 
2:24 PM
Is it just me or is this more Programmers.SE?
0
Q: How far should I go with abstraction?

mickaeldNote: This post has been copied from this StackOverflow topic I've been trying for a while to write clean and testable code, with the help of DI and abstractions. I found myself guilty of service-itis, creating 3 or 4 interfaces for something that clearly doesn't need it. So I decided to relax, ...

I'm starting to maybe perhaps get a little sense of what may or may not be on-topic on programmers...
 
@rolfl Mala-king!
 
I am new here and have a question: should I leave answers to my question intact (without comments) including follow-up question by author of the answer, or can ask and possibly express I think is wrong about the review? Loki is now talking about my illusions, which is more than offending assumption, I didn't say anything like that about him, but about his review.
 
Simoning Monking!
 
0
Q: Refactoring identical code with dynamic variable

Stefanos.IoannouI have written the following code. It shows a table for Open & Closed tickets. The code for Open tickets is identical with the Closed tickets. I was trying to figure out a way to just write one code segment that will show both tables and use half of the code lines. With some changes I ended up to...

 
@CaptainObvious Ruby on rails??
 
2:28 PM
@firda I will take a look
 
Me too. ^^^
 
To make the problem clear: he stated that my GetKey functor is useless, I cannot se how to avoid that (or bigger comparator) using std::set (not map).
 
5
Q: Sorted vector (aka flat_set) for objects (pointers) with custom embedded key (functor used)

firdaI was asking for such structure on SO, but got only link to boost::multi_index as an answer. So, I decided to write it myself (and plan to include the final version there as self-answer, while probably rewriting/rewording the question as well - it definitely needs it). I wanted both fast and mem...

@firda I see that the comments are getting quite many. I would recommend clearing things up in a chat room.
 
Well, that could be a good solution next time. But what now? See last two comments on his linked question: codereview.stackexchange.com/questions/62372/…
BTW: How can I make the embedded link like the one above from Simon André Forsberg?
 
@firda just paste the link alone without any other text
 
2:33 PM
sounds like he just sent what was left
in Tavern on the Meta on Meta Stack Exchange Chat, 2 hours ago, by Tim Post
That's the rest of the contest prizes that were backlogged due to stock / other problems. They're out
 
8
Q: Container with sorted by multiple keys

Loki AstariFrom this question: Sorted vector (aka flat_set) for objects (pointers) with custom embedded key (functor used) This is an example of a multi-index container. Note: this is not a container as defined by the standard (a lot of methods and types required for that are still missing). It is a conta...

 
@firda Loki was just here
 
@firda From what I am seeing as a total c++ noob, all the points he's making are valid and justified.
 
I was going to recommend pinging him....
 
@firda From what I know, @LokiAstari is a very experienced C++ user. I think he usually know what he is talking about. I however, don't know much C++...
2
 
2:36 PM
as an aside, a short comment on an answer should be fine, but as soon as you find yourself discussing style-preferences and preprocessors you should stop and let the other party have their opinion...
you don't need to write code the way Loki does...
2
 
@firda As for whether or not you want to leave your comments there, that is up to you (although I bet @rolfl is scanning through them as we speak and might remove some of them). You may also flag Loki's comments if you feel that they should be removed for a specific reason.
 
(reasons include: offensive, too chatty, obsolete, not constructive and other)
 
Well, I will think about asking him, that we both remove all the comments. He may be experienced, maybe he is too much experienced, that something that is obvious to him is not obvious to me. And searching in C++11 set by a key, that is not the value type is really not obvisou to me (I will either need C++14 enhancement, or some hack)
 
@firda - I am struggling to understand both sides of the concerns here.
The base problem here is that the comments are not supposed to be a place to discuss strategies.
I think Loki is criticising your use of the preprocessor, and his review is not a comprehensive review of your application/code, just a subset of it.
I also see you suggesting he look in more detail at your code (and run things from links).
 
The problem is under "Overdesign", he just states (no explanation), that the GetKey is never needed. That started it (I just asked). He made short comment and edited it. I was trying to get something positive, some meaning, std::map is the only think I can understand, std::set cannot be used (without GetKey or transparent less - which was added in C++14).
 
2:45 PM
I can't debate the merits of his answer with you (I don't know C++ well enough).
What I can say though, is that objectively he appears to have reviewed your code based on what you presented.
 
There are a lot of lowest voted questions that just need to be deleted..... let's use those moderation tools people
 
It may not be a review you like, but it is a review.
It also does not appear to be offensive, or mean, or otherwise abusive.
 
seconding @rolfl here. The nice thing about this is: You can chose to ignore what he's saying If you have more information, than he has.
 
It appears to be an earnest case of: you have things you don't need, you are leaking pointers, there are existing data structures that do that, and so on.
 
It is ok he reviewed, the problem is I see his explanation-less statement as false and wanted to understand. That's all. Now he talks about my illusions. I must have angered him somehow (by I comment ended with: Of cours I can be the blind man)
 
2:47 PM
He is critical of your preprocessor..... but I believe his criticisims are reasonable.
 
@firda Your code is really hard to read to my eyes
 
@firda I cannot see any reference to 'illusions'.
 
I can understand that, but I am talking about his Overdesign and no need for GetKey. That is the point we talk about.
 
@firda: You asked me for a review. My review stands by itself. If you don't like it then ignore it. You seem to be under the illusion this is a competition were I am trying to win something. Its not; you asked my opinion I gave it. My role hear is not to make your life easier by providing you with answers to your questions, its to make you think about your mistakes so that you can improve. If you don't want to take advice then there seems little point in posting on the code review site. I will leave your questions alone in the future so that you don't feel threatened by my advice. — Loki Astari 1 hour ago
 
ooohhh crap...
 
2:49 PM
his follow-up: codereview.stackexchange.com/questions/62372/… Quote: You seem to be under the illusion this is a competition were I am trying to win something.
 
Oh, that's a different question.
More reading to do, hang on.
 
But he linked it to mine, I wouln't comment otherwise.
 
@firda Just for the record, I think that follow-up question's code is waay easier to read than the original code, but that's just my opinion.
as an aside, to me it seems you misunderstood the comment.
 
I really don't want to anger anybody and appriciated he did try to review (upvoted the answer), but cannot see some of his points (no GetKey + comparator composition - it was using empty base optimization). That is really big part of his review.
 
but I can't put my finger on it, because I neither understand his advice, nor understand the objections you are making against it.
 
2:53 PM
@firda - I think there is a basic miscommunication here. I would not read too much in to his posting his version of your code here.
This is a common thing to do on Code Review.
 
Well, I don't care about the review much now, I can delete it all, but do not understand why the talk about illusions.
 
The 'illusion' he refers to is not about your code.
 
I think you misunderstood the comment, @firda. @LokiAstari is simply saying that his understanding of you is that you feel that it is a competition.
 
What he is saying there is that his code is not in competition with your code.
 
It is about me, my illusions, that is even worse, offensive.
 
2:55 PM
I think you are reading more into it than what is actually there.
 
@firda - let me run you through a hypothetical situation
SOmeone posts some code, it is interesting enough and complicated enough, that I spend an hour trying to understand what is happening, and in the process, I rewrite portions of it, and get my own ideas.
I then answer the question, but, because this is complciated code, maybe someone else has some additional ways to improve it, etc. So I post the work I did, for another review.
I have done that multiple times for real.
It seems that Loki has done the same thing.
I can tell from his answer that he took hour(s) to put together his review.
 
0
Q: thumbnails for bootstrap carousel, jquery plugin

SrleHow it looks like? While you slide left or right appropriately thumbnails gets selected and changes its opacity to be different among others thumbnails. Also you can click on thumbnail to show appropriately image on carousel. HTML After carousel bootstrap code (http://getbootstrap.com/javascri...

 
His new question is not there as a review or comment on your code.
it is a whole new thing, with new requirements, etc.
He may not have said this in a way that is easy to understand, but, he is not trying to solve your GetKey problem, so he is no longer worried about that.
it is not relevant to his question.
 
is there a badge for using all my delete votes in a day?
 
I love this site
9
 
3:00 PM
Certainly, his comment about 'illusions' is not related to your code.... nor is it intended to suggest you are mad, or anything.
All he is saying is that you misunderstand why he asked that question.
 
this question is now active on SO so I am thinking it should be deleted here (and it just took my last delete vote.
-4
Q: Connecting together multiple classes

JollyfreakIn my previous question I learned to divide one class into multiple classes. I divided them into a couple of classes, but it is not working! It just shows blank screen. Main : import java.awt.Dimension; import java.awt.Graphics; import java.awt.Image; import java.awt.Rectangle; import java.awt....

Closed there too
 
In a sense, you keep badgering him for an answer to your GetKey concerns, but he has no obligation to do that.
 
@Malachi the roomba should be cleaning that one up...
sooner or later that is..
 
OK, shall I delete the comments? He don't want to answer the question, for me it seems he really don't want to solve the searching problem, which makes the code very incomplete (lacking core function).... for me it is not reviewable, and my comments probably should not be there because the link there is more of a note than for real linked.
 
@Malachi done
 
3:02 PM
@Vogel612 look through the moderation tools...
 
@firda I will go through and delete the comments in a bit. I first want you to be content that things are OK here.
 
@Malachi um... you know the roomba just deletes questions older than one month??
 
now I should vote to undelete....lol JK
 
so spare your delete votes and let community♦ do it's job ;)
 
@firda The fact that the question context no longer makes sense to you is not the same as the question being a bad question
 
3:03 PM
@Vogel612 those questions that I voted to Delete, shouldn't be here at all, we are the Community
 
You are free to completely ignore his question.
 
@Malachi mind the ♦!
 
Well, angering Loki to make him thing that it would be better not to tuch my posts and me thinking it would be better not to touch his is not OK, but acceptable.
 
hmm...
why does the community user not get a onebox??
 
@rofl: sure, it looked like missing the important part and looked like related to my question and the very problem that started it. I am for deleting all the comments on HIS question.
 
@firda Those are the comments I would delete, the ones on his question, yes.
@firda - these sorts of misunderstandings happen, both in real life, and here on Code Review.
The internet makes things hard to understand/interpret sometimes.
I give people a lot of 'benefit of the doubt'.
 
Well, I know, shit happens. I just don't like such stupid missunderstanding leading to alienation.... will see, what future brings. Thank you for the talk.
 
Neither you nor Loki have done anything that particularly concerns/worries me. This just seems like a difference of opinion on what the right thing is, and what the real problem is.
The trick is to keep it in perspective
 
@firda After having read your code and his answer, I agree that he's somewhat missing the point of the extra template parameter here, however.
 
@firda - my C++ is weak, but I can say with some certainty that Loki is considered to be an expert in the field. Even if he is wrong about some of his assumptions, if you read his stuff, you should find a lot of things to apply to your code anyway.
 
3:09 PM
but I also agree with him in that I don't understand how it performs multi-indexing
 
Yuushi: You agree that either GetKey or transparent Less that can compare user to string is needed? Another solution would be to use some hack with pointer-like classes that can do the comparision.
 
I'm about to go through and delete the comments on Loki's question.....
...last chance?
 
0
Q: Tree items and code indentation (formatting)

paulThis is sort of a two-part question. Part 1 I'm working on a project in which I construct a tree of nodes. In an attempt to organize things, I decided to format the declarations of the nodes in the way they would be structured as a tree: RootNode root; FooNode foo(ai); BarNode bar(...

 
@firda actually, there is potentially another way around this.
 
Sure, multi-index was originated from the answer on SO. It was more about storing the key in the value than true multi-index. My container would have to be duplicated to achieve multi-index which he agreed with (and stated himself).
Yuushi: You know? Can you show me?
 
3:11 PM
Quick interjection
this seems to get a little longer, I suggest you move that to a separate room ;)
 
@rofl: delete them, please and thank you.
 
@firda let me think about it for a sec
 
@firda Hint: Write '@Yuushi' to ping him, then he will get notified about your responses.
 
About that separate room, yeah, if you are going to launch in to a deep discussion about this question's technical aspects, a separate chat room is appropriate.
 
@rolfl: I am new here, will follow anywhere.
 
3:15 PM
@Yuushi / @firda Room for that question ;;;;---)))
 
btw, 33 comments on this answer:
3
A: Find the nearest (small) number x where x can be represented by sum of cubes

holexpersonally I would calculate that value like e.g. this: /* * check the updated algorithm, please * - (Float64)neareastSmallerSumOfCubes:(NSInteger)originalNumber { if (originalNumber > 1) { Float64 _firstAttempt = pow((Float64)originalNumber, 1.0/3.0); if (_firstAttempt ==...

 
@Malachi all right I emailed Tim, asked if unicorns ate my box
2
 
@Mat'sMug he just sent that stuff out like this morning I think
 
3rd time I hear that...
 
51 mins ago, by Malachi
in Tavern on the Meta on Meta Stack Exchange Chat, 2 hours ago, by Tim Post
That's the rest of the contest prizes that were backlogged due to stock / other problems. They're out
in Tavern on the Meta on Meta Stack Exchange Chat, 51 mins ago, by Tim Post
@Malachi Yes, a whole lot of stuff just got unclogged
 
3:26 PM
45 secs ago, by Malachi
51 mins ago, by Malachi
in Tavern on the Meta on Meta Stack Exchange Chat, 2 hours ago, by Tim Post
That's the rest of the contest prizes that were backlogged due to stock / other problems. They're out
 
should have posted this one first....
 
stahp
3
 
in Tavern on the Meta on Meta Stack Exchange Chat, 53 mins ago, by Malachi
@TimPost am I one of those fulfillment's ??
@RubberDuck OCD wanting me to post it again!!!
 
1 min ago, by RubberDuck
3
 
@Mat'sMug I almost asked him if it would be 6-8 weeks from now....
2
 
3:29 PM
ironically I'm working on ...an order follow-up report right now
 
0
Q: Converting the first and last name to pig latin

Oompa LoompaThe following question was taken from Absolute Java 5th ed. by Walter Savitch: Write a program that starts with the string variable first set to your first name and the string variable last set to your last name. Both names should be all lower- case. Your program should then create a new str...

 
Yawn
 
1
Q: Using /proc/stat to calculate CPU usage

rolflInspired by this question: To calculate the total CPU usage as a percentage I wrote the following bash script (as an answer) to calculate the CPU usage for a (configurable) period over all CPU cores on a host. #!/bin/bash #CORECOUNT=$(grep cpu /proc/stat | grep -v 'cpu ' | wc -l) #echo $CORECO...

0
Q: Grey to Colored Image

Lukas HäringI want to improve the code, what it does? You can enter a grey bitmap and it return you a colored one. function ChangeBaseGrey(bitmap, color) { var canvas = document.getElementById("imagesColored"); var ctx = canvas.getContext("2d"); var dataBitmap = bitmap.data; var r0 = (color >> 16) & 0xff, ...

 
@Anirudh I'll second that.
 
September:
3
0
Q: Converting the first and last name to pig latin

Oompa LoompaThe following question was taken from Absolute Java 5th ed. by Walter Savitch: Write a program that starts with the string variable first set to your first name and the string variable last set to your last name. Both names should be all lower- case. Your program should then create a new str...

Ouch.... constructor setting static variables.
 
3:43 PM
sysout with string-concat and " "...
 
0
Q: Multithreading decouple update-logic and render-logic

JoshuaBehrensI want to improve my multithreading competence and tried to build a compact doublebuffered way to seperate two threads where one is only displaying the state and the other one updates the state. So I am here to hear whether I done it "right" and what to improve. Code: #include <thread> #include <...

 
@rolfl you're 10 votes away from a [badge:guru] on the question ;)
4
 
lolcode guru!!
2
 
@rolfl btw: The real story on why Eric has a single upvote:
@JeffreyBosboom: I was trying to reverse a downvote after an edit and accidentally turned it into an upvote. — Eric Lippert 1 min ago
 
@Mat'sMug LOL
 

« first day (493 days earlier)      last day (3531 days later) »