« first day (539 days earlier)      last day (4407 days later) » 

10:00 AM
ok, I will have a look
 
hi all :)
 
sbi
@IntermediateHacker Thanks for the encouragement. Much appreciated.
@IntermediateHacker Actually, it will get worse first, because today I plan to finish what I started yesterday.
 
10:16 AM
Why is alloca not considered good practice?
 
here I go bricking my phone!!
 
sbi
@rubenvb Wut?
 
@sbi I just modified a rooted (but otherwise stock) HTC Legend ROM and am now flashing it.
and now rebooting it
damn these sweaty palmls!
 
sbi
@rubenvb Urgh. I have considered rooting my Android phone, in order to uninstall some of the pre-installed crap I'm not using (too little memory here), but so far have managed to refrain from doing so. But flashing? Why that?
 
well, I had Cyanogenmod installed, which worked fine except for the slowness of ADWLauncher and the fact Google maps navigation always froze up my phone (and made it reboot) after ~30 min.
 
sbi
10:26 AM
One disadvantage of a touchscreen is that it always looks like a kid got its greasy hands on it after wolfing down a chicken leg bone.
@rubenvb What's "Cyanogenmod"? (Android newbie here.)
 
Hi! I'm having some difficulties with writting my own list implementation (based on templates). Part of my code is here: ideone.com/7QYbV
 
@sbi It's the most popular custom rom that all the kids are using these days.
It's quite decent actually, except for aforementioned problems I am experiencing. It really depends a lot on your phone model.
 
@gogowitczak ListElement<type> *search_end type should have capital T
 
sbi
@rubenvb Oh, so you have flashed it before, huh?
@TonyTheLion Indeed, this is not Pascal!
 
@sbi sorry, I don't get the reference?
 
10:29 AM
@TonyTheLion - Now it works. Shame on me :). Thanks!
 
@sbi yeah, twice or thrice. First time I'm mucking around with customizing the ROM itself... It won't boot for now, but I can still reflash, so all's still fine I guess :)
 
Pascal wasn't case-sensitive AFAIK
 
sbi
@TonyTheLion Pascal doesn't mind capitalization. Anyway, good catch. I looked at it for 15secs and didn't even realize the error message sported a lower-case identifier.
@gogowitczak Was? Isn't it, still?
 
@sbi - Isn't Pascal a dead language nowadays? :)
 
sbi
@gogowitczak What about Delphi? Is that dead, too?
(Honest question.)
 
10:37 AM
OK, the rooted unmodded rom works. Guess I messed it up somehow.
maybe I should use gzip and the commandline instead of the 7-zip gui
 
@sbi oh I see
what is "rooting a phone" mean?
phones don't grow in the earth
 
sbi
@TonyTheLion Getting root access to it.
Android is Linux, remember.
 
ah I see
 
@TonyTheLion gaining root access, literallly the ability to do "su"
 
ah, as an owner of the phone, don't you automatically have that?
 
sbi
10:39 AM
@rubenvb It seems Cyanogenmod doesn't support my phone. Good, one less temptation to ignore. :)
 
@TonyTheLion nope. Even the bootloader is locked.
 
sbi
@TonyTheLion Would you have asked that had we talked about an iPhone?
 
@sbi might have.
 
sbi
You're so sweet and innocent, @Tony.
 
I wasn't thinking as far as bootloaders etc
@sbi then you haven't known me long enough, if you think that :P
 
sbi
10:41 AM
@TonyTheLion That was just an euphemism for "naive", you know. Of course, being so "sweet and innocent", this went straight over you head...
 
OMG, sometimes I feel so stupid :(
I totally didn't understand it that way
 
sbi
You're so sweet and innocent, @Tony. :)
 
STOP IT
 
sbi
@TonyTheLion Calm down, sweetheart. Daddy's not gonna hurt you. :)
 
You've crossed the line now
 
10:46 AM
@sbi - I heard a joke about Deplhi lately.
"This year, Delphi developers conference has been held. One of the participants became ill, and another said that he won't organise the whole conference for himself" :-)
More seriously, I think that Delphi has been replaced by another object-oriented languages ​​like Java already.
 
sbi
Uh, oh. Now the lion is roaring!
 
Relevant.
 
sbi
@gogowitczak Ah, Ok. Well, I hadn't looked at it in years.
 
sbi
10:47 AM
@TonyTheLion That one is yawning, not roaring!
@TonyTheLion So is this one.
 
that's a detail
you're being pedantic
oh, yes, this is the C++ room, full of pedants
 
sbi
@TonyTheLion Tell us something new. :)
 
euh, the grass is green and the sky is blue
no, that's not new either
new myobject();
something new here ^
 
sbi
@daknok_t You're assuming I'd lower myself far enough to fight the lion cub. I might be big, hairy, and grumpy, but I'm not gonna hurt a lion cub for nothing.
@TonyTheLion that is objectionable. :)
 
:P
 
10:50 AM
I know, but nevertheless it's something new
@sbi lower yourself??? :P
 
sbi
@TonyTheLion It's new'd, which is different. (Subtle, I know. But this is the pedant's room, after all.)
 
lulz
I should go back to reading tvtropes
been a good alternative to talking rubbish in here :P
 
reddit.com/r/awww
 
sbi
Well, well. I guess I'd better be going. I slept in until noon, which was all fine and well, but I need to stock food provisions for two holidays, refill the almost empty crate of beer in the garden (can't dig all day without a steady supply of beer), and head for the hardware store to buy some more fittings for my water pipe replacement project. (Why is it always that you think of half of them only when you're in the middle of he work?) All on the bike, with a body aching all over.
And then I need to finish that damn project. Ouch.
 
10:53 AM
what project?
 
sbi
@TonyTheLion It's written plainly in the message just above. Yes, I know that one has more than 20 chars. That's me, though. You need to be able to read significantly long texts, and comprehend them!, in order to follow my thoughts. I am sorry, but I simply can't help it. I'm a primate. We can think. That's a hard-to-shed habit.
:b
Now I have finally pissed of the lion cub, and he's gone back to reading TVTropes and reddit.
 
11:12 AM
meh seems I'm unable to comprehend things today.
 
What is the stackframe hardwarly?

I want to allocate memory from stack ( alloca() )

and connect all memory stackframews in some stucruture LinkedList

So, I must:

1). allocate exaclty from stack
2). in allocated memory make links to next/pervious stackframe?
 
11:35 AM
> connect all memory stackframews in some stucruture LinkedList
You lost me there...
 
put the stackframes in a linked list
 
Ell
11:52 AM
hi guys
 
12:13 PM
 
Ell
agh minecraft is a pain to mod
stupid modloader/mcp/whatnot
2
Q: Signal Handlers vs Virtual Functions & Inheritance (Event Handling)

EllI have a basic Window class that I need to have events such as MouseDown, MouseUp, WindowResized etc. I have two possible routes: Signal handlers (e.g. Boost.Signal) or virtual functions where the user of the class creates a class derived from Window and overrides the OnMouseUp, OnMouseDown and O...

if anyone has time
 
12:48 PM
Hey all!
2 questions.
1. Why doesn't std::forward< Arg_types ... >( args ... ) work the same as std::forward< Arg_types >( args ) ...?
 
And 2?
 
Is it impossible in C++11 to define a macro that generates an enumeration and a corresponding function to stringize its enumerators?
I'm attempting to do so, so make your bets now.
 
I guess it might be possible with two macros (one for the enum, and one for the stringization)
 
@Potatoswatter I've done some experiments with enum generation using Boost PP. So did @Cat.
 
If the macros got the same parameter list, why would you need to call twice?
 
12:54 PM
@Potatoswatter First one expands as std::forward<A0, A1, ..., AN>(a0, ..., aN).
 
@StackedCrooked What did you attempt?
@LucDanton How is that different from the second? Am I missing something obvious?
 
Second one is std::forward<A0>(a0), std::forward<A1>(a1), ..., std::forward<AN>(aN)
 
@LucDanton Ah, yes, that would qualify as obvious XvD thank you.
 
You can think of it as (std::forward<Arg_tpes>(args))... if it helps.
 
@Potatoswatter Creating a macro for defining an enum.. Cat's was better though.
 
12:58 PM
I don't plan on doing much crazy preprocessing; the only user-friendly syntax is variadic macros, and that doesn't allow any recursion or individual processing of the list items.
 
You can also get enumerator names using demangling.
I think.
 
Does your hack work with enumerators set to specific values, or just auto-incremented ones?
 
Only auto-increment. Cat's allowed setting values.
Nothing prevents you from implementing it that way.
 
@StackedCrooked That doesn't sound right. It would be very implementation-specific at best. It depends whether enumerators of the same value are distinct in terms of template specialization, and I don't suppose they are.
@StackedCrooked Do you have a link to Cat's?
 
@Potatoswatter Not immediately. It's probably in the transcript somewhere...
 
1:02 PM
My strategy is nothing like this. I'm using stringizing and a constexpr function to parse the C++ source directly.
Although for explicit values, I don't think it can be constexpr… although really that's not much of a loss.
 
Apr 30 '11 at 0:49, by PiotrLegnica
@StackedCrooked Dunn dunn dunnnn, Crazy Unnamed Enum-Making Library v0.2.0: https://bitbucket.org/piotrlegnica/stuff/src/ac3924a3e17a/enum.hpp
 
@StackedCrooked Bah… so I'm searching for it. Any idea about keywords or a rough date this exchange occurred?
Ah, thanks!!!!
 
The keyword was "librarising" :D
 
Thus prüving it's expedaliocious to invant werds all thuh taim.
 
1:25 PM
There, I'm back on a HTC ROM with Sense.
Now I can enjoy mobile facebook
 
1:38 PM
Do you think it's a good idea to redirect std::clog to inhouse logging library?
And use std::clogfor logging instead of the inhouse log library api?
 
Yes, absolutely, assuming you don't change the semantics so other libraries can't use it.
Remember that clog isn't thread safe, though. You still need to add a mutex around clog << "message";, and on second thought that kinda interferes with supporting other libraries using it too.
 
That's a bummer.
 
changing what something in std does seems wrong to me
 
@Collin you can redirect std::cout too. No harm there...
 
Does anyone know anything about treeviews? When I move the mouse over a tree view, there are a lot of of tvm messages coming into that window but who sends them to that window?
 
1:53 PM
For that matter, you can redirect C stdin and stdout, but only to other UNIX streams.
 
@Potatoswatter can't you redirect cout to an fstream?
 
@rubenvb In C++ you can redirect cout to any kind of streambuf, including a filebuf that you might obtain from an fstream. In C, there are no such things.
 
@StackedCrooked I'd actually still use the inhouse library directly (why else do you need it, you can redirect clog to a file or something similar also) and use the redirect of clog/cout/cerr to handle non-inhouse logging.
 
Ah, yes. I missed the "C" part of your sentence. My internal ignore list is kicking in
 
2:36 PM
Such a gap between critic scores and user scores.
 
2:56 PM
@StackedCrooked People love to complain :)
 
Howdy guys
 
@mwmnj welcome
 
user1174868
3:16 PM
Is there any way to get unbanned from asking questions for SO?
 
@Jordan how do you get banned in the first place?
 
user1174868
I asked an off topic question
 
@Jordan You don't look banned to me.
 
@Jordan Are you referring to this ?
 
user1174868
Yes
 
user1174868
3:20 PM
I cant post questions, it gives me this
 
user1174868
Sorry, we are no longer accepting questions from this account. See goo.gl/C1Kwu to learn more.
 
@Jordan Interesting! Now I have learned more. How about you?
 
@Jordan It looks like you only have one badly downvoted questions and it's more than 30 days old. I have "helped" you by voting that it be deleted.
 
Damn meta police. We can close bad questions ourselves...
 
@CharlesBailey The linked meta question notes that such a ban is likely based on already deleted questions we can't see. Deleting more will just push them into the ban-bot.
 
3:26 PM
Fair point, although deleting the one visible question that is >30 days old should help.
@Potatoswatter What's the ban-bot?
 
@CharlesBailey The script that generates these bans. Described in the link. goo.gl/C1Kwu
My terminology :)
43
A: Can we prevent some of the low-quality questions from entering our system?

Jeff AtwoodBased on the feedback from this post, we have now implemented a form of screening during the question ask period. Questions from IP addresses or accounts with a history of extremely poor questions will no longer be accepted. This is intended to weed out the worst quality questions. (hint hint, ...

 
@Potatoswatter That's what I read but I understood that deleted questions under thirty days old counted and inferred that deleted questions over thirty days old did not count.
 
@CharlesBailey I interpret it to mean having been deleted for less than 30 days. As in, after 30 days of deletion it's really removed from the database.
 
@Potatoswatter The great thing is... we'll never know ;) .
 
Who knows? Anyway, the ban is already in effect, he needs to lodge an appeal and wait for moderator intervention.
 
3:35 PM
Seems quite 1984 / catch-22. He's been banned from contributing to the site and to earn the right to contribute he must positively contribute to the site.
 
@CharlesBailey But he can still write answers, so it's not.
 
@Potatoswatter Really? It read like it was a question/answer ban.
 
It might take a leap of faith to expect to be automatically unbanned due to good answer upvotes, but it should at least impress the moderator.
 
Clang devs say they got <atomic> intrinsics working
libstdc++ (GCC) compatibility is still iffy, but libc++ (LLVM) should work
for those on non-windows OSes
 
I think the term "question/answer" ban is parsed as "question ban or answer ban"
 
3:37 PM
@Potatoswatter oic
I wonder if I'm banned from asking questions...
 
@CharlesBailey You're just so good at satisfying your own curiosity, that it is impossible for you to post a question here?
 
@Potatoswatter I haven't yet had a question that I feel would benefit the site.
 
@CharlesBailey You say tomayto, I say tomahto…
 
@CharlesBailey You can ask selfish questions on SO too you know. It wasn't meant to be an encyclopedia of knowledge.
 
I've asked a few rhetorical questions… and a few dumb regular ones I admit ;)
 
3:42 PM
Does anyone know anything about the WM_POINTER message on Win 8?
 
Some things, you just don't expect anyone else to expect an answer, so you have to ask on their behalf:
10
Q: Does C++ support compile-time counters?

PotatoswatterFor the purpose of introspection, sometimes I've wanted to automatically assign serial numbers to types, or something similar. Unfortunately, template metaprogramming is essentially a functional language, and as such lacks global variables or modifiable state which would implement such a counter...

 
Hello World!
 
Xeo
@sehe My serial upvoter is a bit more subtle and only upvotes 2/3 things per day :P
 
4:33 PM
@Xeo take this mr. greedy
 
@Potatoswatter ohai, what does sizeof fn() return when passed as template argument?
 
@TonyTheLion the size of the return type of the function.
 
oh wow
that code confuses me
 
I can't recall why I preferred sizeof T over T::value there. Maybe no reason at all.
 
figured it out
 
4:44 PM
@TonyTheLion Ah, ok, can you see the deleted answer at the bottom?
 
Ah, OK, T::value would require decltype but I wrote this in C++03.
Actually it has nothing to do with the deleted answer but that reminded me anyway :P
If it were template metaprogramming sizeof and ::value would work equally well, but this is overload-set metaprogramming.
 
user1174868
is the :: stuff that common? It is used when you don't include the library for something right?
 
Xeo
@bamboon lol
 
@Jordan Yes, :: is usually a Good Thing. It's used when you do include the library but you don't indiscriminately import all the library's names.
 
Xeo
4:49 PM
@Jordan :: is the scope operator / delimiter
Everytime you access a certain scope specifically, you need it.
 
user1174868
I am just learning c++ so I don't see that too often, I do see it quite often on the internet though
 
:: is the Everything In Its Right Place Operator.
 
Xeo
::stuff would be global namespace, std::stuff would be the standard namespace, class foo{ ... }; foo::stuff would be the access to the static members inside foo scope and so on and so forth
 
@Jordan If you're learning from a resource that puts using namespace std; at the top of every file, you might want to read something else instead, or at least get another perspective.
 
user1174868
ugh
 
user1174868
4:52 PM
Well more importantly than learning c++ I need to get a good grade in the class :P
 
user1174868
I am using Malik's Introduction to C++
 
Obligatory "never do using namespace std;".
 
user1174868
why?
 
user1174868
I have never not done that
 
It's reasonable to write small programs that way but a good instructor won't write examples like that.
For large projects, you'll always be adding names to your namespace, and the Standard committee is always adding names to std. A collision will happen eventually.
 
user1174868
4:58 PM
I really have no idea what you are talking about, it is so different from what I am use to
 
You have no idea, but that's OK you're taking an introductory course. How "used to" a particular way can you already be?
It's really not a big deal for school projects.
So don't worry too much yet.
 
user1174868
I hope so, for me school is more important than actually knowing how to do the stuff, I really need all As
 
But for many thousands of identifiers and utilities that do things that will likely be later standardized, std:: is your friend.
@Jordan Hopefully you know that's shortsighted. Real Life lasts a lot longer than school… and you can make up for lost A's easier than lost knowledge.
 
user1174868
I know but that is what i have to do now, I have a bad GPA and I have to get it better or I will not be able to go to school anymore
 
user1174868
Basically I need all As the next 3 semesters
 
5:05 PM
Ah, that's different then. Just take it one semester at a time and give your advisor lots of cookies.
 
user1174868
Yeah I want to see if bribing my teachers is a thing, because I needs As
 
user1174868
I have never been able to get a B or higher in a math class though, no matter how hard I try, and I have to get an A in calc 1 and 2
 
@Jordan Bribing the teachers is different from bringing a cookie to the advisor…
an actual bribe would likely get you expelled pronto…
C++ and calc 1 at the same time? o_O
 
user1174868
c++ calc, ethics and spanish
 
user1174868
then I need to take physics, calc 2, c++ 2 and something else
 
5:09 PM
How many semesters have you finished already? This is university?
 
user1174868
6
 
user1174868
I am at a community college
 
OK… may I ask why you picked C++ over other languages?
 
user1174868
It is what I always wanted to do since I was a kid
 
It is a hell of a language!
 
user1174868
5:11 PM
ohh
 
user1174868
I misread that
 
user1174868
I picked c++ beacuse that is all that is offered really
 
I edited it after asking.
OK, I see.
Well… this is bad news, but curriculums that only offer C++ are often outdated. C++ is older than many other languages, and it was popular in introductory courses until maybe 10-15 years ago.
Many schools might teach in Java or Python now… I don't know the current practice but C++ has a lot of "sharp edges" such as the :: operator. It's really oriented toward larger projects.
The good news is that if you don't continue with the C++ program at your school, there are many resources that can make learning programming easier.
 
user1174868
eh
 
* potentially a lot easier.
 
user1174868
5:20 PM
I dont know what I want to do, I am just done with school, I hate it, all I do is fail tests and come up short
 
School is designed to be hated.
 
Unfortunately, good teachers can be expensive. Programming is nice because you can learn by doing and asking questions online… for example right now…
I taught myself programming from a few books, and I've been online Q&A'ing since around 2000, back when I was in high school.
The books, in retrospect, weren't particularly good. It's mostly a matter of refinement by practice.
 
I've read one book on Pascal (TP5 har har), one on PHP (which was terrible), and one on C++ (long time ago and it wasn't all that good either). The rest is tutorials, analogy and experimentation.
 
user1174868
I just feel like I am too old for school, I am 26 in classes with a bunch of 18 year olds
 
user1174868
so should I learn c++ from a book or online sources?
 
5:25 PM
@Jordan Both. Don't break the bank with books, don't kill your eyes with online walls of text.
Books cover general stuff, online covers specifics.
 
user1174868
I heard my c++ book is notoriously bad for c++
 
user1174868
I am just so sick of school, no matter how hard I try I get Cs in all my math classes so no university will accept me anywhere unless they are for profit
 
Fortunately, programming doesn't involve much algebra or calculus.
 
@Potatoswatter Stepanov would like to have a word with you :)
 
Well, for what it's worth, I have a very different perspective about college. I taught myself programming and started building experience and personal connections, then I went to university and studied things besides programming. So now I have this degree which isn't useless, but really did nothing to advance my career.
And the degree is in computer engineering. I wish my useless degree were in history or something.
 
5:36 PM
You get a higher minimum wage.
 
user1174868
how much does a degree even matter? I mean what if I go to the garbage school down the street and get a bachelor of arts for computer science, is that different then a large state university?
 
Anyway, the point is, all you really need to do is convince a good programmer that you can become a proficient contributor to his project.
Funny, since I was just reading this article about the uselessness of CS degrees:
 
user1174868
I have no idea what he is talking about lol
 
Talking about folks who graduate without learning how to do anything.
 
user1174868
yeah but the examples he gave sound pretty hard
 
5:43 PM
Well… have you learned about the % operator?
 
user1174868
yes
 
Well, that's pretty much the trick to the FizzBuzz question… % tells if one number is a multiple of another.
 
Does anyone know why I cannot use boost::spirit::lex::tokenize with an std::istreambuf_iterator<char>? Probably some silly thing I overlooked…
std::istreambuf_iterator<char> begin(stream_.rdbuf());
std::istreambuf_iterator<char> end;
lex::tokenize(begin, end, lexer, token_handler);
> Non-const lvalue reference to type 'const char *' cannot bind to a value of unrelated type 'std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >' :/
 
user1174868
Oh I didnt read that far
 
Note that % only works with integral types and types that have operator% overloaded.
It won't work with floats, for example.
 
5:55 PM
@daknok_t There is no way at all to reliably tell if one float is a multiple of another, due to rounding…
At least, not for values over 16 million odd, on a standard float.
 
It won't even make any sense to use the modulo operator on types that aren't integral, because with non-integral division you won't have a remainder.
 
user1174868
so how do you find odd floats?
 
You can't, because floats can't hold integers exactly (with some exceptions). Even and odd numbers are always integral.
You must round them first and cast them to an integer, if you don't care about precision.
 
user1174868
oh
 
What? ceil( f ) * 2 + 1. But beware, there are no odd numbers of type float greater than 2^23-1.
 
user1174868
6:00 PM
so how do you round then? Because just making a float into an int will simply cut off decimals right?
 
user1174868
ceil rounds up?
 
@Jordan Yes. Call me an optimist.
 
Rounding to the nearest integer is done using static_cast<int>(some_float + 0.5), AFAIK.
 
@daknok_t I don't believe the rounding mode of static_cast is specified.
 
@Potatoswatter the fractional part is cut off when casting a float to an int.
 
6:02 PM
> §4.9/1: The conversion truncates; that is, the fractional part is discarded.
Which is a kinda funny way of saying round to zero. If you have integral types that can also represent infinity, the conversion is undefined because there is no fractional part of infinity.
 
I wrote a rational number class once, but I've never tested it very well. d:
And it's probably slow as hell due to calculating the GCD after every operation.
 
Oh I found it. rational.hpp.
 
Pretty straightforward.
 
Is it necessary to reduce the fraction after every operation?
 
6:14 PM
@Mysticial If you could detect overflow, then you could reduce then. But C++ cannot detect integral overflow :v(
 
Oh, you're reducing to avoid overflow... that's tricky. But it's something that can be checked at every operation.
 
How do you want to check that?
 
Well, actually it might be practical there to manually check for overflow on the operations that could cause it. Hmm, and a rough check would do.
 
Oh, you templated the entire class... then that will be a lot harder...
 
@daknok_t You can get the order of magnitude of the numbers to be multiplied, and reduce if the product will be greater than 2^30.
Anyway, if you want to be portable for templates implementing only max() and the 4 arithmetic operations, you can get away with if ( T::max() / a < b ) … i think…
 
6:22 PM
std::numeric_limits<T>::max()
 
One of these days, I need to build a proper C++ wrapper around the bignum library that made for that Pi stuff...
Be interesting to see what people will do with what is essentially a multi-threaded GMP.
 
@Mysticial Maybe you should make it a boost proposal.
 
It'll be a dynamic library with a bunch of headers. I don't intend on open-sourcing the core of the library itself.
 
What's your preferred representation of rational numbers?
 
@Potatoswatter You mean notation? Like 1/2 vs 0.5?
 
6:29 PM
I already have a C front-end to my library which I use various bits of high-precision research or curiosities. But it need a C++ wrapper for. It will be tricky since you don't have any extra parameters to control precision and threads with overlaoded operators.
@Potatoswatter I do them manually. I don't have a class for them.
 
I mean numerator + denominator, repeating digits, those crazy recursive fractions that I can't remember the name of…
 
Continued fractions?
 
@LucDanton Yeah, those
 
Continued fractions are pretty neat... useful for getting rational approximations to something...
Where's that SO question I answered about them...
 
@Mysticial Not giving away your secrets today, huh?
 
@Potatoswatter That's standard knowledge.
here it is
13
A: Algorithm for finding the ratio of two floating-point numbers?

MysticialThis is a fairly non-trivial task. The best approach I know that gives reliable results for any two floating-point is to use continued fractions. First, divide the two numbers to get the ratio in floating-point. Then run the continued fraction algorithm until it terminates. If it doesn't termina...

I made a code snippet that converts a double to a fraction.
Most "attempts" at rationalizing a floating-point number involve multiplying the number by either 2 or 10 until it becomes an integer.
Continued fractions will give you a more "natural" fraction.
Like 0.4184397163120567376. How the hell would some know that is equal to 59 / 141?
 
Do continued fractions tend to overflow if the number is very close to a "round" fraction?
 
@Potatoswatter If it's exactly a "round" fraction, it will terminate. If it's extremely close to one, then there will be a very large term - which could potentially overflow.
 
For example, 1.0000...001? I'm trying to wrap my head around how this representation… its 2:40 am here… but Wikipedia's example representation of pi has some big terms that I'm guessing correspond to 22/7 and that other close call.
 
The 292 in Pi's continued fraction gives it a good 6+ digit approximation with I think only 2-digit fractions.
 
6:44 PM
It sounds like they're more useful for reduction for display than intensive computations.
 
that's an example of a number with unboundedly large terms
 
… but at least the generator function is simple…
 
if you can see the pattern that is...
yeah, it gets some recurring 99999999's every few terms, but I can't see the pattern of the stuff between them...
You can imagine how much precision they had to go to compute CF of that number...
 
Ah yeah, it's simple in binary but not in CF :vP
 
Ell
7:10 PM
hi guys
 
hi
 
hi
 
7:41 PM
hi
 
@user1131997 oh man, I got why you are green
 
@Abyx why? :)
 
it's because you are troll
 
@Abyx seems to be in your tea , there was something interesting :)
@Abyx I need real help. Have you work with stackframes manually?
I want to allocate memory from stack, then connect pieces of allocated memory with each other by reference in them like in linked lists
 
@user1131997 read a textbook or something, msdn is good reading too
@user1131997 ok, what's problem?
 
7:45 PM
@Abyx The problem is , with what I'm doing. Does the way I described upper already in use? or it's smth exotic?
 
struct frame { char mem[100]; frame* prev; };
void foo(frame* prev = NULL)
{
    frame currFrame = {{0}, prev};
    ...
    foo(&currFrame);
}
@user1131997 no, it's not exotic
 
thank you very much
 
@user1131997 you can also look at this (code block is totally screwed up by google.translate, but I think you can read original page)
 
@Abyx thank you very much
@Abyx where are you from?
 
@user1131997 from the same country :)
 
7:53 PM
@Abyx классно :)
 
@user1131997 please don't write in an languages but English here
 
@Abyx okay
@Abyx and from Moscow too?
 
@user1131997 no, SPb
 
@Abyx Don't you finish ITMO or Spb state university?
Sources of FF ( how array is designed )

Shit! As PHP it has a lot of goto, and code doesn't look like C++, it lookl like more pure C

http://hg.mozilla.org/mozilla-central/file/babbc38b7f52/js/src/jsarray.cpp#l2201
 
@user1131997 BSTU
 
7:57 PM
it uses merge sort for sorting in js interpreator in FF
 
Tables in LaTeX are painful.
 
@CatPlusPlus I read there were some programs to import excel/open doc tables
 
8:28 PM
@Luc you there?
 
@RMartinhoFernandes you are std::chrono expert right?
 
Hmm, "expert" is probably saying too much, but yes, I'm familiar with it.
 
Xeo
lol, "familiar". Only howard can probably answer a chrono question faster than you
 
if I take two time_points of a clock, then substract them and call .count on the resulting duration I get a tick_count and thus have to do a duration_cast to get a second type, right?
 
Don't call count, do the cast first.
 
8:37 PM
ah yeah right
 
@Xeo You know who answered the last question?
Take a guess.
 
Xeo
Da faq
Well, it's only slightly related to chrono, so..
 
And it's missing an important thing: is that correct behaviour?
goes to check that
Oh nevermind, the question is silly.
Anyway, what do you guys do when you know for sure that a function returns, but the compiler doesn't realize that?
 

« first day (539 days earlier)      last day (4407 days later) »