« first day (600 days earlier)      last day (4351 days later) » 

4:00 PM
link broke for me
 
and then..."Oops, something bad happened"
 
@RMartinhoFernandes 500 lolcats? What, did you count them all?
 
@Neil 500 is the HTTP code for internal server error. SO shows a lolcat when that happens.
 
@RMartinhoFernandes oh, heh, it's your question
 
@RMartinhoFernandes Oh, that explains it then.
 
4:04 PM
Different SE sites have different pictures, though. Not always cats.
 
@RMartinhoFernandes That was intense.
 
works fine when I search for "bananas" or "search", but not "chat"
nope, "chat" works now, just slow
 
There's probably just a timeout or something
 
@RMartinhoFernandes Ahh the lolcat that's using an unconnected wired mouse again.
 
@RadekdaknokSlupik I explained that away before!
It makes perfect sense.
 
4:06 PM
posted on June 07, 2012

C and C++ programmers usually express ranges asymmetrically

 
@Neil Yeah, there's a timeout. I had trouble with it before, but Marc turned on the "dammit, would you just work?" flag on SQL server: meta.stackoverflow.com/questions/114471/…
 
TF2 time.
 
@Feeds Holy cow a C++ blog post that doesn't have C++11 in the name
 
@RMartinhoFernandes SQL Server? Oh dear.
 
4:10 PM
What about it?
SO is built on a Microsoft stack.
 
hmm, so, in CUDA, since kernel calls are non-blocking...how do I know when the kernel has finished executing so I can copy the result back to host memory?
 
@melak47 The memory transfer blocks until the kernel has completed
 
ahh
 
In general, subsequent calls in CUDA wait for the previous action to complete
 
@KonradRudolph But if I launch two kernels on different devices, they won't, right?
 
4:12 PM
That's pretty different to in OpenCL you get an event you can wait on and you can make the copy wait for the (or any) event to occur
 
@melak47 It shouldn’t block. That said, I’ve never tried that
 
If else or switch?
 
well, from what I read kernel launches don't block anyway
 
@Drise I sometimes use if-else chains even when a switch looks more appropriate, because switch syntax is very warty.
 
Ell
tv tropes security warning thing!
 
4:13 PM
What?
 
Ell
when i load this page i get a host doesnt match security signature thing o.O
I have no idea what it means
 
@awoodland Speaking of openCL, how is that looking now? I heard somewhere that getting your code to compile for both nvidia and amd hardware isn't always trivial?
 
@Ell Are you using the HTTPS link someone tried to post?
 
@Ell oh, I had a "untrusted certiificate" warning when I tried to open the tvtropes site via https...and I posted the image link here, could that have done it?
 
That's normal. TVTropes doesn't care about HTTPS .
 
Ell
4:17 PM
@RMartinhoFernandes not using a link - maybe its because chat loaded an image or something? I don't know - just curious was all
 
@melak47 the tricky thing mostly isn't getting portability, but getting portable stuff to run well
 
@Ell Yeah, someone tried to post an image through HTTPS. That was probably it.
 
e.g. different platforms have different "tricks" and ways of writing things to be super fast
 
yeah chat tried to load the image, but since tvtropes doesnt do https that went nowhere...sorry :p
@awoodland hmm, ok
 
@Ell As compensation, here's a non-HTTPS TVTropes link free of charge.
 
4:20 PM
I've used it a fair bit on nvidia hardware but not worried too much about portable speed stuff beyond simply being correct
 
Ell
hmm need to convert 2d height array to triangle_strip
 
Building a heightmap?
 
Ell
yeah
with Ogre3d
 
I have done height maps with voxels and Perlin noise, but that's trivial. Not sure about triangle strips.
 
Use the geometry shader!
 
Ell
4:23 PM
I can get a heightmap represented by points, but obviously that wont do
I need to make it with triangles and whatnot to texture it
@RMartinhoFernandes I still don't understand what a "shader" is - graphics really confuse me
 
@Ell It's a program that runs on the GPU.
 
Ell
and you can programme your own ones or, are there set things? I see pixel shader, vertex shader, etc. etc.
 
You can program your own ones.
 
There are defined parts of the pipeline where you can program, but you can program pretty much whatever you want in them.
 
I wanted to do something, but I forgot what it was…
 
4:26 PM
Also, IIRC, switch does not accept types like string and such
 
Never mind I know it again.
@Drise Only integral types.
 
Irksome.
 
VB does it too.
 
4:27 PM
@Ell The "shading" parts are programmable. The rest is fixed.
 
@Drise hashmap for switching on a string
 
Ell
@RMartinhoFernandes thank you
 
@MooingDuck Why would I go through that trouble when If Else works so well?
 
@Drise One or both of flexibility and fastness.
 
there's a rumour going around that last.fm password have been leaked now too
 
Is everyone giving away our passwords?
 
hmm, is std::hash("thing") a valid switch case value, and would it match that of std::hash(std::string("thing"))?
 
Ell
@awoodland only the sha-1 unsalted hashes I beleive
not passwords
 
@MooingDuck Switch cases must be integral constant expressions.
 
@MooingDuck No, and no.
 
4:30 PM
@Ell that's as good as
 
std::hash("thing") ain't a constant expression.
 
@Drise if you have a small enough number for if-elseif, then definitely do that. For a large number of strings...
@RadekdaknokSlupik I really wish we could dereference characters out of a string literal as a constexpr, that would have solved this issue.
 
@MooingDuck You can.
 
I really wish that C++' switch statement got sane.
 
@RMartinhoFernandes also that seems silly, they should have guaranteed that :/
 
4:32 PM
hasmaps feel pretty comfortable
put string in, get function pointer out
 
@MooingDuck Why should they?
 
Ruby's case-when is awesome.
 
That guarantee is rarely useful.
 
@RMartinhoFernandes then why isn't std::hash("thing") a constexpr?
 
@RadekdaknokSlupik VB has Select Case, and it works for all (I cannot verify this, but from my experience) data types
 
4:33 PM
@melak47 Does std::function do any dynamic allocation, or is it simply magic?
 
@MooingDuck First, it's std::hash<char const*>()("thing") or similar. But more to the point, because operator() is not constexpr.
 
@MooingDuck I really don't know :S
 
@MooingDuck At least sometimes, it does.
 
@RMartinhoFernandes because if that were the case, and std::hash of a string literal were constexpr, then we could switch on a std::string.
 
Here. Switch how it should have been.
auto score = 70;
auto result = case(score) {
   when 0..40: "Fail";
   when 41..60: "Pass";
   when 61..70: "Pass with Merit";
   when 71..100: "Pass with Distinction";
   else: "Invalid Score";
}
 
4:34 PM
@MooingDuck It's possible it does some small object optimization kind of thing, but in general, it has no other option.
@MooingDuck Remember that only negative hash matches are useful.
 
@RadekdaknokSlupik with what requirements on switch types? What you describe could be done if all switch types were convertible to int. (so, not string)
 
@RadekdaknokSlupik Yea, the inability to do X to Y in c++ also makes switch more useless
 
@MooingDuck comparison operators.
 
@Drise or a trinary x < y < z would make me quite happy as well
 
@RadekdaknokSlupik == would require it to do a linear search through the options, < (plus a strict weak ordering?) could do a binary search. C++ switches are (theoretically, usually) a O(1) jump
 
4:37 PM
@melak47 Gosh, no.
 
:p
 
@RMartinhoFernandes no? It's totally codable.
 
@MooingDuck It's messy.
How do your own overloads work?
 
@MooingDuck It may be O(1ness) but the fact that they are so limited makes them virtually useless in my experience.
 
@MooingDuck With if (…) stmt; else if (…) stmt; … you get the same, only a thousand times more verbose.
 
4:38 PM
@Drise not in mine
 
@melak47 you can write chaining < for your own types
 
I usually want to switch over a string, not an int
 
@RMartinhoFernandes not that messy.
 
Ell
@melak47 iirc, only python can do that magic
 
@Drise see, we've learned to not do that
@Ell there's several languages that do actually, just few are compiled.
 
4:39 PM
@Ell boo does much more than that. All of Python plus stuffs I implemented.
 
Ell
boo?
 
That site is very crappy, btw.
 
@ecatmur I suppose so, but even though I love operator overloading, I must confess I rarely use it, or build classes that need it :/
 
"Thanks to Martinho Fernandes it's now possible to write code like this: <no code follows>"...
There used to be an example of the switch features I implemented there :S
 
@RMartinhoFernandes in chat? comments? questions?
 
4:42 PM
1 min ago, by R. Martinho Fernandes
http://boo.codehaus.org/
 
@RMartinhoFernandes oh, thought you meant on SO
 
Ell
@RMartinhoFernandes I like myvar as duck
 
@Ell Even better: Dim myvar = 5
 
4:48 PM
Yay auto type deduction
 
@MooingDuck semicolon on line 8 is at least the first one (wrong side of })
 
Just looked up operator chaining....looks fun!
MyClass a, b, c;
...
(a = b) = c; // What??
 
@awoodland I know, I'm working on it, but that's a long list :/
@melak47 a=b=c=d=0;
 
@Drise What's annoying is that if you need to turn Option Infer on.
But boo has type inference too.
 
@melak47 or more usefully: std::cout<<"I am "<<age<<" years old!"<<std::endl;
 
Ell
4:49 PM
@Drise as duck isn't type inference!
 
@MooingDuck yeah, that's what I'd want to use it for...but apparently you can also do that. :P
 
@MooingDuck after about the first couple they tend to degrade to noise
 
@Drise as duck is duck-typing. That should be obvious :P
 
Haha
 
Really, it's not a joke.
 
Ell
4:51 PM
does anyone find std::cout << "printing stuff" << std::endl; like that tedious?
 
@Ell yup
 
Ell
@Drise if it quacks like a duck and looks like a duck. its a duck.
 
@Ell std::cout << "printing stuff\n";?
 
@Ell some do, I don't
 
@Ell Yes
 
4:52 PM
In computer programming with object-oriented programming languages, duck typing is a style of dynamic typing in which an object's current set of methods and properties determines the valid semantics, rather than its inheritance from a particular class or implementation of a specific interface. The name of the concept refers to the duck test, attributed to James Whitcomb Riley (see history below), which may be phrased as follows: :When I see a bird that walks like a duck and swims like a duck and quacks like a duck, I call that bird a duck. In duck typing, one is concerned with just those...
 
I usually do printf("printinf stuff\n");
 
template<class T, class... U>
void print(T arg1, U... args) {
  std::cout << arg1;
  print(args...);
}
FIXED.
 
@Ell it's not tedious until you try formatting stuff. Then the C way looks better and better. Then you remember boost.
 
@Ell Don't do << std::endl unless you really want it. If you don't know, you don't want it.
 
printf is type unsafez.
 
4:53 PM
@RadekdaknokSlupik That fixes nothing.
 
@Ell void print(string printstring) {std::cout << printstring << std::endl;};
 
All that does is fail to compile.
 
print("Hello World");
 
@RadekdaknokSlupik ...why not just use printf in the first place
 
33 secs ago, by Radek 'daknok' Slupik
printf is type unsafez.
 
4:53 PM
@RadekdaknokSlupik Yours does something else entirely.
 
@melak47 typesafety
 
@RadekdaknokSlupik so? maybe I like printing my floats and long integers :p
 
Ell
I like "a wrist friendly language" - it says, it's so good you don't even have to touch yourself to ejaculate
 
@RadekdaknokSlupik still an infinite loop isn't it?
 
@MooingDuck No why?
Andrei Alexandrescu has a cool implementation of a type-safe printf.
It's somewhere in his GoingNative slides.
 
4:55 PM
@RadekdaknokSlupik ah compiler error
 
just the usual variadic template parameters printf?
 
@RadekdaknokSlupik Because it recurses infinitely. It isn't really typesafe and the compiler itself will notice.
@RadekdaknokSlupik It's not really a type-safe printf.
 
@RadekdaknokSlupik also makes lots of copies of objects
 
It's only half-type-safe.
For a totally type-safe printf you need to use strings (in a non-trivial manner) in TMP.
 
I love Star Trek: The Motion Picture!
 
4:57 PM
You can make a totally type-safe printf in Template Haskell :P
 
fix:
unfortunately it calls the function a little bit too often
 
Just put a no-args overload.
 

« first day (600 days earlier)      last day (4351 days later) »