« first day (605 days earlier)      last day (4325 days later) » 

12:01 AM
Btw, the professor took my criticism of his statements regarding endl quite well and thanked me for letting him know.
 
We are pretty much at the magic point from 300 years ago. Any sufficiently advanced civilizations technology will seem like magic.
 
Only to those who don't understand it
 
@Drise Oh, well that's refreshing!
 
@SethCarnegie Do you have any names from -300 years that would quickly comprehend our tech?
@Maxpm I really hope thats the reaction from 99.6% of the profs out there.
 
You never said who it would seem like magic to
 
12:04 AM
ref int foo()
{
    auto p = new int;
    return *p;
}
...
foo() = 3; // reference returns can be lvalues
Does this seem disgusting to anyone else?
 
delete &foo()
wait
that's not even C++
what is ref int
 
@SethCarnegie refereed by an umpire with integrity that calls foul? (see question)
 
@SethCarnegie It's from D.
 
ah
well D has garbage collection
So it's fine there
 
I'm actually not certain that that will be garbage-collected.
I think garbage collection is only with classes (not structs), but I'm not certain.
D's garbage collection rules always confused me.
 
12:11 AM
Does sizeof(int) tell you the bit-ness of the machine?
 
bit-ness?
 
Garbage collection is awesome if done right.
 
32 bit, 64 bit
 
Isn't 32-bit vs. 64-bit just an OS choice?
 
12:11 AM
It tells you what your compiler thinks is an int.
 
Not of the machine sorry, of the program
 
> Safe functions are functions that are statically checked to exhibit no possibility of undefined behavior.
(Safe functions are marked with @safe.)
 
I love opening my mail box to find dollar bills inside.
 
My God, why on earth isn't that the default?!
 
I'm not aware of a single machine/compiler aside from ancient versions of C where sizeof(int) is not 4 bytes.
 
12:14 AM
@Mysticial on my Arch box, int is 8 bytes
 
@SethCarnegie Arch Linux?
 
@SethCarnegie Is your compiler on crack?
 
@Mysticial yes
 
@Mysticial I have anectodal evidence that a char can be 24 bits.
 
@Mysticial On DCPU-16 it's 1 or 2 bytes (not sure, but certainly not 4).
 
12:16 AM
sizeof(size_t) is much more reliable for determining the bit-ness without looking at compiler preprocessor macros
 
what about intptr_t
 
@Mysticial Still you need the bit-ness of the char.
 
What about sizeof(maxint_t)? (Not sure.)
@CaptainGiraffe sizeof(x) * CHAR_BIT
It's a standard macro, so it's portable.
 
@RadekSlupik Winner winner poultry dinner!
 
@RadekSlupik Nah, that'll give 8 bytes for the vast majority of platforms 32 or 64-bit.
 
12:18 AM
@CaptainGiraffe I would love to hear the story behind that.
 
@CaptainGiraffe define can
 
What's the point in compilers making their types bigger than the sizes guaranteed by the standard?
 
I'm also not aware of a single platform that has CHAR_BIT != 8. Supposedly some embedded DSP devices have 4-byte chars.
 
@SethCarnegie An object you can store bits in ( I know it is recursive)
 
@CaptainGiraffe by that definition the world is flat
 
12:20 AM
If CHAR_BIT == 24 (and thus a byte is 24 bits), sure, a char can and will store 24 bits.
 
@SethCarnegie Radek saved me with the example of a 16-bit char.
 
The compiler was non-standards-conformant then
 
@SethCarnegie Why?
 
It's defined in the standard to be 8 bits
 
@SethCarnegie not at all char = 1
 
12:21 AM
A byte can be 16 bits, and a char is defined by the standard to be one byte.
 
Oh yeah, you're right
 
Is there a programming language for every alpha character?
 
byte != octet
 
obviously
@Drise no
 
T (right now) IL: R is a programming language
 
12:22 AM
I hope not.
 
The aim of this list of programming languages is to include all notable programming languages in existence, both those in current use and historical ones, in alphabetical order, except for dialects of BASIC and esoteric programming languages. :Note: Dialects of BASIC have been moved to the separate List of BASIC dialects. :Note: This page does not list esoteric programming languages. A * A# .NET * A# (Axiom) * A-0 System * A+ * A++ * ABAP * ABC * ABC ALGOL * ABLE * ABSET * ABSYS * Abundance * ACC * Accent * Ace DASL * ACT-III * Action! * ActionScript * Ada * Adenine * Agda * Agor...
 
Would it be evil to name my language ;?
 
0
Q: How to compute weighted mean in R?

FrankHow do I compute the weighted mean in R? For example, I have 4 elements of which 1 element is of size (or: length, width, etc.) 10 and 3 elements are of size 2. > z = data.frame(count=c(1,3), size=c(10,2)) > z count size 1 1 10 2 3 2 The weighted average is (10 * 1 + 2 ...

 
As in, the semicolon character?
 
@Maxpm That would be awesome
 
12:22 AM
My language is called daklang, but the spec is far from complete. :P
 
The poor Googlers.
 
lol
 
What kind of language is daklang?
 
@SethCarnegie If int is 8 bytes on Arch Linux, then that would break the SSE intrinsics.
 
@Maxpm Procedural with pure functional elements.
 
12:23 AM
@Mysticial just reportn
 
For example: __m128i _mm_set_epi32(int i3, int i2, int i1, int i0)
 
@Maxpm Other people are way ahead of you there. I have compiled a list below (In whitespace). Might be that the chat system somewhat trucates my list, but it is complete.
 
I'm still thinking about RAII vs GC though.
I think I'll go for GC.
 
Do both
LIKE PHP
 
@RadekSlupik My vote is for RAII
 
12:24 AM
If I would do GC, resource handling would be like this:
open("myfile.txt", [] (Stream stream) {
  // do stuff with file
});
open would be implemented like this:
 
@RadekSlupik Mind if I take a look at the spec? Depending on its simplicity, I might want to make a compiler for it as practice.
 
Proper way to do GC would be like this. Sock it........ I dont really care.
 
@Maxpm It's not done yet, but if you want I can upload it so far.
It basically only discusses a small part of the syntax right now.
 
No pressure.
 
12:26 AM
@RadekSlupik Also thats done in the constructor, you are on the RAII team
 
So it seems we are missing: A (Does A#, A+, or A++ count?), H, I, N, O, P (Does P# count?), U, V, W, X (Does X++ count?), Y, and Z
 
@RadekSlupik Thank you for making the capitalization explicit in the title. I was never sure how to capitalize things like Autotools, which GNU capitalizes in titles but (generally) leaves uncapitalized in prose.
 
@CaptainGiraffe open is a function, not a constructor.
 
@RadekSlupik You have to change that!
 
@CaptainGiraffe no, why would it return an object?
It's a function that takes a lambda. The lambda takes an object of type Stream (should be FileStream though).
It can be implemented like this:
 
12:29 AM
@RadekSlupik A constructor return an object? you fiendish heretic!
 
weak open (String fname, weak (FileStream) f) -> {
  stream = FileStream(fname);
  f(stream);
  close(stream);
}
(weak indicates an impure function. I have to change that, too verbose.)
 
@RadekSlupik ForEach support?
 
I just think RAII is elegant. I don't have any problem with GC, and for sure won't get dogmatic about it =)
 
@Drise How do you mean?
each(array, [](element) {
  // ...
});
 
For Each temp As item In itemcollection
 
12:31 AM
This is not VB.
 
temp.PrintSelf
 
@RadekSlupik isnt that python my eye spy?
 
Just a useful "might want to add"
 
@CaptainGiraffe Never done Python, so I can't tell.
I got inspired by Ruby for this.
my_array.each do |item|
  # ...
end
# Ruby
I think I'll use symbols instead of words for pure and impure functions.
Something like $ and %.
 
Yes and this pretty much should end this dialogue =)
 
12:33 AM
Ew sigils
 
or well end up in perl without the pedigree
 
@RadekSlupik yes == true?
 
@Drise Where does it say that?
 
An if statement executes its body only if a given expression yields yes
 
Oh shit I have to update that.
Thanks for the note
 
12:35 AM
lol
I'm a contributor! yay!
 
@CaptainGiraffe RAII and GC aren't mutually exclusive.
 
They should be Yes, No and Boolean, and they should be in the library, not in the language.
 
@RadekSlupik I'm confused...
 
I fixed some of the oddities here: f.cl.ly/items/0a3O1J0q1p2P4429033s/Specification.pdf but I'm going to bed now.
 
god, so many new languages I want to help with.
I'd really like to help write (atleast) part of the parser for WIDE
@DeadMG Note above, btw, if you feel you need help.
 
12:44 AM
Aren't parsers typically generated automatically these days?
 
@Maxpm the bad ones
Why would this be failing?
std::stringstream ss;
ss << 1;

std::cout << ss.fail() << std::endl;
fail prints 1
but not on Ideone, just on my computer
 
Damaged RAM chips!
 
Gremlins!
 
@SethCarnegie I agree that that seems perfectly legit.
 
maybe it's cause I'm using GCC 4.7 on windows
 
12:49 AM
Let me boot VS and ill see myself
 
@Drise don't bother, I know it's correct
 
I'll write my daklang implementation in Haskell (hoping there are LLVM bindings available).
@Seth maybe the stringstream caught an std::bad_alloc?
Do you have any memory corruption?
 
@RadekSlupik I'm doing it at the beginning of the program
I don't have any memory corruption
 
Try debugging it.
 
I did it in a standalone program and it worked fine
it's just this program
I think it might be ICU
 
12:53 AM
ICU?
Btw, VS on windows prints 0
Just sayin
 
@Drise it prints 0 for me too in any other program
I literally have only that code in main and it's failing
but if I make a new file and try it by itself it's fine
 
Make clean?
Whenever things fail that shouldn't be failing, make clean. lol
Wow, is that theoatmeal star being DDoS?
 
C++ sucks. Obsolete piece of shit.
 
Yep, if I don't link ICU it works fine.
aha
 
I think he found it.
 
12:57 AM
it's -D_GLIBCXX_DEBUG_PEDANTIC and -D_GLIBCXX_DEBUG
how stupid
 
Uh?
 
Dumb
I think it's cause I didn't compile ICU with those same flags
 
lol
 
I have no idea how to pass a flag to every compiler command line in ICU so I guess I'll just not use the debug versions of the STL
Or, LibCXX or whatever
 
1:00 AM
hey
 
Hey Cat.
 
Sweet, fixed it
 
Yay! Drise got his first silver badge!
By whoever starred "is your compiler on crack?"
 
That was me. :3
 
10 stars from 10 users.
@CatPlusPlus You seem to be one who would have some input:
1
Q: What happens in memory when calling a function with literal values?

DriseSuppose I have an arbitrary function: void someFunc(int, double, char); and I call someFunc(8, 2.4, 'a');, what actually happens? How does 8, 2.4, and 'a' get memory, moved into that memory, and passed into the function? What type of optimizations does the compiler have for situations like th...

 
1:05 AM
@SethCarnegie There's an environment variable for that.
 
@Maxpm Windows too?
 
@SethCarnegie Probably, yeah.
I don't remember off the top of my head.
It's CXX-something.
 
@Drise That's already answered
 
It's not a matter of OS, it's a matter of build system.
 
@Maxpm can you pass something to make?
ah
6
Q: How to define compiler flags at compile time using CMake?

Łukasz Lewadd_definitions adds definition that is fixed at time when cmake (not make) is executed. How to define them when make (not cmake) is executed? The value of the definition will be an output of a custom command.

 
1:07 AM
@SethCarnegie I know, but from my observations, Cat is quite knowledgeable and may have a different or more detailed answer.
I dislike CMake
 
@Drise Things like that are just straightforward facts, there's not really much more to say than what is said there
 
@SethCarnegie You have a point.
 
4
Q: Passing C/C++ #defines to makefile

MawgI develop C/C++ using the Eclipse IDE. Eclipse also generates a makefile which I don't want to edit as it will simply be overwritten. I want to use that makefile for nightly build within Hudson. How do I pass #defines which are made in the project file of the IDE to the makefile ? (and why doe...

That's the one
 
1:20 AM
I don't mind hand-writing makefiles.
Maybe I'm weird.
 
Oh hey, I was helping someone today, and he said "myexecutable.exe is not a valid windows file". Is that his problem, or mine?
His as in something is stopping it (antivirus maybe) or did I not provide a proper executable?
 
64-bit exec, 32-bit OS?
 
hmmm maybe
If that's so, I told him we'd compile it together tomorrow.
 
$ file myexecutable.exe
Or however that command is called on Windows.
 
1:55 AM
Blah. This has been pissing me off for the longest time now.
And it just keeps laughing in my face.
I have a program (VB.NET) and it runs just fine for a varied amount of time. It logs keys and emails them to an address I specify. However, it stop arbitrarily, and does not report any errors, or throw any exceptions. It simply just stops. However, right before it stops running, it logs a single character.
For example:
----------- Software Design Document 1.docx - Microsoft Word (6/11/2012 8:42:08 PM) User Drise on computer Drise-LAPTOP ------------
[c]c[/c][c]v[/c][bk][bk][bk][s][/s][s]c[/s]onstructs a [bk][bk]the [s]s[/s]tudent[c][s][<-][/s][/c][c]b[/c][->] object[bk][bk][bk][bk][bk][bk][bk][c]b[/c] object witjh[bk][bk]=h[bk][bk]h defea[bk][bk]ault valuesis a constructor and has no return type;[bk].[s]
Is the last line of log while it is working.
And when it stops logging characters, I get
This log was sent on Monday, June 11, 2012 8:50 PM from user Drise on computer Drise-LAPTOP

e
A single charcater.
And then it seems to no longer respond to keyboard inputs.
Because it relies on capturing ctrl+alt+s to show the mainwindow (it's hidden by default).
But why a single character?
 
2:11 AM
Wow this one went down fast:
-6
Q: What does x->y -= 2 in c do?

user1450181What does x->y -= 2 do in C? I'm new to C.

 
Ouch
 
The community can seem to be quite harsh sometimes; Sometimes it's called for.
 
2:33 AM
I eally wanted to tell him bw3's was so gonna sue him stackoverflow.com/questions/10989521/…
 
buffalo wild wings
 
1691814 pubby the Sorcerer (level 27, 238/238 (241) HPs)
             Began as a Demonspawn Monk on June 10, 2012.
             Was a High Priest of Jiyva.
             Escaped with the Orb
             ... and 5 runes on June 12, 2012!
YEAH! First ascension!
 
lol yay you
 
2:52 AM
Ascention? Sorry, I don't think I know what game that is..
 
3:16 AM
Is there a data structure that has the following properties:
1. Very efficient insertion
2. Elements are sorted according to a certain comparision function
3. that is different from the comparision function used to locate elements
?
something like priority queue, but having a different function for identifying elements and sorting them
I need to store data that look like this: {id, value} and I want to have only one instance of elements with a certain id and I want to have an element with the highest value on top, but the value is always a sum of all inserted values with the same id.
so for example if I will insert {id = 1, value = 10}, {id = 2, value = 20}, {id = 1, value = 25}, {id = 3, value = 5},
this data structure will store data in the following order: {id = 1, value = 35}, {id = 2, value = 20}, {id = 3, value = 5}
I know that I can use 2 different data structures to achieve the same effect (hashtable + heap) but I'm wondering if there is one with the same properties that I'm not aware of
 
@KarimA I don't know that there's a single data structure to do it, but something like Boost Bimap at least hides most of the complexity of having two structures indexing the same objects.
 
Jerry, thanks for this.
 
could use some advice for speeding up a chunk of code
 
The problem that I see here is that I'm trying to sort on two axes.
 
3:42 AM
Gaming is now called Arqade
 
any way to speed up C++ execution?
i literally need like .3s boost
anything helps
 
Remove code until it runs .3s faster
 
not possible
is there a faster way to do char* n = new char[upperLimit]();
 
@AgainstASicilian Lots of them, but hard to guess what might apply with no clue of what you're doing.
 
lots of iterative loops
 
3:50 AM
@AgainstASicilian Have you profiled to find which are bottlenecks? Have you, for example, tried unrolling some that are bottlenecks? Most compilers can unroll to some degree, but with care you can often do better.
 
@AgainstASicilian That is very helpful information
 
	for (int a = 1; a <= maxA; a += 1)
		for (int x = 2*a + 1; x < 5*a; x += 1){
			test = 6*a*x - 5 * a*a - x*x;
			if ((test > 0) && (test < upperLimit))
                if (n[test] <=1) n[test]++;
		}
stuff like this
i am just trying to find anywhere, anything, to make it just .3 faster
 
omg apple releases new macbook with retina display must have cant wait must have i want need must have need need want mac os x apple apple apple apple
Also hello guys what's up?
 
you have an addiction problem
 
@AgainstASicilian It looks to me like you should be able to solve that inequality algebraicly.
 

« first day (605 days earlier)      last day (4325 days later) »