« first day (900 days earlier)      last day (4046 days later) » 

5:00 PM
bootstrap is a UI framework
 
right.
I'm assuming it has some javascript features built in?
 
it's basically a 960 grid system + a bunch of fancy UI alterations (buttons, forms, tables, etc) if you choose to include the js components then idk how well it plays
 
yah
 
user2157210
allright work over
 
it doesn't have to have that
 
5:01 PM
I see.
 
it's modular. and no JS is required to use the base css
but for things like alerts, the close function and the show function are handled in js.
 
That's good to hear. I've got a personal project that I'm working on. Started with a template, but I want to rework the UI
 
however you can get the same functionality (limited support) with CSS3
like the modals don't need js to show, you can use :target to show them and hide them
 
@SomeKittens Have you thought of using a linked list for the connections, instead of an array?
A singly-linked linked list may be nicer for larger N
 
@Zirak Add it to GitHub issues
 
5:07 PM
Link?
 
I don't think it's needed when I finish moving everything to best-practice Socket.io
 
nvm, found it
 
oh wait, the traversal is implicit?
 
Hey,
Im trying to change this CSS line #topnav ul li a {
width: 175px;} to 100% using javascript
Doable?
I have the if condition for when i want this to happen just not sure how i'd change the style sheet without changing the actual style sheet link
 
5:13 PM
posted on April 03, 2013

John Resig has written an excellent article clarifying some of the questions that have arisen over the past few weeks regarding Mozilla’s asm.js project. If you haven’t heard of it already, asm.js is a highly optimizable subset of JavaScript designed mostly for compilers like Emscripten. I wrote an article about it a few weeks ago when the spec was first released right here on thi

 
eh, with js the difference will be minimal then. The big impact is in traversal of extra-large arrays.
 
@Zirak is there any guidelines for what types of quotes the bot should say?
I've been trying to add more when I think of good sources for the quotes (see latest pull req)
 
@rlemon Not unless we invent one.
 
ahh, good then.
randomly random shit
 
@rlemon On slides?
 
5:16 PM
only the one.
 
!!/slidepoop
 
!!/tell "" "foo"
 
@rlemon Invalid /tell arguments. Use /help for usage info
 
I want the ability to make the bot say shit without pinging anyone
 
!!/tell SOChatBot "fu"
 
@rlemon Command fu does not exist. Did you mean: fa
 
!!/tell SOChatBot echo foo
 
@SOChatBot foo
 
5:19 PM
How do you guys press Ctrl + Shift + P (for instance)? Ctrl (left pinky), Shift(left ring), P (right ring)? Or how?
 
@ŠimeVidas that but right middle finger
 
Right index for me
Or middle
 
Either middle or ring finger on the right hand.
 
I almost type correctly.
but the middle of the keyboard can share each hand, for instance I might hit y with my right or left depending on where the other hand was due to the last character typed by said hand
 
5:21 PM
Yeah
 
I somehow feel that hitting Ctrl+Shift combinations is easier with the right hand. Is it just me?
 
Or depending on the next character
 
@ŠimeVidas Probably.
 
I never use the right Ctrl and Shift
 
@ŠimeVidas probably are, but my muscle memory (gaming) wants my left hand to control all shift and ctrl + alt strokes
 
5:21 PM
I'd rebind them to something more useful, but I can't even think of something more useful
 
Ah, I see why. My right shift is full (two keys wide), but my left shift is only one key wide.
 
that and my left hand is used to hitting those keys for tab navigation (which I use pretty much all the time)
 
Wow, this sucks
 
I've never seen a left-shift that's one key wide
 
@AmaanCheval Croatian layout: ascii-table.com/img/keyboard-234.png
 
5:23 PM
@ŠimeVidas yea my right shift I will use to produce special chars or CAPS.. but if any single hand combinations are required it is my left.
 
@ŠimeVidas Oh, that would make sense
 
like ctrl + shift, alt + shift, ctrl+alt+shift etc.
 
Your punctuation is different too
I wouldn't like trying to get used to that
 
@AmaanCheval Some things are better, some are worse (concerning writing JS code)
 
my right shift is 4 keys wide, left is three.
 
5:24 PM
@rlemon Same here
 
m59
Hmm. I know there is something to look out for when dealing with for loops... what situation is it where i gets incremented when you don't want it to and you have to pass it as an argument to a function to preserve the value?
 
m59
I thought I was about to run into that, but it didn't cause an issue. Now I can't remember what WILL cause the issue :(
 
@m59 explain situation better
 
m59
I know I used a for loop before and was doing something with i in it, only to realize that i was the final value each time. To fix it, I had to pass i to a function inside the loop instead. I really want to remember what caused that, for the sake of not doing it again
 
5:26 PM
@m59 Closures
26
Q: Javascript infamous Loop problem?

Tower JooI've got the following code snippet. function addLinks () { for (var i=0, link; i<5; i++) { link = document.createElement("a"); link.innerHTML = "Link " + i; link.onclick = function () { alert(i); }; document.body.appendChild(link); } } The above code is for generating 5 links and bind...

 
ohh scope issues.
yea, I don't run into those too often
 
Yeah, but they're good to know about
 
@m59 please, don't attach event listeners within a loop
 
m59
well then, that's awfully confusing, because it looks like what I am doing ought not work...
 
5:28 PM
I think once I learned about scope and block scope that writing js became a joy
 
naah .. it's still hard. I keep writing JS that i cannot debug myself
 
@tereško stahp
 
@ŠimeVidas this is my keyboard for work
 
m59
Ohhhh. It's the function that messes it up in that example.
 
same layout for home
 
m59
5:31 PM
So, it's only when declaring some kind of function in a loop that the issue occurs?
 
I dislike the alternate layout for the home/end group of keys
 
@teresko then write simple code
It's the best kind...
 
@Shmiddty it does take a bit of getting used too. the F keys are tied to the Fn button which enrages me beyond nothing else.
 
@FlorianMargaine not an option
 
but I really like the feeling of the keystrokes on this keyboard so i'm dealing with it
 
5:33 PM
Does anyone else find it annoying that keyboards have the numpad on the right?
 
which reminds me taht i soon might need to buy a new keyboard for my laptop .. there soon will be a hole in the space key
 
@tereško You can just replace the one key, you know.
 
nahh, new laptop dude.
> fuck my laptop has a coffee stain on the strap of the case.... time to buy a new one.
 
My laptop is getting kind of dusty. I think it's time for a new one.
 
My mbp is getting old too, but money's lacking.
 
5:36 PM
My laptop has Windows installed. Time to upgrade again.
 
I once owned a shitty monitor (cannot remember brand) that did it's menus in the native language, as well as their language select menu. Someone (likely my brother) switched it to some symbol language (Hindi or something) and I couldn't figure out how to change it back (this was many years ago) - so I just threw away the monitor.
 
My laptop is owned by my school. Time to download porn onto it again.
 
ohh, yea.. before he changed the language he changes a bunch of other settings so the monitor was unreadable
 
@ShotgunNinja Just got one from the trash. :D
 
porn?
what magical trash can is this?
 
5:38 PM
Trash is a thing. Therefore, by Rule 34, there is trash porn.
 
@rlemon naah .. the alt key is kinda flaky too, arrows are not responsive and i managed to break off one of delete keys
 
How can i inverse a percentage?
 
@rlemon Yea it is the trash can of a huge company that has way too much money.
 
@tereško dude, wtf are you doing to your machine?!
 
@MikeBoutin 1 / pct
 
5:40 PM
head-desk only works if you hit the desk, not the keyboard.
 
@tereško Are you trying to munch your keyboard!?
 
@KendallFrey not this way
 
Well, then, be more specific.
 
@MikeBoutin 1 - pct?
ha
 
i have 6 <div>
 
5:41 PM
perc / 100
 
3 are in the left
3 are in the right
i want to get the percentage from the center they are
 
BotWat++
 
the first 3 are
7.246376811594203
40.57971014492754
73.91304347826086
 
var p = container.width / element.style.left;
 
5:42 PM
and the others are
107.24637681159422
140.57971014492753
173.91304347826087
when it goes higher than 100%
it must go in the inverse way
 
100 - ( perc  - 100 );
100 - ( 107 - 100 ) === 93;
 
Beat me to it ...
 
pct = 100 - Math.abs(100 - pct)
 
so it should be
7.246376811594203
40.57971014492754
73.91304347826086
73.91304347826086
40.57971014492754
7.246376811594203
cause they are perfectly centered
you understand?
 
no, you are now asking for two different things
your expected output is not what you just asked for
> when it goes higher than 100% it must go in the inverse way
 
5:44 PM
yes
 
but your output there just trims 100 off the output
 
I just realized how uniformly sized all of the numbers in this font are.
cooooooooooooool
 
You want to mirror the values when it exceeds the 100% mark.
At least that's what I think you want.
 
107 should be 7 or 93?
 
neither
 
5:46 PM
then you need to figure out what you are asking for
 
Oh, help us all.
 
I think he wants to mirror the values.
 
the 4th element are in the 7.246376811594203% of the second half
 
12345|54321
 
but i need the percentage to create a fisheye like animation
 
5:47 PM
+perc.toString().split('').reverse().join('')
^ money
 
@OctavianDamiean some kind of mirror, but the value will change. All div will go to the right or the left
and it will not have a "mirror"
 
so then wouldn't 107 be 93?
7 % mirror split down the middle is 93%
7% from start === 7% away from end
 
I'm quite confused now.
Not quite sure what he wants.
 
lol exactly.
 
5:49 PM
1
Q: JavaScript replace all

VarunI have to write some JavaScript code to replace characters in a variable: var data = "abcd.-3*(adsa3sd" From the variable data I have to replace 0-9a-zA-Z and . characters. I want the output to be: -*( How can it be done?

 
the percentage is for the width of the <div>
if the 3rd is 74% the 4th cannot be 93% :/
 
well you need to incorporate widths then. We're only doing this off single point x/y
 
@MikeBoutin what are we trying to do?
 
@Varun it's difficult to explain... i want to create a fisheye effect
 
@Varun Why are you linking to this question. Aren't you happy with the answers ?
 
5:52 PM
from the center
 
@dystroy actually no
the answers didnt worked for me
 
@Varun Who's we?
 
would like to participate in @MikeBoutin's question
all ppl in chat :P
 
@Varun I tried the first answer and it worked
!!> "abcd.-3*(adsa3sd".replace(new RegExp('[A-Z|a-z|0-9|\\.]','g'),"")
 
5:53 PM
@dystroy "-*("
 
i tried that too
didnt worked :S
 
Sublime's Ctrl + R is fantastic!
(I'm using it on the jQuery source, no more Ctrl + F "name:")
 
@Varun Well specify didn't work
 
wait putting it on jsfiddle
 
As you can see it worked in here right now.
 
5:55 PM
@rlemon i understand that, but i need a value that when they are in left 50% it will be 100% and when they will be left 25% or left: 75% it will be 50%
 
So either you're doing something wrong or ... actually that's it.
 
document.write("abcd.-3*(adsa3sd".replace(/[\da-zA-Z.]+/g,""));
works
js fiddle is a PITA
anyone else getting blank interfaces?
 
PITA?
 
@rlemon you understand?
 
0
Q: Idomatic Javascript code architecture

ahjmortonI am writing a node.js application which I am breaking down into modules, the issue is I am not sure how to organise my code in an idiomatic Javascript way. Currently each of my modules exposes a set of functions that are intended to be called directly. All state is modified by the module with t...

 
5:58 PM
@Varun pain in the ass
here it is working fine
that is the regex from the highest voted answer
 
try this thats actual thing i wanna do
second box works fine
 
And you don't even have to have the jQuery source opened: Ctrl + P "jquery@domManip"
This is ridiculously amazing.
 
uhhhh
var replaceString1 = "/" + lsResult + allowedChars + "/g";
can't build a regex literal like that irrc
 

« first day (900 days earlier)      last day (4046 days later) »