« first day (806 days earlier)      last day (4146 days later) » 

11:00 AM
@Mysticial nice - how accessible is wifi over there?
 
For 10 or so days. Then I go back to Spain for a few days before returning to the states.
There's a surprisingly large number of unprotected wifi here. Unlike when I was in Jordan and Egypt where everyone had wifi, but locked.
Protected wifi is like a kid outside a closed candy store.
 
nice to know - can't live without wifi
 
I have done everything in my power to eliminate all wireless from my life ^
 
I've eliminated all remnants of smart-phones from my life - haven't gotten to all wifi (yet) - that's going to be tougher
(not that I don't like smart-phones - they are just so damned expensive)
 
For our generation, internet is like toilet paper. We take for granted. We can live without it. But it is suboptimal and uncomfortable.
3
 
11:12 AM
How is it suboptimal?
 
lol, I still have a stupid-phone treating it like if it was made of pure gold. The only option at work is iPhone an I am proud to have never owned an Apple product and want it to stay that way
+ battery life sux so hard on smart phones
If you could pick only one for the rest of your life internet or sex?
I chose internet
 
@irrelephant You can't get your mind away from it. So it bogs you down for the whole day.
 
very true
 
that's why I use spy-tools like this rescuetime.com to ensure that I don't lose my whole day to something unproductive like (most) web-browsing...
 
@Tuntuni Doing more Project Euler?
 
11:26 AM
@irrelephant ah well i was trying to do no. 45
but takes too long :D
 
Why does it take too long?
 
1 sec. brb
@irrelephant I kinda bruteforced it :D
 
What do you mean by brute force?
 
@irrelephant well i just made a loop that starts of with the t, p and h provided in the task. then i just increment them until i reach the same result from the functions.
 
hm
 
11:33 AM
i think i did something wrong though, have to check now
 
I think that'll work o-o You probably just have a bug.
 
yeah it should
i just don't know if this is valid
t(t_c) != p(p_c) != h(h_c)
as a condition
_c are counters
t p and h are functions
 
That one requires a bit of pre-calculated math
 
In C++, you should test separately
 
is this good? t(t_c) != p(p_c) && t(t_cp) != h(h_c)
 
11:35 AM
yeah, but fix the typo
 
yup
running
should be under 60 secs
i hope
 
I think it should be much faster than 60s
 
while (t(t_c) != p(p_c) && t(t_c) != h(h_c))
{
t_c++;
p_c++;
h_c++;
}
 
Yeah, the hex numbers are always going to be the fastest
So you can't increment the counters all at once
 
oh, you're right
hmm
how do i do it then
 
11:40 AM
play with it a little
 
hmm.
did you solve it?
 
yeah, but you should try first; you're on the right track
 
int main() {
    unsigned long long i = 1;
    unsigned long long answer = 0;
    while(true) {
        ++i;
        answer = i*(2*i - 1);
        double k = (1+std::sqrt(1+24*answer))/6;
        if(std::floor(k) == k && answer != 40755) {
            std::cout << answer;
            break;
        }
    }
}
 
lol
 
(alt+f4)
xD
 
11:42 AM
Just do some preliminary algebra to shorten the computations a bit, it's a common way to increase efficiency.
 
std::floor(k) == k makes sure the number is an integer?
 
Also all triangle numbers are hexagonal numbers so it's a waste to count them
it makes sure they're exact
sometimes you have a floating point, like 40755.421 but another k would produce exactly 40755
k is a hexagonal number
 
how did you come up with the formula though?
 
algebra
just shorten it out a bit
 
@Rapptz ? still confused. what did you shorten?
 
11:47 AM
another way to solve it is something like:
 
H = h(2h-1), T = t(t+1)/2, substitute t with 2h-1, you get (2h-1)(2h-1+1)/2 which is h(2h-1)
Since all triangle numbers are hexagonal numbers, you can ignore the fact of calculating both of them
 
that's what i needed :)
 
while(p(p_c) != h(h_c)) {
    if(p(p_c) < h(h_c)) p_c++;
    else h_c++;
}
 
@irrelephant ahhh that's a good one.
@irrelephant increment the one which is lower. nice nice
 
11:53 AM
When using github do you have one repo/project?
 
@Rapptz nice ;) thanks for the help
 
yes
 
@irrelephant thanks for the help :)
 
mhm
 
Have you done all the problems consecutively?
 
11:54 AM
nope. looking for the easy ones first ;)
 
Try 24.
Easiest solution is in C++
 
with the help of some lib?
 
just the std namespace
 
or just a normal solution
ehh
 
it can be done in 5 lines.
 
11:56 AM
lol
@Rapptz could you give me a hint on what exactly from the std namespace i need? :/ not too familiar with it yet.
 
hi sehe
look in algorithm
 
@Rapptz kk, thanks
next_permutation, lexicographical_compare? :D
 
just the former should do it
 
hmm, yes, seems like it is already in lexicographical order (looking at the example)
solved it. :) cool function
that's why i love PE, it introduces you to new things
 
12:12 PM
s/PE/SO/ and profit from real-life 'new things'
Of course, std::next_permutation is real-life enough. Though most of the math-heavy challenges are ... less representative
 
mhm. what is s though?
 
s?
oh
replace all
 
i mean s/PE/SO. what does the s stand for?
 
replace all
 
?
 
12:14 PM
"replace all instances of PE with SO"
 
oh lol.
ah.. now i get it lol x)
is there a way to check if a number is a triangle number?
nvm, got it :)
 
@Tuntuni hehe
 
@sehe ;)
 
some would say 's' is for 'substitute'
 
Xeo
@ThePhD Sure is. Can't you tell by the avatar? :P
 
12:38 PM
@sehe Could also be, you're an occam's razor kind of guy?
 
if i do "int something = some_double" will i get the floor, the ceil or does it depend on something?
 
@irrelephant thank you :)
 
@Tuntuni hmm, but ideone.com/tlQnF6
 
12:50 PM
@JohanLarsson no. just associative thinking. output sometimes similar (with the 'humans are irrational' caveat)
 
@irrelephant :o
 
@irrelephant see 'float inexact' on Stack Overflow. This is deadbeat horse
 
@sehe here he is btw, when he peaked I honestly think he was the best in Sweden, maybe in the world. Have never seen any dog close to him when it comes to getting things done in the mountains. He is old now though.
 
129
Q: How dangerous is it to compare floating point values?

Proud MemberI know UIKit uses CGFloat because of the resolution independent coordinate system. But every time I want to check if for example frame.origin.x is 0 it makes me feel sick: if (theView.frame.origin.x == 0) { // do important operation } Isn't CGFloat vulnerable to false positives when compa...

@JohanLarsson I'm not aware of "things" that "dogs get done in the mountains" :) (I'm a cat owner housemate)
2
 
@sehe cats have staff
 
12:56 PM
not really, of course, cats just don't need much. I like it that way
 
1:07 PM
^ 50 shades of awesum
> With teletype interface and the Fortran language, the computer will be easy to use
Only, it is a hoax/photoshop: fark.com/comments/1115586/…
 
@JohanLarsson A tongue that long should be illegal :)
 
Anyone know how to write a chromium plugin? I need to call "mplayer"
That intercept a URL download, and launch another program instead
 
@MartinJames It was carefully planned, we waited for a day with nice weather and went out when the light was nice and let them run for 45' then we were ready with cameras on tripods and bursted away. Really happy with that pic, the veins in the tongue and the sunlight in the eye
 
@sehe rofl - the Fortran and the Gilligan/Skipper one are my favorites
 
1:35 PM
are these two statements equivalent (if v2 starts off empty)?
std::copy( v1.begin(), v1.end(), v2.begin() );
std::copy( v1.begin(), v1.end(), std::back_inserter( v2 ));
(asking because I'm cleaning up some code and I see both forms)
 
no
the first is erroneous
 
@DeadMG ty
@DeadMG v2=v1; is also crap, right? (I see at least one instance of that in the code)
 
no, that should be fine, assuming the copy was what was intended.
 
so in the case of v2=v1; v2 will be wiped clean first?
 
of course
it's value assignment.
 
1:38 PM
makes sense - ty
 
1:51 PM
damn, I'm still asleep.
 
Just curious have any of you guys come across developers who refuse to give you access to some funcitonality behind their api? Im not talking complex stuff but simple simple stuff.
For example, we're using a framework that uses chrome web kit to have a chrome window inside of a directx application. I asked the developer that I could get a callback when any window opens so i can populate the javascripts context with our own bindings.
 
well
if you are not paying him, then it's fairly reasonable for him to define what he wants to work on
 
He out right refused to something like this because he wanted a more elegant way of doing it. The more elegant way resulting in about using their own custome tool to populate the javascript context that they use.
The service contract is 500k pa
 
then you'll have to ask the service contract what it says he can and cannot do w.r.t. feature requests.
 
btw we pay them for the usage of their engine
It wasn't because of technical reason it was because he declared a callback to be 'unclean'
 
1:56 PM
dude
if you have a service contract, then ask the service contract.
 
No service contract
 
1 min ago, by Chad
The service contract is 500k pa
if you do not have a contract stating that he has to implement the new features exactly how you want them, then he does not have to implement new features how you want them.
 
Well to be more specific, there is a liscence fee of 500k P.A. to use their engine. They give a basic api into their engine and the company i work for on sells it as a solution. per say there is no service contract.
Nice way to put it DeadMG
 
well, if you're not happy with what you paid for, then stop paying for it
he has no obligation to implement the new features you want.
 
oh im been brought in to work with their engine
Eg... Im the one require to impliment the required funcitonality with their limited api
For the twist.
 

« first day (806 days earlier)      last day (4146 days later) »