« first day (879 days earlier)      last day (4063 days later) » 

3:00 AM
@XCritics its not visible
 
@XCritics It's not
 
@SomeKittens I mean, only if you want to get an element by id (right semantics). Otherwise, KISS
 
What's its longevity like?
 
@XCritics: i'd say at this point better than rails
 
youtube.com/watch?v=jo_B4LTHi3I is that for learning or is this just showing him off
 
3:01 AM
but who knows
@XCritics: for learning i'd say use the nodebeginner for a few days, then start experimenting
 
That's what I'm doing
I start back at work tomorrow, 7 days 12 hours
so I'll have lots of time to dabble
So he says it's not supported well on windows in the video
 
Where do you work?
 
Oh nvm this video is 2011
 
Yeah, it's best to work with Node in a Linux environment
 
I'm sure its better supported
We got windows at work
I work at an oil plant :/
 
3:03 AM
lucky you. I had 7 hours of flights today since 6am moscow time and now im still typing to you at 4am :P
 
ah, I see.
 
which is like 7am moscow time now
hmm but windows supports vmware too right? :)
 
Haha yeah but the computer at work is old
I'll just use SFTP with Sublime text I think
Is it really that bad on windows?
 
a while ago i saw some company offering not too expensive ubuntu virtual desktops on AWS but i cant find them anymore.. probably no1 wants ubuntu and everyone wants fruit
no, just the windows command line is bad
 
I use my old alienware laptop as a Ubuntu 12.04 LTS server lol
 
3:06 AM
microsoft has node.js on their azure platform
i use my RoG asus as ubuntu dev machine
 
So do I write all my node.js in a command line?
 
i'm still laughing at the people with macbooks when they are watching my screen like: wtf ...
 
What do you use?
 
@XCritics No, there's just a few things that are harder
 
@SomeKittens what do you mean
 
3:08 AM
Clunkier. Due to CLI issues
Everything will work which is the important part
 
@SomeKittens are you refering to node on windows?
 
@XCritics No, just use the cli to run it
yes
 
@SomeKittens cli?
 
@XCritics.. ye like rails on windows sucks too...
 
haha
 
3:09 AM
command line interface
 
@XCritics Command Line Interface
 
I'm climbing a tree at the zoo during work. My job is awesome.
 
ah
Thought you mean client
 
aw, ninja'd
 
apologies
 
3:09 AM
God damn this guy is good with vim
 
well im writing too many emails nowadays
 
I just know shift+a / i and :wq lol
 
<3 vim
 
@plodder You can send email from vim
 
0
Q: Modify or not modify your objects when creating computing functions?

DokkatSee the examples below: function map_cloning(obj,fn){ result = {}; for (var key in obj) result[key] = fn(obj[key]); return result; }; function map_modifying(obj,fn){ for (var key in obj) obj[key] = fn(obj[key]); return obj; }; function sum_cloning(vector1,ve...

 
3:10 AM
@SomeKittens meh my clients needs the htmls and im too lazy to write a jade mail parser
 
What is jade?
Hipster stuff :[?
 
@XCritics HTML template system, common with Node
No, not hipster, just easy
 
@XCritics: like haml
 
Am I going to be at a disadvantage if I use html
 
no you can use html + mustache
 
Son of a. What. Is. Mustache?
 
i'll type my templates faster then though
 
@XCritics Nope. You can use quite a few template systems or even static html
 
mustache is like logic-less html templating
like that stuff FB made for PHP
i use it as a jade preparser if i need a screen 600x with diff parameters that i dont want to parse runtime :P
 
I want to use bootstrap
Loves me mah bootstrap
 
3:12 AM
i only use bootsrap
can always have someone edit the css :P
someone as in defo not me
 
@XCritics <3 bootstrap
 
So do I HAVE to use mustache or jade or can I just write straight in html
 
no you can do whatever
 
2 mins ago, by SomeKittens
@XCritics Nope. You can use quite a few template systems or even static html
 
you can write html
then zip it
then unzip it every time someone requests a page
 
3:14 AM
lol wut
 
do a s/a/b/ on it
 
Mind = Blown
 
then cache that in memcached
basically you can do whatever you want
 
So I can't just write node.js, include it in my html through src=""?
I have to do all this stuff like putting it in a zip file?
 
no
no im kidding
 
3:15 AM
I'm terrified
 
you just make html files
you can make it all static
or use templating
 
By templating do you mean like, put your navbar in one file, footer in another then include all in one big file when asked for?
 
by templating i mean like what you do with php
or rails
<div><%= variable %></div>
stuff like that
 
oh ok
 
but learn the jade :)
 
3:18 AM
And how do you use templating, is that were jade and stuff comes in?
 
Dbz
Hey guys, I have a bunch of images, and I want to display them in a vertical list in the middle of the page. Can anyone help me with the css? I've got a good start
and the room goes silent O.o
 
@Dbz Can't you put all of the images in a container narrow enough to force them in a straight line?
 
@Dbz mainly back-end js people nowadays :P
 
Dbz
@Christopher, that's an interesting idea, but I want to use the jQueryUI selectable, so a list it must be
 
@XCritics what you want to do is think a bit like MVC... you have nosql lib or orm for models, a template engine for views and then you write some controllers
 
3:20 AM
@plodder jade is slow :(
 
much like rails
 
@Dbz I have got a back-end question, but it sort of spans several languages.
 
@plodder how come you had to refactor so much in rails?
@plodder I haven't had to yet, but what usually causes that?
 
Err, that was supposed to be @plodder
 
Dbz
Okay
I was confused
 
3:21 AM
@BenjaminGruenbaum thats why i preparse it
 
0
Q: MySQL looking for a better solution - long list of AND operator with a type String comparision

user1179459I have search function which does search for keywords in an large mysql table, but since i need to filter out all the bad words, i have to do a following type of a AND comparison in the MySQL, which is a long list of banned words (over 500+) , due to this its very slow, SELECT * FROM keywords W...

love the naughty words :P
 
@Christopher several back-end languages?
 
I have got an html table that is supposed to match a MySQL table
 
@BenjaminGruenbaum LOL
 
@XCritics because i do tons of prototyping for clients that go 100% in the opposite direction in the middle of each project phase
 
3:22 AM
The javascript gets all of the data as json and turns it into the html table that I need.
 
and then you have to refactor
 
@plodder and how come node you don't have to?
 
The server side stuff is handled by PHP
 
Dbz
If I float a list, can I not center it in the middle of the page?
 
@XCritics because rails is less flexible
 
3:23 AM
My issue is that this table is very large and I don't want to rewrite the whole thing when one cell changes in the db
I want to log changes to the db and use javascript to change just that one cell.
 
@christopher do you ahve a fixed amount of cells?
 
No, rows are constantly being added.
 
@Christopher send the cell to change and value to change to from the json
your server has to be able to do that
 
@BenjaminGruenbaum Isn't there a NOT IN (array) for MySQL?
 
I think there is
 
3:26 AM
@andho But how do I keep track of where I am in the list of changes?
 
@plodder do you have any random file you wrote some node and jade that you could gist it and link it to me so I could just see exactly?
 
Dunno if that'd improve performance
 
@SomeKittens I changed all the curse words
 
regexp is very slow, i can do NOT IN but problem is i cant use the %% with that, i think — user1179459 1 min ago
 
@Christopher each cell corresponds to a row and a column
 
3:27 AM
There's our answer
 
the server can send the row and column identifier
 
@XCritics: not on github because my projects are all commercial, but i can find you an example
 
your html table should also maintain that row and column identifier
 
@plodder ok
 
^Old code, I should fix it but too busy
 
3:28 AM
@SomeKittens I hope he doesn't think I'm rude :P
 
Crud, that was back when I was using ejs...
 
@SomeKittens that routes file made me shit
 
Yeah, it's not the best example.
 
@xcritics: thats whats going to upset you at start
 
Dbz
Is there any way to center an unordered list in the center of a div?
 
3:29 AM
@andho The issue I have with this is if I log all of the changes in a text file that has something like (cell, value) for each change, if I open the page in a new browser and the js fetchs the change file and tries to apply the changes, it won't know which changes it already has from the db
 
@SomeKittens what is .ejs?
 
Dbz
any way to center an unordered list horizontally* in the middle of the div, so that there is equal space to the right and to the left
 
It uses the same rails syntax as <%= %>?
 
@XCritics the worst thing to learn about node.js is that you almost always have to use callbacks
 
@Dbz is there content on both sides?
 
Dbz
3:30 AM
@andho there is no content on either side
 
so not function foo () { return bar; }
 
@Dbz oh i assume that the list items are floated right or inline
 
but function foo(cb) { cb(bar); }
 
as in
Home | Products | About Us
 
@andho Is this not a concern?
 
3:31 AM
0
Q: JavaScript: How to provide one-time calculations to frequently used methods

drkthngI'm new to JS/JQuery and wrote some JavaScript/JQuery lines to create a "pulsating" object. I get the "pulse" effect by increasing/resizing the object and then bringing it back to its original state periodically. I was uncomfortable with calculating the necessary values everytime they are needed,...

 
Dbz
Nope, it's a vertical list
 
@plodder it uses the same syntax in templates as Rails? <%= %>?
 
@XCritics Different template system. Take it from me, learn jade
 
@SomeKittens what are those .ejs in your template file
 
@XCritics That's not Jade
 
3:32 AM
@Christopher you'll have to come up with a way to make it synchronize, probably will have to maintain change for each client separately based on the clients first request to the server
 
Dbz
@andho, it's a vertical list of images to be exact
 
5
A: Center Message box on Any Screen Resolution

andhoCenter Horizontally To center a div horizontally you can use margin: auto auto; width: 500px where the width is any width you want it to be. JS Fiddle HTML: <div id="content"> Some content </div> CSS: #content { width: 200px; margin: auto auto; background-color:...

 
@XCritics Didn't realize how old that project was
You probably should ignore it
 
@SomeKittens haha
@SomeKittens So I did npm install jade then it says to make jade.js im in the right file but nothing happened
 
@andho So each client will need its own list of changes on the server?
 
3:33 AM
o make jade.js (Tue, Mar 12)
make: Nothing to be done for `jade.js'.
 
@Christopher ofcourse
 
@XCritics no need to make
 
THANKS A LOT
@XCritics just follow the node tutorial
 
@SomeKittens will that show me how to use jade?
 
3:34 AM
@Christopher or...
 
i really got to grab 3 hours of sleep :(
 
@andho This seems like it could get messy very fast
 
Dbz
@andho, that definitely helped, but it's not centered exactly. Any idea why that might be?
 
@Dbz different size images?
 
@Christopher you could create a file for each time a client requests for full data, then each client will have reference to which file it should start from
@Dbz did you give your list a width?
 
Dbz
3:35 AM
Yes, 200px
 
@XCritics let me know how you get along next time i see you here
 
@Dbz would be easier to check with code, mind setting up a jsfiddle?
 
@plodder I'm here on a daily basis, I have to sleep soon but I'll keep you posted
 
Dbz
@andho, I wouldn't mind at all. The only problem is that you won't see the images- and they are of slightly different sizes...
 
i have to sleep now!
so ciao!
 
3:37 AM
@Dbz shouldn't matter if they don't increase the list width from 200px
@Dbz link to just 1 some sample image from somewhere
 
Dbz
@andho, okay. I'll set up a jsfiddle. Changing the values a little bit first
 
@Dbz ok
 
@andho Would it be possible to do it with one db and one change file on the server? Something like (cell, change, timestamp) on the server so when the js requests the db version it gets the server timestamp that it did the initial request and can then compare that time to the timestamps in the change file?
Then it can progress through the changes sequentially?
 
@Christopher yeah can do that.
 
@andho Do you see any potential flaws with that?
 
3:40 AM
@Christopher yeah, the file could get really huge
 
Dbz
@andho, there are a few important javascript files, and I won't be able to get it to work in a jsfiddle....perhaps I can update my github? It's a super simple chrome extension (the options page) a few kb
 
@Christopher you might be able to store the data in some kind of sequential structure which you can seek to the correct timestamp without reading it sequentially
 
@andho If one of the clients gets a list of changes that has timestamps older then something like 10 seconds, it could tell the server to drop them
@andho How would that be done?
 
@Dbz okay
 
My js is currently requesting the latest changes from the db every second, so 10 seconds should be long enough for every client to get the change.
But I like the sound of your last idea, can you give some more details I how I could get that to work?
 
Dbz
3:43 AM
 
@Christopher yeah you could do that. make sure to catch the error if the file doesn't exist and tell the client to do a full reload if that happens
@Christopher i'm not sure how this can be done exactly
 
Ah, okay.
 
@Christopher it's the basic idea how databases do indexes. tree structure, but this should be even simpler
 
Dbz
@andho, I'm currently working on options.html and options.css
 
@andho Okay, I've got to go now, but I'll give it a shot.
Thanks for your help.
 
3:45 AM
@Christopher welcome
@Dbz can i just open the options.html in the browser
 
Dbz
@andho, sure- I don't see why not
 
var http = require("http");

http.createServer(function(request, response) {
	response.writeHead(200, {"Content-Type": "text/plain"});
	response.write("Hello World");
	response.end();
}).listen(8888);
doin it big
 
@Dbz did you use Pretend it's vertically centered option?
 
Dbz
@andho sounds like me
 
that will not be accurate. it's just a simple way to make it seem centered, but actually not
you will need to use Use Javascript option @Dbz
 
3:50 AM
1
Q: C source code lexical parser in Java

MACI need a lexical parser that will parse C source codes and I have to do it using Java language. I researched for it and saw ANTLR and JAVACC. Which of these parsers are better to use and why? Or do you have any other parser to recommend? Answers will be much appreciated. Thanks.

 
because the list is dynamic height
 
@XCritics \o
 
@deadlock you got your +1
You should make that answer better though
 
@BenjaminGruenbaum only if you like my answer
!!
 
@deadlock Y U NO MAEK SENSE!? Could not understand ``
 
3:51 AM
@deadlock Why are you posting that here?
 
repwhore
 
Dbz
@andho, and suggestions?
 
@andho I am not a repwhore
 
@Dbz use the Use Javascript option in the answer
 
It's just a very general question that I wanted to share my answer for.
Does it bug you @andho?
 
3:52 AM
did i say it out loud :)
 
Dbz
@andho, I don't think I understand
 
no repwhoring doesn't
but posting off topic questions does
and seeing it posted on php chat also increased the bugginess
 
@andho I guarantee that you will get more pissed as you join more rooms because the answer is there. That's what a classic repwhore would do
 
22 mins ago, by andho
5
A: Center Message box on Any Screen Resolution

andhoCenter Horizontally To center a div horizontally you can use margin: auto auto; width: 500px where the width is any width you want it to be. JS Fiddle HTML: <div id="content"> Some content </div> CSS: #content { width: 200px; margin: auto auto; background-color:...

@Dbz see the Use Javascript part. Try to do that. That's the only solution if the height of you list is not fixed
@deadlock true true
 
=]
 
Dbz
3:56 AM
@andho, Cool okay. I do feel like the height of my list is fixed though. It just depends on the amount of images because all of the images are the same height
just different widths
 
@Dbz is it a fixed number of images?
 
Dbz
@andHo, yes and no. It is a fixed number of images, but I may change that number at some point because I want to remove an image or two.
 
@Dbz then you can also change the css right
 
Dbz
@andho, right
 
@Dbz you can use Center screen with fixed dimensions from the answer in that case
 
3:57 AM
"Also you can give a fixed margin-top (or top with position: absolute) to make it seem vertically centered in most desktop and laptop screens."
@andho that's a bad approach
 
@deadlock I know, @Dbz used that approach and didn't like it
but it's an easy way to make it seem so on a simple login page
 
Dbz
@andho, I will try the center screen with fixed dimensions approach
 
@andho, I still don't agree, doing it dynamically is the best approach like you said in your answer. Anyways, I would like to see the flexibility in the next-generation CSS4 (that was a rumor yea)
 
Dbz
@andho, I have more questions if that's okay as well
 
@deadlock i always prefer to keep javascript out of layout and presentation issues unless i'm going full javascript
 
Dbz
4:01 AM
@andho, take this jsfiddle of a button jsfiddle.net/Zq8XU . Is it possible to make the outline only appear around the corners?
 
@andho, you don't have the option if you are after accurate vertical alignment.
 
@deadlock only if the height is not fixed. if the height is fixed there are two css solutions
 
if the height is fixed, table-cell display would do it quickly. But that's not the case in dynamic solutions
 
it is apparently in this situation. not everything is dynamic even in a dynamic web service
and table-cell display would work with dynamic height in the content with a fixed height parent, as long as the content is not inline
which should be in my answer :S
 
Yea I never denied that doing it statically works if the element has a fixed height
 
Dbz
4:07 AM
@andho, take this jsfiddle of a button jsfiddle.net/Zq8XU . Is it possible to make the outline only appear around the corners?
Sorry for the double post
Wasn't sure if you saw the first one
 
@Dbz oh yeah i saw it and opened it and forgot :P
 
Dbz
Cool, I don't want to bother you /be_impatient! I really do appreciate all of your help
 
@Dbz i'm not sure if that can be done. Haven't tried that. Maybe you can try border-image
 
Dbz
@andho, I'll come back to it. I'd rather solve the immediate problems. Like, I can't get my image to be centered in my selector. It appears like there is padding above my image which is pushing the selector, but there isn't. Any ideas on how to fix it?
 
@Dbz what do you mean selector
 
Dbz
4:14 AM
@andho, on the options page I use the jQueryUI selector to highlight which list element you clicked, but the selector (highlight) isn't centered aroudn the image correctly
 
has anyone experienced a weird situation in IE8 where when you click in a textarea and type, you are only able to type 2 characters like "AB" then you cant type the 3rd character..you'd have to then click again the textarea and type again..again u are can only type 2 characters..
 
The problem with object-oriented languages is they’ve got all this implicit environment that they carry around with them. You wanted a banana but what you got was a gorilla holding the banana and the entire jungle. — Joe Armstrong
 
@Dbz i'm not familiar with jQueryUI selector.
 
Dbz
@andho, no problem. I have another question for you though! Can I disable the selection of my list? So that it can only be clicked?
 
@darkyen if you get a chance check out Facebook, this dude ripped off your pen and didn't even fork it. codepen.io/mehulghai/details/pHKBg#pen-details-tab
 
4:22 AM
@Dbz again i don't know what you mean by "selection". Do you mean the style change when you hover over the list item?
@Dbz okay i can see it in the code you provided
 
Dbz
@andho, this time I mean like how you highlight text
 
when you click an image, it shows a box around the image
 
Dbz
@andho yes!
 
atleast the box is supposed to contain the item right
okay let me check
@Dbz your li has a padding: 20px in options.css line 5
it's content bleeds out of the actual li
 
Dbz
@andho, I removed that and it didn't fix the issue. I'll try again
 
4:25 AM
also you have given a height of 18px to the li, but the content is longer than 18px, in options.css line 36
 
Dbz
@andho, fine. You're right >.> I'm fixing >.>
 
and your ul has a width of 130px but the images have width 200px
@Dbz ;)
try to write as few css as possible
there are too many css that is probably not necessary here
also why do you keep the text in the images instead of using text?
 
Dbz
@andho, I guess I'm just a fool?
 
@Dbz hehe
 
0
Q: Why doesn't Javascript work in Internet Explorer?

cpastI'm trying to use Internet Explorer to test a website, but scripts don't seem to be running. This seems like it's an issue on a lot of pages - for example, I tried going to the Acid3 page, and it said I needed to enable scripting. I checked my security options, and Active Scripting is set to enab...

 
4:32 AM
^ great question title
 
Dbz
@andho, I've updated the css page on my github, but I'm getting the bug again even though I removed the padding. Would you be so kind as to take another look?
 
If we’d asked the customers what they wanted, they would have said “faster horses” — Henry Ford
 
@Dbz ok
still:
16 mins ago, by andho
also you have given a height of 18px to the li, but the content is longer than 18px, in options.css line 36
and:
15 mins ago, by andho
and your ul has a width of 130px but the images have width 200px
oh wait, it's 200px now
okay, so you want ur LI to have some space around the image right
 
Dbz
Woo, sorry I was in photoshop trying to crop out the text from the images..
 
@Dbz there is one caveat if you are using text. The text won't be centered to the image
 
Dbz
4:46 AM
>.<
Okay
I'll stick with the images for now then
 
give the LI same height as the image. or give your LI no height at all and display: block, and the LI will automatically expand to the height of it's contents
 
Dbz
I'll display:block
 
then give the LI a small padding
it's very easy to test these changes within chrome or firefox itself using the debugging tools
 
Dbz
I did
Yes, I test them all
My chrome extension loads them every time I refresh
I'm still getting the selectable not being centered around the image though >.<
 
did you remove the 18px height from the LI?
 
Dbz
4:51 AM
yes
`#selectable li {
height: 40px;
}`
fail
I changed it to 40
Removing it entirely fixes the issue
I'm an idiot
 
yeah obviously the image height is not 40
 
Dbz
I'm just removing those three lines from the css entirely
 
so ur good?
 
Dbz
Ha! Nice try. I'm never good ;p
Thank you for all of your help though! It's awesome to have someone I can just bounce questions off of
I'd give you an upvote if I could
Any css tricks in order to stop a user from selecting/highlighting multiple divs at a time on a webpage?
 
@Dbz no
 
Dbz
4:58 AM
What about any tricks to stop them for highlighting/selecting anything
 

« first day (879 days earlier)      last day (4063 days later) »