« first day (677 days earlier)      last day (3356 days later) » 

12:00 AM
@rolfl Your welcome, @rolfl. I thought it could be useful.
It's important to keep track of our zombie population.
 
@SimonAndréForsberg BBC is awesome
 
Fat chance of this being helpful for my management essay, Google:
 
@UtherTG I worked on this problem last year. This post might help you. You'll just need to tweak the code a bit: codereview.stackexchange.com/questions/57976/…Pete 24 secs ago
 
I wonder what my professor would say if I cited that.
 
-1
Q: Setting textureview to stream camera

MooseSo I am creating an application for android in Java and I need to set Textureview to Stream camera, but I don't quite know how you would go about doing that.

 
12:08 AM
@rolfl Another feature I added earlier today:
in Duga's Playground, 5 hours ago, by Duga
Simon André Forsberg vs. Mat's Mug: 2036 diff. Year: +1100. Quarter: +1100. Month: +530. Week: -25. Day: -15.
Now I can keep track of the wall between me and @Mat'sMug :)
 
Hah! I like it.
 
All these tasks are now dynamically configurable as well. So I can add new tasks without restarting that poor @Duga
 
Did you fix his memory?
(rather, the memory incontinence....?)
 
Not entirely certain yet, and it's still a she!
2
 
I have a potential solution for you....
 
12:09 AM
For how long does something have to work before you know that it's not broken?
 
I brought a cluster online yesterday...... with 1TB of memory ;-)
 
JvisualVM again....
Connect to the host, run a GC.... wait a day, run a GC, and compare the used memory size
 
It seems like a recent change might have helped a bit though... but I changed something on my Unix system, not in @Duga...
I'm honestly not entirely sure what it does, but it does free up a bit of memory on the machine
sync; echo 3 > /proc/sys/vm/drop_caches
 
I like not having to worry about garbage collector.
 
12:13 AM
@nhgrif I like not having to worry about freeing memory manually.
 
Me too. I don't worry about this.
 
@nhgrif Likes automatic memory management, I think he called it.
Anyway, supper's on, so I'll leave you to discuss it.
 
Automatic Reference Counting.
ARC-magic.
 
I was thinking about things today.... Today, on the cluster, I wrote a system dependent of programs I wrote in: Bash, Java, Scala, python, Javascript and using systems including Linux, Apache Spark, HDFS (hadoop), NGinx, Node.js, Jenkins, Maven, SBT, and ssh
 
@nhgrif Isn't that precisely what garbage collecting is based on?
 
12:15 AM
It might be based on it, but garbage collection works completely differently from ARC-magic.
ARC is manually memory management automatically managed for you.
 
@rolfl I think you missed to use a language or two.
 
You don't have to wait for GC to come by and sweep everything up--it's deallocated as soon as you're done with it. And you don't have the processor spending time doing garbage collection.
 
probably, depending on how you classify things too... I mean, there's JSON, YAML, XML, and properties files.
 
@rolfl that sounds better anyway :) Did you come to any conclusions in your thoughts?
 
Well, I have this nagging feeling that i am not doing anything "serious", and that I am not using the stuff I am "an expert" in..... But then I realized that very few people could actually be doing what I do anyway..... part of my expertise is knowing a little about a lot.
 
12:20 AM
@rolfl That, and the ability to always learn, is probably the best expertise there is.
 
Dinner, and a POI... BBIAB
 
Very strange. My monitors just died and now have come back.
I'm not sure if it was a loose cord or something--maybe.
 
@rolfl ooh, POI! Just don't eat as much popcorn as I did!
 
12:35 AM
My first GOLD badgeeeeeeeeee... YAY
2
no grieving anymore @rolfl
 
while (@Simon < full) {
    popcorn++;
    POI++
}
 
@Phrancis that needs a CancellationToken my friend :D
 
@mjolka do you by any chance know what does this mean "access foreach argument in CLOSURE, may..."
I get this hint for the following line with Resharper
ShowAllParts(pricelist.Name))
 
Something about using a foreach creates a temporary variable in a certain scope
 
or something vague I don't really follow like that
 
Seems C# closures are a concept of their own... wow... learning on the way
 
If you want a code review, you might want to ask on CodeReviewdyp 1 min ago
 
That's pretty much what I said
> In C# 5, the loop variable of a foreach will be logically inside the loop, and therefore closures will close over a fresh copy of the variable each time. The "for" loop will not be changed.
 
I was aware of that, however I didn't know the word Closure is a programming term as well.
it doesn't look like one really :P
“In computer science, a closure is a first-class function with free variables that are bound in the lexical environment.”
 
12:52 AM
What is POI?
 
Person Of Interest I assume
 
@guyfleeman No. All SE sites have a "primarily opinion based" close reason. While some SE sites allow some degree of opinions (Code Review, for example), there is not really SE site for questions like "Help me choose a programming language!" — Simon André Forsberg 35 secs ago
 
Yes, second person this week to learn about programming closures in this chat.
 
I guess I'm the third.
 
@nhgrif really ? :) I must have stopped reading the chat for couple of mins
 
12:53 AM
Who was the first?
 
@SimonAndréForsberg The answer to "What programming language..." is always Assembly.
 
nggrif I assume :)
 
@Mehrad overexchange
I've known closures for some time. I first knew them as Objective-C blocks.
 
@nhgrif No no no. Either or , depending on the question.
TTGTB
 
Well, I know the term "closure" anyway, reading about it on the web now.
 
12:55 AM
@nhgrif and now you ditched that beauty for Swift
 
I haven't ditched Objective-C.
 
Oh, I saw a Python closure once.
I didn't know what it was or how it worked.
 
Moreover, it's probably a bad idea to ditch technologies...
 
@Hosch250 it's just a glossary term. After I read it the only thing I learned was that now I know what I already knew is called Closure :)
 
OK, I don't know them.
I just write methods and lambdas.
@nhgrif Well, I don't quite know about that.
I think "A" has pretty effectually been ditched.
I never hear of anyone using "B" now either.
 
12:59 AM
I'm not saying that you should continue to develop in outdated technologies.
I'm saying that as an individual, you shouldn't "ditch" your knowledge of a technology.
 
No, you should expand it so much it essentially becomes a new technology.
 
COBOL is 56 years old.
Older than one of my parents.
C is 43 years old.
 
C will probably always be around.
 
If, by the way... you learned COBOL as it were just coming out and you were just getting your first job, you'd have retired by now
 
C, IIRC, is used for embedded systems because it is so lean and fast.
C++ is being worked on to do this, but it isn't as good as C in this respect yet.
Also, Linux, Unix, and parts of Windows are all written in C.
I bet C will be around when the flying saucers come.
 
1:04 AM
I wouldn't bet on always or nevers.
 
Just a figure of speech, but I see your point.
Who knows, maybe the C-killer is just around the corner. LOLCODE, anyone? ;)
 
C would be good to learn, because with all the stuff that's built on C, it'll still be in use by the time any of us retire, no matter what happens.
 
I know, but I don't have enough time.
I hardly know C#, and the more I learn, the more I realize I need to learn.
I want to get at least one language down really good.
After C#, I'll probably go back to VC++ and learn that good.
C is fairly similar to C++, so I should be able to pick up C easily after that.
 
I learned Objective-C, VB.NET, Java, and C++ simultaneously. At least, the basics.
If you want an OOP language that is similar to C, Objective-C would be more similar than C++.
 
Well, I can write a guess-the-number game in LOLCODE, C++, Python, and C#.
I'll probably learn C++ because it is part of the .NET system and I don't have a Mac.
 
1:09 AM
C++ is not part of the .NET system.
 
I thought Visual C++ was?
 
Sure. But Visual C++ is not C++.
 
Yeah, I always forget they are different.
 
Visual C++ is C++ plus Microsoft tinkering.
 
and @Hosch250 is a Microsoft type of guy so Microsoft Visual is always implied
 
1:11 AM
Not everything that works in C will work in C++. Not everything that works in Visual C++ will work in C++.
 
No, I've heard that.
 
Consider VB.NET and C#.NET
The actual languages are Visual Basic and C#
You can write them independent of .NET
But no one does. (As far as I know?) It's pretty pointless without all the .NET frameworks.
It's the same with Objective-C.
You can actually write and compile Objective-C on a Windows machine (I believe).
 
Probably, with the right compiler in.
 
But you can't get the Apple frameworks on a Windows machine.
So it'd be pointless to write Objective-C on anything but a Mac, because Apple is the only one with extensive frameworks to support Objective-C.
 
Talking about extensive framework support, is the way MS open-sourcing .NET possibly going to turn that into a sort of Java thing?
They specifically stated they are working on making it run on Linux/Apple systems, or they want the community to, or something.
Also, what implications would that have?
Would pretty much any Windows software all of a sudden just be able to run on other ecosystems?
At least, other ecosystems with .NET installed?
 
1:17 AM
I don't know.
You'd definitely have to have .NET installed.
 
Would that draw developers into .NET because it could run on anything, like Java, or would it not make much of a difference because the other systems would still have better support?
 
I don't know.
 
OK.
 
But presumably, other languages could being to use the .NET frameworks, I guess.
Like, an Objective-C.NET wouldn't necessarily be impossible.
 
Of course, but that would probably only affect new languages.
Or would it?
 
Java already has extensive support files.
 
This is one of my favorite pages on Stack Overflow.
 
But again, if there was Java.NET, .NET would suddenly open up to a bunch of developers.
 
I misread that first time.
 
But again, Oracle might complain.
Awfully complicated.
On a different note, I'm thinking of how I would write an application with a deck of cards.
Let's assume I have my Card class and my Deck class.
And, a Shuffle method.
 
1:22 AM
Ok.
 
I call Shuffle, which recursively runs about 10 times.
 
Why does it recursively run? And why does it run more than once?
 
That splits the deck, alternatively enters the opposing cards, and runs again.
It calls itself to get good and shuffled (I'm simulating a real shuffle here).
 
You can't simulate a real shuffle.
 
No, but I'm trying to.
 
1:23 AM
you can't.
All you can do is make the processor spend more time doing things.
 
You know how you split the deck in two and flip them so opposing cards approximately land on top of each other.
Then do that a few times...
 
I mean, if you really studied the physics behind shuffling a deck of cards, you might be able to accurately simulate shuffling a deck...
 
Anyway, then I pseudorandomly swap two cards a few times too, to get a bit of randomness in their.
 
But that unto itself would essentially be a brickshithouse worth of code just to call a shuffle() method.
Simply selecting cards at random from array 1 and inserting them in order into array 2 sufficies. Anything extra doesn't add anything.
 
OK, I see.
That is better than what I was thinking.
 
1:26 AM
brickshithouse - Love it.
 
I was planning on simulating the Riffle shuffle.
 
Well, @Hosch250, to accurately simulate that... probably at least a month's worth of work and that doesn't even count the actual studying of how cards are actually shuffled... cards sticking together, etc.
 
@Hosch250 Animated GIF might do just as good
 
All you really want is a randomly shuffled deck of cards, right?
 
1:28 AM
@nhgrif That was why I was going to pseudorandomly swap cards a few times.
Yes, I was over thinking the problem.
 
Check out the Wiki mjolka linked.
and you're done.
 
Sure will.
I have a set of Knuth books, so I'll look at Algorithm P too.
 
The randomly shuffle the deck to perfect-ish randomness in computer code is simple and takes just one pass through the deck.
Multiple shuffles don't increase the randomness.
A real life shuffle isn't anywhere near as random. Even if you use a machine, and even if you shuffle 30 billion times.
 
There is just something odd (to me) about modifying a random function to be... less random? Differently random?
 
No, I was thinking about simulating a real human shuffling.
 
1:31 AM
Cards stick together, human shufflers aren't perfect.
 
Exactly.
 
0
Q: Kth to last element of a singly linked list

giulio Find the kth to last element of a singly linked list Any comments? import org.junit.Test; public class Solution { // Find kth to last element of a singly linked list // Solution proposed: Use a runner that is k steps ahead // when runner hits end of linked list, slow on kth to end el...

 
I was going to do a "perfect" shuffle, then randomly swap cards a few times to break the "perfectness" of it.
 
So in order to simulate this, it'd take a ton of studying on the science behind actually shuffling a deck of cards.
 
Yeah, you are right.
I was over-thinking it again.
 
1:32 AM
So, you're going to do a few extra swaps that ultimately won't change anything, really. Because you haven't broken the randomness.
 
Not anymore I'm not.
I was thinking that a "perfect" Riffle shuffle about 10 times, plus swapping cards 20 times wouldn't be predictable by the user.
But, that is way more work than the Fisher-Yates shuffle.
So, that solves my problem of how to keep it random across instances of the app opening without storing the deck.
 
what?
Did you know, by the way, that there's a bug in .NET's random function?
 
No, is there?
 
Yep.
 
I learned from Knuth that no algorithm can be truly random.
What is wrong with it?
 
1:37 AM
@iharob The format I provided would parse correctly what the OP wishes to parse - write a test program to verify if you must, but it is besides the point. He did not ask for a code review, he asked how to do something, specific with atol which is what I provided in my answer. =) — Segmented 8 secs ago
 
Hmm, couldn't easily find the article.
But basicallly... for signed integers, the absolute value of the largest negative number is 1 larger than the largest positive number
And if you leave your computer on for like 38 hours or something like that and call random at just the right nanosecond, it tries using a value one larger than the maximum integer size and crashes.
 
Woohooo!
That sounds exciting!
And then I would sit there and trace the program through and through and try to find where it crashed, and probably never find where my bug was.
I guess I'd better remember that and use a try/catch there.
 
@nhgrif i think you're referring to this line referencesource.microsoft.com/#mscorlib/system/random.cs,62
which used to just take abs of the seed
 
I should write a patch.
I bet someone else already did, though.
 
@mjolka Is it fixed?
 
1:43 AM
@nhgrif yes int subtraction = (Seed == Int32.MinValue) ? Int32.MaxValue : Math.Abs(Seed); (unless i'm misremembering and the bug was on a different line)
 
The line looks like a fix, yes
 
Yep, it's fixed.
Look at that shocking spacing around the operators.
They should improve their naming too.
 
Shocking spacing?
 
What?
 
Que pasa?
 
1:45 AM
for (int i=1; i<55; i++) {  //Apparently the range [1..55] is special (Knuth) and so we're wasting the 0'th position.
  ii = (21*i)%55;
  SeedArray[ii]=mk;
  mk = mj - mk;
  if (mk<0) mk+=MBIG;
  mj=SeedArray[ii];
}
Sometimes they use a space, sometimes they don't.
 
Oh
 
Ah, the next lines
I read recently that they're going to do a mass cleanup soon (or already did) as part of the release to github
 
for (int k=1; k<5; k++) {
  for (int i=1; i<56; i++) {
SeedArray[i] -= SeedArray[1+(i+30)%55];
if (SeedArray[i]<0) SeedArray[i]+=MBIG;
  }
}
 
"Zeroeth" (0'th) needs to become a real word
 
1:46 AM
Using Java braces, not C#, and bad indentation.
I wonder, would they appreciate any help?
 
@Phrancis 0'th is pronounced "first".
 
@Hosch250 They're called Egyptian braces.
 
OK, I was going to say that I can space operators as well as anyone.
@nhgrif I thought it was K&R braces.
 
It's a matter of loading the solution in VS and do a cleanup with their custom Roslyn tools or just Resharper
but they'll want to do everything in one go and address multiple issues
 
1:48 AM
OK.
Does Resharper have a thing where you can only use it while in school?
I can use VS Pro while I'm in school, but then I have to switch to VS Community.
I mean, the free student edition.
 
Unless you can write C# in Eclipse :D
 
@Hosch250 K&R omits braces for one-liners. "One-True-Bracing-Style" says braces are not optional. "Egyptian Style" refers to both, I think, but primarily just says the opening brace goes on the same line as whatever it's opening.
When the opening brace is on a line by itself, this is referred to as "Allman" bracing.
 
@Phrancis Don't know, I already have everything in VS, so I'll probably keep it there.
 
@Hosch250 I'm not sure what you're asking here
 
I can use VS Pro because I have a U address.
I was told by someone here that Resharper has a similar program, but I don't know if you have to stop using the product once you lose your U status.
 
1:52 AM
@Hosch250 That was a joke, btw. Eclipse is for Java et al.
 
You get 1 year of resharper license
 
OK.
 
if you want to continue, you'll have to provide your email address again in 1 year
 
OK.
 
I paid for it my first year (100€) and used the student license a few weeks ago at the renewal
 
1:53 AM
Know why they're called Egyptian braces?
 
I'd still pay for it in a heartbeat
 
@nhgrif Yeah, I saw CodingHorror's article.
@JeroenVannevel What in particular does it do?
I'm getting along fine without it, but if it will really help me, I might as well try it.
 
public class ILookLikeCSharp
{
	public static void main(String[] args)
	{
		System.out.println("Hey ma' I look like C#!");
	}
}
 
Look at that!
 
1:57 AM
    @implementation ILookLikeCSharp

    + (void)main:(NSString *)args
    {
        NSLog(@"Hey ma' I look like Objective-C#!");
    }

    @end
 
That ^ does NOT look like C#.
Objective-C#, sure.
 
Pragmatics ftw. Or maybe not :)
 
class IAmCSharp
{
	public static void Main()
	{
		Console.WriteLine("Hey ma, I'm C#!");
	}
}
 

« first day (677 days earlier)      last day (3356 days later) »