« first day (954 days earlier)      last day (4219 days later) » 

20:00
@sebas when you're done not being impressed with my unpolished 2 day work, we can talk about how you're building rank. What would be a very simplified rule you're using for rank?
it looks really good
Thanks, try clicking the 'sort by' button, see how it instantly updates, which you can apply in your case
yes i did
In the end, I learned not to care, to do what I believe was right. All of a sudden the Android room's quality increased, you could have technical discussions without twenty users asking for code, you could have fun discussions just like here.
So yea, that's more or less the story behind the Android incident.
here is one rule:

$('#SubscribersManageAnylistList tr:contains("Ahora"):contains("$"):not(:contains("Si")):not(:has(img[src*="images/plus.gif"]))').css({'background-color' : '#F9B820', 'font-size' : '12px'}).insertAfter("tr.Heading3:last");
20:02
Except for the jQuery animations which I had to use for the scroll-bar, it's all just backbone, if it was production code I'd even drop jQuery altogether because it's useless when your codei s bound the right way. If you open the HTML or JavaScript files you can see that except for the tool-tips (which don't really belong anywhere), I don't have a single selector
ouch formatting
@sebas That's not a rule at all, say this in words
ok
@sebas also, what would be a similar rule applied to our fiddle (For example, on analyst names)
@Octavian That's why people from the other rooms are rejected? Because those people are most likely the trolls?
20:03
@OctavianDamiean Thanks, that was interesting
i dont know becuase i would need to know more data (customfields associated with each analytics)
analysts
@sebas the rules are based on your objects you get from the database, not on a selector or an image it has
@AmaanCheval Nope. Users don't get rejected because of rooms they are in but because of how they chat in the other rooms, only the content gets evaluated.
i know let me rephrase
A lot of people from other rooms have access to the Android room.
20:04
lets say in your example
@sebas If you want more data, you also get the number of successful recommendations, and a rating (Buy, Hold or Sell) and a number of total recommendations and a firm, you can use those if you need more fields
u want to filter analysts that have 5 or more recommendations, rating Sll and are NOT from the "fake firm inc" firm
rating sell
Ok, we don't want to show these analysts at all?
The remaining ones, we want to sort by rank?
@sebas would you mind that rating being Buy instead of sell? Apple doesn't get Sell ratings XD
my bad, i meant to say

If analysts match this criteria:
have between 1-5 , rating Sell and are NOT from the "fake firm inc" firm

give them rating 10

if
have more than 10 recommendations, rating Buy and are NOT from the "fake firm inc" firm

give them rating 20

Everything else

rating 5

and then sort by rank
20:12
another rule: if multiple analysts have the same name (duplicates) only show the first one
So rate will be something like:
function rate(analyst){
        if((analyst.recSuccess<5) && (analyst.rating=="Sell") && (analyst.firm!=="Nomura")){
            return 10;
        }
        if((analyst.recSuccess>10) && (analyst.rating=="Buy") && (analyst.firm!=="Nomura")){
            return 20;
        }
        return 5;
    }
right?
(Nomura is some firm we have in the data)
@sebas when we grab the analysts, we simply give them this rank, and then sort by it when we display jsfiddle.net/cYhTF/2
See how it's perfectly clear to tell what the criteria for ranking is here?
Inside the fetch function we added
for (var i = 0; i < analysts.length; i++) {
                analysts[i].sebasRank = rate(analysts[i]);
}
And when we serve the analysts we give:
self.analysts().slice(0).sort(function (x, y) {
    return y.sebasRank - x.sebasRank;
});
what is that for
the for (var..
What is what for?
@sebas we iterate through all the analysts, and assign them a rank, we can do this inside the sort, but I think this is simpler
@Amitd Not sure how to get it to work.
This could have been a .map or a .forEach but I figured that this way is simpler for you
20:17
give me a min to see your code
Someone, I need help getting "remote" parameter to work in JQuery Form Validation
@sebas in this version it shows all the data, so you can more easily see why it sorts this way: jsfiddle.net/c8LbZ
@DemCodeLines how's it going with that chick?
@BenjaminGruenbaum Still waiting for an answer to that friend request on FB. To be honest, I am just waiting for her to finally "deny" it and I am also considering the option to cancel the request altogether.
how do i turn my data that is inside a mysql db into something like your databroker.azurewebsites.net/Analysts/?ticker=AAPL
@sebas This one has a legend jsfiddle.net/ah5NY
@sebas you're asking how to serialize your SQL data (or at least the relevant parts) into JSON, that's a good question and it's pretty simple
@sebas See this question, it's about that, it's really simple stackoverflow.com/questions/383631/json-encode-mysql-results
20:22
user = new User found[0].username, found[0].rank, found[0].roll,
        found[0].hero, found[0].steamurl, socket
@sebas (of course, don't use mysql_* methods (it's deprecated), use mysqli_ or PDO instead)
Is it possible to store a socket into a class
I keep getting circular structure convert to json error
@XCritics just because JSON can't store circular references doesn't mean JS can't... JS is just fine and dandy with em
@BenjaminGruenbaum thanks a LOT for your help ill try to implement and adapt this for my needs, thank you
@BenjaminGruenbaum gist.github.com/Gacnt/3b4cb1b33964d9cb0dc7 this is what I have so far, I cannot figure out how to get my socket into that User class so that I can call it on inviteplayer
20:24
@sebas we can update the criteria we sort on, it's very straightforward, KnockoutJS which we just used has a very simple tutorial (at learn.knockoutjs.com ) , I chose to use it because it is the simplest, but we didn't have to use it at all, or could have used another framework, it just took care of the data-binding for us, otherwise we could have done the drawing manually
gist.github.com/Gacnt/… This line is causing the TypeError
@sebas It's important to take from this how simple it is to manipulate data when we store it as data, programming tasks turn into, well, programming tasks when your logic isn't mixed into your presentation.
@XCritics why are you emitting the socket itself?
@XCritics you can also emit socket.id
I want to emit to a certain user
@sebas no problem, good luck :)
so if I stored just the socket id, how would I do that?
20:26
I see, it sure looks simplier than doing it on the server side im still wondering about performance but ill trust you
lets say var asd = { 'socketid': '3om13gm1o3g' }
@sebas usually, client performance is a lot cheaper than server performance
socket.emit asd.socketid 'function' data
right
@sebas you can of course do this on the server side with PHP too and return the HTML, but that means you should do all the manipulation on the server and return the final HTML, if you want to change it you ask the server for an updated version. Either your logic is done in JS or PHP, as long as it's not in the DOM you're doing ok. You can ask the PHP room here for help on how to do it on the PHP side, they're a helpful bunch
20:29
@BenjaminGruenbaum socket.to(id).emit?
or in, I think they're the same
wait, what
I'm confused about what you're trying to do :S
Emit to a specific socket, not to everybody
If a sends b a message, I don't want xyz to see it, just a t ob
@XCritics just save the sockets in a map (on connection, based on ID) and use that
that's what I'm doing
Yeah, but you can defiantly also use rooms with to or in like you suggested
20:34
ill gist that
gonna test it now, but this is what I have
ANyone developped in LUA ?
@OctavianDamiean so, why did you stop with Android?
@dievardump I know how to "Hello World" :P
@dievardump I played Manufactoid
This is a project where style isn't important, so I'm not going to search anymore, but if you have a cleaner solution for fixing my issue, it'd be appreciated.
Issue: TinyMce v3 ('cause a plugin I need isn't compatible with the next version) becoming huge (very high width, making the page need to scroll horizontally to almost half its size more to see the edge of the editor) if there is a lot of text.
My solution:
#tinyMce_ifr {
	max-width: 800px !important;
	color: red !important;
}
(color: red is for debug)
ew !important
20:37
Indeed.
@BenjaminGruenbaum Because of Java and the fragmented Android API.
Ew !important. :p
I heard some game platformes chose to use LUA to allow players to create custom modules on their games
@OctavianDamiean Good response :)
That's pretty clever
20:38
@dievardump That's what LUA was built for, being a layer above C for scripting
@BenjaminGruenbaum Last thing, gist.github.com/Gacnt/3b4cb1b33964d9cb0dc7 at the very bottom, the client side gets that object back, which is console.log keys, but when I for key of keys (coffeescript) key.username is undefined, why is that, it's clearly there, console.log key returns Gacnt
Eeehm, is there a way to reduce the scope of my CSS, or reset it for a particular part of the document? Because some of my CSS is affecting TinyMCE in weird ways, and not only is that unwanted, but it could be the cause of my width problem
@Ariane are you willing to ditch IE?
@JanDvorak Yeah, since this isn't a project-breaking feature. The teacher will probably correct on Firefox anyway.
!!/tell ariane google style scoped
20:47
Hm, !!/tell is brken
Well, the bot logged out a while ago.
(You gave it too much of a human name and now she's selfish!) :p
@JanDvorak Yeah I had found it... though this seems like it's the exact contrary of my problem. Can I de-scope my style only for TinyMCE?
Then welcome the chrome-only feature of shadow DOM :-)
Oh wow, it's not even ditching IE, it's ditching everything but latest Firefox xD
Yeah no, can't. Firefox at school is probably 5-10 versions ago.
iframes?
20:50
I don't really know what that is.
same-domain iframes aren't that bad
But I do know TinyMCE uses one, whatever it is.
Give up, the bot went to sleep. She hates you.
Aww, so now I can't !!/mute everyone
20:53
you can, but gallery is hard to manage without the greetbot
It's not the same :(
Now I can't feel all powerful because I can do something that is suddenly significant and someone else can't on the internet :((((
> There are only two hard problems in computer science: naming things, cache invalidation and off-by-one problems.
That's not two problems, STUPID
that's the point
It's a joke.
20:59
Have you met my friend Nicholas Cage?
Dude, name dropping is a horrid thing to do. Danny DeVito told me that himself.
@SomeKittens THAT's namedropping, stop contradicting yourself, STUPID
@CapricaSix thanks zirak
<table data-bind="foreach: listings">
	<tr>
		<h3 data-bind="text: name"></h3>
		<img data-bind="attr: {src: 'http://i.imgur.com/F5iJY.jpg'}" alt="Tour thumbnail" height="100" width="100"/>
		<p data-bind="text: description"></p>
		<div data-bind="text: rating"></div>
	</tr>
</table>
^ gives me Uncaught Error: Unable to parse bindings.
Message: ReferenceError: description is not defined;
Bindings value: text: description
@SomeKittens your objects in the listings array don't have a description field, that's what it's telling you
God this object oriented design is way better than my millions of forloops
21:03
listings is an empty array at this point.
@BenjaminGruenbaum But it doesn't have a name field either.
@SomeKittens Wait, why do you have a p and an h3 inside a tr?
And no td
I think you might be confusing Knockout with your invalid DOM
This should work:
<table data-bind="foreach: listings">
	<tr><td>
		<h3 data-bind="text: name"></h3>
		<img data-bind="attr: {src: 'http://i.imgur.com/F5iJY.jpg'}" alt="Tour thumbnail" height="100" width="100"/>
		<p data-bind="text: description"></p>
		<div data-bind="text: rating"></div>
	</td></tr>
</table>
Also, foreach on the tbody, that way you can add a header (with the thead) easily if you want to
ah, that was it
This is why I try and stick to server-side stuff. Our front-end guy is out sick today on holiday (I keep forgetting what day it is)
If you make invalid HTML, you're gonna have a bad time
21:19
Wouldn't it be surreal if SO questions went back to 1990?
@BenjaminGruenbaum I saw a question, and then I saw the asked date and I read it as January 5th 1990 for a sec
oh lol
Java 1.0 and JS 1.0 questions
@BenjaminGruenbaum mebbe, I just thought if SO is around in the next 20 years with everything archived, that would be really cool
Can I use Mosaic as a gopher client?
21:21
@lawm lol
@BenjaminGruenbaum NYtimes has some things archived with 1860's datestamps, but that's kinda unauthentic
My first experience of the Internet was FTPing Depeche Mode lyrics from a Vax.
That was like the AJAX of its day.
@BenjaminGruenbaum I'm using socket.to(users[data].socket).emit 'alertInvite', socket.username and users[data].socket is the right socket id, but it's just alerting the person that clicked the link, not the person that should be receiving, am I suing socket.to wrong?
probably :P
I don't sue JS libraries
21:27
@SomeKittens you asked me a knockoutjs question less than an hour ago :P
@BenjaminGruenbaum it's io.sockets.socket no longer socket.to :)
@BenjaminGruenbaum I'm responding to @XCritics' typo. "use" !== "sue"
Damn stupid AJAX jQuery grumble grumble
God I'm having such a nerdgasm and this refactor of code I did
ahem
21:38
Like all over the place
lolz he said nerd*gasm*
Before: https://gist.github.com/Gacnt/7087d5fac420379c86a5
After: https://gist.github.com/Gacnt/1edb64c0e42ad0e0d497
look at all those gross for loops removed
@XCritics I realized CS is actually pretty damn elegant after looking at your code
I love it
21:40
is this node?
And I'll also take that as a compliment :D
Yeah
ya
OK *adds another person to the node helpster list *
lol
actually, it is socket.io
But, it's on a node driven server-side
Is mongo better than MySQL in your opinion?
Has its ups and downs at times I guess, but overall I prefer it
21:42
Depends on what you want
Shrunk 47 lines in that refactor, boss mode
Mongo is much better for RAD
@SomeKittens wats RAD?
Do all of you guys recommend heroku?
or AppFog?
or what?
I do if you're not using sockets
Okay
21:43
I like Nodejitsu cause they actually support sockets
Heroku you gotta long poll bleh
Does heroku have mongo built in?
Grmbl. Been working for nearly an hour to use JBImages, only to discover that it gives TinyMCE the wrong paths and doesn't let me manage an image list. Too awesome.
if that's a valid question?
@lawm Rapid Application Development
@lawm ...sorta.
21:43
It's an add-on
@SomeKittens Is it free for all of that shit?
Nodejitsu you just click the 'databases' tab, and click new database, give it a name, and then use the link they give you
Yeah, all the basic stuff
15MB free storage
So nodejitsu=betterish?
21:44
@SomeKittens Like my refactor :D?
Wanna help me test super quick or you busy
I'm running Kittens Chat on Heroku for free
Have you heard of pagodabox? Its pretty good but its pretty bad in terms of productness
@XCritics busy with my own productivity
It's ok, you're still my best bud
wink face
@XCritics So how are Mongo queries working on node?
@SomeKittens is this forkable?
21:46
there's a mongo query
@XCritics oh..
Is it like SQL/
?
It's actually NoSQL
lol
@XCritics So how do queries work?
you pass it objects, and use async functions to play with the return values
21:47
@XCritics confusing..
not really
@lawm db.collectionName.find({keyName: 'valueYouWant'})
@XCritics oh!
collectionname is the 'table'
21:47
I was thinking classes? I've never used those..
What's keyname?
Like.. args?
get all the items in collectionName where keyName is equal to valueYouWant
@SomeKittens so like in a certain col or same row as "foo" on col "bar"?
Sorry, I dont know a thing about dbs
I think I'll start with a PHP backend and then when I'm ready go to a MongoNode backend
try the tutorial at mongodb.org/#
ok
Desperately need jquery validation help
anyone please?
need to check if username is a duplicate of that in the databse
21:57
@DemCodeLines that's serverside validation
you can do it with AJAX if you must use jQuery validation
The sad thing about Node, is there isn't much documentation for learning it, other than a book or two, you just kind of have to play with it, but it's really fun and powerful when you do
google jquery validation ajax
@XCritics Wanna help? Ask and answer node questions in SO
I do!
Whenever you run into an issue you don't know how to solve, and you manage to, do that, that is exactly the sort of thing that drives a technology
jQuery("#email").validate({
	expression: "if (VAL.match(/^[^\\W][a-zA-Z0-9\\_\\-\\.]+([a-zA-Z0-9\\_\\-\\.]+)*\\@[a-zA-Z0-9_]+(\\.[a-zA-Z0-9_]+)*\\.[a-zA-Z]{2,4}$/)) return true; else return false;",
	remote: "inc/1x7LGBa-email-uvS.php"
});
21:58
Well then I must be driving node all by myself :P
@BenjaminGruenbaum ^
In the remote file, I query the database and then run this code:
if ($result->rowCount() > 0) {
    $output = true;
} else {
    $output = false;
}
echo json_encode($output);
@XCritics yeah, with your one nodejs answer with zero upvotes :P
@BenjaminGruenbaum There's not that many node questions to answer.
Hey, that dick head never even marked an answer :P
But like 50% of my questions are node :)
@SomeKittens The ones there are are actually interesting
22:00
What's wrong with my code?
I have more points in Joomla than I do Node. Ouch.
I asked this and I wanted to answer it myself but this guy answered it before I was able and his answer was better than what I was going to write, so I just accepted it and left a comment for stuff I wanted him to clarify :)
25
Q: Building a website using node.js - best practice

Benjamin GruenbaumI was wondering how one would go about developing a website from scratch with node.js . I understand how I could possibly do it, but I am interested in the best design practice. I need this theoretical website to: Do a lot of AJAX Be very straightforward Be relatively small Connect to... let's...

@DemCodeLines Are you using a jQuery library?
@BenjaminGruenbaum And I answered in Vanilla node, not express, so, I think that's bonus points :)
22:00
Same as This:
13
Q: setImmediate vs. nextTick

Benjamin GruenbaumNode.js version 0.10 was released today and introduced setImmediate. The Api changes documentation suggests using it when doing recursive nextTick calls. From what mdn says it seems very similar to process.nextTick When should I use nextTick and when should I use setImmediate?

This one is a PHP question, author said 'if you want to use node, you may' so I answered in node, explaining pretty much how the HTTP protocol works during that, I'm proud of that answer:
8
A: Break HTTP file uploading from server side by PHP or Apache

Benjamin GruenbaumFirst of all, you can try this code yourself using the GitHub repo I created for this. Just clone the repository and run node header. (Spoiler, if you're reading this and are under time pressure to get something to work and not in the mood to learn ( :( ), there is a simpler solution at the end...

It uses the net module, that's one level lower than the HTTP module, way lower than express
The rest of my nodejs answers/questions are mostly short stuff, like "How do I use a favicon in express" or "how do I parse a url"
Ooh, this is one Q&A I'm proud of, doing asynchronous exception handling with domains in nodejs
3
A: Javascript Asynchronous Exception Handling with node.js

Benjamin GruenbaumI ended up using domains, I have created the following file I called mistake.js which contains the following code: var domain=require("domain"); module.exports = function(func){ var F = function(){}; var dom = domain.create(); F.prototype.catch = function(errHandle){ var args...

Last one, this one also didn't get accepted, probably because I read it when it was half a year old, about socket.io message passing
3
A: Reliable messaging under socket.io?

Benjamin GruenbaumThe Real Underlying Issue This issue isn't just limited to socket.io. It is a well known problem called the Two Generals' Problem. Two armies, each led by a general, are preparing to attack a fortified city. The armies are encamped near the city, each on its own hill. A valley separates the ...

So MS still adds non-standard crap to their browser (even if the idea of this function is not so bad)
22:05
@ThiefMaster Actually, it's in the standard
hm according to mdn it's not
Hmm, lemme find it, nodejs recently implemented it to be consistent since they had setInterval and setTimeout
yeah that's were i read about it
hrm ok, then the MDN document is somewhat misleading
> This article is in need of an editorial review.
0
Q: Verifying using JQuery Form Validation that email isn't duplicate

DemCodeLinesindex.php: <script type="text/javascript"> jQuery(function(){ jQuery("#email").validate({ expression: "if (VAL.match(/^[^\\W][a-zA-Z0-9\\_\\-\\.]+([a-zA-Z0-9\\_\\-\\.]+)*\\@[a-zA-Z0-9_]+(\\.[a-zA-Z0-9_]+)*\\.[a-zA-Z]{2,4}$/)) return true; else return false;", remote: ...

22:11
Node does timers so much better than browsers :/ timer ids are stupid
> if integer ids are good enough for setTimeout and setInterval, they're good enough for setImmediate (named in the same vein). These were my attempt at weak refs in 1995, and they "stuck".
( Branden Eich )
especially since people do stuff like for i in range(0, setInterval()): clearInterval(i)
If they were doing python, sure :) But yeah, not keeping track of your references is bad in any context, especially something like this
!!> setTimeout(console.log.bind(console.log,"hello"))
@BenjaminGruenbaum 1
22:15
Wow I got a -1 on the question. Cool.
setTimeout acts like a setImmediate if you omit the second param iirc
@DemCodeLines That was me, see my comment.
If you edit it to fix those issues, I'll switch the vote to a +1
@ThiefMaster turns out, it's actually in the specification, whatwg.org/specs/web-apps/current-work/multipage/… , "Let timeout be the second argument to the method, or zero if the argument was omitted."
So calling setTimeout with 0 is actually supposed to behave the same, although I remember it being considerably slower when testing, at least in node
!!/gm git-stash
@OronM 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.
!!/gm pants
so it's not that smart.
!!Should I have tea now or later?
@SomeKittens Should I have tea now
22:25
no, that's what I'm asking you
@SomeKittens I edited.
@DemCodeLines Much better, thank you.
@SomeKittens Well, it's a user-taught command.
You're welcome. Now I just await answers
@DemCodeLines answer for?
22:30
@Happyninja the question.
@DemCodeLines which is?
@OctavianDamiean Bro, can you help me test for 2 seconds
-2
Q: Verifying using JQuery Form Validation that email isn't duplicate

DemCodeLinesI imported the following: http://ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/jquery.validate.js http://ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/jquery.validate.min.js index.php: <script type="text/javascript"> jQuery(function(){ jQuery("#email").validate({ expressio...

@Happyninja ^
@XCritics I was in the process of transitioning from a sitting homo sapiens to its next evolutionary step, lying homo sapiens.
2 secs :D
22:32
However, if it's a quick one, shoot.
it is
I am using PDO
@OctavianDamiean go to gacnt-dotafinder.jitsu.com login [email protected] / testtest
and click Find Players
@DemCodeLines so basically you want to check whenever the email already exist?
22:34
Yes
@OctavianDamiean close the page, I wanna see your name disappear :P
Aweesomme
22:39
is it possible to append an entire html file into a div when the ajax returns the file contents ? for example currently i add the contents of the page via to parent div via .innerHTML because its not just an element its both text and divs and other such things.
Alright, I'm out. Laters all.
o/
@SomeKittens is onclose what I would listen for with sockets to monitor a drop? Like how SO knows whether the message drops or not?
:9655973
$isUniqueFlag = false;
	$sql = 'bla bla bla';
	$result = $pdo->query($sql);
	while($row = $result->fetch()){
		if($row['email'] != $email){
			$isUniqueFlag = true;
		}
	}
something like that
does it make sense to you?
could you not just do WHERE ? NOT IN (select email FROM user table)
the row count would then tell you if its unique?
yea probably
22:41
if it can be done via SQL only it would probably be better than looping
^
just do a COUNT on * where email=?
although in sparta voice "This is java-script room" :P
I am doing a count
if ($result->rowCount() > 0) {
    $output = true;
} else {
    $output = false;
}
echo json_encode($output);
encoding a true or false?
22:46
could just do :

if ($result->rowCount()) {
echo true; exit;
}
echo false; exit;
Music guru's: Could I get y'alls opinion on my latest score? soundcloud.com/cc-inc-1/beethovens-secrets
tried this it doesn't work
@Tukkan 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.
@DemCodeLines php room
@TheReddKing 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.
22:52
1 message moved to PHP
@DemCodeLines did you try to separate problem aka running your check-email.php directly to check what it say? cause it probably give you a tasty error
Did the bot get a makeover? :D
guys i can't animate scrollTop from place to place because its always animating from top to exact place:
$("html, body").stop().animate({ scrollTop: offsets[index] - 50});
@Happyninja I am not sure how I would run it directly.
22:54
@Tukkan tried .scrollTo?
i'll try, possible that I love You :D
@DemCodeLines just run call your script directly and instead of waiting for $_REQUEST or similar directly describe your var like $email= '[email protected]';
I am not sure on what you mean run call your script directly unless I am overthinking
Is there like a

socket.emit 'sendMessage', data, (err) ->
    console.log err if err

« first day (954 days earlier)      last day (4219 days later) »