« first day (2441 days earlier)      last day (2506 days later) » 

10:09 AM
I'm having an issue with node that doesn't have capturing groups:
ie
data.match(/import .* (from)/g)

doesn't output `from` as a capturing group
but testing on regex101 shows it as a group
Full match	8-31	`import { greeter } from`
Group 1.	27-31	`from`
but in node I just get the full match
 
!!> "import { greeter } from".match(/import .*? (from)/g)
 
@OliverSalzburg ["import { greeter } from"]
 
I am the greetest!
Now I am leaving Earth for no raisin!
 
I do not know the answer
 
@OliverSalzburg add a check, and if it exists, use hash >_>
:D
i gave him something he can start with. Validation and ect is his job
otherwise I was giving a whole function while he's not doing any shit
 
10:18 AM
The problem would exist with any solution when converting from the array to the map
 
why did the bot tag that?
 
@Neil \o thanks for the answer. i wanted the thing to be completely transparent, what you are suggesting implies comparing two specific implementations' performance, while i wanted to try to provide a comparable value for any other possible implementation. like, i can create a third function and generate that value, without changing the other two functions
something like...
var totalReadTime = READ_TIME * 30;
var totalWriteTime = WRITE_TIME * 30;
var iterations = 20;
return (totalReadTime + totalWriteTime) * iterations;
anyway, i'm the wes from the html room, remember me? :B
 
Here is an example you can try:

let foo = `abc123
jhwfiweabc21`
let a = foo.match(/(abc)123/g)

why are no groups captured
 
10:42 AM
!!>http://google.com;
 
@BenFortune "SyntaxError: expected expression, got end of script"
 
I decided to go down this route:
let myRegexp = new RegExp(/foo/g)
let match = myRegexp.exec(data);
while...
 
@WesStark not sure I completely understand. If you add a third implementation, you can also check for that like you can for two
 
so basically I'm apply this regex to a file I read, but I'm wondering how to modify the content of each capturing group in the original file without it blowing up
 
@WesStark and yes, it's been a while though. ;)
 
10:44 AM
still in italy? :P
 
Yep. Very much so
 
enjoying it or hating it :D
 
@SuperUberDuper i don't know what you want
all abc123 ?
 
I think I need to do a replace instead
 
iirc torino? torino is nice tho
 
10:46 AM
Meh, it has its perks. I always get to eat Italian food for instance.
 
> Return value
An Array containing the entire match result and any parentheses-captured matched results; null if there were no matches.
 
:D
 
He wants "any parentheses-captured matched results"
 
but its compicated by the fact that I only want capturing groups replaced
 
Yes, torino is nice. Maybe a little fast paced for my liking, but my wife doesn't seem to mind at all
 
10:50 AM
:D do we have something fast paced, in italy? wow :P
that's surprising :P
anyway, i'm not sure i understand either. so, what you suggested is basically an average of everything. which i'm not sure how is going to work out. like since you mentioned java, compareTo could be as simple as comparing an integer, or comparing millions of of them...
not sure about that
 
@SuperUberDuper RegExp literal inside of the RegExp constructor?
 
Wait, you have to perform an operation on n items, right?
 
hey lemon
 
Did I understand that part correctly?
 
@SuperUberDuper replace takes a function for the second arg and you get the captured items as args
 
10:55 AM
@Neil it depends. wait, let me think of an example
 
nice thx
 
11:06 AM
hello
 
I've lived in torino
Hated it, but sure, not as much as other italian cities
 
dat stretch
 
@Neil nope i'm failing at making a decent example. what i had in mind is summing the time of the smallest operation times the count it gets executed. for instance if i access a field in a class, that's gonna be like 1s (doesn't have to be accurate, it must be precise in respect to other operations). i access the field 10 times, so it's 10s. with those 10 fields i do ten comparisons, so 10*10. in the end i will have a number i can compare to something else and see if it's smaller or bigger
 
@rlemon the trouble im having is that the replace is overwriting my non capturing group:

data.replace(/(?:foo(.*)(?:['"])/g,'$1$1')
 
11:20 AM
i am likely being not clear enough :B
 
I want to keep the foo part in the output
 
data.replace(/(?:foo(.*)(?:['"])/g,'foo$1$1')
done :B
that regex is invalid though. you are missing a )
 
foo could be an expression so I can't hard code it in the output
 
capture it and do $N ?
 
?
I need to replace a group in a very specific location
but my replace is overwriting the ?:
even with the missing )
data.replace(/(?:foo)(.*)(?:['"])/g,'$1$1')
 
11:28 AM
@SuperUberDuper He means data.replace(/(foo)(.*)(?:['"])/g, "$1$2$2")
 
I see, but don't get why ?: is being captured
makes the regex ugly
 
?: is not captured, by definition
 
also I don't want the last group captured either
 
it's not, because it's ?:
 
but it is being replaced
 
11:31 AM
that's because it's part of the match
if you want the match to end before it, use lookahead
 
I don't really see the point of ?: then
 
It's just to avoid assigning a number to that group, mostly
 
then why not just avoid wrapping it in () then
 
Because sometimes you need grouping
I this case I guess you don't
 
I see, like ()+
which would be 1 or more groups?
 
11:34 AM
right, or |
 
@SuperUberDuper Conditions
 
ok
so what I need is look behind and look ahead
 
JS doesn't have lookbehind
 
ahhhhhhhh
so sad, what is ECMASCRIPT thinking off??
 
simplicity and performance, probably
 
11:40 AM
i don't feel that those lookarounds belongs to what a regular expression means
 
11:58 AM
@WesStark sorry, lunch
if you're performing constant operations like ifs and adding and such, you can generalize by just keeping track of overall time
If you have to do a constant thing several times, you multiply that time by a constant amount
Guaranteed
In other words, you can disregard the extra constant time pretty much
It'll get taken into consideration by the Monte Carlo simulations
 
12:14 PM
FML ... my sleepy mind helped me to invoke git reset <commit> instead of git revert <commit> :|
 
@KarelG Use git reflog
To get back to the commit before the reset
It's not deleted until git gc is run (explicitly or implicitly)
 
yeah luckily. But it's a bit hassle to resolve it
especially with new files
 
Is there a "boilerplate" or something which keeps track on (mobile) devices respectively their dpi and resolution options? To use that in css media queries.
 
12:29 PM
how do you pass bind for this in JSX props ? Tried to pass a THICC arrow function but ESLint was still crying so added it as an ES7 class property like so class LoginForm extends Component {
  onButtonPress = () => {
    this.onButtonPress.bind(this)
  } Is this the recommended way?
 
@jAndy I'd say use whatever a popular CSS framework uses
 
that's a good way, @C.Astraea
 
@OliverSalzburg name me a popular css framework today :p
 
@C.Astraea That's how we do it.
 
It prevents it from needing to re-bind in every render() (one of the motivations for the eslint rule).
 
12:31 PM
@jAndy Touche
 
what is Bricks?
 
@SyedMuhammadAqeel 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.
 
Rectangles made of baked mud used for building structures
 
@OliverSalzburg for a second and because of missing colon over the "e", I seriously wanted to google for a second for "css framework touche"
 
12:36 PM
@jAndy Sorry about that. I have deadkeys disabled for easier markdowning and I didn't want to Google+Copy+Paste the correct e :D
Because ` is a deadkey on the German layout
 
I have a have a handmedown german layout macbook .... most annoying thing when trying to type template string
took me 2 weeks to relearn the keys
this weird key is in it's place §§§§
 
@OliverSalzburg I'm using German layout, why is that a dead key? It's useful for words like touché :P
 
@jAndy Dead, as in, it doesn't produce a character by itself
I customized my layout to make it print ` or ´ directly. Without having to press space
I also replaced the , on the numpad with .
Makes a lot more sense for me. Especially with IP addresses
Someone actually made a similar layout but you get the deadkeys back if you additionally press Alt IIRC
 
@rlemon my memories
 
12:57 PM
Regex q: Can lookaheads (?=) only affect the group following it?
I want (?=.{5})(\$*\d+)ABC
To match only something like
$$$12ABC, $1234ABC, $$$$1ABC
But not
$2ABC
which is currently does :|
 
@SvenTheSurfer Is that not just [$\d]{4}\dABC?
oh wait $1$ is a problem
 
Yeah I guess so, sorry I didn't make that clear. It's more specifically a padding thing.
I only want $ followed by digits. 12345, $1234, $$123, $$$12, $$$$1
 
(?=[$\d]{5}[^$\d])\$*\d+
 
how do i regex for the strings "-(" and "- (" ?
so i want to match any lines with "-" followed by "(" even if there is 0,1 or more spaces in between
 
/-\(/ and /- \(/
or /- *\(/
 
1:06 PM
is there a short command, pref 3 chars as this is something i want to do to pan through methods in objc
and what is the operative principle here? so i can read up on it. the idea of matching only about the ordering of the chars that is..
 
what?
 
..
i just want to know what regex rule you are using
 
I don't understand
There's nothing special about that regex
 
i want to understand your answer
so say... "this is the globbing rule.." or soemthing
 
I think an elementary regex tutorial would suit better here
 
1:09 PM
i've tried
 
i woudl just like to know what the operative regex rule you used there
 
Repeating the same words will not yield more results
 
alright fuck it
thanks for nothing
 
I used various regex techniques
Which don't you understand?
...I guess someone isn't here to learn
 
1:13 PM
do you even have a good insight in the regex named groups ?
 
Who, me, what?
 
yes. Something that I see in .NET
named groups
 
it's a proposal for js iirc
 
I've used them
 
*/-*
isnt it like that ?
 
i don't comprehend it very well. Seems ... weird. Anti-pattern
like (?'foo'bar){2} means match ... bar two times and foo contains bar ?
 
Yeah
It doesn't really add any expressive power (afaik), just readability
 
what's the use case for having barbar matched and retrieving bar from foo?
 
oh no I forgot regex again XC
 
1:17 PM
@KarelG Um, er, what makes you think there wouldn't be one?
This isn't specific to named groups
 
cos i'm unable to think one :D
 
I mean with a literal "bar" there isn't one
 
/.*-.*/
 
but for groups in general, sure
 
wait
maybe for parsing date strings ?
like you want yyyy-mm-dd
then you can name each digit group
 
1:20 PM
Again, it doesn't add functionality, only convenience
 
@KendallFrey thanks :3
 
They aren't adding "balancing groups" to JS are they?
i.e. groups act as stacks with push/pop
 
I'm so tired
 
I'm Kendall
 
Hi kendall, I'm tired
 
1:25 PM
I know
 
Uno
 
I'm bad at self deprecation
 
Try harder
 
@ndugger Thats a prototype app I am writing
 
one feature I really wish javascript had was creating specific types of errors and catching them, like Java or Python has
// like this
try {
  await fs.readFile('someFile.js');
} catch FileNotFoundError {
  // blah
} catch {
}
 
1:41 PM
When Filtering Data especially for a dashboard which is better? filtering from the back end (making a request every time to backend APIS) or filtering from the front-end(pulling all the data and filtering from the front).
 
Bluebird has that
 
@rlemon does it work with async/await?
 
I wouldn't expect so
 
@grasshopper usually it's a bit of a mix of both, depending on where the performance bottlenecks
 
Ska
@grasshopper backend of course. There can be big performance and network issues based on how much data you need to transfer.
 
1:43 PM
@corvid gotcha which means my webapp should be able to do both
@Ska yes?
 
Well, it means you balance based on the situations, like:
- How often you need to re-filter
- How 'expensive' is it to include the 'extra' data needed fro the client to be able to re-filter
- Preference
 
I mean, not necessarily... and it also depends on how large the data set is. Like if you're receiving a page of data with 10 items and a query string, slicing/filtering that small data set might be plenty manageable on the front end
 
Ska
@Luggage yes, but dashboards usually have the features of showing very slim set of data. To show the average sales amount per week, you don't want to pull all sales records for the past year and calculate averages.
 
You may end up with a combination. e.g. the server aggretages down to an intermediate level where the data is summarized by ALL the possible ways the client can further summarize
Yea, you would never do THAT much on the client.
 
I'm not sure about your back end, but don't you have to massage the data to fit into your view at least a little bit? e.g., if you are making a chart, you will probably not receive the appropriate JSON to simply generate a that chart
 
1:47 PM
But you MAY have the server send sales by month AND user and then the dashboard further summarized by user OR month.
 
Ska
Sometimes you even need backend optimizations. Caching averages in DB instead of calculating every time, etc.
 
You should only send the data you will directly use on the client
 
You can easily produce a graph with a day by day summary of the week
 
@KendallFrey ^^
 
1:48 PM
rlemon sounds like "A Clockwork Orange"
> Singing in the rain...
 
If the details are needed say on an hourly basis, you can perform an Ajax call to retrieve it on the fly
 
ok so when I do filter on the frontend using angular js should I watch variables that when changed will filters my collection or can i get a way with using the ng-repeat filter feature (which does that automatically)
 
none of us are suggesting filter only on the client.
 
yes but you are saying to do a combination of both
 
1:53 PM
@Luggage filtering on backend seems pretty straightforward to me but frontend im not sure which is the best way
 
ah.
 
angular 1? I haven't heard that name since years
 
lol I like angular 1
 
ouch
 
If you like your framework, you can keep your framework.
 
2:04 PM
so how do people usually show an image on image fetch failure? Attach a handler to onError to default out the image to a local thing?
 
@corvid Lucky you, I debugged it for a client, now he calls me almost every 3 days.
 
@corvid then what if the error images fails to load? :)
 
that's why I am a confuse
 
the browser will eventually display the alt message
 
base64 image placeholders
 
2:10 PM
if not present, a no img icon is shown
 
draw an error image on canvas
use a non-image placehold (an appropriately sized and styled div)
 
0
Q: Warning - React

MBrownGI'm having a little problem with a warning in my Ionic 2 code: Warning: Accessing PropTypes via the main React package is deprecated. Use the prop-types package from npm instead. I'm not using anything about React or proptypes, but I'm getting the message describe before. My package.json: "d...

 
2:25 PM
@rlemon holy shit lmao
 
@Luggage do you use AutoSave in mobx?
 
@KendallFrey you can try it yourself. translate.google.com/#auto/en/%E3%81%88%E3%81%90
pretty fun
 
omg
> Dynamic embroidery sewing sewing soup bouche Flavoring Eastern pineapple Crucifixion Crucifixion Eastern pineiflorum Crucifixion Crucifixion Crucifixion Eecuguet deeuvering Crucifixion Eecuguet
fuck me
 
lol
 
now I'm hungry for some sewing soup
 
2:28 PM
@KendallFrey I won't needle you about your choices of food.
 
I am hankering a delicious breakfast early evening soup
 
wtf is "eggpling"
it wraps around eventually
 
it's a common torture practice
"he was eggplinged to the point where he revealed everything, noone can blame him"
 
is there any module of node js for proxying videos from url?
 
2:34 PM
you mean to watch porn and nobody in your company can track you watching porn?
 
@jAndy exactly!
 
!!couchdb or redis
 
@jAndy redis
 
Anybody here like to play golf?
 
2:42 PM
putt putt!
 
How to concatenate an indice to a for in sammy.template? "<% for (var j=0; j < result.steps[i].step$indice.fields.length; j++ ) { %>"
 
@SterlingArcher I've played, but not in ages. Why?
 
user1596138
@SterlingArcher before and after. First is how I got it, upside down and all lmfao imgur.com/a/A5mki
 
user1596138
Bare LEDs hanging out
 
user1596138
Also tiny bit more blue lol can't see all the hoses in any 1 pic tho imgur.com/a/qgr26
 
2:53 PM
HAHAHAHA @towc how does it feel to have a guy who insists on forgoing JavaScript to do jQuery question your dignity? stackoverflow.com/questions/44682853/…
 
user1596138
@towc Also I know jQuery is Javascript but why the heck would somebody need to know Javascript when there is jQuery. Why would he ever need to know document.getElementById or document.getElementsByClassName when he can use $() which is easier — aqw alhadary 20 hours ago
 
user1596138
He don't even know about querySelectors lmfao
 
what kind of dickheads would upvote that :P
 
I'd never consider using pure javascript for animations nor ajax. Yes, it's obviously possible, but not something you'd want to do. — freedomn-m 21 hours ago
 
@towc I almost wanted to for the laughs but I couldn't reinforce his behavior lol
 
2:54 PM
it's not something I'd want to do?
damn
 
Well there goes that bit of code, eh rlemon?
 
@BadgerCat maybe
 
I mean, one of the upvotes was probably from my friend @Jhoverit, and that's fine
I don't have any anger, I'm actually laughing at the idea of finding out who did
 
@towc the upvotes are probably because multiple people recognised stackoverflow.com/questions/44682853/… this comment is unnecessary and kinda dickish.
 
user1596138
What u talking about boi
 
2:56 PM
I mean, in the end I used the argument of the absurd, it helps a lot I think
I could have just stopped at "have fun not using javascript then", sure
I see how it can be seen as dickish, but it was meant to be a simple point
 
I agree with both of you. It is kind of dickish, but can you really say towc is wrong? Everyone is catering to a guy who ignores what they say and says, nah $() is the end all be all.
 
it wasn't "I'm curious how long you'll last because you suck", it was "I'm curious how long you'll last because jQuery can actually do very little"
 
user1596138
Didn't this thread end 20 hours ago?
 
Just show him the new way to import jQuery lol: var $ = document.querySelectorAll.bind(document);
Tell him it's lightweight and still has the $()
 
ew
 
2:59 PM
@Trasiva just curious if anybody else loved it
I've been playing a lot of golf lately
 
const $ = (selector, context = document) => context.querySelectorAll(selector);
 
@SterlingArcher Do you even read pings from when you're away?
 
I mean, sometimes
I like to leave people in suspense
Or I just haven't been on main yet
 
@rlemon was about to say "not as ew" as jQuery, but that's a much better solution
 
const $ = (selector, context = document) => Array.from( context.querySelectorAll(selector) );
 
3:00 PM
assuming step is assuming
what if you wanted the nodeList
@SterlingArcher
I see you shiver with antici ...
... pation.
 
I've never actually wanted the nodeList
 
look at the dates
 
@SterlingArcher I sent you a wonderfully awful image today, please acknowledge it so I feel validated
 
@rlemon Give the guy credit for his commitment to the joke
 
@KendallFrey I've seen it
 
3:02 PM
@rlemon he would say "oh no it doesn't work"
 
validate that sucker!
 
@Shrek Autosave? No. Is that in mobx-utils?
 
@SterlingArcher Oh, by the way, did I tell you I got Jamire?
 
user1596138
@SterlingArcher if u checked ur snapchat more often you'd see more dick
 
3:07 PM
@Luggage haha ouch i.imgur.com/pV8dJVw.jpg
 
@Trasiva no shit? nice man!
 
@SterlingArcher Nah, I'm fucking with you, lol.
 
I made dis for u guys.
 
-4
Q: can any one please reply to my issue plzzz

Umar Farook Can the birthday of any our friends in classroom or the Co employee with us can be seep in the notification without the use of the Internet by using java problem can any one please reply to my issue plzzz

lol
 
It's so bad.
 
3:18 PM
@Vap0r there are 3 instruments!
 
Oh damn didn't know. That might've helped with trying to create a distinct baseline vs melody
 
4 actually lol. I like it so far, but you've got some work to do
 
@SvenTheSurfer I have to work, but here's my quick addition of the other 3 instruments. Might come back so I can structure around knowing I have more options :) . g.co/doodle/dpv2q4
 
old
 
Jason?
 
You caught me. I have two accounts. This ndugger character is just made up.
 
jQuery
 
I really hate that change Imgur made for linked images.
 
3:42 PM
jQuery is love
jQuery is life
2
 
aka 💩
 
I am jQuery
 
No, I am jQuery
 
Hi jquery, I'm HIV positive
 
3:50 PM
what's the difference?
 
$("[data-HIV=true]").removeAttr("data-HIV")
@ndugger you're welcome
 
dude, that's just nasty code... if you're gonna use jQuery in a joke, at least write good code
 
> Are you happy, @ndugger? Is this what you wanted? You've just given this baby full blown jQuery!
 
@Vap0r No, he's HIV positive, can't you read?
 
@Loktar with that picture, suuuuuuuuure.
 
3:55 PM
@ndugger nah
@MadaraUchiha still no
 
ban vapor pls
he sux
 
but by that logic
 
ban dugger
 
I mean we both suck pretty hard maybe we should agree to stop using the internet?
 
he's too good
 
3:56 PM
@ndugger you first though
 
you aren't using the internet
you're abusing it
 
I promise I'll be right behind it.
 
I don't suck, I blow
 
You know what they say, abuse it or ablose it
 
they who
 
3:57 PM
big liquor
 
Well, me, but it might become a thing
 

« first day (2441 days earlier)      last day (2506 days later) »