« first day (602 days earlier)      last day (4362 days later) » 

12:52 AM
 
 
1:34 AM
!!> objToResult = function () { return 'trollz'; }
@Zirak trollz
@Esailija hacked ^
Well, not really. meh.
Anyway, moving the do-shit-with-result outside the worker...it shouldn't have been there in the first place.
 
static analysis is fun
although coming up with descriptive error messages is... uh.. hard
anyways this static language compiling to JS thing is finally shaping up
in case it ever gets done, coffee script is teh doomed
also everyone loves type declarations like int() < (string) < (string) someFunction = foo
 
1:58 AM
hello
in which condition i can use "type of" ?
 
ugh, fuck the bot. I need beauty sleep.
 
 
3 hours later…
5:19 AM
which is better creating a plugin in jquery or calling functions from one to another
 
 
1 hour later…
6:40 AM
is there any way to disable browser's save as option by using jquery
or javascript
 
7:16 AM
@Zirak it cannot be outside of the worker, besides you can just make it unconfigurable etc like [].join
 
hello
$($children).appendT0($parent) is appending $children to $parent but i want $children to be only inside $parent.but unable to do it
 
7:53 AM
RT @MarcoInEnglish: #accessible #Firefox for #Android will now work much better with the d-pad of the Eyes-Free keyboard, starting with ...
 
8:30 AM
Hello All
I need a help to match a substring
having two data like abc_12J8787 , cdvf_13J87876
now want to compare abc_12 with cdvf_13 only
the string name may vary but pattern will be <string>_<no><char><no's>
Please help me how to achieve this
 
8:51 AM
hello
 
 
2 hours later…
10:22 AM
@Esailija Why can't it be outside the worker?
 
Hello zirak
 
because it can only pass strings
 
i need your help is there any way to disable browsers save as option
 
@ChaitanyaTummagunta no
 
and it should just be easier to use defineProperty, no?
to make it unwritable
 
10:24 AM
@Esailija I wanted to just replace it all with JSON.stringify anyway
 
k thank u
 
but json stringify only works on plain objects and arrays
if you do this then it will crash
because it tries to stringify the Object DedicatedWorkerContext
initially it used just JSON stringify though
and btw, if you "hack" the objToResult, it will only be for that command anyway
it won't affect any others
 
yeah yeah, I know
I still don't like the worker serializing the answer
 
10:43 AM
Let's see the bugs I made
!!> console.log(42); { 'a' : 42 };
 
:)
 
First bug: I didn't execute the bot.
@Zirak Could not process input. Error: Object > console.log(42); { 'a' : 42 }; has no method 'startsWih'
sigh
 
:D
 
!!> 41+1
 
Good Evening
 
10:53 AM
@Zirak Maximum execution time exceeded
 
(O_O)
 
that's caused by error in worker
 
hrm...blob SyntaxError
 
!!>(41+1)
 
@Abhishek Maximum execution time exceeded
 
10:53 AM
how did you update the base64 encoding of the code
 
erm...pasted shit into btoa '^^
 
btw I am using base64 encoding only because I was too lazy to make multiline string from the worker code
it's easier to make a jsfiddle with console.log( btoa( document.body.innerText ) )
and then use that base64 for the worker code
 
I hate online tools...inserting \n everywhere
!!> 41+1
@Zirak Maximum execution time exceeded
 
in the codeExecutor.js, you would take that console logged base64, and put it in var workerCode = atob('textfromjsfiddle')
 
yes yes
 
10:59 AM
watch out for whitespace in the end as well
 
No syntax error, no nothing
 
ok weird
 
I just horribly failed somewhere
 
ll
 
ok I can't see any mistake in the worker code
can you add a console log to workerExecutor to see if it ran correctly
at least to narrow down where it could be
worker.addEventListener( 'message', function ( event ) {
		clearTimeout( timeout );
console.log(event.data);
		finish( dressUpAnswer(event.data) );
		worker.terminate();
	});
 
11:06 AM
nah, it doesn't get there if it sends a "Maximum blah blah"
 
postMessage({
			answer : result,
			log    : log
		});
where is log defined
 
...you make a fine point.
 
there is console.log but no variable log?
 
Lesson, kids: When you change shit, make sure you changed it everywhere.
 
weird that it doesn't cause a reference error
 
11:08 AM
>_> v8 runtime error occurs as javascript runtime errors >_>
in native modules ..
 
note also that if you pass a result that is not serializable, I don't know what will happen
 
[for anyone who is writing thats a vital piece of undocumented information]
 
because you can only send strings
or maybe other primitives as well
but can't send other objects
 
!!> 41+1
@Zirak Maximum execution time exceeded
LOL
It's the inline comment
I'll put my money on the inline comment
 
how so
ah
I see
 
11:12 AM
"var global = this; //most extra functions could be possibly unsafe var whitey = { 'self': 1, 'onmessage': 1, [...rest of code...]
 
you changed /* */
to //
 
:D
 
and didn't think I used /**/ for a reason
:D
 
!!> 1+41
@Zirak Maximum execution time exceeded
"Cannot redefine property: cleanObject "? wat?
 
wut
 
11:14 AM
ugh, let me guess, you didn't compress the object cleaning into a function because of this?
 
no it was laziness
you can declare it inside a closure and it should work fine since it won't get attached to global object
 
I'll lazy it up even more
 
in the meanwhile, I am getting destroyed here stackoverflow.com/a/10955691/995876
 
!!> 41 + 1
@Zirak Maximum execution time exceeded
sigh onmessage is not defined
 
yeah you are actually running that function in strict mode now
does that matter?
 
11:19 AM
Yes, yes it does :P
!!> 41 + 1
@Zirak 42
YAY!
 
!!> console.log(1,2,3); console.log(1,2);
 
oh dear hell I'm stupid
 
the original is this :
var console = {
        log: function(){
            cvalues = cvalues.concat( [].slice.call( arguments ) );
        }
    };
though I think that's the same what you have
 
ungh...this wasn't supposed to happen. There's a check before...
So it's somewhere else
!!>console.log(4)
Well, yeah...if the answer is undefined...
JSON.stringify( undefined ) === undefined sigh
!!>console.log(4)
@Zirak undefinedLogged: 1:4
Not perfect, but working
!!>console.log( 0, 4, [1, 2, 3] );
@Zirak undefined Logged: 0, 4, [1,2,3]
woop. going afk for ~15 minutes...tell me if you find any more bugs.
 
user379888
11:44 AM
Hi all.
 
user379888
I am having trouble validating a form. I would love to get some help.
 
user379888
Anyone?
 
12:24 PM
0
Q: Send additional data with form via ajax request

Somebody is in troublemy page code is <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <tit...

 
 
1 hour later…
1:36 PM
@IvoWetzel any experience working with node.js native modules ?
 
@Abhishek Not really, only did some C++ / V8 stuff once
 
:-(
I need somebody to help me with making native modules async :-(
I will start with converting my code to "good looking OO C++"
cya later
 
Do any of you know a SO mod, or one which sometimes comes to this channel? Apparently you need to ask a mod to unfreeze a room
 
@Zirak what ?
 
Which part wasn't clear?
A room I made (for the bot testing) was frozen because I was a slug, and I want to unfreeze it. To do that, I need to ask a mod, so I asked if any of you know one which comes here.
There was one...balpha?
 
1:54 PM
oh
i dont :-( some randomly peek in though
and try staying in C++ more chances
 
hrm, I can flag a random message...but that's not nice
 
:-)
 
Can you flag one of my messages (preferably one saying that I want to unfreeze a room), so that it won't be very random?
 
done
 
waits behind the bushes
 
1:56 PM
hides
I am so frustrated because of C++ these days :/
 
heh, that happens whenever I come close to C++. It's a trolling language
 
some self proclaimed awesome C++ libraries are totally insanity of code and a mess to learn but useful on the other hand
 
Amateur C libraries are the best. It's a barrage of lunacy
 
in my Google Crome java script code does not work.
why?
 
Well...just in case a mod does come here when I'm dead or something: Can you please unfreeze this room please? Project was halted and resumed, and I don't want to clutter other chats. Thanks, and sorry for the flag
@prjndhi wow, you win the Vague Question of the Year award
 
2:03 PM
no
 
@prjndhi can you show us code ?
cause there are more reasons for that then the hairs on your skull :-D
 
"Hey, mechanic, my car doesn't work. No, I didn't bring it. So, why isn't it working?"
^ that's your question. Show us the car. Explain what isn't working.
 
Zirak i starred your request :-) so that he sees it.
 
Neat, thanks
 
Np
 
2:09 PM
Yep
 
I will finish this module on any case today (rage)
 
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
function myFunction()
{
alert("I am an alert box!");
}
</script>
</head>
<body>
@Abhishek
 
Facepalm
was the function ever called ?
i cant see it :-D
try adding

myFunction();
 
yes
what?
 
at the bottom.
 
2:25 PM
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
function myFunction()
{
alert("Hello World!");
}
</script>
</head>

<body>
<button onclick="myFunction()">Try it</button>
</body>
</html>
still not working.
in browser this code is displayed.
@Abhishek
 
Hi all
 
works for me
did u clicked the button ?
 
whats wrong tih my regex ? /^[0-1][0-9]:[0-5][0-9]\s[am|pm]$/i
 
and press ctrl + shift + i
 
i want to test an hour like : 11:30 am
 
2:29 PM
before you do so
so that it shows u errors
in the console tab
 
user1385191
> At Mozilla, we were losing a few add-on download clicks because of the lag from putting the JavaScript at the bottom. So, we created a tiny bit of JS that recorded important events, which we loaded in the <head>. The queue re-fired off the events once the JavaScript loaded.
 
user1385191
[reads linked code]
 
user1385191
oh, jQuery with class selectors; go figure
 
?
 
Ahaha i read that yesterday
 
2:33 PM
Hi there
 
Greetings Amigo
 
im having a html & css problem and the chat room for this category is empty,can i spit it out here?
 
user1385191
moral of the story: don't whine about page speed when using a 250 kB library
 
@MikeBoutin Change [am|pm] to am|pm
 
@Zirak /^[0-1][0-9]:[0-5][0-9][\s]([ap]m)?$/ ?
 
2:39 PM
[] is a character group, so it matches any of the characters it finds, once
Yes, that could also work
 
user1385191
oh look; another script that sniffs for Opera with a RegExp
 
But that makes the \s mandatory, and [\s] is obsolete - simply do \s
To make the \s also optional, simply add a ?
/^[0-1][0-9]:[0-5][0-9]\s?([ap]m)?$/
 
user1385191
protip: document complex RegExps
 
Actually, it can be make more pithy
[01]\d:[0-5]\d\s?([ap]m)?
erm, remove the [] around the second \d
hrm...the trailing whitespace...non-capturing group?
^[01]\d:[0-5]\d(?:\s([ap]m))?$
That way it'd still capture the suffix, but not the whitespace
Regexs are weird
 
user1385191
/**
 * 1. Numeric (0-1)
 * 2. Numeric (0-9)
 * 3. Colon
 * 4. Numeric (0-5)
 * 5. Numeric (0-9)
 * 6. Whitespace OR a OR p
 * 7. a OR p OR m
 * 8. m OR undefined
 *
 * e.g. 10:10 pm
 * e.g. 10:10am
 */

 /^[0-1][0-9]:[0-5][0-9]\s?([ap]m)?$/
 
2:49 PM
Why not just for instance 6. Whitespace (optional), instead of diving a bit into the state machine-ness?
 
user1385191
I want to outline both cases
 
Hmm
 
/*
  [01]    first digit of hour (0 or 1)
  \d      second digit
  :       colon, separator
  [0-5]   tens of minutes (0 through 5)
  \d      individual minutes
  \s?     optional whitespace
  (       begin suffix
   [ap]m  am or pm
  )?      suffix is optional
*/
And of course examples
 
user1385191
pretty good
 
user1385191
just imagine if some of the HTML RegExps were documented
 
3:01 PM
No mods @Zirak :-(
 
user1385191
I did you a favor and flagged the post
 
Thanks
 
3:27 PM
1
Q: How does one unit test an algorithm

Asa BaylusI was recently working on a JS slideshow which rotates images using a weighted average algorithm. Thankfully, timgilbert has written a weighted list script which implements the exact algorithm I needed. However in his documentation he's noted under todos: "unit tests!". I'd like to know is how ...

 
I have a general web programming best practice question. The answer may involve Javascript, JSON, or something else so I feel it's appropriate for here.
 
go for it
 
!!> {} + []
@Zirak 0
!!/spec addition
@Zirak [11.6.1 The Addition operator \( + \)](http://es5.github.com/#x11.6.1), [B.1 Additional Syntax](http://es5.github.com/#B.1), [B.2 Additional Properties](http://es5.github.com/#B.2), [Annex E \(informative\) Additions and Changes in the 5th Edition that Introduce Incompatibilities with the 3rd Edition](http://es5.github.com/#E)
@Zirak Y U NO MAEK SENSE!?
hrm, the latter shouldn't have happened
 
3:45 PM
yes! It finally parses it correctly >_>
void repeat(string a, const int b = 0):
    b = b * 2

void(string, const int) r = repeat


int() < (string) foo(const string a = 'test'):

    int() c(string a):

        int b():
            ret 0

        ret b

    ret c


int() < (string) < (const string) l = foo
I sure broke the rest of the compiler while fixing it though...
 
I have a form and the intention is to allow the user to add something to a MySQL database (which I've already set up and have the correct CGI to obtain a post request and insert to the DB, this is no problem). But I want the web page to allow the user to enter the data in the form and on submit I want to stay at the same page and simply confirm to the user that the data was successfully submitted (or that it failed it if fails). What is the best practice here?
FYI, I'm fine writing the javascript to modify the HTML or create an alert() or whatever, but my question is more about what kind of request this should be? Should it be just a Javascript callback, should I do it via an actual POST, should I use JSON?
 
user1385191
form.onsubmit = handlerHere;
 
Ever heard of XMLHttpRequest?
 
so you're both saying make it a callback from the submit button and then in that Javascript do an XMLHttpRequest? I'm new to web programming, so no I haven't.
 
user1385191
no; not the submit button
 
user1385191
3:52 PM
submit goes beyond that
 
From the wikipedia page: XMLHttpRequest (XHR) is an API available in web browser scripting languages such as JavaScript. It is used to send HTTP or HTTPS requests directly to a web server and load the server response data directly back into the script
Thanks, that's awesome
 
user1385191
whenever you refer to it, please use that name instead of "AJAX"
 
user1385191
years of marketing have poisoned the community
 
I've never said AJAX in my life.... except for right now
so @MattMcDonald what's this about submit going beyond that.. how does onsubmit differe tfrom the submit button, can you give me a pointer on that?
 
user1385191
forms can be submitted many ways
 
user1385191
3:58 PM
the keyboard is one overlooked way
 
oh, so just the enter key?
 
user1385191
the "submit" event will catch both mouse and keyboard submissions
 
gotcha
I have something to chew on for a while with this XMLHttpRequest thanks guys
 
user1385191
because form interaction encompasses more than the mouse, you'll also want to use the "focus" and "blur" events to handle form controls
 
user1385191
(if desired)
 
4:00 PM
I'll read about that
 
4:14 PM
I have a general design question, anyone here?
 
sure
 
4:56 PM
Can someone help me to install nodejs in ubuntu
git checkout v0.6.19
Not a git repository (or any of the parent directories): .git
I will come here later. My power backup going die.
 
@ankit tell me which Operating SYstem
 
git init ?
Ubuntu
 
cause most have a nice lil package for it now >_>
[dear god my eyes]
root@host: ~ # echo deb http://ftp.us.debian.org/debian/ sid main > /etc/apt/sources.list.d/sid.list
root@host: ~ # apt-get update
root@host: ~ # apt-get install nodejs # Documentation is great.
from node.js page
 
it's for debian
sudo apt-get install python-software-properties
sudo apt-add-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs npm
 
man i am going to sleep
i doubt i am going to be least productive tonight.
 
5:02 PM
lol
 
Sam
5:42 PM
Evening everyone :)
I bring gifs :)
 
user1385191
6:30 PM
up to 52/52 in IE 5 at the cost of eschewing IE 4
 
6:50 PM
well, let's do a small test:
!!~foo
@Zirak Nothing found for foo
!!~foo = I liek mudkip
@Zirak Saved alias foo
!!~foo
!!~foo = I haet mudkip
@Zirak I liek mudkip
@Zirak You are not allowed to do this, young padawan
@Zirak I liek mudkip
@Zirak You are not allowed to do this, young padawan
wow, double the fun!
!!~foo == I haet mudkip
@Zirak You are not allowed to do this, young padawan
!!~foo == I haet mudkip
@Zirak Saved alias foo
woop
That's...interesting. SO chat defines a function called TheThingThatGetsDataFromTheServer
 
7:27 PM
0
Q: How to Have Multiple JavaScript Countdown Timers on a Page?

nusantaraI'm trying to have multiple JavaScript countdown timers on the same page but I am still a beginner in JS and can't figure out how to do it. I am working with code from here because I like the timer's aesthetics. Can someone give me one or two solutions so I can learn from it? Thank you!

 
Can someone read how it's work brainstorm.ubuntu.com/idea/2517
Just install "nautilus-open-terminal". This package will add a "Open in Terminal" option to the right click menu for a folder.
it's not work on my ubuntu
 
apt-get install nautilus-open-terminal
Have you tried that ?
 
I have install it from ubuntu software
center
they are now show me remove option instead of install so it's look to me that it's already installed on my computer.
 
7:43 PM
Are you even running nautilus as file manager ?
 
no
please let me know how to use them.
I just use File for open directory.
 
7:54 PM
problem solved. I cut file and move to root directory and run them from terminal.
 
user1385191
 
8:16 PM
hey guys
 
8:31 PM
@MattMcDonald You really are crazyiest than i thought
 
@ankit you really act like you give us order since you're here, it really does not work like that here. Ask a question and pray for someone replying. Don't say " look at that " " look at this " " tell me how to do that "
 
No, I thing Someone already know how to do it so I just tell. Well My question is still not got any unanswered.
 
9:00 PM
hi everyone
anyone knows how to initialize a google map when a form is submitted? google.maps.event.addDomListener(window, 'load', initialize); this initializes is when the window loads, maybe i should try google.maps.event.addDomListener(form, 'submit', initialize); ? but it doesn t seem to work
 
9:27 PM
@JavascriptGeek Are you remembering to halt the actual submission, so the form renders your map instead of submitting to the server? If so, when it "doesn't seem to work," what does it do instead of working?
 
@Derek , actually you should so start getting a steady stream of downvotes for this answer .. thats what you get , if you think that everyone uses same browser as you
 
Why would anybody even consider using document.querySelector("#id") over gEBI ?!
 
@ChrisNielsen i am not sure what you mean, my english is not very good... I also tried the onsubmit="initalize();" on the submit button and I get the page but without the map
 
@JavascriptGeek Ok, so normally, when you submit a form, it takes the browser to a new page, right? Just attaching an event to a form's onsubmit does NOT prevent that from happening all by itself. I think probably your initialize() is being called ok, but the form is still submitting before initialize() has a chance to show your map. Somewhere in your event handler, you need to prevent the form from submitting.
 
@ChrisNielsen ok, i think i undrestood what you mean, and thank you, will check this and come back :)
@ChrisNielsen my form is <form id="myform"></form> and doesn t have an action="something.php" etc, so I don t think that it takes the browser to a new page, if I understood well what you want to say
 
9:47 PM
@JavascriptGeek If you don't have an action, it still submits to a new page. It just uses whatever url you are already on as the url for the action. So if you are at example.com and you have <form id="myForm" /> and you submit, it submits as though you had <form id="myForm" action="http://www.example.com" />.
 
ok I see... will try to fix this...
 
@JavascriptGeek You can watch this happen with fiddler, from fiddler2.com/fiddler2. Totally invaluable tool for web development, if you don't have it already.
 
i use mozilla error console and firebug... does this has any extra?
 
I never heard about Fiddler and i'm not in my first year of dev
 
@JavascriptGeek Well yes, I recommend checking it out, but in this case, Firebug can also help you. In your "Net" tab on firebug, make sure "Persist" is turned on. Then you should see the extra page request that occurs when you submit the form.
 
9:53 PM
And I'm not sure it's really usefull when you have Firebug or the Chrome dev tool
 
@ChrisNielsen will check, i had heard that there is something like fiddler. I didn t know what exactly it is, but it sounds good, thank you
 
@DieVarDump There are many things Fiddler does that are not covered by Firebug or Chrome. =) For instance, you can edit the response from the server before it gets to the browser, or you can capture and replay responses, or if you are using your server as a proxy, it can monitor your server's requests to some other server...
 
@DieVarDump I finally solved my problem, with a weird way though, thanks for your advice, it was precious!
 
It was not me but Chris
 
@JavascriptGeek Glad you got it worked out! =)
 
10:02 PM
:)
8 hours on my pc working on this google-developers.appspot.com/maps/documentation/javascript/… example and it seems like it has passed one hour, i think i will start liking programming :P
 
10:28 PM
Any idea why Chrome does not want to render the box-shadow ? jsfiddle.net/dievardump/vxEfh ( Works in IE9 / FF 13 / Opera 11 )
 
10:39 PM
@DieVarDump It renders in Chrome if I remove the display: table-row for p elements. Obviously, this may have other undesirable consequences for you.
 
obviously. i should have ask " with table-row "
time to get drunk
Bye
Thanks btw
 
11:12 PM
why they give people like this a microphone vimeo.com/43380467
 
11:29 PM
He complains about ",,," == new Array(4), which is extremly easy to explain, but mentions PHP :-/
Also, he's good some good points, if webpages were applications, which they are not
Some people forget this
 
Hello
 
@tereško Keep in mind that IE 8 and after supports document.querySelector, and that covers over 90% of all users in the whole world. Also we should start using new stuff like this, just like what Google does. (No more old browsers holding the internet backward!)
@tereško Keep in mind that IE 8 and after supports document.querySelector, and that covers over 90% of all users in the whole world. Also we should start using new stuff like this, just like what Google does. (No more old browsers holding the internet backward!)
 

« first day (602 days earlier)      last day (4362 days later) »