« first day (1822 days earlier)      last day (3144 days later) » 

7:08 AM
I think this is my first rainbow supposed to rapresent, ya'know, a rainbow codepen.io/towc/pen/zvdNLj
 
how do ya get the logic to write this animations, mainly creating the particles and lines
 
@argentum47 it's not even physics
pretty sure that the code is clean enough for you to go through it (start from the anim function on the bototm), I have to go to school ;)
 
as long as you know how to canvas you won't have any probs, otherwise use mdn for stuff after "ctx."
 
7:23 AM
ok, still have 30 mins before going to school actually :P
@argentum47 so, focus on the particles: they only need 4 properties: the color that they have, the radius from the center, the current radian and the angular velocity, right?
the color will depend from the radius, and the formula is very simple
first of all I define a value depth that goes from 0 to 80, right?
I want to get a rainbow spectrum from that, so to get the hue I first do depth / 80 to get a value from 0 to 1, and then I multiply by 360 to get a value between 0 and 360, which is as far as hues go
now, to get the radius I just add depth to a value which rapresents the radius of the lowest particle, right? len = s / 3 + depth in my case
 
i know that using multiple canvases for "double-buffering" exists, but has anyone thought of using multiple canvases like layers?
 
@Neil it's done all the time ;)
 
is it efficient?
 
@argentum47 now, the radiant always starts at -PI, because that's the opposite of 0 in radians, and in the .step() I increment the radiant by the velocity, which is a small value that goes from .01 to (.01+.02), do you see what's going on?
 
ok
hm.. I see
 
7:29 AM
@Neil not much, I'd usually reccomend to keep multiple in memory canvases for the layers, and then paint them onto a single on screen canvas
but if you don't need it to be excellent, just stack the canvases ;)
@argentum47 then what I do is simply call ctx.arc starting from the radiant of the particle, and going to the updated radiant. This is all I do to obtain the circle
then if the radiant is over 0, I just reset the particle and it cycles again
everything clear for now?
 
could be advantageous
then, what can't be solved by painting in the proper order afterall?
would be advantageous in the design sense.. separation of concerns
or maybe you'd want to potentially adjust the positioning
 
one of the things that you can't yet do when you're painting everything on a single canvas is applying different css filters to it
it has happened to me that I wanted to css filter in different ways various layers
as of now in most browsers you can only do it using multiple canvases, but that's pretty much your only limitation
the only downside
!!mdn canvas filter
 
yes
 
@argentum47 for the clouds, I bet you can figure out how they work: I literally just give them an (x,y) position, then a radius, and using this formula I make them smoothly animate their radii
cos( x * pi * 2 - pi ) / 2 + .5
look at what x rapresents: it's always a value between 0 and 1, because tick varies from 0 to maxTick, and x = tick / maxTIck
this way you get a smooth curve going from 0 to 1 and back to 0 if you input a value from 0 to 1
if you don't know much trig, don't worry about it, just look at the graph for cos(x) and know that I'm just manipulating it to fit my needs
and that's the whole pen ;)
 
7:45 AM
the lines were interesting..
var k = [];
for(var i = 0, len = Math.round(text.length / 10), j = 0; i < len; i++, j=10+j) {
  console.log(j)
  k.push(text.slice(j, j + 10))
}
the code can be simplefied ? I am trying .. "long string".in_groups_of(10)
 
8:15 AM
const originalFn = Symbol('original unbound fn');
const protoBind = Function.prototype.bind;
Function.prototype.bind = function(...args) {
	const bound = protoBind.apply(this, args);
	bound[originalFn] = this;
	return bound;
};
this really simplified a lot of things :D
 
8:28 AM
0
A: I wana display just 10 rows per page.But i don't know how?

NimmyHere is the Paginate Directive created by Michael Bromley for pagination. Here is Github & Plunker

That piece of junk got accepted...
3 links, and some text formatted as code to circumvent the fiddle requires code block...
Oh, and the answered explicitly asked the OP to accept his answer.
 
Guys any idea about how to get Multicolor Stroke in RaphaelJS or SVG?
 
@Cerbrus Shame it's accepted, NAA flag won't stick now
I'd flag NAA if it wasn't accepted but when it is it'll just get declined
 
It is an asnwer
Flag as VLQ instead
 
I get NAA flags marked helpful on link-only answers all the time, but yeah, VLQ maybe
And it's not an answer, it's a link :p
Someone want to finish this off? One vote needed. Old opinion based Q from 2009 that someone decided it was a good idea to reopen
it's about as relevant as the spanish flu
 
8:39 AM
Cheers, spotted it in the re-open queue earlier but couldn't stop it. I've no idea why people feel the need to reopen those kind of questions
 
crl
9:09 AM
@ShivKumarGanesh multicolor stroke? like how?
like a stroke which would gradually change color?
 
crl
9:29 AM
!!is someone?
 
@crl No way
 
crl
!!do you grammar?
 
@crl Impossible
 
!!wat
 
crl
9:30 AM

wat

Oct 15 '14 at 18:05, 10 minutes total – 45 messages, 8 users, 1 star

Bookmarked Oct 15 '14 at 18:16 by rlemon

 
!!wat4
 
9:51 AM
Oh my.. we've got 29000 log entries from the same client because logging is failing and someone forgot to build in a failsafe to prevent an infite loop when the client then tries to log the error it got while trying to log an error
I hope that user isn't on a limited dataplan...
 
Hahaha
An error in logging writes to the log?
 
disclaimer: it might be more than one user, it's hard to follow this log in realtime
but still..
 
count your stars it's only 29k entries then
I've seen sql server literally eat up every bit of free space on the hard disk causing another problem to occur with our software
 
only 3 active users on the site now according to GA, the rest must have had their browsers crash
I think if that server dies it will be for the best so I hope it's low on HD
 
300GB of free disk space occupied mostly by sql server database file
 
10:25 AM
In Babel is super called implicitly on a class that extends something but doesn't have a constructor?
 
@Neil cute
 
@phenomnomnominal Apparently; babeljs.io/repl/…{%0A%20%20constructor%28%29%20{%0A%20%20%20%20console.log%28%2‌​7B%20called%27%29%3B%0A%20%20}%0A}%0Aclass%20A%20extends%20B%20{%0A}%0Anew%20A%28‌​%29%3B
 
Yeah looks like it.
 
Yeah, they added that not too long ago
My first experience with react-router was spending half an hour trying to figure out why their bundled examples was failing and it was because of that
 
I'm trying to find where it is in the spec
I'm a muppet
bah
not that link
 
10:37 AM
Linking to babeljs code isn't easy :o
 
> If constructor is empty, then let constructor be the result of parsing the source text constructor(... args){ super (...args);}
 
10:59 AM
I store some JS objects in an tmp array, what is the most optimal way to check if some object already is inside of that array?
It looks like this
Array [ Object, Object, Object ]
And when I do array.push(Object) I need to check if it is already inside...
Thanks
 
@DušanRadojević use a Set()
Check browser compatibility first
 
thanks
I always can use something like in this 1st answer: stackoverflow.com/questions/4587061/…
but it just does not feel very good in terms of speed
 
alternatively, use an object where each property is some unique string assosciated with the Object. If an object exists at that key, don't add it to the array.
 
@DušanRadojević arr.indexOf(obj)?
That will only work for the exact same object
Not an object with the same properties
!!> var a = {}, b = []; b.push(a); b.indexOf(a) > -1;
 
@MadaraUchiha true
 
11:04 AM
@DušanRadojević ^
 
Thanks @MadaraUchiha :)
 
@DušanRadojević Seriously though, use a Set.
 
What TLD do you generally use for locally hosted internal projects? .dev?
 
@AwalGarg depends
 
on?
 
11:08 AM
we have project.us.local for things that are actual things being used
dev.us.co.nz for dev
test1-6a-f.us.co.nz for test environments
 
@AwalGarg locally hosted?
 
stage.us.co.nz for staging
 
@MadaraUchiha not listening to outside connections
 
we also have "production" enviornments that can only be reached on local networks
 
@AwalGarg I usually just differentiate them by port number.
 
11:10 AM
@phenomnomnominal any specific reasoning for .co.nz?
 
@AwalGarg we're a new zealand website?
 
@MadaraUchiha don't get bored of the cryptic numbers? ;-)
@phenomnomnominal ah
 
@AwalGarg vOv
 
crl
11:21 AM
.us.co.nz sounds like .usa.colombia.new-zealand
 
us conz
the prisoner rap group
 
well, it's not actually .us
 
crl
it's .them?
 
yep
@BenjaminGruenbaum any reason Promise.map() doesn't just resolve if it's given undefined? (in bluebird of course)
 
11:37 AM
0
Q: different actions for a button in javascript

tony Starki want to configure two different actions on a button depending on the click. For the first time click , i want to call a function F1() and on all other time i want call another function F2(). I am new to javascript, and i am looking for a variable that can store the value like a flag. I trie...

Why do questions like that always attract shit answers
And apparent random downvotes on a answer that tells the OP to use a boolean instead of a integer to determine wether or not a button has been clicked.
 
@Cerbrus It has the jQuery tag. It attracts shit answers and people :3
 
People that don't know native JS
:D
Did you see the while answer?
 
@Cerbrus Yes
 
No. It sounds amusing. Care to share?
 
Heh, you can safely doenvote every new answer that appears there, before reading them and coming to the conclusion they should be downvoted.
 
11:43 AM
 
Original revision:
while(fflag==1||fflag++){
    F1();         //do 1st action action
}
 
@MadaraUchiha what's that screen resolution?
 
@AwalGarg 1080p
 
crl
x5000p?
 
Oh, 2 more delete votes on this please: stackoverflow.com/a/33075337/1835379
Or vlq flags
 
11:50 AM
@Cerbrus 1
 
flagged as VLQ
 
Hi good morning
 
Deleted. Thanks guys
 
@Cerbrus howee chlist
 
Gret codez
fery stronk
6 rep user just accepted my answer on there. Victory! :D
 
crl
11:54 AM
very lousy/lame question?
 
Kinda basic, but people gotta start somewhere
Punctuation aside, it's decently written
 
user5020521
hi guys if in php I delete a row and count it by rowCount function how can I pass that function into a async js ?
 
@Riccardo990 That question made no sense whatsoever.
 
user5020521
why made no sense @RoelvanUden
 
crl
grammar!
 
user5020521
11:58 AM
wha do you mean?
 
user5020521
grammar what
 
crl
@Cap we should hve a typo/grammar checker
 
@Riccardo990 "Why did that make no sense ..." is the correct form.
 
is bluebird still the best browser promise polyfill?
 
crl
"Why didn't that make sense" or other ways..
 
user5020521
11:59 AM
@RoelvanUden I know what it the proper form
 
This must be intentional.
 
crl
*it's
 
user5020521
damn keybodard
 
user5020521
and I'm not at school so please stop acting as teachers
 
user5020521
it's useless for me and for you
 
crl
12:01 PM
let's ignore this person
 
user5020521
may I at least show you the problem I'm currently dealing with?
 
Not being at school is not a valid reason to prevent any further progression of your intellect. You should have chosen a different profession if your goal was to get through life without learning anything.
 
user5020521
is this proper enough for you?
 
Back to the problem at hand, passing a function from PHP to JS makes no sense.
 
user5020521
and what I did ask you was the lack of sense
 
user5020521
12:03 PM
matter of fact I''ve asked you why does that make no sense?
 
@Riccardo990 PHP runs before the browser even begins to think about reading your JavaScript
Functions run in PHP time are invoked, run, and complete long before any JavaScript is being run.
Therefore, transferring a function from PHP to JavaScript doesn't make sense.
 
Besides all of the above, they run in completely different environments and usually, even on different machines.
 
user5020521
and what if I had an ajax which calls the php when needed
 
Also, @Riccardo990 please remember that everyone here are here on their free time, and are not obligated to help you, or even be nice to you.
 
#XY motherfuckers
 
12:04 PM
Then you are not "passing a function", you're making a new request.
 
In other words, php isn't aware JavaScript is a thing, and JavaScript has never heard of php.
 
If you want help, saying things like "I'm not in school right now so stop teaching me" is not a good way to go about that.
 
user5020521
just let me explain you better what is the problem
 
crl
@Cerbrus js sometimes sees some ".php" files and inversely
 
Write a question on SO and we'll nuke it when it's not up to proper standards.
^_^
 
12:06 PM
@crl let's not nitpick ;-)
 
user5020521
I have a table and for each row a delete option
 
user5020521
if you click delete you asynchronously call a php page which actually deletes the selected row and then I'd like to pass the deleted row to a callback function in order to let the user know what is the deleted record
 
@Riccardo990 Yes, okay, where is the problem?
 
user5020521
ini php there is rowCount a function which as the name says counts the row
 
So, you have something like a deleteRow.php you're calling with an AJAX call, right?
 
user5020521
12:09 PM
I would like to pass that function into the javascript callback function
 
user5020521
right
 
user5020521
may I show you the AJAX request?
 
Okay, anything that file outputs, will be returned to the AJAX's success callback
 
@Riccardo990 Please
 
user5020521
I'm attempting to build the ajax in pure javascript jQuery is not the proper way for me
 
12:10 PM
@Riccardo990 Why not?
 
user5020521
@MadaraUchiha I've already asked for permission
 
user5020521
I used may I
 
@Riccardo990 I meant "Please do"
Or "Yes, you may"
 
user5020521
@Cerbrus thank you for waisting your time for me
 
user5020521
@MadaraUchiha you too
 
12:11 PM
Yeah, okay.
 
@Riccardo990: I was trying to help you, but if you don't want my help, you can just sod off. Good luck.
 
user5020521
who the hell kicked me?
 
@Riccardo990 Me
 
user5020521
12:13 PM
I thought I was polished
 
Someone awesome.
 
You're being rude, and you were warned.
 
user5020521
I wasn't rude
 
@MadaraUchiha This.
Yes you were
 
user5020521
or better tell me where I've been rude
 
12:13 PM
We were ttrying to help
 
Ah crap lol
 
You just tell us we're wasting our time
 
user5020521
instead of telling me that I was
 
I misread your message
@Riccardo990 Sorry mate, my bad, shouldn't have kicked you
@Cerbrus He thanked us for wasting our time for him.
We both misread the same message XD
So yeah @Riccardo990 basically, anything you echo in PHP will be available in the response.
 
user5020521
so @MadaraUchiha may I show you the AJAX request?
 
12:16 PM
@Riccardo990 Sure
 
crl
this is some real chat pollution
 
@crl Is someone discussing JavaScript?
 
crl
not recently
 
then it is not pollution
 
Did you kick him again?
 
12:20 PM
Yea, I was tempted to move some of that.
Yes
 
Why? :/
 
He was being rude, unconstructive
Or a general pita
 
oooh, thar riccardo guy. ignore him already. he never contributes anything useful.
I have him on my ignore list since few months. Everytime I remove him from there, my head goes to hell.
 
@phenomnomnominal because it is not given a correct type?
It's about warning you about errors early @phenomnomnominal
 
user5020521
here I am again
 
12:22 PM
@BenjaminGruenbaum I get the concept, but an array not existing isn't necessarily an error
 
user5020521
so I send you the ajax before somebody kicks me again
 
If it gets an empty array, it resolves, so why not if it gets none
 
user5020521
function eliminaTages(indiceArray) {
	var r = confirm("Sei sicuro di voler eliminiare " + phpObject[indiceArray].nome + " " + phpObject[indiceArray].cognome);
	if (r==true) {
		cancellaRecord(indiceArray);
	}
	console.log(r);
}
function cancellaRecord(idRecord) {
    var url = "php/cancella_tages.php";
	if (window.XMLHttpRequest) {
        //code for IE7+, Firefox, Chrome, Opera, Safari
        xmlhttp=new XMLHttpRequest();
    } else { //code for IE6, IE5
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
 
@Riccardo990 thanks heaps for supporting IE5 #hero
 
Well that explains your understanding of the English language.
 
user5020521
12:24 PM
the last function that actually is a callback one should fetch the php
 
@phenomnomnominal Not the kind of heroism the city wants... or needs.
 
user5020521
I tried to warn you about the italian names used for the function
 
user5020521
but I was kicked and when I came back I forgot to tell you if you wish I might translete them and sand you again the file
 
!!tell 26232475 letitgo
 
12:27 PM
Can't hold it back anymooooore
@MadaraUchiha ^ So, which of the 2 is it? Let it go, or don't hold back? :P
!!Let it go or don't hold back?
 
@Cerbrus don't hold back
 
user5020521
@Cerbrus I've asked you four times your permission to send you the AJAX
 
Not me
 
user5020521
I pinged you three others
 
user5020521
and*
 
12:28 PM
I have no time for this meta, gtg
 
crl
!!youtube let it go
 
user5020521
@MadaraUchiha I did ask your permission to send you the ajax
 
user5020521
so what is the problem now? is it bad formatted?
 
I'm going to go against cap's instructions. Forgive me, cap, imma let it go.
 
user5020521
12:30 PM
should I use jQuery? should I use english names for the functions
 
@Riccardo990 Depends, and yes.
 
user5020521
@MadaraUchiha well I will translate them now
 
@Riccardo990 What browser support do you need?
IE6 and IE7 have a combined global usage of under 0.1%
IE5 isn't even measured anymore
 
What about 8?
 
@Cerbrus Sadly, 8 ships (shipped?) by default with Windows 7
So it's still above the 1% usage.
 
12:32 PM
Well that blows
 
user5020521
function delTages(arrayIndex) {
	var r = confirm("sure to delete " + phpObject[indiceArray].name + " " + phpObject[indiceArray].lastname);
	if (r==true) {
		delRecord(arrayIndex);
	}
	console.log(r);
}
function delRecord(idRecord) {
    var url = "php/cancella_tages.php";
	if (window.XMLHttpRequest) {
        //code for IE7+, Firefox, Chrome, Opera, Safari
        xmlhttp=new XMLHttpRequest();
    } else { //code for IE6, IE5
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    }

    xmlhttp.onreadystatechange = function() {
 
user5020521
translated
 
2 mins ago, by Madara Uchiha
@Riccardo990 What browser support do you need?
 
user5020521
any browser support
 
@Riccardo990 Will you support NetScape 1.0?
 
user5020521
12:34 PM
I am aware of the low percentage of ie5 users
 
user5020521
don't take the piss outta me please
 
user5020521
I am aware of waisting my time
 
@Riccardo990 Why are you here?
 
user5020521
what I am doing is just a mere pure javascript test in order to be able to handle a async request
 
user5020521
an*
 
12:35 PM
If it's a test, you don't need to bother with IE5
 
There is this button that's itching...
 
user5020521
@MadaraUchiha thank you for telling me but forget about it now
 
I mean, come on
 
Suppose I have a tree which consists both of Arrays and Objects
I wish to update a node in this tree
without having a reference to this node (and these nodes can be created dynamically)
 
user5020521
I am just attempting to tell the delOutcome what row was deleted
 
12:37 PM
@Abhishrek Like: [{},{},{},{ children: [{},{},{}]}]?
 
would it be wise to use a string which is the form of key.key.key
@Cerbrus not exactly but yeah similar
 
user5020521
in php I'm using a rowCount function I'd like to pass the deleted row to that callback function
 
@Riccardo990 you're going to get so much help by being an asshole! Keep going!
 
more like [{}, {}, {}, a: { b: [], c: {} }]
 
He'll be back in 30, or later.
 
crl
12:39 PM
@Abhishrek not valid
 
@Cerbrus Oh, I opted for tiny avataring
 
@Riccardo990 303 phpRoom
@crl what ?
 
crl
[{}, {}, {}, {a: { b: [], c: {} }]
 
Ah
[{}, {}, {}, {a: { b: [], c: {} }} ]
 
@Abhishrek And how do you know which node you want to update?
 
12:40 PM
Drag and drop :-x
This tree is basically a ui state.
 
There's a visual representation of that tree
And you drag/drop stuff around?
 
@MadaraUchiha yep
I thought of storing path in every node and array
 
@MadaraUchiha That works too, but doesn't really send a message
 
so acccessing c would be $.3.a.c
 
@Abhishrek And when that node moves around?
 
crl
12:42 PM
I'm doing something similar, working for a company that does a CMS, and we are going to store each element in a page in a tree. Each object has an id, and it's stored in Mongo (don't hate me for that)
 
@MadaraUchiha yeah thats the hard part
 
@Abhishrek You know what's really good for this?
 
I will have to recursively update all paths
 
Better just look up the node
 
The DOM
 
12:43 PM
@MadaraUchiha react :P
 
@Abhishrek That's... ugly
 
It kinda what it does
 
This is stored as a state in the store, The components merely recursively render the state
 
Let try a different angle
What do you have this state for?
Who else uses it?
 
The user and a transpiler :D
 
crl
12:45 PM
@Abhishrek you could store each internal object in the DB, with a parent field
and build the tree from DB, then the updates are easy, (just changing parent field)
 
Or literally store them in a hashmap
and do the same !
 
@Abhishrek How does the user use you internal state representation of the UI?
 
@MadaraUchiha he drags and drops individual blocks around which update the internal state
 
Then that map really isn't flexible enough
 
after drag and drop an action occurs and the update is dispatched
oh wait I can literally generate the path to update on the fly no need to store .path
 
crl
12:48 PM
@Abhishrek quick question, what are you using for DnD? something you did yourself or a lib?
 
is it not odd that I have no way to get the nth item from a Set?
 
@crl React-dnd
 
crl
hmm ok thanks, not using react :/
 
Actually this would have been much more trivial in non-react
but heh this runs on react-native too
 
crl
I still don't know what to use for angular DnD, lots of shitty libraries
 
12:50 PM
No library
Angular is simple enough
 
@crl 4th version rulebook?
 
@MadaraUchiha thank you !
 
crl
@tereško Dragons n Dropsters
 
@Abhishrek My point is
You generally have an internal representation of your data model so that other parts of your app can easily query and make changes
 
raw.githubusercontent.com/paul-nechifor/ohmu/master/… somewhat remotely partially almost cool
 
12:55 PM
If you have no other such parts, it may be better to just use the DOM (or react DOM, or whatever), and serialize the data on demand.
 

« first day (1822 days earlier)      last day (3144 days later) »