« first day (1532 days earlier)      last day (3638 days later) » 

00:13
Evening
Guys, am I going the wrong way about model handling and interaction with it? example: jsbin.com/hozoda/2
Would be appreciated if anyone could take a peek.
00:35
Ubuntu or Redhat and why?
@monners I assume by redhat you mean fedora?
@MikeNolan I guess, yeah.
@monners I would say since ubuntu is debian based it's more stable. The downsides is apt-get is old af (to be "stable") so getting packages can sometimes be a pain. Ubuntu comes with a lot of necessary crap like Unity.

Fedora is less stable but RedHat is a pretty good company and a lot of my friends use fedora.
@monners how new are you to linux distros?
@Eugene ...er can we see the code?
Very. I'm thinking about getting a new gaming pc to replace my iMac, but I can't stand the though of using Windows as a dev environment, so I'm exploring Linux as my main OS, and just using Windows for games
00:47
@monners Theres also Mint
I started on ubuntu but found Mint to be more stable, lightweight, and easy to use
@MikeNolan Sweet, thanks! I'll check that out. Looks like what I'm looking for.
You got it
How do we find the occurance of a character in a string?
like the string "Hello Ham Sam" would return 2 because 2 has occured twice in the string
h had occured*
!!> "Hello Ham Sam".replace(/[^H]/g, "").length
00:58
Thanks copy
yw
!!> [].reduce.call("Hello Ham Sam", (a, x) => a + (x == "H"), 0)
damn df
does anybody here know Rust?
Don't leave metallic things in the rain
as in Rustlang
01:08
Never heard of it
rly?!
rust-lang.org
Okay, I heard of it
Never used it
I just recently decided to learn it as my first low-level lang
since JS was my first lang
and its pretty Sweet! dint rly like Ruby and python
That's probably a good choice
You should also try a functional language like Scala at some point
oh yeah Im taking aP Java in school
i hate it so much
01:11
Java isn't functional
I know
Elxir is right?
Yeah
Ive made a single user Agenda in Rust, and a GPACalc in it
the multi user in Rust is so verbose :p
mainly because Im too stubborn about pushing the project off to reading the docs
01:32
Great, PSN is down again.
Fucking hackers...
m59
m59
01:48
@BenjaminGruenbaum What do you think of Angular's form/model system overall? I've learned enough to be unsatisfied with Angular, but can't find any approach as clean as what I can do with Angular directives. Unfortunately, that's so tied into the framework. I don't think Ractive offers anything nearly that powerful with its decorators and components... not sure if it's even possible to integrate that functionality into Ractive. Any tips to guide my thinking at this stage?
02:31
@m59 You've learned enough to be unsatisfied with Angular?
how can i target a javascript var to be set by a php var? from
m59
m59
It objectively has serious problems. @KendallFrey
They've been trying to come back from them for a while, but altogether scrapping it and writing Angular 2.0 is all that can be done.
@13375 You do realize that PHP and JavaScript don't run on the same computer, right?
i know, but i'm using an ajax page loader, and a javascript timer
where does php come in?
02:33
server time
You're sending an ajax request to a php server?
converts to a game turn
@MikeNolan I added link above.
yes, so you can't just refresh page to get another turn
and you can track game turns
02:36
i hve my js sitting in js files
example: stackoverflow.com/questions/19151767/… has the count var set by the php var
i on't want to refresh the whole page, just the div
ttfn i'll be back
 
2 hours later…
05:08
coin slot o.O
 
1 hour later…
 
1 hour later…
07:15
checkout my new app github.com/oussamaelgoumri/appRunner it will help you manage your web applications, and access them easily from the browser, please leave me some feedback
ok
clojure is cool
07:32
It don't out put error and also not removing the class
function favorite()
{
$(document).ready(function(){
$(this).removeClass().addClass('fa fa-star inbox-started');
})
}
document.removeClass ? I think that is not correct
oops that's correct cause I need to remove all the classes not a particular one
313
Q: How to remove all CSS classes using jQuery?

Click UpvoteInstead of individually calling $("#item").removeClass() for every single class an element might have, is there a single function which can be called which removes all CSS classes from the given element? Both jQuery and raw JavaScript will work.

with Id it's removing perfectly but with $(this) It doesn't remove classes
try something odd like removeAttr('class') perhaps
08:07
@user2736704 className = '' ?
oh, and removeClass does seem to remove all classes: james.padolsey.com/jquery/…
08:19
o/
user3949359
08:51
So, in require.js I can do define['jquery'], function ($) {
//some code
});

And this "dependency" means, that the following code in the body will need it to be executed, right?
user3949359
Also, what is the difference between a JS file import and a JS module? Is there any?
09:06
I never used require, but maybe its just the term, It ensures that the //some code isn't executed if the jquery is n't loaded. like a
//just saying
$.html("<script src='jquery.js'>">.onload(callback);

maybe
and I thinks such a thing would also ensure that the scripts are loaded in order, like adding an async = false in the script tags
 
1 hour later…
10:22
@Neil in here?
@Zirak
even toggle class isn't working on $this

	 function favorite($this)
	{
		$(document).ready(function(){
			$(this).toggleClass('inbox-started');
		});
	}
@Ravi Oh hey, what's up?
!!tell user2736704 format
@user2736704 Format your code - hit Ctrl+K before sending and see the faq
Second, check what this is inside of the ready callback
10:23
nothing, just needed to ask a question...
@Neil
@Ravi shoot
@user2736704 you're using $(this) inside the function, not $this
well $this is not a funtion @FlorianMargaine
object HTMLElement @Zirak
In mongo, in $match in aggregation $in operator is not preserving the order of an array, is this usual?
@Neil
@Ravi Why would it matter?
It just has to be in the array I thought
10:27
yes it is, although this array is already sorted which is from some other collection. So.....
@Neil
@user2736704 Florian's right, re-look at your code
You're passing in an argument to favorite so I'm assuming you want to manipulate that
this inside of the ready is the document, probably not what you wanted
@Ravi If you don't specify order, the order is likely going to be the order in which it was inserted into the collection when you query it (though I don't think it is guaranteed)
It may happen to be in alphabetical order because that's how it was inserted unless you specified an ordering
Though it shouldn't matter. A value just has to be contained within the $in array
$this.toggleClass('inbox-started');
it always output error $this.toggleClass is not a function
@Neil you are right, it's in alphabetical order.
What i am doing is getting an array sorted by a field by aggragation on collection ABC, and then i am using this array ($match, $in) to fetch some values from collection XYZ.
in XYZ there is no sorting applied
@Ravi So I don't understand your question, what order is not being preserved?
The ordering of values in the $in operator says nothing about the ordering of the values it will fetch
10:36
@Neil hmmm....
so i'll have to use other (several) queries to do this.............
anyways, Thanks man!
@Ravi No, let me try to understand
You are fetching what would be the array values you will use for $in operator in a future query for a separate entity, correct?
Yeah, e.g let's say collection ABC is giving me an array like arr = ['22', '11', '21', '10'], now when i apply this in $match: {field: {$in: arr}}, this is returning objects with alphabetical order i.e '10', '11', '21', '22'.
@Neil
In your 2nd query, just specify sort for that field
In addition to the $in
@Neil sort, will sort it in alphabetical order, but i need it to be same as applied array, i.e. ['22', '11', '21', '10'] instead [ '10', '11', '21', '22']
10:42
@Ravi Hmm, I see what you mean
There's no easy way of doing this
As I see it, you have two options, one, you perform a single query for each element in the array, and perform operations one at a time
It's a lot more query-intensive, but from your program's pov, it is no more difficult to do it this way
The second way is to deal with it yourself in your program
This is more intensive in your program but it is not query-intensive
In other words, for each item in the array, you perform another pass dealing with items that have that value only
Unless mongodb has some way of providing a custom sorter.. hmm
@Neil hmmmm... a custom sorter in future would be a nice idea :)
Thanks again :)
@Ravi np, sorry there doesn't exist a cleaner solution :P
yeah.
I would personally go with the 2nd option, because queries consume a lot of bandwidth and can easily be a bottleneck
it's sometimes just easier to query once, and sort it out later
i'm gonna do the same.
11:01
Morning Folks
I have a form which I am submitting using ajax on a button click
what's happening is because of slow server time, I see "your connection was reset" warnings
then I click "try again" which refreshes the page
again I see "your connection was reset" I refresh again
but in the backend, the form got submitted several times with the same values
I got around 4-5 records in the database
with same values
How to tackle this problem?
@m59 meh, it depends on what you're building
11:20
Hi there, I have a simple question. I have a simple code with "for". Why my mozilla returns object, not incrementing number? Code:

for(var i=0; i<3; i++){
console.log(i);
}

Screenshot: http://prntscr.com/5l28zu
Are you sure the numbers don't get logged?
Yes, I am :)
Native debugger, or firebug?
Hm...problem is in code, I opened about:blank and it works there
Sometimes firebug just crash
12:08
!!> for(var i=0; i<3; i++){ console.log(i); }
@BenjaminGruenbaum "undefined" Logged: 0,1,2
^ @PDKnight works just fine
or the thing considers "undefined" an object and just returns that...
check your browser version...
m59
m59
12:31
I don't know how to handle this
@m59 Right now this function displaying data in first row a b c second row d e f. Can I display a b in first column c d in second column and e f in third column? Thanks — Kulbir 5 hours ago
That does not deserve an answer.
12:45
Some information is missing or incorrect. Please correct the following fields and try again:

* Password: Your new password must not contain spaces or unprintable characters.
...why?
Aha it's always the question "why". Password characters restrictions or obligations are just...
so that they can send it to you by email?
Why would they store my password?
Lack of basic knowledge of security?
Oh goodie
12:50
Achievement Get: Use a Code Snippet in an answer.
@KendallFrey ... What about a question?
I don't ask questions
But when I do, they're about Visual Studio
Would you consider asking on PPCG?
@KendallFrey Oh come on... Everyone asks questions. :)
2 days ago, by Kendall Frey
how fast is imagedata?
Dec 4 at 19:30, by Kendall Frey
How would it not work?
12:55
@JanDvorak I used to use that site, I think I've asked a question or two
@Unihedro I just ask my questions in chat because I'm a lazy bastard
@KendallFrey Well... In that case... Do you use code snippets in questions asked in chat?
no can do
Aww. :(
walks away quietly in sorrow
@JanDvorak Just noticed that PCG is my second site in alltime rep
My favourite answer:
2
A: Minify Brainfuck

Kendall FreyREBEL - 104 _/^_$/$</([^][<>.,+-]|\+-|-\+|<>|><)//((?<X>(<|>))+[+-]+(?!\2)(?<-X><|>)+(?(X)(?!)))([+-]+)/$3$1/.+/$>$& Usage: Input: Reads one line from stdin. Output: Prints one line to stdout. Anomalies*: Entering _ causes another line to be read and used, rather than outputting nothing. ...

m59
m59
@Zirak we can't send a space in the URL as GET request, duh!
12:59
Have you tried %20?
user3949359
Anyone else having trouble with otpimizing their require.js modules?
user3949359
I get a "Exception in thread "main" java.lang.NoClassDefFoundError: org/mozilla/javascript/tools/shell/Main
"
user3949359
it's a java error since I'm using a .jar file for the purpose
m59
m59
13:13
@JanDvorak I don't think you got the context of my joke.
oh. got it
Can the password contain & and ? ?
13:41
Yay first baconjs answer (I think)
So I'm thinking of trying a trackball, specifically this one
67 to go :D
@Zirak why?
I'm utterly confused: you see the 2 orange bars at the margins of the page? I have no idea where do they come from ingdirect.it
@BenjaminGruenbaum Why trackballs? Because they look like a good solution to mouse pains
Why that one? Because in the decent price range, it seemed to rule; the other Logitech one is wireless, which is yucky
nvm
@BenjaminGruenbaum yeah yeah... that's stupid
@Zirak what mouse pains?
@BenjaminGruenbaum Wrist pains from moving the mouse around
There are valid reasons to do this @towc - for example if you built your site at a time IE6 was still a thing
@Zirak how about you unplug your mouse?
did you try it?
like, really try it?
unplug mouse, try to survive 2 hours
13:46
@Zirak I mainly use my mouse for gaming, and for internet things sometimes. Usually I just do things with the keyboard.
@FlorianMargaine he has enough of that at work :P
@FlorianMargaine Have we met?
Talked?
Experienced the same WMs?
I don't remember you trying stumpwm...
Maybe even shared an editor?
13:47
but I mean, I didn't see how much I used the mouse until I unplugged it, literally
even after all that
@BenjaminGruenbaum I hate how google decided to change arrow up/down behavior on their main page
And lot of websites do that now
I just use vimium, less painful
@FlorianMargaine To answer your question: Yes, I spent a month doing that.
@Zirak what about a trackpad?
13:50
@Zirak unplugging your mouse? geez, what do you have, a 10,000 bolt lock on the plug?
Or graphic tablet, pretty good to navigate
@BenjaminGruenbaum ugh, hate them. Can barely stand the one on my laptop.
Something I really want to try one day is this keyboard
@Zirak that's because the one in your laptop sucks :D
@BenjaminGruenbaum Totally, I should uninstall it and run Windows instead
Used a wide variety of trackpads, hated them all
Even better, a trackpoint in your keyboard
13:51
@Zirak inorite?
I used one briefly, and was impressed for something that doesn't move
From your experiences, best node host/vps/etc? Ready set go
@NickDugger localhost
@KendallFrey The ones in the older Lenovo laptops, right? Took me a while to appreciate. That's why a trackball may be interesting.
"older"?
my thinkpad t430 has one
13:52
@KendallFrey I don't know how to reply, except for fuck you. lol
I've used mice that had both the standard mouse behaviour, and a thumb trackball
interesting
not very ergonomic though
I want to try m$ ergonomic keyboard
touchscreens will soon fall out of use, they're horribly unergonomic
depends how they are used. when they are in front of you, yes. When they are as a "surface", it's ok
Any time your eyes and hands are at the same location, you're moving unnaturally
13:56
@FlorianMargaine Both Natural and Sculpt aren't really good ergonomic keyboards, they're popular because they're cheap and made for mass production
uh, really?
either your cricking your neck staring into your lap, or stretching your shoulder by lifting your arm to eye level
TEK is supposed to be extremely good
@Zirak - trackballs are great for drawing, for people who mostly code and surf the web, they suck. What you want is a vertical mouse.
I had serious shoulder pain from using my computer mouse too much, and got a MouseTrapper, and it's actually worked pretty good
13:58
As should be all products from Kinesis
@adeneo Interesting about the MouseTrapper
And for keyboards, get a mechanical one, there's really no substitute for a real old school mechanical 'board, even if they make a lot of noise.
I'm on my third (they wear out) -> http://www.razerzone.com/gaming-keyboards-keypads/razer-blackwidow
@Zirak the kinesis or tek keyboards look good... but I don't want to spend $300 if I'm not sure it actually is good
That's the problem with these things: You have to try them out first, and it's such a small field that you're unlikely to stumble on someone with them.
@adeneo Really? I've tried mechanical ones before, didn't notice any significant improvement (aside from the cool factor). Maybe it's longer term effects.
14:06
Has anyone experienced problems with heroku? I'm considering going with them
@NickDugger I haven't used it myself, but one of my friends does, and he seems very positive
@Zirak - You probably won't notice from just trying it a little bit, and the Razer I have takes some time getting used to as well, but once you do, there's no going back.

It's a lot faster to type on, all the buttons have the same resistance etc. so you never hit a button only halfway down and keep going with a missing character, like you often do with regular keyboards.

Mine is a gaming keyboard, even if I don't really play games, but I've had three of these now, and I have a regular Logitech keyboard for the servers, and it's just horrible compared to the mechanical keyboards.
i rather like mechanical keyboards as well. i actually like the click -- it's much easier to know you've pressed a key. :P
clooo jaar
I have big strong muscular nails, touch screen and my fingers are mutually exclusive
14:22
@adeneo I don't have this issue with regular keyboards tbh
@FlorianMargaine
Or if you're a real geek, you get the ultimate Das Keyboard
It's all black !
@adeneo seems to me the keys are much easier to replace there
and you can't wear out a key, since there's nothing on the key to begin with
Help mee
13
Q: MySQL function to find the number of working days between two dates

YadaExcel has NETWORKDAYS() function that find the number of business days between two dates. Anybody have a similar function for MySQL? Since holidays adds complexity, the solution doesn't have to deal with holidays.

What is this table ?
0 1 2 3 4 4 4
14:30
@Joeytje50 - I've tried one, and you think you know where all the keys are, until you try a keyboard with no symbols, it's really hard when you're not used to it
@adeneo I think I would only get problems with the F-keys higher than 6, some of the numpad keys, and the Win-key/alt
@argentum47 The number of working days between monday and the following corresponding day of the week
ah well that's still probably too much
you'd probably get used to it though I assume
i.e. the number of working days between monday and wednesday is 2
14:33
btw guys is there a way to tell SO which tag is more important?
@Joeytje50 - and suddenly you need a tilde or some other special character you can't remember the location of ?
it says "css - " on stackoverflow.com/q/27658345/1256925 but it's more about svg
But I don't have the start date and end date, I only have month and year.
@argentum47 Then fill in the blanks, with the first day of the month
Emm, from which I kind find the start and end date
14:34
@adeneo I pretty much know every special character key on my keyboard, including the `~ key
This looked spooky but now I feel this awsome stuff. I can get my boss'es head to spin round round. oh yeah
You spin my head right round, right round...
:)))
I have to understand the formula though
do() || !do()
//try{...} -- syntax error
@rlemon lorempizza is down?
14:43
@argentum47 every week is 5 days, then use the numbers from the table to calculate partial weeks
        throw Error("ha");
Such descriptive error messages.
better than throw "ha";
catch(e){ // ah
14:51
@BenjaminGruenbaum shame on you for not using new
@FlorianMargaine most classes don't care and those that do don't deserve it.
@FlorianMargaine huh?
That's from the Google inbox source
Shame on ... Google?

« first day (1532 days earlier)      last day (3638 days later) »