« first day (2074 days earlier)      last day (2860 days later) » 

12:57 AM
@GregBorbonus my JS knowledge doesn't extend very far past prompts and alerts :p. Would you be willing to help me with this some time in maybe an hour?
 
 
2 hours later…
2:49 AM
@driftking9987 Hey, sorry I was away, Father's Day stuff.
@Zacharee1 sure.
 
3:00 AM
@GregBorbonus thanks! I think I have a little time.
Remember, I am new to this
did I miss you by 11 mins?
 
Nope
I'm here
 
yay :D
 
Give me a few, I'm going to write up a JSFiddle
 
that's fine :)
I'm annoying a friend on Skype rn, so I can wait :p
@GregBorbonus what's your timezone? It's after 11PM here and I'm not feeling very well. Would it be OK with you if we picked this up tomorrow?
 
same here, but I won't be on tomorrow
can you give me 10 minutes?
 
3:12 AM
sure
 
the Fiddle is for you
 
oh, thanks :)
 
@Zacharee1 does that help?
 
I think
I'm not sure I really understand it though
 
It's actually simple.
the goal is, grab info, if it can, append to the div. Then check the state of the checkbox, if it's checked, scroll to the bottom, otherwise, do nothing.
 
3:24 AM
Where does id come from in the JS?
OK
 
I'm populating it.
in the setInterval, I'm passing id as a parameter to my function.
which is then passing the id to the get_content function.
 
oh, I didn't see the setInterval
 
I didn't need to do that part in this example, but if you're grabbing info with an ajax call, you may need to pass a parameter lik that.
 
yeah
Let's see if I can get it working
So this script works for both divs at the same time
 
yup
would work for a hundred divs
 
3:29 AM
So I have two separate IDs for my autoscroll checkboxes. If I just change them to the same name, this'll work?
like, checking one won't affect the other?
 
the ID is in the format of autoscroll + box.id
 
OK, so the combination makes it unique
 
yes.
You could do a $('#box#').next();
then id won't matter
 
I think this will do for now :p
So, for the get_content function, should it look like:
function get_content(id) {

  if (typeof id == "undefined") {
    return;
  }
  count++;
  return document.getElementById(id) = <theajaxreturn>;
}
 
no, the get_content function is used to get the next line/html
If you're using an ajax call, you need to reverse your logic.
 
3:34 AM
?
So do I make that return the content of what the AJAX response brings?
Although that would append content+new to content
Is there a way to only append new content from the response?
 
That includes a function that on check of the checkbox, it will scroll to the bottom immediately as well
 
ooh thanks
I'm seeing if I can make the code work with what I have
It's telling me ajax_get isn't a function: pastebin.com/60hQ5MJx
 
3:57 AM
first, things first
that won't work
 
oh I see
you have the place in get_content(), right?
 
ajax is asynchronous, so on your success function, you won't want to return replaced
you want to pass replaced off to ajax_return
 
how might I do so?
 
remove the ajax_get calls
and put your ajax call in get_content
 
just did that
function get_content(id, box, checkbox) {


                  count++;

                  //Make ajax call. and on return(complete); run it like this:
                  $.ajax({
                        type: "POST",
                        url: "php/bungeelog.php",
                        data: id + "=",
                        success: function(data) {
                            var replaced = data.replace(/\\n/g, '<br />').replace(/['"]+/g, '').replace(/§r|§e|§a|\\u001b/g, '').replace(/\\\/help\\/g, "\/help");
 
4:00 AM
close
 
ahh
 
1 message moved to Trash can
@GregBorbonus Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. For posting large code blocks, use a paste site like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
 
function get_content(id, box, checkbox) {


                  count++;

                  //Make ajax call. and on return(complete); run it like this:
                  $.ajax({
                        type: "POST",
                        url: "php/bungeelog.php",
                        data: id + "=",
                        success: function(data) {
                            var replaced = data.replace(/\\n/g, '<br />').replace(/['"]+/g, '').replace(/§r|§e|§a|\\u001b/g, '').replace(/\\\/help\\/g, "\/help");
 
ugh I hate WinSCP
 
And you can remove the count stuff
 
4:03 AM
oh OK
OK, it's working, but it's appending the same 750 lines over and over
and auto-scroll isn't responding, but that's probably me
 
 
4:18 AM
OK, I settled with replacing the whole div. This site doesn't need to be very efficient
thanks for the help! It works amazingly!
I need to go to sleep now :p
 
 
1 hour later…
5:32 AM
!!> 3 ** 3
 
@phenomnomnominal "SyntaxError: expected expression, got '*'"
 
5:56 AM
poor @CapricaSix, they probably keep you in a cellar 1<3**2
!!> [false ** 2, true ** 2]
 
@FilipDupanović "SyntaxError: expected expression, got '*'"
 
user3119231
6:17 AM
o/
 
morning o/
 
o/
duplicate that shouldn't have been reopened in the first place: meta.stackoverflow.com/questions/283456/…
^_^
 
 
1 hour later…
7:45 AM
lol
 
9 messages moved to JS trash
 
user3119231
hell
 
9:13 AM
morning guys
quick question. is clojurescript a replacement for javascript?
 
No, clojure to JS compiler.
 
so can a person using clojurescript do everything a person in js can?
 
Clojure is more of a functional programming language, so you'll need to do things the FP way.
 
@littlepootis is fp way the better way? as compared to oop
 
@Ming Theoretically, yes.
@Ming It's not strictly better, it's different.
Some people like it more, some people like oo more.
Honestly, I'd make sure to know JavaScript really well before jumping onto languages that compile to JavaScript.
 
9:19 AM
^
 
@MadaraUchiha i see. have you tried clojurescript before though? just wondering whats the learning curve.
 
@Ming I haven't.
It's on my list
 
but my thought are if clojurescript is really just clojure being compiled to js, then wouldnt someone with zero knowlege on js but proficient in js be able to build js apps? since they can write good clojure code.
proficient in clojure i mean
 
@Ming That's theoretically true
But I can almost guarantee that clojurescript has a higher learning curve than JavaScript does.
 
did you mean clojure has a higher learning curve than javascript? since I'm assuming clojurescript is really just a transpiler to javscript
@MadaraUchiha
 
9:25 AM
@Ming Yes, apologies
 
no worries. I am still quite new to clojurescript. dont fully understand it too.
but how does one incorporate js libraries into clojurescript? i cant imagine how that would work out @MadaraUchiha
 
You don't need to
 
I never seen anything as weird as this while programming :|
Where is "i" getting "last" value from
in first iteration i is "0" as expected
 
> i = "last"
It's like.. right next to the {.
 
but in second iteration (don't know why... as there is only 1 object in array) i gets value "last"
 
9:30 AM
@littlepootis why not. because wouldnt I need the functionalities of the js libraries i wish to interact with.
 
@Ming your compiled code will be able to make use of them.
 
@littlepootis is this for me ?
 
@Mathematics Yes, carefully read line 1164.
 
@littlepootis :| ,...
that's chrome developer's tool, showing the current value of i
 
Yes, the i was set to "last". So, it shew "last".
 
9:33 AM
set where ?
 
line 1164, after the opening curly brace..
 
@littlepootis did you read this ?
1 min ago, by Mathematics
that's chrome developer's tool, showing the current value of i
 
Oh.. you might want to check if it hasOwnProperty..
 
true, thanks
 
9:51 AM
it works but why is it inheriting a property that it shouldn't
and not displaying it in chrome dev tools
 
what is the size (aprox.) of the headers in a response?
 
@Neoares huh ?
 
@Mathematics http headers
 
that's the most broadest question I ever read
you can try fiddler to find that out
 
why? I think it's very specific
 
9:56 AM
there are billions of types of messages with different headers having different options
 
hm... yes I guess I could use a sniffer
maybe Charles? I've got a license on that one
 
@Mathematics If this.expandList is an array then do not use for...in loop, there are better alternatives for iterating over array
 
@Zhegan true
I found the issue
non of this is my personal code
 
10:15 AM
Folks, where on SE would I ask a question about scrum processes?
 
@Mathematics in walks the proto chain.. don't use for arrays.. better don't extend the built in objects like that.. but if you have to anyway then.. jsfiddle.net/81ds7157/1
 
@cswl thanks, that makes sense
 
ah, thanks @Mathematics
wait scrum has no project managers
 
Guys, has this strange bug been posted before ? reddit.com/r/javascript/comments/4oxtgk/…
6
 
10:34 AM
@DenysSéguret It's new to me
 
10:48 AM
@StephanMuller it is about project management... not about project managers
@StephanMuller scrum is a project management strategy or method
 
the typeof null optimization bug also happens in the last node, even if it's fixed (or supposed to be) in Chromium as per the bug report
 
Since functions like console.log or window.print require a specific context to run, why don't they bind to it instead of complaining if you call them the wrong way?
 
Bad implementation ?
 
Might be so that they know what to print / where to log?
 
I know I sometimes refactor some "static" module functions to not need their context anymore (I mean I replace the this with the module), so that the function can be passed more easily
 
10:57 AM
do you know a better site to find bootstrap components like buttons,navigation,.etc. bootstrap site has only 4,5 examples
 
Make your own
 
With this resolution, Fast Snail's icon looks like a snail in a plate, between a fork and knife
(obviously I'm French)
 
hahaha
 
Either I'm stupid, or it's super hard to convert a svg drawing to a fontello icon. Or both.
 
@DenysSéguret go through Illustrator
 
11:03 AM
@bitten I'm not rich enough. Or smart enough. Anyway, I tried with Inkscape.
 
What happens if you drag your SVG file into the element labeled "drag your SVG files here"?
 
@JanDvorak I see something which looks exactly unlike my drawing. Which means I did something wrong obviously.
 
Maybe it's very specific about what should be inside the SVG file?
 
I dunno. I've read this doc but it looks like I failed to apply it properly.
 
what happens if you open your svg file in your browser?
 
11:11 AM
Can you pastie the svg file?
 
@DenysSéguret Nope totes new
 
@JanDvorak here: https://gist.github.com/Canop/91d333ea10bc6fdbe5253b65ea2d9f0f
(it's just a test, I'll release all my creative forces once I know how to go til the font)
 
Does it help if you remove the fill and stroke attributes entirely?
 
@JanDvorak doesn't seem to help
 
What is the result?
 
11:20 AM
 
Looks like it discards the stroke and uses a black fill
 
someone is having a stroke?
greetings, programs!
 
@thedigitalmouse no, but I'd like
 
hey now, keep it clean... i didn't mean that kind of stroke :P
reads title... wait.. is that for real? o.O
(scours the googles)
bah i keep getting 'East Coast Music Awards' responses in my search :(
(refines his googles)
 
@DenysSéguret did you create the source of the svg?
 
11:26 AM
The source of the svg ? I made it in Inkscape
 
@JanDvorak yeah, fontello is ignoring the stroke width and filling the path
 
Oh, I think I understand now
 
I guess you'll have to trace the stroke outline
 
@DenysSéguret okay let me look through inkscape a bit
 
yeah... this will be painful
 
11:28 AM
you should be able to change the export settings so it exports it differently
seems that Inkscape is going for the optimal export, i.e. less bytes
 
I'm interested but I don't see any export options (or even an "export" menu)
 
*Main> deriv . exp $ exp x
(e^e^x*(e^x*1.0))
I'm brilliant
 
@DenysSéguret oh okay.. i'm looking for a "convert shapes to paths" kind of thing
 
I think I'll try drawing it directly as an outline
 
okay, good luck
 
11:33 AM
Am I right that jQuery lacks a selector function "first sibling of the context after the context that matches a given selector"?
As in, a better and faster version of .prevAll(selector).last()
 
Yes
TBH I think I only get this problem while answering questions. Doesn't happen so frequentely with my HTML
 
@JanDvorak i wish there was a parent css selector
@DenysSéguret if you're really struggling, download a trial of illustrator
i can help from there :3
 
I'm dealing with old-style HTML - the kind of thing where you type in content by hand.
 
@JanDvorak wow, can't remember the last time i typed with my hands
c:
 
@bitten t'was before your accident, when you still had your arms ?
 
11:39 AM
@DenysSéguret heh
 
So, how do you type now?
 
@JanDvorak ..you'll never know
haha
great music, and great theme
 
@bitten the first one is annoying
 
the song?
 
_manifesto
 
11:53 AM
oo i've never listened that one actually
 
DON'T DO IT
 
haha
okay
what is it?
i'm actually going backwards from 40
 
it's creepy
 
i recognised more artists / bands on that end so thought it might introduce me to some similar ones
 
How does one normally convince the browser to clear any fixed headers when scrolling to an element? By overriding hashchange?
 
11:55 AM
use the scroll event
and compute the distance of your element
with element.offsetTop
 
Why the scroll event?
 
@Neoares okay well i have to listen now..
 
because you need to compute the distances every time the user scrolls
I have worked on a similar problem
 
@bitten @JanDvorak You made me understand the problem, it's "ok" now (I just have to suck less at drawing)
 
@DenysSéguret i think you're being too hard on yourself, svg's are a real pain to work with
well they aren't, but it just seems each piece of software wants the svg in a certain way
 
11:59 AM
canvas is also a real paint to work with
 
I don't. I want the user to scroll as he wishes, I just want to hijack the scrolling that happens on hash change and on initial load. Ideally, I'd also hijack scrollToView, but I can do without.
 
geddit?
 
@Mosho giggity
pigments are a real paint to work with, too
 
stappit plox
 
@JanDvorak you don't want to detect when an element is on the viewable zone?
 
12:00 PM
@Neoares I only care which elements are in the view when a certain button is pressed
 
oh you can do it actually with this
	function isVisible(){
		return st+sh > pt+ph/2 && st < pt+ph/2;
	}
let me show you the variables
 
That's not the issue.
 
sh = window.innerHeight;
pt = element.offsetTop;
ph = //height of your element
st = window.scrollY;
then I don't understand your issue. I thought you wanted to know if an element is in the view or not
 
I want to tell the browser how to scroll to a specific element.
 
oh ok
then you may use a plugin?
I guess there is a lot of libraries that do that
 
12:04 PM
which happens 1) on page load, 2) when a hash link is clicked, 3) when I change the hash from javascript
My idea is to override hashChange -> animate scrollTop with jQuery
 
@JanDvorak so scrollTo?
@bitten CSS is too slow anyway.
 
12:26 PM
*Main> deriv . cos . asin $ x
((0.0-sin asin x)*((1.0/((1.0-(x^2.0))^0.5))*1.0))
It may not be very good, but at least it's correct
 
12:37 PM
morning everyone
 
is there a way to update a react class outside of react?
i'm only finding information about updating the state -within- the class
 
Are you using redux?
 
nope
 
Unfortunately I have no idea then :\
 
@BenjaminGruenbaum I used jQuery#animate({scrollTop, but that still doesn't prevent the browser from scrolling there. My next idea is to override the hash links with a click event and, if I'm nice, pushState.
 
12:52 PM
@corvid should i be?
ReactDOM.render( <App stats={stat}, .. )
 
if you want to, I recommend it personally. Does it fit your application?
 
i am not sure
it's a UI for a game
the stat object comes from my game model, and i just want to update the game model and let react do it's thing
i was recommended redux before actually, although i'm just still studying react atm
 
Oh yeah if it's a game I would heavily recommend redux because it can maintain a global state in a very manageable way, but also reveal a small subsection of the API to any individual component
 
Is "jQueryable" a good name for "jQuery or element or selector"?
 
not in my opinion
sounds more like "is this thing accessible via jQuery?"
 
12:57 PM
I mean, any arg that works in jQuery(arg)
 
$() could apply to half a dozen libraries that use $, so being "JQueryable" might not apply (granted it will likely be, but still...)
might as well say it is "libraryable" :D
 
fixed >:-(
Why can't you preventDefault hashchange? :-(
 

« first day (2074 days earlier)      last day (2860 days later) »