« first day (426 days earlier)      last day (4747 days later) » 

15:00
@RyanKinal :-P
So, if I wanted to start contributing to a open source, client-side JS library, what would be a good one? (Preferably forkable on GitHub)
I feel like I need more JS in my life :-D
lol idk
It was more of a generic question, but I guess mostly directed at @Raynos and maybe @ThomasBlobaum
@RyanKinal :-P
I had a high-profile recruiter contact me about a possible client-side job, and I don't feel like I have enough good code examples out there to impress him.
15:10
Paid account = private repositories
@Zirak And contributors
hey
you can contribute to that stuff
@RyanKinal ... :(
@Raynos inorite?
I was half way through refactoring that >_<
15:12
Oh yeah. I should have thought of that :-P
lol @ issue #29
dom shim is pretty easy to contribute to, fork it, implement XHR2 or DOM3 events
> become godlike. beat IE6
I would just show them my fiddles! "Ahem sir, these are cool, but we really dont need 'real time lighting' on our websites with JS"
or write the htc to make it work in ie6/7
I think I also need to get Stormy (working title) live.
15:14
@Loktar :(
@RyanKinal projects without readmes are rage
@RyanKinal if you can get a gov gig, you can show them an animated power point and it will impress them.
@Loktar lol
@Raynos Yeah... I kinda wrote the whole thing in 12 hours, minus a few updates. It was 4am by the time I got around to pushing it to GitHub, so I didn't write a readme
@Raynos If I ignore everything you say on the style guide, can I still contribute?
@Zirak the DOM-shim doesnt confirm to the style guide
maniacal smile
15:19
But yeah the DOM shim needs XHR and DOM3 events support. It also needs better unit tests and more eyes on it to make it production ready
I need to work on making it more modular myself
But if you want a list of open source js projects that need to exist I can supply :D
RT @Pl4n3: #Javascript Physics library Bullet.js v.0.2 is uploaded http://code.google.com/p/bulletjs/downloads/list Some Bugs (e.g. that caused unnatural jitter) ar ...
@Raynos I wouldn't mind a list. But I might start looking at XHR2 and see if I can help out with that.
let me see if I can commit what I have to a dev branch
@Raynos May I use ES5 stuff like Object.create?
Don't bother quite yet. I'll probably start out with reading specs.
15:29
I meant I started doing some work for XHR
the pain in the ass is setting up an echo server to unit test XHR
@Zirak dom-shim assumes an es5 compliant environment
THANK YOU
Well the shimmable subset of ES5
you cant use getter/setters on non dom objects
can I do ajax cross-domain JSON calls to arbitrary sites using CORS, or does each site have to specifically support CORS?
(i'm having trouble finding some introductory stuff that i can really understand)
@Raynos So, I should be forking the dev branch, correct? I'll assume the "master" branch is considered the "stable" branch?
15:34
the dev branch wont build
I would recommend you fork the master and I'll rework whatever you have in my dev rewrite
Okay
So... am I required to "build" it with Node, and then run it client-side, then?
I still haven't done anything with Node, so I'm a bit unfamiliar ;-)
Oh yes you have to build it using node
@hippietrail you just need the browser to support it, if the server gives a green light for CORS, it will work
Ah, good to know
15:41
@hippietrail though if by JSON you mean JSONP then you don't need to worry about that at all...
@Esailija no i want to call this airport code site that has very little documentation and only returns json as far as i can tell and not jsonp
@hippietrail, the json page doesn't allow CORS so you have to server-side proxy it
so far i'm thinking i must have to try calling it and see if the site returns the cors http header(s)
@hippietrail you could of course send feedback to them: Y U NO CORS
ah bummer i don't have anywhere to put a proxy server
15:43
you can use the yahoo one?
yeah i did send feedback and they never replied
there's a yahoo one? we only found this one when we were looking
0
A: Which IDE are you using to develop node.js apps

RaynosThe node toolset depends on the environment *unix: node npm git unix windows: Windows azure powershell for node.js msysgit both: text editor of choice (Sublime text 2) debugger of choice (node --debug, node-inspector) As for IDE's, I don't use any because all IDE's for node I've trie...

you'll need node installed on linux or use the azure powershell sdk for windows
omg I ate way too much now I my stomach is in rage mode
15:44
@RyanKinal you should use irc for node.js :)
@Esailija oh a general json proxy tool from yahoo, not an iata airport code server by yahoo...
@hippietrail afaik, you send a xhr request to yahoo to fetch the page from airport, then yahoo sends back the response with CORS headers
so you don't need your own server to proxy it
I never used the yahoo thing just something that popped in my head :D
sounds cool but so far i can't grok that yahoo page to see where to start
@Esailija you don't need that anymore in modern browsers. We have CORS these days
@Esailija it kinda looks like you can only use it to call yahoo api's not arbitrary api's on the web unless i'm missing something
@Raynos does the server i'm calling have to have cors support? and how if so how can i check whether it does?
15:49
@hippietrail I know nothing about CORS
hmm seems not many people do and the w3c docs are pretty opaque for me
@Raynos you didn't even follow our conversation? The server doesn't send CORS headers that's why I suggested yahoo
@Raynos aha that looks like a better intro than the ones i had found thanks!
@Esailija did you verify that the server didn't send the cors headers? how? i'm just on my netbook right now with few tools
@hippietrail, yes, I have google chrome so it's pretty easy
I just love the part in a design where you just scream "THIS CAN'T SCALE IT'S TOO COMPLEX", tear everything up and start again
thanks @Esailija i have google chrome too but i don't always know or remember all its features. i found a free online http header viewer though
maybe i need to find a free json to jsonp converter proxy
@hippietrail C-S-j, Network->page name->Headers
@Zirak aha of course, thanks!
this seems to be a free json to jsonp proxy: blog.jsonpify.com
not that i can get jsonpify to work
16:17
Looking at projecteuler.net/problem=1 is there a way to solve this using arithmetic progression?
Ahh I see it now.
series 3 + series 5 - series 15.
I want a game related project Euler
@Loktar What would you like to do?
idk what the problems could consist of
but it would be interesting
I know you wanted to start a JS competition before.
yeah I still have that domain too
codecompo.com or whatever it was
16:21
@Incognito The only thing you have to watch out for is numbers that are a multiple of 3 and a multiple of 5
Wait... that's what you just said. Nevermind
@RyanKinal Yeah, this is why I'm saying subtract the fifteen. I'm not sure if that would work.
It probably will.
It seems like it should
I'll find out soon.
Clever
My math is awful, I feel like I'm just compensating with my programming knowledge.
This is why I'm doing euler.
16:23
@Incognito Yep, it can be solved by making 3 series.
a = { 3, 6, 9, 12 ... } d = 3
b = { 5, 10, 15  ... }  d = 5
c = { 15, 30, 45 ... }  d = 15

answer = sum(a) + sum(b) - sum(c)
@Zirak Well, I'm trying to use arithmetic series so I don't have to even bother generating the whole series, just the first and last multiples.
Which leads me to my next question, how do I get the first and last multiple, and the number of multiples in the series?
You don't need to. There's an easy formula to find the sum of an arithmetic series
sum(a) = (a1 + an) * (n/2)
@Zirak I know, but my math skills are garbage so it takes me longer to figure out how to put it all together.
a1 is the first in the series, an is the last in the series.
I suppose for series of n=1000, m=3 I could do...

floor(n/m)*m to get the last in the series, floor(n/m) to get the number of values in a series.
Is there a better way?
The last in the first series is obviously 99, in the second one it's 90, and in the third it's also 90
Right, but I'm making a function that deals with n multiples.
The purpose of me doing euler is to push myself to make really reusable software and getting better at math.
16:32
Then yes, it's a simple way to do it
So my first way of doing it was... jsfiddle.net/BDG/wDyN7/4 which isn't doing any of this in a nice way.
oh cool Im going to have to do the teamJS thing, thanks for posting that @Raynos
do you guys understand wtf this guy means?
0
A: How to draw Arc on canvas on mouse move?

LoktarLive Demo The above draws an arc when you click and on mouse move expands it, however it doesnt delete the previous one. Your question is a bit vague, so let me know if this is close to what you were talking about.

idk why he would want to draw an arc on mouse move if hes rotating a compass...
Sorry, no idea what he wants.
oh well
I try to jump on canvas questions, but some are a bit retarded.
As far as I can tell you gave him exactly what he wants, but he doesn't have a solid enough grasp on english.
I'm amazed at the drop-out rate on project euler.
16:42
haha yeah, I dropped out at 5
Roughly 2% of people get 1/3rd of the way through.
The problems are too heavily based in math for my brain to comprehend
plus I generally try to do them at work.. which isnt a good idea.
See, I was really good at math. I haven't done math in over three years... and... poof, it's all just a pile of garbage.
I remember a lot of cool things you can do with math, but I'm totally lost with them. I used to be in math contests, now I'm like Hurrrr how do I do this trivial question I'm sure I answered in grade 10.
lol yeah
@Incognito Is the answer 5363?
16:46
@Zirak Answer to what?
Euler question #1
@Zirak Answer is always 42.
Not the right answer.
Deleted the answer.
16:47
oke
Oh, @Zirak The total seies is numbers from 1..999 inclusive.
Not 100.
~_~
@Incognito Uhh, that's the answer Euler shows as the correct one
@Amaan On #1?
Yep
16:48
Am I solving a different #?
I'm seeing a number that starts with a 2, and it was accepted.
I don't think so. Problem #1, sum of multiples of 3 or 5 below 1000
user1385191
question #3 was really tough
user1385191
haven't bothered with 4
It says I've solved #1, and it's a six-digit number starting with 2.
@Incognito Yeah, it is.
16:51
We've become confused. I was saying that chat.stackoverflow.com/transcript/message/2122892#2122892 is the wrong answer.
Not your now-deleted answer.
user1385191
just did the question in about 10 seconds
I'm trying to optimize my range function
@Incognito Ah
@MattMcDonald #1 is easy
@MattMcDonald I'm trying to make the general solution, not specific: adding multiples of a series for any number of multiples, using arithmetic progression. Otherwise I'd be well done and on my way.
user1385191
16:53
like I said, #3 is tough
In mathematics, a geometric progression, also known as a geometric sequence, is a sequence of numbers where each term after the first is found by multiplying the previous one by a fixed non-zero number called the common ratio. For example, the sequence 2, 6, 18, 54, ... is a geometric progression with common ratio 3. Similarly 10, 5, 2.5, 1.25, ... is a geometric sequence with common ratio 1/2. The sum of the terms of a geometric progression is known as a geometric series. Thus, the general form of a geometric sequence is :a,\ ar,\ ar^2,\ ar^3,\ ar^4,\ \ldots and that of a geometric ser...
Ah, wait, I clicked on 6 instead of 3.
3 looks like a good use case for array.map
user1385191
with 3, you need to use factors
user1385191
otherwise it'll lock up
@MattMcDonald #4 is pretty easy
I just solved it (again)
Heh, I just tried registering.
16:59
(Brute-force. With no thinking at all)
I got: Warning: Cannot modify header information - headers already sent by (output started at /home/admin/domains/projecteuler.net/public_html/includes/index_main.php:13) in /home/admin/domains/projecteuler.net/public_html/includes/init_functions.php on line 2
@adscriven I think that happens when your username is already taken.
Wouldn't surprise me. My username was longer than 16 characters though, I now realise.
@Incognito 503963?
@Zirak Six digits, starts with a 2.
17:02
Then 503962 :P
@Zirak What are you trying?
Doing a sanity test, too lazy to pull out a calculator
@Amaan Polish my small algorithm
You can get the answer really simply by just looping through all the numbers and adding only the multiples
hmm, getting a pretty big steep...wonder why's that
My sum function is faulty :P
1 + 2 + 3 + 4 + 5 is definitely not 12.5
well aren't I an idiot...multiplying when I should be adding
Hah
Your answer's correct
huzzah, no brute force done!
If I have an array of [2, 3, 4, 7], how could I generate the unique combinations from it such as 6, 10, 14, 15, 35? Is there an option other than two for loops?
Where did the 15 and 35 come from?
user1385191
yep, there's #4 down
user1385191
17:23
good old Array.prototype.reverse
Err, 4 should have been 5.
Also, I think that's not all of the combinations x.x,
I'm missing quite a few of them.
if I have a, b, c I need ab, ac, bc, abc.
you guys notice on the account page JS isnt even listed as a language on project euler :?
12 13 23 123?
@Loktar ecmascript. It got me too.
ahh ok... so Actionscript counts as well :?
17:34
Hi all
please help a girl out..
0
Q: EXTJS4: how to set value of displayfield dynamically (from server data)

astrocybernauteI want to add an account Info section to my app, it would contain name and role of the current user In my server side i can get those infos, but i dont know how to send them from server to my form and display them in a displayfield The only way I know of dynamically populating data from sever i...

You're really a man
user1385191
yuck, extjs
do you have any code at all
user1385191
just brute-forced #5
user1385191
man, that's a massive answer
17:38
im on # 7
bleh
I think I might skip it
@Esailija code of my display field? or server side code to get the data?
yes i have both
@astrocybernaute you should add the relevant code in your question
and what is a display field
it loks like a label
oh it's an ext.js thing
user1385191
yeah, #6 is insultingly easy
17:44
10 sounds pretty easy too
@Esailija yes
added my code
you need to replace IBM and Admin with something dynamic? What server-side language are you using?
ohh
32 watchers \o/
soz I don't know c# at all =(
17:48
doesnt matter cause i know how to get my data with c#
the problem is in extjs..how to send this data to my form
the problem is indeed extjs
the solution is y u use extjs
@Raynos doesn't matter... instead of sending static value from server you just send dynamic ... I don't think it's client side issue at all and yes ext.js sucks :P
i just stepped in to say extjs sucks, thats all
cool
im not sendin static data from server!
i dont know how to do that
17:51
like instead of Admin in php it would be <?php echo $role; ?>
@Loktar # 7 what?
if i could send any data from server that would be ok
yeah but thats not php thats extjs
problem #7 on projecteuler @Raynos projecteuler.net/problem=7
I have to disagree that the statement <?php echo $role; ?> isn't php
it would pass a dynamic $role value to ext.js which could be Admin or Member or whatever
i meant im not using php :p
17:54
yeah but seeing as the problem is what you send from server... your problem is server-side ie c# question?
the extjs snippet in your question is sent from server with static values IBM and Admin.. you need to modify your server code to send something else
where do u see i send it from server, im not,ibm and admin are static i wrote them inside extjs code
where do you think you are sending it from then? en.wikipedia.org/wiki/Http#Technical_overview
18:13
Is there a donation page for jsFiddle? ... It needs additional servers, it's impossible to work likes this... :)
Friendly tip: stop using jsfiddle to work
@Zirak But I need a demo generator...
Or at least some online testing environment...
@Å imeVidas you can't donate
I already asked them
@Zirak problem is IMO anyway JSfiddle is vastly easier to use
oh wait
The idea of dump code -> run can't be that easy/hard to do
yeah true, I just make a random html when jsfiddle is going way too slow
@RyanKinal Ah, of course. Instead of using jsFiddle, I just load my IDE, create the demo in it, then load my FTP client, upload the demo to my hosting, and then access it with my browser. ... And when I want to make changes to the demo source code, I just repeat that process. Why didn't I think of this myself...
18:19
You can make your own in like 10 LOC
@Å imeVidas I just load Vim/Emacs, automatically go via ftp or whatever to the server, change shit directly, save, refresh :D
you guys don't run a local server?
on your test machine?
IDE: 0, Vimacs: 1337
ide shmide
18:21
@user886931 The demos have to be online... it's for Stack Overflow...
<--- runs a local server
ah right
good point
@Å imeVidas Step 1: Develop on your local machine. Step 2: Upload to hosting Step 3: Win.
@Zirak Yea, I guess my IDE (WebStorm) has FTP built-in, but I don't use it...
Emacs wins in this case. dired doesn't care if it's a local directory, or a whatshemahcallit-that's-used-to-emulate-servers-like-real-HDD's
So I'm just like "gimme F:/htdocs/winz", and it's like "oke"
18:25
ehh
i like using git for deployment
so i never use (s)ftp anymore
server just has another copy of git repo, i just ssh in and pull it
and work on my own copy wherever
but yeah for little sample stuff i guess thats no good
@Loktar RAGEQUIT THE INTERNET
jsfiddle y u no better
user1385191
ah, good old jslint
@IvoWetzel what did your company do :\
user1385191
yeah, I just usually type :below sp path/to/file in vim :)
@Raynos IPO
Oh and now it's -7%
18:36
what does that mean?
did it go public
user1385191
lol, zynga's almost as low as RIM
lol @ var isntPrime
I broke clean code practice for this bitch.
user1385191
18:38
you need to ensure it's over 1 as well
Number.prototype.isPrime has a side effect. That's why I have that extra variable.
never seen [].some before
ah, es5 stuff
what is the point of this.valueOf()
user1385191
it does as it says
to get a number primitive
this is a Number object
i don't think you need to
should work fine as is
18:42
I'm neurotic at times. Couldn't remember if it's legal to do shit on number objects and not only number primitives.
@Zirak y u big number example
you can but there will be conversions
user1385191
@user886931 new Number(10); // Number
Number.prototype.wassup = function(){
return ( this + 1 ) * ( this + 2 );
};

Is fine but it will have to get valueOf 2 times
user1385191
this is a problem with Boolean objects
user1385191
18:44
they're dangerous
with booleans yes
but numbers should be ok
yeah that example just crashed the hell out of my browser
thanks buddy
not really, if this represents an object number which originally was a 0 primitive, it will be truthy
but 0 is a falsy
wish i could star my own posts
10000 STARS
...
18:47
Esailija yes but he doesn't have !n anywhere
or anything like that
@user886931 it's just a question of good practices
as a general thing
-9.2% ...
looking great!
ok, so then... n=+this
no function call :)
another gotcha is that you can't do (this === 5)
@IvoWetzel hmms?
18:49
why would you do that
@ThomasBlobaum Stock of my company, had the IPO today..
sees no optimization suggestions, cries
@Zirak, can't you see he suggested +this :D
@IvoWetzel oh oh, cheers!
over .valueOf()
18:50
hahah
yeah see
it will be nano seconds faster
go for it
that's a great optimization
or slower
i have benchmarked it before
@IvoWetzel theres been alot of negative talk about them
depending on browser + is slower or faster
18:50
and, you save 8 characters
@IvoWetzel im still trying to milk the HN traffic news.ycombinator.com/item?id=3360759
that's huge
16 actually
+ will be slower than this.valueOf(), I can guarantee it. But even if it weren't, we're talking picoseconds.
Optimization comes in the form of "oh, you're duplicating this process" or "oh, you can change this algorithm to a better one"
only going through half of the numbers is most what you can get out of me and you already have that :(
I suppose you could use typed arrays
and not use callbacks in iteration
This solution should technically be a lot faster than a regular prime number check (aka semi-brute force for loop)
18:54
I.E. get rid of .some and do it the ugly way :P
Callbacks can do a little. Typed arrays likely will help with memory cost (a little bit), performance benefit will be negligible.
Something much more algorithmical is necessary.
Something that makes you say "of course! it's like what I did before, just better!"
I have a great pdf on that... maybe I can find it
it could be this pages.towson.edu/aconover/Documents/… not sure because it's loading so slow
@Zirak I HURD U LIEK OWNT (100% slower, take that!)
@Zirak yes that's the pdf, save it cos it takes so long to load :D
there's not much stuff on prime numbers but it still could help, it's a great pdf anyway :)
@Raynos You basically did what I did on my second draft (storing in an object, not array.) Ditched that because of .some, ah well :P
18:59
half = Math.floor( n / 2 ) might be slightly faster as half = n >> 1
wheres your second draft?

« first day (426 days earlier)      last day (4747 days later) »