« first day (1560 days earlier)      last day (3388 days later) » 

user3949359
12:00 PM
How do I make a number increment fast on a webpage with javascript? Is there such a plugin (not using WordPress).
 
the fastest i know is: number++
or number=number+1 @nosille
 
user3949359
@CSᵠ Would you like too see what I want on a page?
 
of course
please show me
 
user3949359
@CSᵠ triathlonresearch.org. Go to the footer
 
user3949359
incrementing it in a primitive way won 't do the job
 
12:03 PM
then, this is a problem with your formulation :)
so, what do you want to do actiually?
faster than you already have? till 20k ?
 
just skip some numbers
 
@nosille
 
user3949359
did you visit that page's footer?
 
user3949359
this thing is a WP widget
 
user3949359
and I can't use it
 
12:04 PM
why not?
 
user3949359
I'll have to come up with a different incrementer, or a solution of my own
 
okay.
 
where's the code?
 
user3949359
@Vader I'm migrating the site away from WP actually
 
i want to see the code for that
 
user4202350
12:05 PM
Atleast tell what i should place in Path?
<script src="PATH_TO_FILE/alertify.min.js">
somebody help me with this
 
user3949359
@CSᵠ The widget is called "Milestone"
 
user3949359
I don't have the code
 
well you can say you want it to reach n in a certain number of seconds, base don that adjust the increments.
 
@nosille ohh, that's not good :(
 
user4202350
PATH_TO_FILE
 
user3949359
 
user3949359
 
@ShaU you're making no sense, mind rephrasing?
 
user4202350
@CSᵠ I am trying to iplment this in --> fabien-d.github.io/alertify.js in my simple JSP page
 
user4202350
For custom alert
 
user4202350
but Nobody help me
 
12:08 PM
@ShaU JSP is deprecated
 
@tereško the book is neat :-)
 
oO
which book, who are you and how do you know me ?
 
user4202350
@Unihedro Ok in HTML?
 
@nosille find the relevant JS code and come back here
you can't just send people in wild goose chases
 
user3949359
@CSᵠ I really can't. In WP you can't access much of the code
 
12:10 PM
g'day
 
user4202350
@CSᵠ can you.........
 
user4202350
@BartekBanachewicz can you...........
 
user4202350
@Unihedro can you...........
 
16 mins ago, by Unihedro
@ShaU no
 
@ShaU what does it mean?
 
12:12 PM
@ShaU Essentially being a programmers means that you can help yourself.
 
Exactly @RoelvanUden
 
@RoelvanUden What makes you feel they're a programmer? :p
 
user4202350
@Unihedro Ouch.
 
I think @ShaU has to be learnt lot of things
being a programmer
 
user4202350
@shankar.parsanamoni I am no having experince in javascript.
 
user4202350
12:14 PM
i am good java
 
Sorry, that does not compute. If you are good in one language, you at least have the reasoning to interpret, understand and debug another. Your problem isn't specifically JS, either, it's basic HTML.
2
 
But ,we dont know how much java knowledge u have
 
user4202350
Sometime i think Why people dont help each other.
 
@ShaU Sometimes I wonder how you expect people to help you on a trivial problem which can be googled.
 
We help each other when a single google search doesn't give the answer ;-)
2
 
12:17 PM
well a lot of the problems you are having have already been solved. You just have to google it :D. No harm, no foul
 
@ShaU I think you are just passing office day time in javascript chat room
 
@Unihedro bartek overload
 
@BartekBanachewicz yes :P
 
I didn't know it works via IP :/
that other guy was playing really nice
you know what would be nice
if you could upload a midi file and render it for everybody to see
or lilypond
or image at least
 
@BartekBanachewicz You don't have to convince me native sort is bad.
@ShaU people like helping those that help themselves. If someone comes here with an actual challenge you can bet your ass we'll be all over his problem like a band of wolves. When we see questions that tutorials and simple books cover we usually just go "meh".
@BartekBanachewicz also, you don't have to convince me JS contains a lot of crap :D You've said that multiple times and I've always agreed with you
 
12:29 PM
How to check if a string variable matches the syntax like that of a number in the shortest way possible?
 
@FlorianMargaine damnit
 
@Unihedro regex
\d+
 
/-?\d+/.test(foo)?
 
ok, how can i debug code from inside a (worker)? console.log() or alert() even are of no help... //example play.elevatorsaga.com
 
wait, and exponents and decimal places...
 
12:30 PM
@Unihedro !isNaN(foo)
 
@BenjaminGruenbaum Thanks!
 
does anyone here use webstorm?
 
@BartekBanachewicz that won't work for a lot of numbers but that might work
 
@Unihedro Number()
 
@CSᵠ Yeah, you get a number. But does null == Number() work?
 
12:32 PM
hmm... Number(x).toString() === x.toString() //cc @BenjaminGruenbaum ?
 
@CSᵠ what's wrong with isNaN(x)?
 
what numbers won't that work for?
 
@BenjaminGruenbaum Isn't there something like a linter that throws a tantrum when you use decrepated/replaced methods? It would do many a world of good to be forced into better practices (including me).
 
not sure, but checking if my longer version makes sense...
 
@CSᵠ Number("1e9").toString()
 
12:34 PM
Enjoying Bartek's music
 
1e9 is a valid numeric string.
 
^
 
yup
 
@RoelvanUden jslint does not allow a lot of things. In general you can have a style check in place.
 
@CSᵠ so.. can i get a console log, possible? options?
 
12:36 PM
I do have a very strict JSHint and JSCS but it doesn't attempt me to use, say, .forEach instead of for...in (just as a terrible example).
 
@Unihedro almar's currently sitting with his hands crossed, playing left hand with his mouse. What've you done! :D
@Unihedro we're all bartek's
 
:D
 
@RoelvanUden there are cases a for... in is better than a forEach
 
I'd just create a range and stick to only using while for not iterating a sequence for... of for anything that's a sequnce and for(i = 0; i < n ; i++) for performance spots
Then again I rarely find myself using loops in the first place in code that's not performance sensitive, I've come to find them a lot less intuitive. I mostly use them when I realise my code is too smart and convoluted and not accessible enough to new maintainers.
2
 
12:41 PM
Yeah, and that's sad since loops are more convoluted and require you to be smarter :-)
 
@BenjaminGruenbaum do you count forEach as loops ?
 
for is a last-resort solution
when you have no other way to solve the problem
 
@BartekBanachewicz I'm not sure I agree - I just think I got to a point where I don't think writing a for would express the problem very well but I still realise in the back of my head that it'd probably be more readable so I force myself to use it .
 
@BenjaminGruenbaum Wait, explain that for me if you don't mind. If you have an array and want to do things with each item, you need to loop, right? Am I reading correctly that you just don't use loop for this..?
 
12:45 PM
@RoelvanUden what things with each item
 
@RoelvanUden what do you want to do to each item? If you want to apply a function to each element that's map
 
"doing things with items" is programming basically
 
Oh you don't count map as a loop then ?
 
Hmm, the parallel from your world is using LINQ instead of loops for processing collections.
 
Ah, right, but even .map is essentially something that loops in my book. It's a weird book, I know. I get it, you just don't want looping logic but you don't mind using queries to create new data from something.
 
12:47 PM
@dystroy no, I don't. It's implemented as a loop but I'm not specifying how the collections is traversed nor am I changing it. It also doesn't have to conceptually do anything until I access an item.
@RoelvanUden would you say a LINQ Select is a loop?
See, I and you both realise I put you in a tight spot since a JS map and a LINQ Select are different in Select being lazy - but bear with me - conceptually they are the same.
I just want to map things, I don't care if it happens in a loop, happens in a RDBMS, happens in an XML document or a NoSQL database.
 
@BenjaminGruenbaum 2.9
 
Conceptually what I'm doing is mapping items - the loop is the implementation detail not vice versa.
Usually at this point I realise I'm being an ass and that loops are more natural to people than maps and refactor code to look less like function transformations and more like small state machines working together. Conceptually though I think I'm right.
 
map could be implemented as a huge if-statement.
 
@BenjaminGruenbaum Essentially, yes. I know it's a lazy evaluation in C# (yay for yield) and not-so in JS (at least, not yet), but at least I get how you think about loops then. You're doing more immutability and functional programming-like constructs instead of 'traditional' looping and mutating states.
 
Although I use LINQ very liberally - I'd usually prefer a C# foreach loop to a .Aggregate at work code.
 
12:51 PM
(Which is elegant most of the time :-D)
 
The thing is readability is more important than elegance. Sucks but it's true
 
depends on which team you're working with
 
Because Aggregate is unreadable, so yeah, I'd imagine you'd make a IEnumerable<T> method that yields in a foreach.
 
Problem here is that it's only words. We could very well write the exact same code and took very different positions in that debate...
 
I thought mapping was now known enough to use it when needed.
 
12:53 PM
@dievardump no. Many coworkers I've worked with didn't know how .map worked, and actually struggled to understand it
 
Oh ok
 
struggled ?
 
user4202350
tsill stuggling
 
stuggling is different, even I like to stuggle
 
user4202350
can you help
 
12:54 PM
I don't now, I was using array_map in PHP since long enough to have no problems with the JavaScript one.
 
user4202350
fabien-d.github.io/alertify.js I want use this alert in my simple JSP or HTML
 
@ShaU did you read the "The end of maintenance..." ? That's just some cheap JS and CSS, learn CSS and you're done
 
@RoelvanUden looping logic is just an implementation detail
 
user4202350
@dystroy Please i want to use alertify.alert("Message"); in my html
 
@ShaU for gods sake how many times are you going to repeat that
if we help you with that you'll come back 5 minutes later with another problem
get rid of this library, buy a decent book on web development and read it
 
user4202350
12:59 PM
@BartekBanachewicz No... Only one time
 
it's not only one time
 
user4202350
I assure you
 
Your assurements aren't worth much
 
@ShaU you were told several times that your questions without research are not welcome in this room. Please read a tutorial.
 
yesterday, by ShaU
@BenjaminGruenbaum Hi Benjamin. How are you. You are Good Person.
 
user4202350
1:00 PM
@BenjaminGruenbaum Hi Benjamin , I tried , i googled it. but still i am not able to generate it
 
it doesn't happen over the course of hours
put some actual work in it
come back in two weeks.
 
@ShaU Don't care. We are not interested in these questions - please don't make us be rude to you - we don't want to but we will.
 
user4202350
But why?
 
user4202350
Why Nobody help me
 
Because it's difficult to help you
Communication barriers, etc
 
user4202350
1:02 PM
Hi BoltClock
 
Bye
 
user4202350
Please understand
 
@ShaU we're helping you, but not in the way you think you need help
 
@ShaU because we believe, regardless of it being true or not - that you have not made enough effort.
 
@ShaU Please bear in mind that this room is not a help-desk, nor a paid-for service. We're just a bunch of people chatting.
 
1:02 PM
@ShaU I hope you will understand that we have limits too
Everyone does
 
I'm not helping @ShaU - I just want him to contribute constructively or leave. This is not the JS help room or the JS newbie help room. It's the JS room. We like interesting questions and discussion.
 
and nobody wants to help you shot yourself in the foot, like using a deprecated library that can be replaced by some simple JS and CSS
 
@ShaU If you approached a group of people in the street and spoke to them like this, how do imagine the outcome?
 
Nobody help you because you don't event help yourself.
In my head that was more profond. Now that I read it that's shit.
 
user4202350
Oh my god.
 
user4202350
1:04 PM
Every one is after me!
 
user4202350
Ok Better i take leave today.
 
You're too cute, that's why!
 
You better.
 
user4202350
Am i ?
 
user4202350
Ok Bye Guys.
 
1:05 PM
No, I am
 
user4202350
But if someone get some time , then please have a look at it.
 
user4202350
See ya
 
-1
Q: How to use Browser object model to make your website ?

Axphey I m having issues in understanding browser object model and i have no clue how to use it on my desirable working of it.

 
1:21 PM
wow, window.console.log() for that extra mile
 
@dystroy I am seriously wondering if it's a fault of education system in India.
It's like they are taught every other page of the books
 
window.window.window.console.log
 
It might also be that there was a sudden very big demand for programmers in India, more demand that what could be formed at that time. But how do you know he's Indian ? Because of the "i" ?
@BenjaminGruenbaum to be sure ?
 
@dystroy because just doing console.log is obvious.
 
Oh, I had missed CS's comment
Makes me think of this : http://stackoverflow.com/questions/26847070/why-do-we-prepend-global-variables-with-window
I'm not even sure I agree with myself on the recommendation (the "it's cleaner")...
 
1:29 PM
@dystroy also in JavaScript getting properties doesn't throw exceptions.
 
@BenjaminGruenbaum not always true but why do you say that ?
 
Yeah, I didn't mean in edge cases.
 
@dystroy profile pic? Dark hair and the skin tone more or less points at that area.
 
 window.Promise // an undefined means no one defined it yet.
 Promise // throws an exception on access
 typeof "Promise" !== undefined // long and annoying to type.
Meh, you know what I mean :P
 
Sure, might be Polynesian. Or wherever.
 
1:32 PM
@BartekBanachewicz Ok, I now see what you mean. In my book this would weight for using the unprefixed version, as I prefer my code to fail fast in a not subtle way.
 
@SomeGuy if you do it please troll the teacher :3, and in case you need key press on turbo c without blocking there are two things if(kbhit()){ key = getch() } and something inportb (the former is simpler, the latter is the cool grandpa's method)
 
@BenjaminGruenbaum BTW, why not "Promise" in window ? Still annoying but feels more logical than the typeof oddity
 
@dystroy I wouldn't use either to be fair :P "Promise" in window also works.
 
@darkyen00 Haha cool, thanks
@Zirak I've had that left open for like a week. I think I'll read it tomorrow :P
 
iirc i did post a working pong and snake game in this chat on turbo c
 
1:43 PM
semantically speaking, when writing ES6, is there ever a reason to not use a class, and just put methods as properties in an object, if it suits my needs? I know it works, I'm curious, though, if it would break some kind of a design pattern
 
@darkyen00 also a screenshot with a porn tab
@NickDugger w/e floats your boat
 
@FlorianMargaine also your bachelors party pics :P
 
why are you reminding us to unfriend you on facebook?
 
I am not on facebook :P, its been almost 4 months like so
 
Are Microsofts "augmented reality" goggles really "holograms"? Do they fit into the definition of a hologram?
 
1:47 PM
Yes, they do.
 
holograms are typically the 3d laser images
but dunno what's the definition
 
> as from a laser: when it is placed in a beam of coherent light a true three-dimensional image of the subject is formed.
I dunno
I don't think they can call it a hologram
 
@NickDugger it's a style choice. I like classes since they're just sugar for prototypes.
 
It doesn't project anything, it just uses the goggles as a screen for augmented reality
 
Hologram reminds me of this
 
1:50 PM
@BenjaminGruenbaum what if I was building a 'library' of sorts, and all of the modules were classes, but when I want to finally put them into a global variable to access them from, I just do window.foo = { a: class Something... etc.?
 
> Holography is a technique which enables three-dimensional images (holograms) to be made. It involves the use of a laser, interference, diffraction, light intensity recording and suitable illumination of the recording. The image changes as the position and orientation of the viewing system changes in exactly the same way as if the object were still present, thus making the image appear three-dimensional.
 
@NickDugger why do that? Export them from a module and require that
 
@RoelvanUden apparently, no.
 
No globals please :D
 
Not even one global?
lol
Every library ever has a global...
Well, that's obviously an exaggeration
 
1:52 PM
just use exports
then some code wanting to use your library will just use import
 
But it can't, unless they use something like 6to5. I'm writing ES6 code for use in ES5 projects? lol, it's weird
 
@BartekBanachewicz That sounds exactly like what HoloLens is doing.
 
@NickDugger you can determine whether there's some kind of module loader by checking to see if define or require is defined.
If there is none, export do a global variable under a namespace.
 
what's define?
 
@NickDugger RequireJS's AMD style modules
 
1:57 PM
Ah, I've never seen them; only commonjs or whatever it is
 
You could also write it using ES6 modules, and then distribute the code after 6to5 compilation of the various module loaders
 
@ircmaxell hmm
 
Right now my pipeline is: I write ES6 code, gulp then 6to5s it, and then browserifys them all into a single file
 
@NickDugger Sounds good to me
Where does this break down?
 
1:59 PM
what do you mean?
 

« first day (1560 days earlier)      last day (3388 days later) »