« first day (1207 days earlier)      last day (3748 days later) » 

12:13 AM
Angular-wise, if I wanted to store data about the current user, would I use a service?
 
yay, I'm learning
 
12:35 AM
@SomeGuy About 12 or 13 I think. Now I get the opposite problem, restless leg syndrome.
 
^^ same here.
Exercise/melatonin/semi-strict schedule === untired Kittens
 
@SomeKittensUx2666 I find exercise is what causes it. If I push myself too hard on a ride my right leg has the party at about 2AM
 
really? I don't do hard exercise, but 20 min of walking is enough to keep 'em calm.
 
It's actually almost become a guide to working out :P No RLS, no gain.
 
1:04 AM
how can i make a element disapper after time out and then reapper after say like 30 seconds
 
Start another timer in your callback
 
not sure how to do that
 
Or use setInterval and check whether it is visible or not
 
@TimWolla The vamps are afoot
 
God those sounds
That bing scared me
 
1:07 AM
Yeah, it's a bit loud.
 
@SomeKittensUx2666 What does that mean? I'm no english native.
 
@TimWolla We call those who suck advice out of StackOverflow without ever contributing back or making an attempt to figure things out on their own 'Help Vampires'
Sometimes it's shortened to 'vamps'
 
I see, I see
 
'afoot' is slang for 'actively prowling' (in this case)
 
Yeah, I was confused by the vamps term. Insiders are hard to get when you are not inside
Well, he will have to figure out how to start the other timer. I wasn't going to give him some code.
 
1:10 AM
Yeah, giving code generally results in them coming back next time they need something.
In any case, welcome to the JS room! It's a little quiet here.
 
Well, I already know it. I am part time lurker.
Though a bit inactive on SO in the last few months
 
Busy with work?
 
It's not like that I don't have time for SO. It's more like there are no suitable questions for me
Or other people are the faster gun in the west
 
Yeah, I haven't actively been answering questions for a while for that reason.
picked up a little lately, but mostly as the opportunity shows itself.
 
Yeah
I'm getting my daily dose of reputation by my „Comments in .gitignore“-answer.
I still don't get why it has got over 70 upvotes.
 
1:24 AM
!!roll my own expand or hack bootstrap's
 
@SomeKittensUx2666 hack bootstrap's
 
roll my own
I mean, your own
 
@copy yeeep.
 
It's that age-old decision-making strategy. Flip a coin and identify which side you were secretly hoping it'd land on.
 
@monners What if it lands on the border?
 
1:35 AM
@TimWolla doesn't matter.
It's not about the actual answer at that point.
 
Just joking…
 
2:30 AM
@TimWolla undefined
 
m59
How does a dev team decide to name their product "mongo" taken from "humongous", when it clearly brings to mind "mongoloid"?
mongodb, you so racially insensitive.
 
3:13 AM
Why recently have all the noob bitwise operator questions been in hot network questions?
110
Q: What do two left angle brackets mean?

user2412672I saw a loop which I've never seen before: for (int i = 0; i < (1 << list.Count); i++) I can't understand what (1 << list.Count) means, maybe someone could explain me this?

161
Q: What does (x ^ 0x1) != 0 mean?

KodeWarriorI came across the following code snippet if( 0 != ( x ^ 0x1 ) ) encode( x, m ); What does x ^ 0x1 mean ? Is this some standard technique ?

23
Q: Difference between ! and ~ in c#

Marc TrittibachWhen I first leared how to write programs, I used C. (very basic command line applications) In both languages you use the ! - operator normally like this: if(!true){ //false.. } I wanted to do some bit-masking in c# and i wondered about the '~' operator. Now i'm a bit confused bec...

 
4:08 AM
Hi guys
 
Hi guys
Can anyone help me with this question
0
Q: Same code but behaving differently in different view

Derek 朕會功夫I have created a fiddle, and it works fine in all browsers I have tested.1 However, when I try the same fiddle in the whole page view (/show), the fiddle suddenly starts doing weird things such as some animations are not animating asexpected, and this only happens on Chrome (tested on Chrome 33)...

 
I am changing my views about jQuery.

It is perhaps the most irritating library if you are working in a modern browser, but in case of a non-modern browser jQuery is quite an amazing library.
 
@AbhishekHingnikar Why?
 
@Derek朕會功夫 wrote a winJS app
jQuery helped a lil :-)
especially by reducing the AJAX mess :P
 
I mean why do you think jQuery is irritating
 
4:12 AM
@Derek朕會功夫 meh... its too much bells and whistles
Its syntax is great :-> but the additional utils it gives you [which are mostly useless in chrome] are wasting space.
oh and also silent errors
 
@AbhishekHingnikar jQuery does provide many methods that I don't even use, but it's still very small in size though
297 B (compressed)
 
@Derek朕會功夫 o_O 297 B ?!?!?!
the website says its 32KB
 
It's 81.7 KB, but only 297 B is transferred.
I got these numbers from the console
 
@Derek朕會功夫 thats cached -_-
fakepalm
 
Okay 297 B is because it cached...
yea I thought I have cleared the cache but I realized I didnt
So I tried again this time it says 33.7 KB
 
now u see my point ?
ps i hate jQuery for silent errors :-/
there should be a mode / plugin for jQuery
jQuery.insult = true;
 
If you only want the selector though, you can get Sizzle
 
which makes it throw insane exceptions like
"FRIKEN IDIOT THAT WAS A NULL ELEMENT"
@Derek朕會功夫 I usually use jQuery where I can't use Angular
for AJAX and syntax sugar for sizzle
 
why dont you open up the uncompressed version and just remove all the parts you dont want
 
4:24 AM
@Derek朕會功夫 or use zepto
 
btw Do you know what is this website https://wizpert.com/
It starts sending me emails when I have questions on SO that are not answered for a long time
 
that typo
> developers can now access Google Chrome from their computers instantly.
 
hello
 
4:39 AM
@AbhishekHingnikar Google sucks
 
// Clearing target area...
 
They just can't stop putting their Chrome OS stuff into everyone's computer
 
Is the main site down?
 
@RUJordan I can't access the main site either
It's up again now
 
Holy FUCK THATS A HOLOGRAM
 
4:51 AM
-2
Q: HOW TO MAKE APPLICATION WITH SIMPLE CURD API FOR AN OBJECT

user3268438HOW TO MAKE APPLICATION WITH SIMPLE CURD API FOR AN OBJECT.Your answer will be judged on application and API design, clean code, maintainability, performance and efficiency.

 
Ground-breaking technology with JavaScript!
Demo: http://jsfiddle.net/DerekL/dPvF9/show
 
boooo repost
 
can we call [{key1:value1, key2: value2, ...},{key1:value_x, key2: value_y, ...}, ... ] as a 2D JSON ?
 
@RahulDesai What do you mean a 2D JSON
 
Isn't that just an array with objects as index values?
 
4:57 AM
@Derek朕會功夫 I am just trying to know if that term exists. It would be similar to the format I mentioned above.
 
How do i run something in bg/daemon in windows via command prompt
/cc @BenjaminGruenbaum , @SimonSarris , @rlemon
 
@RahulDesai I've only heard of 2D arrays
 
@RahulDesai say what ?
and why ?
ps thats a JavaScript object not json
 
aww man I was removed as room owner :(
 
@RUJordan Who'd you forget to sleep with?
2
 
m59
5:35 AM
dang I love conditional stuff
foo(x || y)
beautiful
I just saw this code
'undefined' != typeof Customer ? Customer : module.exports
It makes me sad when ternary is used to worsen code.
 
@monners Hahaha
 
@RUJordan You need to get your premature ejaculation fixed
21 hours ago, by Stack Exchange
She removed you again
 
m59
lol what?
Why did that happen?
 
Some bug
The current theory is that the bot gives him explicit write access, which demotes him
!!refresh
 
5:49 AM
@SomeGuy Good Morning mate
 
Morning!
How are you?
 
m59
oh my
646 questions, 11 answers
and his answers suck.
Non answer accepting help vamp.. stackoverflow.com/questions/21542050/…
 
SO is full of them
He probably just went offline right after asking in this case
 
m59
Nope.
He logged in 45 minutes ago.
and his history of answer accepts is pretty bad. He never answers questions well (if at all), so he probably can't appreciate the time that goes into a good answer.
 
can any one suggest the best link to learn backbone.js and its functionalities
 
m59
5:55 AM
Sure
angularjs.org @CJRamki
 
angular js?
 
m59
=D
 
i could not find any documentation about backbone.js there...
 
m59
LOLLLLLLZZZZ
That's because it's Angular :) It's a joke.
 
backbone.js and angular js are same?
 
m59
5:58 AM
No. Nevermind all of that.
Wow that joke really failed hard.
 
Hahahaha
I found it pretty funny, if that helps
 
m59
=D
 
why you guys are kidding me?
really i dont know about that...
so only i asking about you peoples...
 
m59
It's ok, just forget about it. I learned a little bit about backbone just googling.
and youtube
 
@m59 thanks...
 
m59
6:13 AM
@SomeGuy how are your architectural skills?
 
m59
Where is everyone?
 
 addImage: function (url) {
            // Render and swap a random image :D
            // aint this fun ?
            var el_length = this._availableImageList.length;

            if (el_length === 0) {
                this._resetAvailbleImageList();
                return this.addImage(url);
            }


            var seed = Math.floor(Math.random() * el_length);
            // Retries ... because random !
            for (var i = 0; i < 4; i++) {
                if (this._availableImageList[seed].replace(url)) {
// this code makes me feel shameful
 
m59
@AbhishekHingnikar care to help me work out an architectural issue or see if I'm on the right track?
 
@m59 i can give it a try
 
m59
If I understand things correctly, objects, like classes in other languages, should only have one responsibility (SRP)
so, in an application, I feel like they shouldn't be responsible for handling errors - they should just say "this is a problem!" and let something else work out how to move forward
Does that make sense?
 
6:47 AM
yes.
 
m59
Doesn't that mean try/catch?
 
yes and no
you might throw that error for an external error handler
 
m59
Yes.
 
but again that becomes try/catch
 
m59
I could also imagine an error service that everything would have to depend on
 
6:49 AM
no
That service will become a rescue / escape route
I use a httpInterceptor in AngularJS which ensures all the calls are valid and none of them results into a 401 or 503
if so I either log the user out or throw a server issue
that interceptor also retries if its a common error or calls other error handlers
Is that what you are trying to achieve ?
 
m59
This is for my REST api, it's in php right now and I'm rewriting it tomorrow in Node, but vanilla (no framework)
 
@m59 y no express ?
 
m59
Here's the run down
I don't see the need =D
If I wrote it with vanilla php, there should be no reason I can't do the same in Node and save the performance
 
@m59 salute
 
m59
At minimal, it has routing I don't need.
 
6:51 AM
@m59 php is itself butterscotch flavoured tooty fruity with caramel topping and pizza base
 
m59
hehe
Anyway, here's what I have:
One class parses the url and query string etc into an object
 
and an api server without the need of routing and that too RESTFUL sounds suspiciously Chuck Norris to me.
 
m59
It needs routing, but my routing is different
 
hmm
interesting.
 
m59
It's more dynamic
The resources have to declare their own routes.
It's the opposite of the typical pattern.
 
6:53 AM
hmm
 
m59
Anyway, so I have kind of "rewriting" class to prepare an object for my use
and then I have a class that takes that and tries to instantiate the appropriate class to deal with the request
this is the first place an error can occur
api/spaghetti
will attempt something like
 
Hi guys, any idea about my question here?
http://stackoverflow.com/questions/21545800/send-fb-private-message-to-multiple-people-using-facebook-api
 
m59
var controller = new spaghettiController;
which is going to fail if I don't have one.
try {
  $controller = $Dispatcher->getController($request['controller']);
  $ctrlResp = $Dispatcher->dispatch($controller, $request);
  $Response->setMainData($ctrlResp);
  $Response->addStatus(200);
}
catch (ApiException $e) {
  $Response->addError($e->getError());
  $Response->addStatus($e->getStatus());
}
Here, the ApiException class defines all the problems that can occur, and the Dispatcher throws new ApiException('Dispatcher-ResourceNotFound')
Which then looks that problem up and sets the message and status for it
then, I can use them however I want. With this one, I use the status, but other times I don't.
To me, this makes sense... I don't know if there's a better way.
@AbhishekHingnikar did I scare you off? :)
 
7:09 AM
@m59 nope
I was debugging some russian vodka sort of bug
 
m59
heh
 
@m59 In node i can just do something like
app.use(errorHandler);  // using express
 
hi
I am in trouble with form fields
 
m59
So, what does that mean?
 
7:11 AM
I have a form. But I want to submit fields value that have been changed.
 
m59
nm looking it up =D
 
I have tracked the form value. But now I want to submit those values.
if you dont mind could you please look into my code
 
app.get("/:id/",function(req,res,next){
   DB.getUser(req.params.id).then(function(err,user){
          if( err ) {
                   re.errCode = 404;
                   next();

          }
          res.json(user)

   });
});

app.use(errorHandler);
basically in express if you call next it calls the next middleware
say you wan't an error handler with some superman like stuff you can do it like that :P
 
var tracker = new Object;

$('input.formfield').each(function() {
tracker[$(this).attr('id')] = false;
});

// and then later on

$(".track").on("change", function() {
tracker[$(this).attr('id')] = true;
console.log(tracker);
});
 
then your errorHandler can have all the logic for error handling @m59
 
7:13 AM
i have use serialize function.
 
and what is wrong ?
 
Hi guys, any ideas about my question here? stackoverflow.com/questions/21545800/…
 
now how may i pass the these id which are true to serialize function
 
RTFM is an initialism for the expression "Read the fucking manual" (sometimes flaming or another metaphor or profanity) or, in the context of a Unix environment, "Read the fucking man page". (see man page) The RTFM instruction is sometimes given in response to a question when the person being asked believes that the question could be easily answered by reading the relevant user's manual or instructions. In expurgated texts, substitutions such as "read the flaming manual", "read the fine manual" or "read the friendly manual" are used (or similar variants). Initialisms similar to RTFM in...
 
m59
@JoeMarie You already asked that a few minutes ago. Someone would answer if they wanted to.
This is a javascript room, not facebook api room. It's not all that likely anyone will happen to know that.
 
7:59 AM
Guys I have a question.
Why do American soldiers in this video make a Crunchwrap Supreme with their flag?
 
I want to kill the guy who write THIS
 
m59
@ThiefMaster I have no idea what I just read, but what's wrong with it?
 
It creates an undebuggable mess. And it's very poorly documented
 
@ThiefMaster We don't need no documentation.
;)
 
@Miszy I'm sorry, but "documentation" is one syllable too long.
 
8:06 AM
Yeah, I know.
I won't be an alternative rock star.
 
m59
@ThiefMaster cannotGet ?
what the heck is that?
 
8:50 AM
@ThiefMaster suicide is not allowed.
 
hi all
i used a lightbox jquery, downloaded css and .js files, it workin fine but there is another div which is appearing in my project intermittently
 
@m59 found your solution ?
 
m59
Dunno =D
 
@sheetalnainwal that's the lightbox or the overlay behind it, isn't it?
 
m59
I'll just get to writing tomorrow and see where it goes.
 
8:57 AM
yes overlay is there @JanDvorak
 
function cannotGet(source) {
	return source.CanGet ? !source.canGet() : false;
}
 
and thankyou for considering my question @JanDvorak
 
that "library" is ~10yo crap
 
m59
oh
 
ok, maybe more like 6 years
but very old for sure
 
9:00 AM
@JanDvorak lokeshdhakar.com/projects/lightbox2 i followed this link
 
@sheetalnainwal which div do you mean and when does it appear?
 
i need only popup div while clicking but it is showing another one which is appearing in loading time of my project @JanDvorak
 
so, you want to suppress the loader?
 
yes..
but .js file has complex code i m unable to modify it
i need a popup to be displayed when i click on my given text
 
didn't find anything useful on SO
 
9:07 AM
actually not exact as my issue
 
@ThiefMaster lol
 
There's no easy built-in way to "validate" a date in javascript? The spec says that new Date(2000, 20, 58) should be allowed, which I understand, but there's really no way to determine whether there are that many months and that many days in said month in JS? (I don't feel like writing all that extra logic for something so basic)
 
@Kippie create a new date and check if the values returned match those passed in?
 
That's.. actually not a bad idea
 
Or use some kind of library for that :P
 
9:15 AM
Fun trivia, can anyone guess (no checking!) what the prototype of Date is in JavaScript?
Like, what the prototypical date is, what Date.prototype returns
 
the start of epoch?
 
Close, but no.
 
year 0?
 
!!> JSON.stringify({a: "1\n2"})
 
@IonicăBizău "{\"a\":\"1\\n2\"}"
 
9:17 AM
1
Q: How the new line are stringified on the client side vs server side?

Ionică BizăuI have the following object {g: "a\nb"} that I stringify using JSON.stringify. On the client side '{"g":"a\nb"}' is returned but on the server side an escaping character is added: '{"g":"a\\nb"}'. Chrome console Google Chrome console view Node console > a = {g: "a\nb"} { g: 'a\nb' } >

 
It's 'Invalid Date' - fun wtf moment :)
 
Maybe somebody finds an answer. ;-)
 
Yeah, I saw that earlier when I was debugging my date. Thought it was odd, because I have no idea when it would ever return that
 
@IonicăBizău interesting.
 
My guess it's just a rendering issue. There is only one backslash in either case, but the node console renders it escaped. Note the double quotes in the JSON don't need escaping - instead, the Node console uses single quotes to delimit the string. — Jan Dvorak 1 min ago
 
9:21 AM
@JanDvorak that's correct. I just posted it as an answer too - didn't notice you there :P
0
A: How the new line are stringified on the client side vs server side?

Benjamin GruenbaumThis is a rendering issue, the results are equal. It just shows them differently in the Chrome console for clarity. Node doesn't do any magic You can observe this in the chrome console: JSON.stringify({g: "a\nb"}) === '{"g":"a\\nb"}'; // true

 
@BenjaminGruenbaum Thanks! I guess you are right, but this doesn't explain this:
0
Q: Doesn't require() function parse new line characters in JSON correctly?

Ionică Bizău> a = {content: "first-line\nsecond-line"} { content: 'first-line\nsecond-line' } > console.log(a.content) first-line second-line undefined > b = JSON.stringify(a) '{"content":"first-line\\nsecond-line"}' > JSON.parse(b) { content: 'first-line\nsecond-line' } When JSON.stringify is used, an esc...

 
@IonicăBizău do === on them :)
JSON parsing is done exactly the same way on the client and the server - code.google.com/p/v8/source/browse/trunk/src/json-parser.h
(In chrome that is)
 
Hello everyone !
If there are any angular.js users here please help with this question http://stackoverflow.com/questions/21547735/angularjs-filtering-over-array-of-objects-in-ngrepeat-doesnt-restore-items-with
 
@BenjaminGruenbaum The issue appeared from another module that was sending me 1\\n2 instead of 1\n2. :-) Thanks!
 
9:37 AM
back from religion hour
 
@Cicada3301 What is religion hour ? =)
 
in my country people who don't want to do religion at school can leave it for that hour
 
There's still religion in public schools in Italy ?
 
@dystroy yep
 
hey anybody worked with lightbox
i have an issue
 
10:27 AM
!!welcome imac
 
@imac Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
ok... . The repository URL in git push -u is case-sensitive.
 
What am I missing here?
navigator.geolocation.getCurrentPosition(function(position) {
    console.log(position);
});
 
@monners Nothing, why?
 
Nothing's being logged
 
10:37 AM
Are you running this from console?
 
I couldn't get it working in a local project either
 
@monners won't work locally
 
I've tried many variations
 
you need to request access
 
You have to bind it to event.
You can just run it, because of safety issues.
 
10:38 AM
@Miszy Ahhh, that makes sense
 
you need, you have to, you can !
 
This one will work:
window.addEventListener('click', function () {
    navigator.geolocation.getCurrentPosition(function(position) {
        console.log(position);
    });
})
 
CSS question :
0
Q: Position an element over a table-row element

dystroyI have a list of .message whose display is table-row. Some of those messages should have a red triangle over them, at the bottom center. The element containing the triangle can't be inside a cell of the .message. It's easy to do when the .message display is block but I can't seem to be able to d...

 
@Miszy Well I'll be damned... Thanks!
 
@monners you can also run it in a setTimoeout
setTimeout((function() {
    return navigator.geolocation.getCurrentPosition(function () { console.log(arguments) });
}), 1000);
 
10:41 AM
^ can you?
 
Works on my site
And that run in the console
 
@phenomnomnominal Doesn't that completely sidestep the whole security aspect?
 
nope, it still requests the users permission
 
@phenomnomnominal what do you use the geo information for ?
 
Just mapping where the user is on a map
 
10:44 AM
o/
 
\o
@GNi33 I'm seeing Alkaline Trio 3 times in the space of 2 weeks!
 
that... sucks?
 
hehe, awesome!
 
@GNi33 oh, also, don't know if it's your thing, but I've been posting some covers on SoundCloud, have a look! soundcloud.com/phenomnomnominal
 
oh, nice
I'm at the office right now and my freaking headphones broke, so I can't listen to them now, but I got em bookmarked
might buy a Charvel DS-2 today
or a Ibanez ARZ300, will try those two in the evening
 
10:50 AM
Nice! I've heard good things about the charvel
 
yeah, me too
 
I'm thinking I might get a gibson J45
 
looking forward to get my hands on it later. and the price seems pretty good, so I guess I'll just have a weak moment and buy the thing
 
Nice, you gotta do it!
Nothing quite like a new guitar
 
@GNi33 I had two ibanez guitars so far and they are worth the price
@phenomnomnominal I hope you mean "new old guitar" :)
 

« first day (1207 days earlier)      last day (3748 days later) »