« first day (1991 days earlier)      last day (2961 days later) » 

user2620028
5:00 AM
i believe so yes
 
user2620028
last i heard of it was around unity 5.0 time was when i was working on that game and i have been sidetracked since lol
 
Java is doing pretty good on security in recent years. A few years ago they practically frozen the language development to focus on fixing it (breaking may old applets in the process), and patches are now released pretty frequently.
 
By most accounts, the worst security now is Apple.
 
@Sheepy idk man stuff like this is still happening, zdnet.com/article/oracle-issues-emergency-java-patch
> Oracle issues emergency Java patch for bug leading to system hijack
that's why I don't even have it on my system anymore
 
5:02 AM
That happens to Git too. And ffmpeg. All in recent months.
 
yeah but Java has stayed pretty consistent over the years lol
 
Same for all OS and browsers. Even PDF reader.
 
> @Loktar Flash is a plugin, which make things complicated. It hurts security.
everything hurts security I guess so why does it matter ;)
 
Vulnerability happens. What is important is incentive the hackers to tell you rather than sell them, and to patch them fast. Java security is a lot better than its worse days. Of course, if you can live without it, then please do by all accounts :)
 
It's hard to ignore things always in the news for exploits
 
user2620028
5:05 AM
ouch
 
eh wait. That looks like it includes all of their products
yeah, so that is misleading
 
I worry more about my Firefox, really. I heard it is not up to par in that department lately...
 
but yeah, I agree with your statement about flash above @Sheepy I just think it applies to any plugin. That was my only point with Flash getting hit so hard.
 
Poor Flash. Just because Jobs didn't like it...
 
yeah, but in fairness I think the web is definitely better because of it
I mean because it's mostly dead
I just think the tool is still pretty nice for creating animations is all
wonder how much it hurt Adobe, would be interesting to see their sales figures
 
5:10 AM
The tool is great. I am sadder than the designer when we have to do ad banners with Google's web designer rather than Adobe. Under assault from all fronts, it seems...
But I am not sure the web is really better, honestly. I can't tell whether it is more accessible, but I certainly miss the fancy sites of the Flash Age.
(And no, I don't miss Geocity.)
 
user2620028
@loktar you know damn good and well they are fine based on the price of their products lol
 
lol yea, especially with that monthly CC cost
 
user2620028
yeah
 
user2620028
damn well i have to go to sleep
 
yeah same here, see ya
 
user2620028
5:15 AM
wish i could be on the chatroom during the day but my work has it blocked :/
 
user2620028
peace
 
o/
 
user2620028
\o
 
user2620028
cap is so lazy making me do that lol
 
|o|
 
user2620028
5:16 AM
didnt she give hi fives at some point in time?
 
Yeah. If Microsoft is succeeding with Office 365 - most normal people I know are not eager to update office at all - I guess Adobe is having some good time...
 
user3119231
6:06 AM
morning :)
 
Anybody here to help?
 
user3119231
!!welcome Nafis
 
@Nafis Welcome to the JavaScript chat! Please review the room rules. Pleasedon't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
Factorio is nice
 
Ok, here's my question....
I am not very well in regex. I want to make a pattern for a phone number with a particular country code with + sign.
for example +46<any number>
nothing other than +46
any idea? anyone?
 
user3119231
6:17 AM
@Nafis regexr.com -> examples -> phone number
 
But I want to match exactly +46 at the biginning
how can I do that?
@Maurice
 
user3119231
What did you tried so far?
 
^(+880){6,14}[0-9]$
^(+46){6,14}[0-9]$
^(+49){6,14}[0-9]$
 
user3119231
maybe @littlepootis can help?
 
do you want to require the parens?
 
6:25 AM
yes
wait, no
you mean parenthesis?
 
/^yes
 
no, I need only numbers started with +46 exactly
 
/^\+46[0-9]___/
fill in the blank
 
What else I might need in the blank?
 
I'm not familiar with country code 46x
 
6:33 AM
^\+46[0-9]$ this didn't work
 
^\+46[0-9]+$
 
@Cerbrus, thanks a lot. It worked
 
6:51 AM
You might want to have a look at regular-expressions.info/tutorial.html
 
7:05 AM
o/
 
user3119231
\o
 
@Cerbrus, what if I want to put anynumbers or if I put + then it will check exactly 46 after that, otherwise without +, any numbers are allowed?
 
^(+46\d+)|[^+]\d+$
 
7:22 AM
@Zirak I like how the name of that document is "Microsoft Word - column2.doc - column2.pdf" :D
 
@Cerbrus, it didn't work
@Cerbrus, if I put only +, it shows valid, which is not suppose to.
 
@Cerbrus \+
 
In [], as well?
 
^(\+46)?\d+$
Should do the trick.
 
Hm, yea.
 
7:28 AM
@Nafis That's read as "Beginning, then, optionally, exactly +46, then, only digits, then the end".
 
@MadaraUchiha, it worked. I don't understand how can I create regex myself.
 
38 mins ago, by Cerbrus
You might want to have a look at http://www.regular-expressions.info/tutorial.html
 
@MadaraUchiha, I don't understand this way. For example, I know if I want to set a character limit, I have to put {6, 14}, but it's not working
 
crl
Can someone explain this jsbin.com/diloyu/edit?html,js,output ? false, but it should be true
clone is meant to just to a damn copy, and not touch data, but for some reason it fucks up things
 
7:46 AM
ignore me
 
Why are you using map in one place and a for loop in the other
 
@crl returns true to me
 
crl
@AwalGarg with clone(data.regions.a); it's true but cloning the whole data clone(data); it's false
 
Also 'use strict'; like damn
 
crl
hmm solved it, but I dunno why
	else if (cp.regions) {
		let rs = {};
		for (let r in cp.regions){
			rs[r] = clone(cp.regions[r]);
		}
		cp.regions = rs;
	}
works ^   vs:

	else if (cp.regions) {
		for (let r in cp.regions){
			cp.regions[r] = clone(cp.regions[r]);
		}
	} // doesn't work ^
 
7:51 AM
your code is bad and you should feel bad
 
rs = cp.regions.map(clone)
Please
 
crl
can't map an object
 
Oh I see
That shouldn't be an object
You're using the wrong data structure
You can tell because you're trying to map over it
 
crl
there will be more keys, and they are named by design (some regions in a layout, 'main', 'footer', 'header', ...)
ok thanks guys
 
regions: [{'name': 'a', 'title': 'bar', children: []}, ...]
 
crl
7:56 AM
yes, thought about it, but usually in the template, we explicitely pick one region by name, so with that ^ I'd have to .filter
I need an Object.prototype.map, fuck it:) nah jk
 
You want a keyword list
 
seems like a bad idea to change the object of a for...in statement, within it's own loop....
 
It's a very bad idea
Especially in a function named "clone"
Which sounds like it's supposed to clone an object so you can treat it like it's immutable
 
crl
it's changed after the loop
 
also, as far as I can tell (assuming clone is what I think it is), isn't that just overwrite a key with it's original value?
 
crl
8:01 AM
yes, creating a clone
 
o/
 
I'm putting my hands up and backing away slowly
 
@crl If your object has no functions in it: JSON.parse(JSON.stringify(obj)) is a quick and effective hack for deep cloning.
 
quick to write, not quick to run
 
crl
8:02 AM
@MadaraUchiha in reality it has upward .parent relations, which fucks up JSON.stringify
I wish there was an option for .stringify for that skipCycles
 
google "npm deep clone"
 
crl
doing it on client, and well my method seems fine no? (not generalized because I'm lazy)
 
I mean, it's been a solved problem for a really long time
 
your method is sort of near fine, code is not.
 
crl
@AwalGarg where?
 
8:09 AM
How can I merge two mysql databases with the same structure ?
 
crl
database or tables?
 
actually I have some data in a mysql database I want to includ it in another one that has the same structure
 
just export the content of one and load it in the second one ? what's the problem ?
 
crl
you'd overwrite it? (with primary keys)
 
yes
exporting the content wont create duplicate rows right ?
 
crl
8:12 AM
don't export the auto-increment fields maybe, but it'll fuck up relationships if any
 
how
 
It really depends on your requirement, type of key, what's a duplicate for you, etc.
 
ok thank you
 
@crl using for..in on dicts without hasOwnProperty check. and your usage at the end just calls clone without any assignment, that seems like mutation which is odd. and the other issue shea highlighted
 
crl
ah clone(data)? just for testing that shit, ofc I'll use that value
 
8:15 AM
But I think it is also a problem with JS. We don't have Map literals, which are something much more needed in every day life than object literals.
 
Map literals would make me so happy
 
I have used sweetjs in one small project to add # syntax for Map literals. It worked frigging awesome and I would kill to have that in ES native. But it won't, ever.
 
crl
@AwalGarg that object isn't supposed to have other special props
 
Use a map
 
@crl yeah, it isn't supposed to have. But when code grows, these problems are not unexistant. They cripple up all the time and cause time wastage.
 
crl
8:18 AM
yes, ok, will give a try
 
That's literally the use case for a map
 
crl
data is the model, don't want to put any function in it
 
Is Math.floor(Math.random() * 200); biased to higher numbers? Lol..
I got some moving rectangles and they always end up in a corner.
http://codepen.io/schoening/pen/bpRXNV?editors=0010
 
But you're gonna have a lot of fun using maps for that cuz we don't have map literals :(
 
hello
 
8:20 AM
Don't get me wrong - I love JS for all of its highly dynamic nature. But I think large codebases need more security from the compiler.
 
I wouldn't go that far, but the native data structures are incomplete and their APIs just aren't very good
Fixing that will help a lot
 
@Schoening no, Math.random is random enough for what you're trying to do
 
That's what I thought too! Well then I must be messing up somewhere -.-'
 
dissecting your code now, I'll let you know
 
user3119231
 
user3119231
8:28 AM
1px tolerance between top bar and red div? is this a known problem?
 
@Schoening can I also give you some "best practices" advice while I'm at it?
 
@towc that would be apprechiated! The whole point of that code is to try out finite state machines
 
pX is generally accepted to be used just as x
 
crl
document.querySelectorAll('style, link').length
228 // ouch
 
that might happen if you have something like
 
8:30 AM
never seen that used in code, it can be confusing because you're just referring to this, not that. Use self or _this
 
<div>
	<div>another</div>
</div>
in contrast to
<div><div>another</div></div>
 
also, this.position doesn't add much, literally just do this.x, this.y
 
@towc ah, yeah.. pX is an artifact from when I had velocity in the code
pX pY vX vY
O
Oh
I found the issue
 
the Wander and Sleep constructor don't make much sense. Use WanderState and SleepState at most, but it doesn't really even make much sense to use those in any case. Have some property of this be state and set it to either 0 or 1, or use flags (at the beginning of code WONDER = 0, SLEEP = 1, so this.state = WONDER or this.state = SLEEP) or better yet this.wondering = true/false since you only have 2 states
Then in the beginning of the goblin's update you do if( this.state === WONDER ) this.updateWander(); else if( this.state === SLEEP ) this.updateSleep(); or similar, all within the Goblin constructor
we usually do this btw:
 
The issue was that it didnt check properly for destination reached.
Changed to
Math.abs(this.end.x - this.owner.position.x) < 1 && Math.abs(this.end.y - this.owner.position.y < 1
 
8:37 AM
function Particle( x, y, vx, vy, ax, ay ){

  this.x = x; // position
  this.y = y;

  this.vx = vx; // velocity
  this.vy = vy;

  this.ax = ax; // acceleration
  this.ay = ay;
}
 
Hm, okay
 
a goblin is a particle in this case
 
Yeah, I didnt polish that code all that much
 
and watch out for indentation (line 48)
and if you haven't already, I suggest you look up comma-listed variables
var a = 1,
    b = 2,
    c = 3;

// instead of

var a = 1;
var b = 2;
var c = 3;
 
Is that a good practice tho? I thought nr 2 is a bit more defensive.
 
8:41 AM
@Schoening it can help in case you forgot a comma or semicolon, but it's not worth it
and if you really care about that, comma-first is a good compromise
I value whitespace more than most things, it's pretty subjective
 
@towc I prefer the latter
 
Oh, and I can use "use strict" i suppose to avoid the issue with a forgotten var keyword
 
// comma first
var a = 1
  , b = 2
  , c = 3;
@FlorianMargaine yeah, not trying to convince, just saying that he should see if he prefers the first method to the latter if he hasn't considered it already
 
oh and comma first is an abomination
9
 
I prefer the first one, with commas last, because it's easier to read, but I have to admit you can't use it everywhere or it will be messy, especially when you have multiline declarations (object literals, functions)
 
8:44 AM
@DenysSéguret yeah, and it's not like you already had bugs related to this :)
 
I always appreciate ideas and input. I didn't put too much care in that codepen code.
 
@FlorianMargaine it looks bad, but it does fix some issues. I doubt I've ever forgotten a comma, but I don't have much experience anyway. That Bananawicz (not sure what his name was again) had some pretty strong arguments for it...
 
I like my bikesheds red, thank you very much.
 
I prefer underscores to camelCase. But I have almost given up on it.. Because most places out there use cameCase for JavaScript. And if I try to be consistent then things like v_X look real bad compared to vX or vx..
 
@Schoening when you consider that not only the fixes I showed you help with reading but also make writing much much easier you can understand that you may end up writing code like that without thinking about it
@MadaraUchiha wooosh
 
8:47 AM
!!urban bikeshed
 
Yeah, thank you for taking the time @towc :)
 
@MadaraUchiha bikeshed Bikeshed refers to topics which have never recieved concensus and are likely to generate side-discussions and flames unless all participants are well-read on all the past history. It stems from the idea that big changes (like the building of a power plant) go through quickly, since everyone assumes that someone else has checked it out, while simple changes (like building a bikeshed) often get mired (snip)
 
@Schoening ugh
 
@Schoening no problem, I love criticizing people when I can :)
 
Criticizing is fun.
 
8:48 AM
and interactive
 
@CapricaSix TIL
 
hehe
 
crl
I was taking bikeshed really literally
 
I took it partially literally
I'd say 80% letters, 19% numbers and 1% magic
 
crl
@ssube and is it fine to have a variable taking either an integer or null?
 
9:01 AM
Just noting down necessary things for developing a web project. uxrim.com/technical/2016/03/29/required-js-libraries any suggestions?
 
crl
- a computer
 
not that basic though
you will understand once you read my article..
 
crl
'now a days' are you sure? (I'm not native)
 
oh ok
removing thanks
 
crl
'blue bird'
 
9:04 AM
done
 
@Mr_Green good old javascript..?
rip vanilla javascript
 
@littlepootis I didn't get you
 
and you never will
 
come on what mistake I did now?
 
Hi guys
 
9:11 AM
Hi
 
anyone here who is working/worked on angular js
i am badly stuck in validation part
 
@crl the brits use it. "They used to throw the poop by the window. Nowadays we use a toilet"
 
Isn't bluebird a single word?
 
@cornedor Welcome to the JavaScript chat! Please review the room rules. Pleasedon't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
crl
not sure there are npm packages names with spaces anyway, but wouldn't be surprised
 
9:33 AM
yeah thats true, but its written like 'bluebird' on the bluebird site, its also just the name of the bird, which is also just Bluebird ;-)
 
done thanks
 
Does angular js validatuion works if i have multiple form tag on same page?
 
crl
How do I 'push' a value in an array, just before the last one?
 
splice?
 
crl
a.splice(-1, 0, val), yea thanks
 
9:48 AM
@crl push is like append
 
crl
10:15 AM
dang, more packages than atoms in the universe
 
@Learning yes, validation should work per form
 
How can I implement this in javascript. "If a > character appears in the mask, all the characters that follow it are converted to uppercase until the end of the mask or until a < character is encountered. "
 
@GayanJayasingha Welcome to the JavaScript chat! Please review the room rules. Pleasedon't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
why EDGeee pushes scroll bar down the page ? it's horizontal scroll...
 
@GayanJayasingha You can have a regex replace with a function.
 
10:20 AM
@crl there is only 1 atom in universe ?
 
crl
!!> "hello>world<.".replace(/>(\w+)</g, w=>w.toUpperCase())
 
@crl "hello>WORLD<."
 
@Abhishrek There are 559 nodes..
 
crl
yes, and a big one
 
@littlepootis And ?
I wish you could do this for a Java project ;-) (and visualize how many packages it imports, including the builtin ones)
 
10:22 AM
Well at least it has a standard library
 
I don't particularly like Safari, but I have to say, their type and code coverage profiler is pretty rad.
 
crl
it's webkit based, maybe, dunno if webkit does those things
 
@littlepootis You know? It took me a while to understand what your nickname means
Little Pootis Spencer.
 
@MadaraUchiha Yep
 
am I going to stay ignored here ?
 
10:31 AM
@Mathematics probably not
 
why edge is making me worried
 
@SterlingArcher jaipurcuisine.com give it a try :D
@Mathematics screenshot ?
 
Professor Snugglesworth
 
Hey baes
I got the best mark in my master's thesis proposal. :)
 
grats :)
 
10:42 AM
thanks :D
 
and I'm seeing that you're already mixing up German with English, that's great :P
 
I didn't even notice omg :(
 
it's fine :D
I knew what you were talking about
 
you threw in some danish too
 
@BadgerCat where in Mexico are you from again?
 
10:45 AM
@littlepootis Bae is babe, not poop
@GNi33 Texcoco, it's a town close to Mexico City
But right now I'm living in Bochum
 
yeah, I know :)
 
@BadgerCat Congrats! :D
 
oh cool, pretty sure I did spot this town when flying over it
 
@SomeGuy Thanks :)
 
It's right after this vast.... lake or whatever that is
 
10:47 AM
Yeah, it's right next to the airport
 
but jesus christ, is mexico city huge
 
Yeah, but I don't miss the traffic
Only the food
 
I even miss the food
 
@Abhishrek here you go
I am not sure how to describe it in words
 
@GNi33 What was your favorite?
 
10:49 AM
@Mathematics which one is EDGE ?
 
yup
 
WHICH ONE IS EDGE ?
 
Microsoft Edge
 
I give up
Which one of those screenshots is microsoft edge ?
 
both
I am trying to show the problem
 
10:50 AM
Mexico City is fun, such a weird city. You're standing in a park right next to an incredibly beautiful building and the Torre Latinoamericana, then you walk 200 meters and it reeks of piss and other substances and everything around you is just sketchy
 
but I am not able to describe in words properly
 
@BadgerCat so hard to say. Mexico probably Teotihuacan
 
you see horizontal scrollbar is at the end of page
when I want it visible on the page
 
Oh, I meant food
 
@GNi33 kinda similar to chat.stackoverflow.com.
 
10:51 AM
trip overall I'd be intrigued to say Antigua in Guatemala
@BadgerCat oh, that one's easy. We went to a street taco guy somewhere in... I think it was called Hidalgo around there. just wow
 
@GNi33 can we talk about JavaScript here ? oh no that's not related
 
@GNi33 Street tacos are the best, didn't you get sick?
 
@Mathematics oh, I'm sorry. did I mess up your message flow?
click ignore then
 
you are ignoring your precious time...
 
@Mathematics shh.. respect what the lady wants to talk about.
 
10:54 AM
@BadgerCat no, I was afraid of it, but the guy of the AirBnB told us about the place. He's been living in Mexico City for 6 years and that was the best tacos he ever had anywhere, so we gave it a shot. He was not wrong
 
@JanDvorak hmm, didn't knew he is a lady, I will stay quiet now for them ;)
 
> Although the Consultative Committee for Units considered the proposal
I bet they're fun.
 
@Mathematics no one needs to stay quiet in here at all, but a quick conversation between people that know each other for quite some time because of this room here doesn't hurt I think. But yeah, I'll go back lurking
 
What? Complaints about topic not being strictly js?
 
10:57 AM
@rlemon not strictly
 
If you think "I know, I'll tell the room to be on topic so they help me", dont.
 
I won't,
 

« first day (1991 days earlier)      last day (2961 days later) »