« first day (633 days earlier)      last day (4315 days later) » 

10:00 PM
(define (fibb a) (if (a<1) (1) (+ fibb (- a 1) fibb ( - a 2) ) ) )
 
(define (fact x) (if
(= x 0) 1
(* x (fact (- x 1)))))
 
Ell
scheme is messed up
 
@Ell FTL RPN
 
Ell
ftl rpn?
 
10:02 PM
@Ell reverse polish notation :p
 
FFS, I think I need output parameters. I hate this crap.
 
@Ell ForTheLose ReversePolishNotation
 
@Ell "rpn ftl" translated into RPN (sort of).
 
user1174868
@MooingDuck Doesn't that do something like 4+3+2+1 though?
 
Ell
10:02 PM
oh haha
 
@MooingDuck but the operator is in the front, so isn't it regular polish notation?
 
Why would it?
Draw it.
Run it by hand on paper
 
@Jordan technically it does no, it actually does the fibbinacci sequence.
 
I know how to do (approximately) nothing in a functional language. Shame on me.
 
if you give it 0, it returns 1. If you give it 1, it returns 1, if you give it 2, it adds the two previous, resulting in 2. If you give it 3, it adds the two previous, resulting in 3. Then 5, 8, 13, 21....
 
Ell
10:04 PM
let x = x * y
 
@MooingDuck lol, you wrote fib i nacci. Again.
 
Don't bother calculating more than fibb(30) or so, your computer can't handle it
 
@melak47 Probably, but nobody uses regular Polish notation -- strange, since you'd think spelling "Lukasiewicz" frontwards was hard enough.
 
@melak47 heck if I know
 
With that scheme (hurr) even 15 is like a bajillion calls.
 
10:04 PM
@RMartinhoFernandes I CANOT SPEEL
 
@JerryCoffin lol
 
@CatPlusPlus nonsense, it's only 32768 iterations.
 
user1174868
I am not sure what is happening I am getting fib(5) = fib(4) + fib(2) but what are the values of the function?
 
17 then. Whatever.
 
@CatPlusPlus my C++ version could do up to about 38 in less than a second (barely). or maybe it was 28.
 
10:06 PM
Fail.
 
Ell
hmm in haskell, is there such thing as variables? :L
 
@Jordan you only get the results once you have reached fib(1)
 
Mine can do up to that as fast as up to 1.
 
@Ell Yes.
 
@Jordan you typo'd
 
user1174868
10:07 PM
I don't get that, the only value that it can return is 1
 
Variabele vary.
 
@Ell didn't you just write 'let x = x * y'
@Jordan yes, but it adds 1 and 1 etc...
 
@Jordan Did you try running it by hand? Do it. Until the end. You'll see.
 
user1174868
Just a heads up, I am really stupid and bad a t programming so I am sure everyone is getting really pissed at me thinking that I am trolling but I really am just stupid
 
user1174868
10:07 PM
I did it by hand
 
user1174868
@RMartinhoFernandes I just see it as giving out 1
 
Ell
Right okay, I'm getting confused
 
@Jordan it keeps adding 1s until it reaches the result. It's remarkably slow.
 
Executing machine code by hand.
 
@Jordan the point is how many 1s
 
Ell
10:08 PM
why doesn't let x = 40 work :(
 
@Jordan AFAIK, 1+1 is 2.
 
@Jordan did you do it until you reached fib(1) ?
 
F(2) = F(1) + F(0) = 1 + 1 = 2
 
user1174868
(define (fib n)
(cond ((= n 0) 0)
((= n 1) 1)
(else (+ (fib (- n 1))
(fib (- n 2))))))
 
@Ell x = 40 -- nullary function that returns fourty
 
Ell
10:08 PM
wait its let x = 40 in x
 
F(3) = F(2) + F(1) = F(1) + F(0) + 1 = 1 + 1 + 1 = 3
 
fib(4)
fib(3)                   + fib(2)
fib(2)          + fib(1) + fib(1) + fib(0)
fib(1) + fib(0) + 1      +   1      + 1
1      +  1     + 1      +   1      + 1
= 5  the fourth fibb number is 5.
 
user1174868
Oh
 
Leave drawing to robot.
2
 
user1174868
10:10 PM
I get it now, it just happens to work out that you can just add 1s to get the number
 
@RMartinhoFernandes I linked it earlier. It's still hilarious.
 
user1174868
it doesnt have to resemble anything like the sequence, just that the base case is true and you break it down to the base case so the result is correct
 
@Jordan right
@Jordan right
 
@Jordan well I wouldn't say 'it just happen to work out', that is how the series is defined after all :p
 
user1174868
Well I don't think that is how the series is defined
 
10:12 PM
but you can see why it would be slow when calculating 39088169 or something
@Jordan sure it is, look at how each row expands
 
user1174868
Mathematically isn't it $a_{n-1} + a_{n-2}$?
 
fib(4) = fib(3) + fib(2). fib(0)=1, fib(1)=1
@Jordan plus a base case
 
@Jordan And what do you think the "+" means in there?
 
First, we had Markdown fail. Now, we have LaTeX fail.
 
What would you call a range that has an underlying range of bytes and iterating it produces integers according to some endianness?
 
user1174868
10:16 PM
Okay so the first thing I need to do for recursion is find a base case?
 
i_didnt_read_the_description_range
 
@CatPlusPlus I'm not sure that is better than the current damn_i_dont_want_to_write_this_range.
 
EndiannesDependentIntegerByteRangeWrappingRange
 
(That really is the current name)
 
Maybe endian_integer_range.
 
10:17 PM
57 mins ago, by Jordan
I don't know lists yet
@Jordan You are aware that LISP stands for 'LISt Processing' language?
 
But Scheme doesn't, duh.
 
user1174868
@sehe yes but it hasn't been taught in my book yet
 
@RMartinhoFernandes I thought Scheme is-a lisp (besides being... erm messed up)
 
Scheme isn't Lisp (unless you meant like Lisp (which it is))).
 
user1174868
I am really bad at math so I guess I will be really bad at finding base cases
 
10:19 PM
@RadekSlupik I meant "is-a" like, you know "is-a"
 
One of Lisp/LISP is a family of languages and the other is the original language.
 
@Jordan base cases are the easy part usually
 
Fuck if I remember which is which.
 
@sehe I only wrote that sentence for the joke.
 
(oh (next time (make it) more obvious))
 
10:20 PM
@RMartinhoFernandes integer_range?
 
The joke was the paren mismatch, actually.
 
@sehe It inherits lots of things from LISP, but one thing it doesn't inherit is the fact that its name stands for "LISt Processing" language.
 
Ell
@RadekSlupik I was about to say :L
 
@RMartinhoFernandes I'm not saying it does :)
 
@DeadMG That sounds like something else.
 
10:21 PM
@RadekSlupik Oh. Did I balance mine by mistake?
 
it's a range of integers
 
Like the result of boost::irange.
 
@sehe I can't say if you did something by mistake or on purpose.
 
@DeadMG the 'given endianness' makes it something else than just plain integer
@RadekSlupik :)
 
user1174868
@MooingDuck Oh, maybe I am thinking of the base case wrong
 
Xeo
10:22 PM
@RMartinhoFernandes That could get complicated to describe in a type name
 
@RMartinhoFernandes How about octet_generator, octet_range?
 
It decodes octets.
 
The existence of multiple endiannesses sucks.
 
Meh, I don't mind calling them bytes.
 
super_secret_octet_decoder
 
10:23 PM
If you think otherwise, you're not my audience.
(I am my audience, anyway :P)
 
Xeo
Yay, time again for 2³² Noodles, 1 Cup
 
Two loungers, one cup. Never mind.
 
user1174868
I really do not understand base cases I guess I need to google that
 
reinterpret_integer_range?
 
10:25 PM
@CatPlusPlus Oh I reversed the purpose
 
endian_cast<int, big_endian>(foo) would be pretty cool, actually.
 
@RadekSlupik Yuck
 
xD
@JohannesSchaublitb what's up lit/b/?
 
@RadekSlupik He's doing memory management
 
10:27 PM
I think I'm going with this:
    template <typename Integer, typename SinglePassRange>
    using big_endian_range = byte_ordered_range<big_endian, Integer, SinglePassRange>;
    template <typename Integer, typename SinglePassRange>
    using little_endian_range = byte_ordered_range<little_endian, Integer, SinglePassRange>;
 
@sehe oh wait I meant endian_cast<big_endian>(foo).
 
Aliases FTW.
 
why are they upvoting this, and not my reply below it :(
 
I've been gone for a while. Did Jordan get any closer to understanding recursion?
 
10:28 PM
that makes people think my question is already answered and make them not bother
 
Delete all the answers!
 
Ell
I have never needed recursion
 
@Jordan The base case is the expression that when TRUE the recursion stops.
 
@Ell never?
 
@Ell I have a few times.
 
10:29 PM
Well you don't really ever need it. You can use loops instead.
or goto
 
@RadekSlupik eww
 
goto hell
 
user1174868
@JimNorton That doesn't always seem to help get the answer though, maybe that is how I know I shouldn't be using recursion though
 
C++ sucks in that you cannot have recursive lambdas.
You need a loop or goto.
 
Meh, that's not really that important. Also, no, you don't need a loop or goto.
 
Ell
10:31 PM
@RadekSlupik why can't you have recursive lambdas?
 
@RMartinhoFernandes you can just unroll your loops by hand! yay!
 
Just build it in two steps like normal people.
 
@Ell because lambdas are nameless.
 
std::function<int(int)> factorial;
factorial = [&factorial](int x) { return x * factorial(x-1); }; // look ma, no loops
Alternatively, use Y.
 
user1174868
I don't quite understand how I would do recursion ifI have two inputs but I need to find a third value
 
Ell
10:33 PM
@RadekSlupik just name the lambda
 
Does this help?
http://www.cs.umd.edu/class/fall2002/cmsc214/Tutorial/trace-recursion.html
 
@R Does that compile?
 
Why wouldn't it.
 
Xeo
std::function<int(int)> factorial = [&factorial](int x){ return x == 2? 2 : x * factorial(x-1); };
Look, no two steps!
 
Ell
also you could write a function that gives it a name temporarilly. let me think
 
Xeo
10:34 PM
@RMartinhoFernandes Endless recursion, though.
 
@Xeo The second step is the passing of that.
 
Xeo
@RMartinhoFernandes Sorry for not following the whole conversation. :D
 
As opposed to f([](int x) { return x == 0? 1 /* you failed too, smart ass */ : x * this_function(x-1); }); <- one step.
 
@JohannesSchaublitb So glad that I did not add variadic templates to Wide.
 
Great job on your "optimization".
 
Xeo
10:36 PM
I always forget the base case for factorial
┐( ̄ー ̄)┌
 
Does Wide have lambdas?
 
@RMartinhoFernandes Still can't avoid std::function here w/o polymorphic lambdas.
@RadekSlupik Of course.
 
@DeadMG Yeah.
Monolambdas is terribly annoying.
 
In daklang all functions are lambdas :P
 
user1174868
Does anyone know where I can find examples of recursion?
 
Xeo
10:37 PM
I wonder if they will implement them through auto or like []<T>(T x){...}, getting all brackets / parens in a single expression
 
user1174868
specifically something that finds the smallest number
 
@Jordan Look around. The chat is currently swamped with them
 
Ell
can I have a late argument type? :L like a lambda which takes an instance of itsself?
 
You can take a std::function.
 
@Ell std::function.
 
Ell
10:38 PM
I'm trying something
 
Don't tell me you're reinventing Y.
 
Y U REINVENT Y
 
Ok, now to implement this damn iterators.
 
Ell
I don't know what Y is :L I know it's the "Y combinator" but haven't the foggiest as to what that is
 
pulls off Boost.Iterator
 
10:39 PM
Imma sleep; I have to work tomorrow. Fixing some IE7 shit.
 
@Ell let x = f x in x, obviously.
 
Ell
I still don't know what that means :S
 
Ell
I'm just sure you can get lambda's to call themselves without being named
 
F# f#tw
 
10:40 PM
That's what Y does.
 
@Jordan a base case can be any (or many!) place where for an input you hardcode the output.
 
Ell
right. So I guess it's already been done in c++ then? :l
 
There's a question on SO.
 
Does anyone here remember how to project a point onto a line?
 
It's a nice exercise, because you often get it wrong.
 
10:41 PM
That statement is true.
 
user1174868
@MooingDuck So an inequality would work?
 
@Jordan the smallest number? There is no smallest number.
 
daaamn
ate a bad meal and now I'm the sick
 
@Xeo wikipedia
 
@DeadMG owned by bacteria?
 
10:42 PM
eh
owned by whatever's in my intestines
 
@EtiennedeMartel project it onto the line how
 
Bye.
 
@EtiennedeMartel The result is the point P where dot(AP, line_vector) = 0 (where A is the point you're projecting).
 
@Jordan quicksort without recursion is tricky.
 
Ell
@DeadMG again? I swear this happened but a few days ago
@RadekSlupik cya :)
 
10:43 PM
@Ell It's been happening for months.
 
user1174868
@MooingDuck I am just trying to do this homework problem I have been stuck on for 5 or so days
 
@Ell Probably did.
@RMartinhoFernandes Years.
 
i do homework problems for just $200 an hour.
what is it?
 
user1174868
I can almost afford that
 
user1174868
10:45 PM
Let me just go take out some more loans and be a poor
 
user1174868
It is deadly being poor in America, people can smell the poor on you
 
@Jordan Time for you to move north.
 
@Jordan you've said that like 15 times today. We get it. That's not relevant to anything
 
@EtiennedeMartel Also, mathworld.wolfram.com is a good resource for these kinds of questions.
 
user1174868
@MooingDuck I don't want to do lists, I want to do this problem before I go insane, I will die doing this problem if I have to, I don't care about anything else except doing this problem
 
Ell
10:47 PM
I ought to learn haskell some time
 
@Jordan We also don't care about that.
 
@Jordan so, what IS the problem?
 
user1174868
I can't ask homework questions here
 
user1174868
also I want to get it on my own
 
Ell
so stop complaining :L
 
10:49 PM
IOW, get cracking.
 
fuckles
need to edit my Wide spec but left all my passwords at University
 
@Jordan We just spent like five hours attempting to explain recursion. I don't know what you want from us.
 
@DeadMG You fail.
Sooooooooooooo much.
 
lol
 
user1174868
10:51 PM
@MooingDuck I am not complaining I just want to get this problem done is all
 
let's be honest, I've been coming home from University for three years and this is the first time I left my pw db
 
So, you fail 33% of the time?
 
@DeadMG pw db can be copied for /free/
 
@Jordan looks like complaining to me
 
@sehe Yeah, but copied on to what?
 
user1174868
10:52 PM
@MooingDuck Oh
 
@RMartinhoFernandes I come home more than once per year.
 
@DeadMG you must have a lot of passwords.
 
@DeadMG dubious
 
@DeadMG media, the web, email, paper, you name it
 
@DeadMG Ah, ok.
 
10:52 PM
@melak47 About 20 of them.
 
@Jordan Do you understand how recursion works and how to diagram it yet?
 
@DeadMG hum. they must be really long then?
 
user1174868
@JimNorton Yes I just can't apply it to anything
 
@melak47 Very much so. That is the purpose of a PW DB
@sehe Email PW is in the DB. Web? How would I secure it without a PW? As for media, I'd gladly stick it on my phone, but I actually don't know how to put arbitrary stuff on an iPhone.
 
10:53 PM
@Jordan What exactly is the problem you are trying to solve? Maybe we will help if given some details..
 
@DeadMG Wait. Is there no passphrase on the pw db? EPIC FAIL
 
@sehe Of course there's a passphrase.
 
@DeadMG "Email PW is in the DB" is a complete fallacy
 
But there's no PW DB.
 
user1174868
I am suppose to find an n such that bn > a, where a > 1 and all positive integers.
I am suppose to use recursion and the expt function but other than that I have no idea how to do it like that. I have tried many, many times and I can't get it. Here is some sample code I tried.
[1] http://ideone.com/07cFi
 
10:54 PM
oh yeah, I forgot about the actual passphrase thing.
@sehe What do you mean?
 
@DeadMG where do you keep the passphrase? :P
 
my gmail account password is in the db.
@melak47 In my head. It's extremely long
 
@melak47 On wikipedia, duh.
 
sbi
room topic changed to Lounge<C++>: @all hasn't shown up all day, but we'll tell him you asked. [brainfuck] [c++] [c++11] [c++-faq]
 
Ell
@DeadMG how is breaking sha-512 going? (or was it 256?)
 
10:55 PM
256, and I've paused that project for a while
got bigger fish to fry right now
 
Well, you can still edit it, no?
 
@DeadMG I have my 64 digit wireless passphrase memorized, too :)
 
You're trying to break SHA256? Good luck.
 
@Jordan wait, I kinda understand I thin
 
AFAIK it's all static HTML, so you can just point your browser there and save the things.
 
10:56 PM
@Mysticial It's more than doable.
 
@DeadMG I mean, it is obviously possible to send the PW DB by mail, while opening your mail using (another copy of) the same PW DB. Duh.
Much like, it is possible to do a recursive factorial using a lambda and std::function<>
 
@RMartinhoFernandes Can't edit a website without the PW to the server :P
 
sbi
@DeadMG You got bigger fish than breaking sha-256? That must be one big fish you got there.
 
@DeadMG But you can write the things, just not publish.
 
@sehe That would require copying the pw db beforehand :P
@RMartinhoFernandes Yes, but I really need to publish.
 
10:56 PM
@DeadMG You need a different approach.
 
I've practically fucking forgotten what I was gonna put on there already, and it was kinda important
 
DeadMG has to write his new language before using it to break SHA-256.
 
@DeadMG Define "break". Birthday attack? Preimage attack? Rainbow table/preimage?
 
@DeadMG What's the problem? Anyways, since you mention leaving it at work, you already have it on some kind of media.
 
@DeadMG Can I say "I told you so" again?
 
10:57 PM
@sehe no, I left it on my PC at my place at university
 
@Jordan The test function is almost right actually
 
@sehe I think you're misunderstanding. He left it at a remote inaccessible place.
 
@Mysticial I think it's a birthday and preimage and collision.
 
@DeadMG So, youir PC is obviously not password protected then. Otherwise, how can you get into your PC to access the PW DB ?!
 
been a few weeks since I checked which kinds of attack were which
 
10:58 PM
@DeadMG Oh great...
 
@sehe Nah. If you get to someone's PC physically, you pretty much already won.
I'd be more concerned about losing my goddamn PC than all my passwords.
 
@DeadMG Wow. You really don't appreciate cryptography at all, do you?
@DeadMG Ok. So it is indeed not password protected. I get that. Good point
 
We should be using biometric locks on our PC's.
 
@Mysticial Well, I converted SHA-2 into a giant case of XORSAT, which is P, not NP-Complete.
 

« first day (633 days earlier)      last day (4315 days later) »