« first day (329 days earlier)      last day (3694 days later) » 
00:00 - 20:0020:00 - 00:00

8:05 PM
Welcome, @konijn
Oops
@Koveras
 
Hewo
I'm confused, I changed my display name on my SE profile but it still shows davidkennedy85 in lots of places
 
Hello @Koveras, welcome to the 2nd Monitor.
I'm not sure if you have been here before or not ;)
 
@Koveras - did you check the 'apply to all sites' checkbox when you changed your profile?
 
Oh, davidkennedy...
 
I think so, but to the left of this message for instance it says davidkennedy85 not Koveras
Apparently you guys don't see it like that
 
8:07 PM
I see @Koveras
 
Weird
I guess that's fine then
I just recently learned that the internet is public and that it's a bad idea to tell people my real name
Where's @Mat's Mug
 
@Koveras - hit Ctrl-R and refresh your page
 
I don't think it's that - I clear my cache regularly out of OCD
 
Humor me ;-)
 
Ok
Oh snap
That was magical
Do you have powers rolfl
 
8:10 PM
I do .... but not that sort.
 
How did you know that would work :o
 
As I understand it the icons and names for the chat rooms are held in the javascript or something.
 
Huh
 
Refreshing the page reloads the things. Chat does not query the databases for all the details every time things change.
 
@Koveras I use my real name and I'm still alive :)
 
8:15 PM
I noticed that
I recently had a stalker look me up though
It's was... spooky
 
Those kind of people are so fun.
 
Also, other people will still see your old name on Chat unless they refresh...
 
That's not the word I would use
Well you guys seem okay
 
(that is, of you were in a room with them before.
When you joined the 2nd monitor, you came in 'fresh' with the new name/icon.
 
I'm not sure about Jamal though
2
Yeah, I was chatting with some folks about video games
 
8:17 PM
It's a... um... codename. :P
 
And someone disagreed with me, so they found my blog and attacked me from a religious stance
And also questioned how good of a father I am
 
@Koveras Aww, sweet! Use the race card back!
 
@Koveras - true story. My 10 year old is learning the piano. Her music teacher gave her 'homework'. The theme for an upcoming concert was 'Canadian Music'.
 
And by questioned i mean they accused me of selling my kids to the zoo
 
lol
 
8:18 PM
wut
 
Her homework was to find out a little bit about the composer of her song, and prepare a little talk.
We left her alone for about 30 minutes on the computer.
 
2
Q: Java 8 streams - each step in the chain evaluated for entire input or do items get passed through?

djhworldSay if I have this trivial program List<String> input = Arrays.asList("1", "2", "3"); List<String> result = input.stream() .map(x -> x + " " + x) .filter(y -> !y.startsWith("1")) .collect(Collectors.toList()); Behind the scenes does it work like a) o...

I'm suprirsed the cod ein my answer there works ;)
 
Selling kids to the zoo? Religious fight? Was it a religious zoo?
 
Her speech she prepared was: so and so wrote this song in 1998, when they were a student at such and such. They now live at 1234 this street in this town.
 
Whoa
I know enough about reality to not put my address out there at least
 
8:20 PM
Anonymity is bliss.
 
@syb0rg Easy for you to say, you're half robot.
 
But if someone knows your real name and state, and they are determined enough to destroy your internet persona, even with just that information they could find you
Well, maybe not but I wouldn't be surprised
Oh and @Simon, it wasn't even a "fight" - it was "wow you're a Christian you are a terrible person"
But much worse words were used
Anyways it freaked me out enough that I've been on a crusade to change all my usernames since
Especially once they mentioned my kids
 
lol, most Christians I have met are very nice persons. Heck, I am one myself lol
 
I'm with you but some people are a bit intolerant
 
^^^^^ truth is, most (christian|muslim|.*) people I have met are really nice.
 
8:24 PM
What's funny is they tend to accuse Christians of being the intolerant ones, then destroy them because of their religion
 
Yup. Luckily I don't often meet those intolerant ones
I agree with monkey, I met many nice muslims as well
 
That's because you stay in here where it's safe
Most chat rooms aren't like this one :)
 
Hmmm... let's nip this one in the bud.
 
@SimonAndréForsberg I actually am one. ;-)
 
@Koveras CodeReview requires a certain amount of tact.
 
8:26 PM
@Jamal Nice person, Christian or Muslim?
 
How to tell a person their code is crap, and make them smile about it.
 
@SimonAndréForsberg Muslim
 
Oh, whew, I thought you were going to say 'Nice Guy'.
 
hah
 
I am 'the nice guy', is says so in my profile
 
8:27 PM
Kind guy, yes. Nice Guy(TM), nope.
 
Oh I thought we were questioning Jamal's gender
 
Nah, that's Syb0rg.
So, about that weather we're having ..... ?
 
That would be difficult to discuss to any degree of accuracy due to not knowing one another's locations
 
How about you tell us where you live ...? ;-)
 
How about I tell you where I'd like to live
 
8:30 PM
Works for me.
 
I don't even konw, somewhere that doesn't have many natural disasters
 
@Jamal Nice. I actually read a bit in The Holy Quran last year, wanted to get a bit more acquainted with Islamic religion.
 
Which pretty much rules out everything
 
Inter-religious dialog FTW.
 
Montana?
 
8:30 PM
Central Canada ....
 
It'd be cool to be like an isolated hillbilly with some land or something
Too cold in Canada
 
Although, it is still 'rebounding' from the last Ice-Age.
 
@SimonAndréForsberg The sad part is, I don't know any Arabic...
 
@Jamal Neither do I, I read an Arabic with English translation one :)
 
People usually say they wish they could live in Hawaii or something but that would not be a very wise choice IMO
Due to tsunamis, volcanoes, godzillas and what not
I wish I lived in space
 
8:33 PM
And you don;t think the disasters there are a problem?
Watched Gravity recently.... ;-)
 
What disasteres
Oh I dunno what that is
 
Hmmm, I have a better idea: en.wikipedia.org/wiki/Sharknado
By the way, can I just call you ralph? rolfl kinda screws with my dyslexia.
 
But his name is Rolf.
You can always call him monkey.
And give him a banana, he likes that.
 
rolf is weird to spell too.
 
8:39 PM
Call me what you like ... but don't call me late for dinner.
Also, if you type @r and hit tab, it will autocomplete.
And, it seems like 'monkey', or 'the monkey' , is the nick-name I have 'earned' in here.
As they say, 'that's what my friends call me'.... so, go ahead and call me the monkey ;-)
 
Anyone know where my name comes from?
Without cheating
 
Never heard it before I think
 
Anyone who was a PC gamer in the late 90's
?
 
well, yes... a bit at least. Apparently never played that game
 
RPGs much?
 
8:47 PM
not many. Although I was a member of the old RPGMaker.net community
 
Well some would say you missed a golden era there but I dunno. All video games suck depending on how you look at it.
Which is why I so badly want to make one, so people can complain about it ad infinitum
Hullo @200_success
 
@Koveras Hi. Welcome to CR.
 
Aren't I supposed to say that
 
For what it's worth, I read your new name as "cover ass". ... ;-)
 
hehe
 
8:53 PM
Oh, name changed. I see.
 
Yes, you may know me better as Jamal
2
What is temporal coupling?
 
@Koveras when functions in an API have to be called in a specific order
 
And when it is not done right, you have a temporal anomaly
 
For example: file = new File(); file.write("foo"); file.close(). The close cannot come before the write
 
Ah thanks
 
8:58 PM
It can, but then it does not work.
 
Is that bad then? How else would you do a file operation
 
nifty type systems, or constructs like try-with-resource can hide this coupling
 
I don't know what either of those things are
Oh okay the second thing is from Java
nifty type in Google doesn't provide much info though
 
yes. “nifty” isn't a name, it just means “clever”. Here: “too clever for its own good”
 
Oh you're being facetious
 
9:05 PM
this is chat, what do you expect? ;-)
 
Are you saying it's not necessarily a bad thing then?
 
I don't really expect people to use the word facetious in the right context, in appropriate circumstances, and spelled right ... that's for sure.
 
@rolfl did I get it right?
 
Well, leveraging the type system is often useful, e.g. when writing a “fluent API”. But in this example of file IO, I wouldn't want a type-system based solution, except maybe in Haskell
 
9:07 PM
but temporal coupling itself is definitively an antipattern
 
> lacking serious intent; concerned with something nonessential, amusing, or frivolous: a facetious person
You got it right.
 
You gotta spell these things out for me, I'm pretty thick
 
@amon temporal coupling must mean something I am not familiar with.
The example you gave is happens-before type things, which all programs are about.
 
@rolfl my example was about an illegal state, not about about changing state itself. But you may be right that I am not describing the correct term. Wikipedia says this:
 
You're being faschicious
 
9:10 PM
> When two actions are bundled together into one module just because they happen to occur at the same time.
 
So a real temporal coupling would be to have a method with both opens, writes, and closes the file? (and only that)
 
I think this blog post describes it better than me: blog.ploeh.dk/2011/05/24/DesignSmellTemporalCoupling
 
Yeah, Iw as reading that one.
 
That's factitious
 
The Java JDBC API strikes me as being a good example of bad temporal coupling.
Class.forName("com.mysql.jdbc.Driver"); ... ;-)
Or even autocommit, etc.
 
9:17 PM
@rolfl that's not temporal coupling, that looks like dependency injection
 
9:34 PM
Wikipedia says temporal coupling is "... just because they happen to occur at the same time."
 
@rolfl: I've posted a Java answer. Please let me know if something's not quite Java-like.
0
A: Determine total number of ways of reaching a destination

JamalAlthough this is not related to optimization, it looks like you could replace some while loops with for loops. If you're using a counter, chances are you should use the latter type of loop. First, I want to mention that you should use whitespace between operators and keywords for readability. ...

Particularly the second code block.
 
9:51 PM
Not Java-like : Brace goes at line-end ;-)
if (condition) {  // <<< brace at end
@Jamal - ding.
 
Also, I figure the code is broken.
I am busy trying to get a JDOM release out, but I saw that question, and thought "how does that compile".
 
@rolfl Where in my code do I make changes? I'm not using an if.
 
All your loops:
for (int i = 1; i <= n; i++)
{
becomes
for (int i = 1; i <= n; i++) {
 
Ah, I see. Okay.
 
9:56 PM
@palacsint what do you think of this line:
 ways[i++] = (short)(getWays(stationId)%(10^9 +7));
 
I'll fix that, along with referencing palacsint's link.
 
Do you think Java is doing an implicit cast of the 10^9 to a long?
 
@rolfl I don't think so... it smells :)
ehh
 
@rolfl I think the 10^9 becomes 3
 
xor...
 
10:00 PM
yup
So that's ways[i++] = (short)(getWays(stationId) % 10);
 
first I've found the loop too simple
 
Yeah, it is horrible.
 
it should be similar to JD's graphAllPath solution I guess
 
duh, feeling pretty dumb right about now.
Amazing how some broken context makes you thing a certain way.... like, in what world is ^ a power operator in Java.
2
 
@rolfl I should've noticed that as well. :-)
 
10:07 PM
Has the monkey learned something new or had he just totally forgotten about it?
 
So, @Jamal - in your first edit.... you changed the text description .... the answer mod 10^9 +7. to be .... the answer mod 10<sup>9</sup> +7 .... are you sure that was the right thing to do?
@SimonAndréForsberg - I saw the description saying 10 to power 9 and immediately thought 'overflow' From that point on I was expecting to see power operator, and, it does exist somewhere in my past as the caret ^
 
@rolfl I'm not entirely sure. Go ahead and change it back if I'm wrong.
 
The OP probably meant it as 10 to the power of 9 and wasn't aware of ^ being XOR in many programming languages.
 
That must be it.
 
@Jamal If you're going to put int testCases on its own line, then why not change the degenerate for loop to while (testCases-- > 0) { … }?
 
10:12 PM
Otherwise I believe he would just have said 3 instead of 10^9, if he really meant XOR :)
 
Since I've mentioned my thing, perhaps someone else could point it out.
@200_success I could do that.
 
What question are we talking about? :)
 
Clarification: In the description it says: Since the number of ways can be very large output the answer mod xxxx. Is the xxxx 10-to-the-power-of-9-plus-7, or is it 10-xor-9-plus-7 ? — rolfl ♦ 31 secs ago
 
3
A: Determine total number of ways of reaching a destination

JamalAlthough this is not related to optimization, it looks like you could replace some while loops with for loops. If you're using a counter, chances are you should use the latter type of loop. First, I want to mention that you should use whitespace between operators and keywords for readability. ...

 
^ is exponentiation in Basic and Visual Basic.
 
10:16 PM
@ChrisW Precisely why I didn't say all programming languages
I'm not sure which ones do it what way, but I think 'most' use it as XOR
Especially the C inspired ones.
 
10:33 PM
@200_success Answer has been updated (along with some examples).
 
0
A: Credit card verification: string conversion most optimal?

syb0rgThings you did well Readability - everything was well organized and spaced neatly. Initializing variables within your for loops/adhering to the C99 standard (which is the minimum you should abide by in my opinion). Marking your function arguments as void when you don't take in any parameters. U...

 
Look at that, all three mods working on one question!
 
@200_success There is what that simple "strtok is depreciated" answer would have turned into ^^^
 
And it's not us dishing out some punishment. ;-)
Now let's see all three mods answering the question.
 
yesterday, by Simon André Forsberg
How many moderators does it take to close a question? :)
^^^^ the question?
I thought we had to keep that confidential? ;-)
 
10:37 PM
But anyway, with the ^, it seems clear that the OP didn't test this code (and probably threw out the word "optimization").
 
10:54 PM
(10^9 +7) = 10
So he might have tested it; because the example outputs are less than 10.
 
@syb0rg You still seem to be working on it. =)
 
if getWays is implemented correctly
 
@ChrisW I probably did jump the gun on this one, but it did seem unusual to me. Hopefully we'll be clarified on this, unless it's already determined what was being done.
 
@200_success Yeah, I made the edit with regards to your comment. I didn't see that implementation at first because of how he wrote it up.
 
@200_success i was waiting for my query to be answered, nobody came back, how do u suggest me to proceed? stackoverflow.com/questions/22705945/…
 
11:00 PM
@syb0rg What's 3/2 in integer division again?
 
1
oops
typo in the answer :P
 
@Sham To be honest, I don't understand what you're trying to ask either, in parts (1), (2), and (3). I gave you the answer to part (4).
 
ok
 
This was already a reasonably good visualization:
1
Q: Python memory model for this program

ShamMy query is on the below program with respect to symbols that are storing values and functions, when ran on http://pythontutor.com/. My question is: How does python execution model look for above program on memory before start interpreting the python program? How do i visualise that memory l...

 
part(1) function is stored as an object with class 'function' but here in my second query i got the chance to know how where my code is embed it is code attribute
which NPE answered
does this point make sense?
part(1) is already answered
 
11:06 PM
@syb0rg Sorry, I had to downvote. You just broke the code by rewriting it without understanding it.
 
as i mentioned in the query itself
 
prod = prod%10 + prod/(prod%10 + 0.0);
 
@200_success How does that break it?
It compiled fine. So how does it affect it during runtime.
 
I'll just say that the original
prod = prod%10 + prod/prod%10;
was weird but correct.
 
In part(2), i would like to know, what is the name of the class member which stores the function code that is passed as an argument?
 
11:10 PM
@200_success So you are saying to remove the whole int division section?
 
Read
The Luhn algorithm or Luhn formula, also known as the "modulus 10" or "mod 10" algorithm, is a simple checksum formula used to validate a variety of identification numbers, such as credit card numbers, IMEI numbers, National Provider Identifier numbers in US and Canadian Social Insurance Numbers. It was created by IBM scientist Hans Peter Luhn and described in [http://www.google.com/patents?id=Y7leAAAAEBAJ U.S. Patent No. 2,950,048], filed on January 6, 1954, and granted on August 23, 1960. The algorithm is in the public domain and is in wide use today. It is specified in ISO/IEC 7812-1. ...
... which you linked to. Try implementing it yourself in C.
@Sham Sorry, I don't follow your question at all. Perhaps you could provide some specific code as an example to discuss?
 
>>> def summation(n, term, next):
total, k = 0, 1
while k <= n:
total, k = total + term(k), next(k)
return total
>>> def cube(k):
return pow(k, 3)
>>> def successor(k):
return k + 1
>>> def sum_cubes(n):
return summation(n, cube, successor)
>>> sum_cubes(3)
36
this is there is cs61A text book
in*
above is the example for higherorder function where functions are passed as args
 
@200_success Fixed, kinda. My implementation is very different from his.
So I removed the section.
 
so for summation() function, if i say summation.__code__ i get summation bytecode stored
what about term & next? which attribute bytecode of term & next get stored?
are they just referece variables sharing same byte code that global frame is pointing to?
 
@syb0rg Downvote rescinded.
 
11:22 PM
@200_success Good, thanks. Maybe if you finish reading the rest of the answer, I could earn your upvote ;)
 
@syb0rg Are you done editing yet? =)
 
So... does anyone want to play TTT Ultimate multiplayer with me? I got a GWT Multiplayer version working
zomis.net/tttnew/multiplayer.html if anyone is interested. Just enter your name and click "Connect"
 
@200_success I believe so :P
Until you find some other discrepancy
 
@Sham I assume that you are asking about __code__ out of pure intellectual curiosity? Because I've never used it for any practical purpose.
 
actually am asking such questions because am getting better sense when am writing code where nothing is typed statically in python, am able to visualise my code in a better way, am actually not using this info anywhere practically
 
11:27 PM
Give me a few minutes to think about how to present it.
 
11:45 PM
That was a fast downvote and close vote! :D
(on the incoming question)
 
Well, I supplied the close vote, I'm not sure who supplied the downvote.
 
Looks like this is the same user who posted a now-closed question just today. Is he not understanding?
 
He seems to be mixing up SO and CR
 
-2
Q: Code revision - compile error says illegal start of expression

PivoI'm having trouble getting this to compile. I believe it has something to do with my kelly brackets b/c my error says: C:\Users\Pivo\Google Drive\CIT130 - Java\Chapter 6\PP65.java:72: error: illegal start of expression }//end for ^ C:\Users\Pivo\Google Drive\CIT130 - Java\Chapter...

 
His CR question is on-topic for SO and his latest SO question is on-topic for CR...
-1
Q: Pass an array of numbers into a method that's overloaded

PivoI'm doing my homework and it says to write a test program that prompts the user to enter ten double values, invokes this method, and displays the average value. I was able to get this program working with an overloaded method... but I'm curious to hear your feedback on where I can improve and wha...

 
11:49 PM
That's quite some confusion, then.
 
We do not fix code. We review code. Stack Overflow fixes code. You have posted a question here before that was off-topic for the same reasons as well, with comments telling you this. Please listen to them. — syb0rg 1 min ago
More stern, since this is the second time he has been told.
 
I would edit that, but I usually prefer to not do so for off-topic questions. Seems like a waste since Community will eventually clean up.
 
You seem to be mixing up Code Review and Stack Overflow. Your most recent question on SO should have been posted here, and this question should have been on SO. The difference between SO and CR is, once and for all: StackOverflow - I have broken source code: "I tried to do it right, but it's broken, how do I fix it?" CodeReview - I have finished source code: "Now that I've done it, can it be made better?" Please come back here when you have code without errors and that it works as intended. We will gladly help you clean your code up once it is working correctly. — Simon André Forsberg 1 min ago
 
@SimonAndréForsberg - should I flag that SO post for migration to here ... I think I should.
 
It's really unfortunate that he's having non-working code, because the code stinks smells
@rolfl Yes, I think you should. That would at least give him some +rep here
else
        //do nothing
Why do people do this, seriously!?
 
11:59 PM
Because then the next line they write will be the else ;-)
 
There is his problem btw, missing { } or ;
@rolfl But then the //do nothing would be incorrect.
 
00:00 - 20:0020:00 - 00:00

« first day (329 days earlier)      last day (3694 days later) »