« first day (511 days earlier)      last day (4428 days later) » 

6:03 PM
hmm
anyone here know much about quaternions'n'shit?
 
I'm trying to implement some functionality and not too sure about how to go about it
 
@RMartinhoFernandes: Y u have two bitbucket accounts.
 
6:40 PM
yay
I fixed my camera
now you can zoom in on a point
man, this day has been unusually productive
 
6:57 PM
16 mins ago, by DeadMG
now you can zoom in on a point
 
7:21 PM
now I'm trying to figure out how to do unprojection so you can "select" shit
 
If anyone has any connections in NYC, I'm looking for a place to sleep while I'm over there the last week of may. Any help is appreciated :)
 
yeah man
let me just call up the mayor, he'll arrange a sweet five-star hotel for you
 
don't want five star hotel
 
that's lucky, cause the mayor's never heard of me :P
 
7:31 PM
@TonyTheLion You sure travel a lot :)
I've never even been in the americas.
 
time to play some Starcraft
no, Starcraft Paper Towel Edition
well, I think I can use GLM to get the start and end of the ray
but I've NFI how to go from "ray" to "intersections"
 
@StackedCrooked ohh I love travelling, and while I'm young, and don't have that many expenses yet, I'm gonna use that opportunity to see the world :)
 
0
Q: Reallocating 2D arrays on C++

Who Careslets say i have: #include <iostream> using namespace std; int **a; //Global Variable int main() { n=5; a = new int*[n]; for ( int i = 0 ; i < n ; i++ ) a[i] = new int[n] ; } is there any realloc() method to increase the row size? (column size is fixed) I mean if the row s...

> please don't advise any vector or sth like that.. Cuz i need my array as global.
Since when can vector not be global?
 
uh
never
 
That was a rhetorical question. :P
 
7:49 PM
don't think so
but I think a simple quad-tree algorithm should do fine
I mean, the stuff won't be stacked on top of each other in Z axis
so I guess that in reality, I only need to test the X and Y, and I can simply take the Z value
even an average Z of all the bounding boxes in the scene should be more than enough
not yet :P
but ultimately it's not that important to have an efficient algorithm, I mean, even pro Starcraft 2 players can only do three-four clicks per second
that's only once every 7-10 frames
 
Hey, it's 21 and it's 9 degrees outside.
SPRING!
 
Spring (also known as SpringRTS or formerly TA Spring), is a free open source RTS game engine created by the Swedish Yankspankers. Originally intended to bring the gameplay experience of Total Annihilation into three dimensions, the engine has since evolved to support a plethora of more modern and more flexible features, including built-in high-level extensibility through a Lua scripting interface. The core game engine is licensed under the GNU GPL. Various games leveraging the Spring engine range from free content games with minimal restrictions on use and distribution to games with ...
 
Not that spring.
 
kek
damn, I wish VS10 had <chrono>
 
@DeadMG I've been using OpenMP's timer.
 
8:04 PM
Windows High Performance Timer is good enough for me
I just don't want to create my own abstraction on it :P
 
@DeadMG there is boost.chrono, isn't it the same thing?
 
Since it's the only cross-platform wall-clock that's well supported.
 
wall-clock? I need something more precise for game timing
milliseconds at least
nanoseconds pref
@ScottW Are you on the EU server?
 
@DeadMG The OpenMP omp_get_wtime() is pretty accurate.
At least milliseconds. Probably as accurate as the performance counters.
 
@ScottW Fucking Blizzard- Warcraft III, every copy could play every region
I've NFI
but since about 2008, I've been really questioning some of their decisions
maybe they fired their smarter management and replaced them with idiots
no LAN is pretty fucking dumb
and they screwed up rather hardcore with some of the Cataclysm raiding content too
 
8:09 PM
It's all DRM.
 
one guy on TV just said about an aircrush accident "the chance of you surviving there is just 10000000 to 1!" xD
 
Xeo
Hm. VS11 beta still doesn't let you return nested lambdas it seems..
Not even something as simple as []{ return []{}; }; works.
 
@DeadMG What kind of optimizations are being done at link time?
 
user406009
Doesn't merging of redundant definitions happen at link time? Space optimization of sorts.
 
@EthanSteinberg How would redundant definitions occur?
 
user406009
8:22 PM
IIRC inline functions is one example.
 
How would the linker recognize an inlined function?
 
I thought they were inlined before the linker started
 
user406009
Nah, they are "weak" definitions.
 
user406009
Just double checked.
 
8:41 PM
just came back from the local drinks store
 
OK
 
accidentally the juice bag fell down and the content was all over the floor
embarassing. but the guy in the cash box was relaxed and wasn't angry with me. i didn't even have to pay the juice
 
Like this? <— not inlined, gif.
 
Is there a free diagramming software (flowcharts, UML) that doesn't suck balls?
 
8:53 PM
nope
 
@EmileCormier Pen and paper?
 
@Pubby software, not hardware
 
> Whoever put the letter "b" in subtle should get a pat on the back.
2
 
I wish there was a UML tool that lets you directly type in the text in a class box without having to fill out a tax form. I think UMLet was supposed to let you do that, but I remember not liking it for other reasons.
 
I'm not sure if there is a free version of OmniGraffle. It's pretty good.
Crap, only a 14 day trial.
 
8:57 PM
OmniGraffle is Mac only, I think.
 
and iOS. Do you need something for Windows?
 
I prefer something that works with both Mac and Linux.
Maybe I should write my own. I just want a tool that'll help you document the high-level architecture of a program, and not something that can generate code out of the UML.
 
Hey people , If I do this :
tempResource = (resourcesMap.count(tempResourceName) >= 1)? boost::shared_ptr<Resource>(resourcesMap.find(tempResourceName)->second)
: boost::shared_ptr<Resource>(new Resource(tempResourceName));

does the new Resource get created , regardless of the value of the ternary operator ?
 
No.
By the way a more common version of doing that lookup is auto it = map.find(foo); if(it != map.end()) { /* use *it */ } except in your case you can still use the ternary operator of course.
 
I always found the find interface of std::map to be kinda clunky.
 
9:05 PM
@LucDanton Hmm, that seems more reasonable , but I am struggling to understand why this line is leaking memory in my program !
 
I wish there were a bool map::exists(const Key&). count is the closest thing.
 
I'd argue that map.find(foo) != map.end() is closer yet.
 
@angryInsomniac : What is the value_type of your map? Resource* or boost::shared_ptr<Resource>?
 
boost::shared_ptr<Resource>
 
Don't do shared_ptr<T>(new T()).
Use make_shared.
2
 
9:18 PM
If I wanted to write a diagramming tool on top of Qt, would there be some kind of library/toolkit that knows about geometric shapes and rubberbanding?
 
You can use Graphviz (you can compile it as a library IIRC) for laying out stuff, if that's what you mean.
 
Forgot about Graphviz. I don't know if I could use for drawing / laying out shapes interactively, though.
 
@angryInsomniac It isn't.
 
@EmileCormier Not sure if it does drawing, but you can surely use it for calculating coordinates and line curves.
 
@DeadMG believe me , it is ! Checked using the task manager too
 
9:23 PM
task manager is the most irrelevant thing you can imagine
 
Task manager -_-
 
and it most certainly does not give source file and line numbers
 
Use valgrind or something similar. A specialized tool, not a task manager.
 
@DeadMG nope , but I can step through the program and verify where the consumption goes up
@daknok_t using vld
 
@angryInsomniac No, not really.
the fact that the consumption went up is irrelevant- for a start, memory allocator and OS caching make the values meaningless
and secondly, the fact that it went up is supposed to happen- you just made an object. What you care about is that it didn't go down when it was supposed to.
 
9:25 PM
@DeadMG hmm , well , lemme make sure of that then
 
@daknokt : I'll check it out. There seems to already be a Visio clone in the KDE office suite. It was called Kivio and is now called Calligra. Maybe I lend them a hand instead of writing yet another half-assed diagramming tool that sucks. :-)
 
i once wrote a patch for koffice
a so-called "junior job"
 
I never contributed to large-scale open-source projects. Not sure what to expect.
 
xD
"Copyright (C) 2005 Johannes Schaub <litb_devel@web.de>" =)
 
You've earned your place in history now. :-)
 
9:34 PM
lol
 
Hi
 
maybe anyone has experience with WT: webtoolkit.eu/wt and knows proper way to install it?
 
If Boost.Bitfield ever gets reviewed and accepted, I guess I could leave my mark through that. Vincent Botet would deserve 90% of the credit for it though.
 
@EimantasKasperiūnas Haven't tried it, but maybe the installation instructions can help.
 
9:44 PM
Yay, Boost.Variant error messages
 
well tried to do everything step by step, not so good actualy, found this one: gitorious.org/winstng/winstng/blobs/master/README-winst.txt which says it does work by itself, but trying to figure out how all the gitorious stuff works, havent faced it before :P
 
@DeadMG Ok , figured out the leak , the resources have lists of dependents and dependencies , there seems to be a circular reference situation ! where I've made a pointer to something which points back indirectly !
 
told you the leak wasn't on that line
 
@CatPlusPlus : I sometimes think that recursive template metaprogramming has done more harm than good to the evolution of C++.
 
lol
what else do you propose for coding template metaprogramming than recursion?
 
9:53 PM
I like the direction they took in the D programming language.
Only skimmed though the language spec, so I can't really say much more about it.
 
D is a horrifically bad language
"How can we take C++ and make it even worse?"
 
@EimantasKasperiūnas thanks to you I'm writing a C++ MVC web framework right now.
 
oh, it's ok
instead of two major string types, we'll add a third
then we'll enforce inheritance from Object
then we'll break rvalues utterly and remove value inheritance so values are worthless
so you end up with something like C# but with bad tools
 
@daknok_t Nice to hear that, how it called, is there some kind of beta version or what? :)
 
9:57 PM
I'm glad I didn't invest too much time learning D, then. Hehe.
 
Oh, and we totally didn't improve on the only thing that mattered about templates- their shitty performance
you can ray-trace, if you want the compiler to crash being out of memory to assemble even a single frame
 
@EimantasKasperiūnas It's called "wxx" and it's pre-pre-pre-pre-pre-pre-pre-alpha. GitHub.
 
@JohannesSchaublitb I think calling the shop owner a 'juice bag' is both wrong and a tab disrespectful
 
@sehe i think so too
@sehe who did so?
 
@JohannesSchaublitb oh I must have reading it wrong :)
 
10:02 PM
why do you think that i didn't mean "juice bag" literally?
 
@TonyTheLion that's very suttle
 
@daknok_t great stuff, be sure to make great instalation instructions :) none of current ones has such, understandable for average programmers who are still learning :)
 
Meh, writing webapps in C++.
 
I wouldn't mind at all
 
10:06 PM
A drawback of C++ is binary portability.
 
@CatPlusPlus from my POW it's not so terible, it's just common steriotype mostly, thats my oppinion
 
Static typing is what we actually want.
 
Haskell! <3
 
Yeah, if you want static typing, then Haskell or even C# would be a better choice for a webapp.
 
I want static typing and dynamic deployment.
 
10:08 PM
@JohannesSchaublitb hint: I don't, but that's the boring way to read things
 
It's been too long since I looked into D. For some reason, I had the impression that D would make metaprogramming as easy as regular programming, but after searching for examples, it seems that D also uses functional programming concepts like recursion for its metaprogramming.
 
I would still prefer C++ over PHP for web apps.
 
When I first learned about Haskell it was often compared with OCaml. But today I rarely hear about OCaml anymore. I wonder if it died a silent death.
 
@EmileCormier What I don't get is why you would pick any style for metaprogramming.
I can program in OO or functional or procedural as I like in regular programming, why not the same in metaprogramming?
 
OCaml isn't very interesting.
 
10:16 PM
Because they don't map as well in a language where the metaprogramming facilities are grafted on rather than well thought out.
 
@EmileCormier : By "you" do you mean Emile, or "someone".
 
it sucks the biggest pile of donkey dick you can possibly imagin
 
@DeadMg : By "you" do you mean Emile, or "someone".
 
don't ever use it unless you are forced to at gunpoint
 
Template Haskell FTW.
 
10:17 PM
@EmileCormier I mean "D's designers"
@ScottW Do that often, do you?
 
@DeadMG : I know what you mean. I'd like to be able to go though a list of types iteratively with some kind of static for construct. D only seems to have static if, which I admit is better than doing the template specialization dance in C++.
 
@EmileCormier No, you don't get it.
the whole template idea is fucking dumb
templates = regular programming, but at compiletime
there's no reason not to use every technique, and language feature, you would use at runtime
static if? what's wrong with normal if?
or try/catch?
 
@DeadMG : Yeah, that'd be cool.
 
what I designed in my language
 
> I'm a beginner programmer in C and my dream is to build an app which scans search engines for extracting thousands and thousands email adresses and then upload a txt file with those adresses onto a ftp server.
I didn't know anyone's dream were to be scumbags
 
10:23 PM
@DeadMG : You designed a language? Is the spec public?
 
the spec's not complete yet by some way
I'm taking a break from it
 
After a 30-sec skim, it reminds me of Objective-C.
 
they have nothing in common
 
Well they both are based off of C ;)
 
10:27 PM
Well, objective-C is way more dynamic than C++.
I guess I'll have to actually sit down and read it before making rash comparisons.
 
I believe in ObjectiveC you can add methods at runtime.
And "calling methods" is actually implemented as a system of message passing.
So yes, more dynamic :D
 
How common is utf-16/32 for storing text files?
 
16's not uncommon on Windows
never encountered 32, though
 
Do UTF-16 and UTF-32 need to exist?
 
10:34 PM
utf-32 does, 16 should be abolished
 
In what situations would UTF-32 be preferable over UTF-8?
 
eh, I don't see what's so criminal about UTF-16
 
@StackedCrooked When you don't want variable length for whatever reason
@DeadMG What benefit does it have over 8 and 32? Practically none.
 
@Pubby Well, it can store all BMP text in a single code unit, and it's more efficient than 32
 
@StackedCrooked Text operations.
 
10:37 PM
@DeadMG Compression is more efficient than both
 
except you'd have to uncompress every time you wanted to actually use it
 
@LucDanton I see. Like a reverse_string() would be much easier to implement if using UTF-32 than UTF-8.
 
@StackedCrooked Not really. You'd still have to worry about accent characters and other combining codepoints.
you still can't do a simple codepoint reversal
 
Normalize.
 
@LucDanton Cannot remove all combining marks.
 
10:39 PM
@DeadMG I don't really see how. Can you give an example?
 
Can someone help me with this ?
http://stackoverflow.com/questions/9650807/shared-ptr-throwing-assert-when-it-goes-out-of-scope
 
dunno, one was pointed out to me when I was going to write my own Unicode class
and I don't recall what it was but I do know it does exist
 
@StackedCrooked The usual wisdom is to use UTF-8 to store, and UTF-32 to manipulate. Athough by 'manipulate' what that really means is 'use an API that manipulates for you' so that you don't get it wrong. And of course as a user you don't usually get to choose whether the API accepts UTF-32 or something else.
 
@LucDanton Why store UTF8 for arbitrary-content arbitrary-language text?
 
@DeadMG Yeah, normalization is handy but I would still never implement an algorithm for Unicode myself, unless it's in terms of some other operations that I know are well-defined. So really, I'd use an API.
 
10:41 PM
@LucDanton Oh yes, I know that much. All I'm saying that normalization cannot remove all the combining marks, so if you're processing, you still can't just treat Unicode like a bigger ASCII
 
@DeadMG E.g. no byte-order issues. Comes in handy if/when networking is involved.
 
@LucDanton That's more of a "niche" use- especially considering that the dominant architecture is LE
 
No takers ? :(
 
and ARM (can be) LE as well
 
@DeadMG Networking is not niche, no.
I.e. protocols end up using UTF-8, not UTF-16.
 
10:45 PM
networking is just one of potentially many uses of a string
 
@LucDanton Indeed, at my job we do ntohs, htons, etc.. all the time.
 
Although 'storage' might not have been a concise way to describe all that.
 
not to mention the idea that you'll have to cope with endianness if you ever use any data, ever, that is more than a single byte
 
Let me put it another way:
 
@ScottW Oops :P
@ScottW I am .. going nuts :D
 
10:47 PM
The usual wisdom has been "use UTF-8 for storage, UTF-32 for manipulation" such that we're now up in the situation where a lot of protocols use UTF-8 and that text manipulation API/libs may or may not use UTF-32. So use whatever form is more convenient for your text manipulation API and UTF-8 when marshalling the data around.
Does that make sense?
 
heh
yes, I can always understand the legacy code argument
but then, by the same token, there's no reason to abolish UTF-16 since many Windows apps, and the Windows kernel itself, use that
 
Is there guides for C++ unicode?
 
@DeadMG Is it legacy if the protocols are in use right now?
By the way I fixed my tenses, I think I got that very much wrong.
 
it's legacy- for the purpose of this discussion- if you would design that aspect differently if you had the opportunity to re-engineer it now
 
My advice (and that 'usual wisdom') applies to writing applications and libraries, not implementing systems.
My advice regarding inventing new systems is "use UTF-8 and UTF-32, and use them explicitly (not by convention)".
 
10:55 PM
yeah, I've been thinking about trying to convert my renderer to use UTF-8
I don't want to have to do it later if I want to port to Unix/Mac
the choice is kind of awkward
I'd like easy interoperation with C#, Java, and Windows, but I also want to work well with Unix and I don't want to deal with byte orders and such
 
What's wrong with using conversions?
 
kinda ugly
plus, if I want nice code, then I don't have many options to choose from for Unicode support
and if I want hardware-rendered UI controls, then I will need things like ICU's Break Iterators
yet to find a decent library of controls that will render on top of D3D
 
Anyone in for a downvote party?
 
i downvoted random answers
 
-21
Q: Email collecting app

user1261593I'm a beginner programmer in C and my dream is to build an app which scans search engines for extracting thousands and thousands email adresses and then upload a txt file with those adresses onto a ftp server. Simply, make a database which will contain large amount of emails. Is it even possible...

I think most of us already saw it?
 
11:07 PM
Lol, "my dream".
Sounds like a Nigerian attempt.
And how do you build an app that can "scan search engines".
 
user406009
libcurl?
 
Damn, sometimes I need to take the chill pill before writing snide comments
 
How would you use Google for scanning email addresses? Search or * @ * ?
 
@Mysticial My dream is to make a relativistic 4D engine.
 
Did I just ping everyone?
 
user406009
11:10 PM
@StackedCrooked There is probably a way to look for mailto links.
 
user406009
That's how I would do it.
 
@StackedCrooked Hey why are you emailing me... ;-)
 
My dream is to write software that detects emotions by analyzing blood.
 
And your question is how to obtain blood right? Seems legit.
 
@daknok_t Isn't it more accurate to analyze brain waves, or neurotransmitter activity in the brains?
 
11:16 PM
@Luc Danton special hardware.
 
I'm probably missing the joke.
 
@StackedCrooked Not more accurate, but a hell of a lot less latency
 
Indeed.
 
@StackedCrooked it wasn't a joke.
 
user406009
@StackedCrooked I think the joke is the idea that someone's personality could be told from their bloodtype( which is then extrapolated here into the idea that current blood would lead to current emotions)
 
11:17 PM
Perhaps there is a relation. Perhaps anger will result in higher adrenaline. But it won't be very detailed.
 
user406009
I think emotions from facial expressions would be a lot more practical.
 
Yeah.
 
Some people are too good in hiding emotions.
 
Someone should pin the link to that email question. That'll help get it to -100?
 
I've started soft-hyphenating my SO posts with &shy;. Is that extreme?
 
11:19 PM
What's the method of creating distinct aliases?
 
@StackedCrooked No the Nigerians actually employ brains. A bit
 
I know it's not even well-defined, because the very notion of "soft hyphen" is a terrible car crash.
 
My dream is to send a broadcast ping message to the Internet. My only obstacle is that routers don't want to forward it.
 
@KerrekSB What do you gain? Fancy linebreaking?
 
My dream is to dream of me dreaming of what I should be dreaming of.
 
11:20 PM
@StackedCrooked There's a new protocol that supports it. Let me look up what it's called...
... a yes: Twitter.
 
Meh..
 
@LucDanton Quite. I regain mastery over whitespace.
 
ICMP is where it's at.
 
@StackedCrooked Another way to reach everyone is via ICBM.
 
@KerrekSB Then I'd say it's not worth it, but that's because I don't use hyphens too much.
 
11:21 PM
An intercontinental ballistic missile (ICBM) is a ballistic missile with a long range (greater than 5,500 km or 3,500 miles) typically designed for nuclear weapons delivery (delivering one or more nuclear warheads). Most modern designs support multiple independently targetable reentry vehicles (MIRVs), allowing a single missile to carry several warheads, each of which can strike a different target. Early ICBMs had limited accuracy that allowed them to be used only against the largest targets: cities. They were seen as a "safe" basing option, one that would keep the deterre...
?
 
@LucDanton It's not about using hyphens, but about using long words. If you have a long word in an inopportune location, you get nastily torn-up margins.
 
Apparently the LLVM & Clang guys commit during weekends as well.
 
hmmm
this cinema looks fascinating :P
 
@KerrekSB Oh I see. Nothing wrong with using that on a by-case basis then, I can see the point when the words do get large.
 
@LucDanton The only thing that worries me is that it's UB.
But I performed a "proof by test" by testing it in Opera 11, Iron and Firefox.
 
11:25 PM
Anyone in the mood to explain vectors of vectors to somebody?
 
@daknok_t I'd rather die.
Pointers make me see stars.
2
 
haha
I point to pointers…
with my middle finger.
 
user406009
That pdf is wonderful though.
 
user406009
Simple, has examples, and is to the point.
 
I see what you did there.
 
user406009
11:30 PM
dl.dropbox.com/u/6101039/Modern%20C%2B%2B.pdf is what I am talking about(from daknok's comments)
 
Created a tinyurl for it: tinyurl.com/fuck-pointers
3
 
Someone is saying this:
#include <iostream>
using namespace std;
int main(void) {
    cout.fill(' ');
    cout.width(6);
    cout.precision(2);
    cout.flags(ios::fixed|ios::floatfield|ios::right);
    cout<<15.91D;
    return 0;
}
expected output:
  15.91
actual output:
15.91
apart from the `D`, Ideone is not nice either: GCC 4.3: http://ideone.com/vE48e
GCC 4.5: http://ideone.com/6JNee
And VS11 Beta outputs garbage.
What's the deal?
VS11 beta output (without the `D`): `0x1.fdp+3`
I'm not even gonna try guessing what that means...
Is markdown completely ... down?
 
11:51 PM
@daknok_t You’re my hero!
 
Xeo
@rubenvb precision means total precision, not after the floating point
 
If I'm dealing with UTF-8 should I use char or uint8_t?
 
@Pubby uint8_t
@Xeo what about the spacing?
 
Xeo
There, correct output
 
(Pity that I don’t have access statistics for the PDF link, I’d love to know how often this has been accessed.)
 
11:53 PM
@rubenvb Who knows, but the expect result could probably be achieved with cout.setf(ios::fixed|ios::right, ios::floatfield|ios::adjustfield); instead of the flags call.
 
@Konrad Rudolph post it to /r/cpp and see how many upvotes it gets. Rough measurement for how many people like it.
 
The flags call sets both scientific and fixed, unsets all of hex, dec, and oct and generally makes no sense.
 
user406009
Of course format strings are still tons better. std::cout<<boost::format("%6.2f") % 15.91D;
 
Xeo
Except that boost::format is even slower than usual formatting with iostreams
 
@daknok_t I’ve got no clue how reddit works … isn’t that what they call “rep whoring”?
 
11:56 PM
There should be a printf like function that acts on ostreams and is type safe. Will implement that tomorrow in libdaknok.
 
Hi there!
 
Ok, thanks guys.
 
@rubenvb : Your avatar looks like Orko.
 
The Buddhabrot is a map related to the Mandelbrot set. Its name reflects its similarity to classical depictions of Gautama Buddha, seated in a meditation pose with a forehead mark (tikka) and traditional topknot (ushnisha). Discovery The Buddhabrot rendering technique was discovered and later described in a 1993 Usenet post to sci.fractals Previous researchers had come very close to finding the precise Buddhabrot technique. In 1988 Linas Vepstas relayed similar images to Cliff Pickover for inclusion in Pickover's forthcoming book Computers, Pattern, Chaos, and Beauty. This led directly...
 
@Konrad Rudolph reddit works like this: you sign up, post a link and people upvote or downvote it (you can actually vote on reddit). Then you are addicted.
 
11:58 PM
Lol, was that a script?
 
Reddit is very much like SE but with the wiki and Q/A stuff removed.
 

« first day (511 days earlier)      last day (4428 days later) »