« first day (2482 days earlier)      last day (2691 days later) » 

00:02
it's amazing to watch those huge things
the amount of energy required to get them into orbit
00:26
Good morning chat
A stupid question about react-native: Does the server side have to be node.js? Could it be php?
what server?
my understanding of react-native is that it compiles to a native app
So the server side could be php?
so you end up with a bundle of code which has to be installed and can run offline
!!
@N1ng That didn't make much sense. Maybe you meant: 3, d, y, ^, !, π, ?, א
00:30
if you are talking about your react-native app consuming an api, then yes, the api could be written in anything
I want to build an app which should store some data.
And I told to my teacher I would like to use react-native.
where is the data going to be stored?
Then he replied me that node.js is hard to debug(?
well for one, react is a front end framework and isn't tied to nodejs so..
I want to store identifier of user, id/password
00:32
and nodejs is not hard to debug at all
LOL
Nice!
if the data needs to be stored server side, then yeah, you'll need an api
if not...then you don't need a server at all!
I was about to use Cordova instead... Thank you...
@Mosho 😒
well I mean it just wasn't the house I guess, just wait the one you get will be fucking SICK
So I can use php to build the api? @derp
sorry about the ping
00:43
@Loktar I dunno, it was a real nice one :X
I lost count on how many potential houses I missed out on, but real nice ones, this would be the fourth
third even
i recently moved into a sweet place
but the plumbing is crap. everything leaks.
Based off the advice I got yesterday, I've opened a bounty on this question explaining how the heck TypeScript does the whole "let's mix two things together to make a new class" stackoverflow.com/q/26948400/1079075
Hello. Not sure it this is fitting chatroom as question is react specific. i.imgur.com/VntCyNG.png - I can't reproduce this problem in a clean repo. Basically when using back button the location prop is one step behind history. Anyone met a problem like this?
01:22
@Misiur because nextProps 😋
this.props refers to the current, nextProps refers to what is being passed in recieveProps
idk just a guess after seeing the image anyway
@Misiur depends on where location and history are coming from
01:48
@Loktar I wish it'd be that easy
Are coming from react-router, as this is component defined in <Route component={Youarehere} />
good morning lovelies
morn
02:06
Hi!
has anyone watched castlevania?
season1
@N1ng yep write the api in whatever language your heart desires
at the end of the day the interface is just HTTP request
don't use php though, if you can help it
the last thing this world needs is more php code
02:22
world also doesn't need blanket statements
@WesStark isn't that a blanket statement though?
lol i was just typing that
why does (x => x) (5) == 5 ?
@marsouf 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.
@marsouf is that a trick question?
02:31
if (x => x) (5) == 5, why (x => x) (5 * 5) is equal to 25
and whyyyy does (x => x) (x => x) (5) == 5 ?
god is evil for this
are you complaining about operator precedence?
yeah
you heard me :)
@Cauterite how is that operator precedence
don't ask me, it's not my question
@marsouf take deep breaths and try to understand what the lines do
02:34
does (x => x) (x => x) have the same reference as (x => x) ?
what reference
i mean if they point to the same object
assuming js lambdas are objects
why would they be the same reference
you explain oy
idk nothing :D
x => x defines a function (lambda)
(x => x)(5) defined a function and calls it with a single argument 5
similar to const fn = x => x; fn(5);
02:37
mosho, what experience do you have in js ?
i'm just curious
I'm a developer, working mainly with typescript and js
btw, could you point me to some good functional js books or forum posts ?
i always find myself leaning towards functional paradigm
google can, I haven't learned js in a while
it seems more fluent and easy to reason avout
what are you learning right now ?
okay lets say you have a cardboard box with a lid and lets say your value of 5 is a teddy bear. In your example, you put the teddy bear into the box, close the lid and then take the teddy bear out
02:40
@derp facepalm
you take the bear out while the lid is closed?!
you must be a magician
(f => g => x => g (f (x))) (x => x) (x => x) (5) == 5
why would I put Paddington in a box ;(
man i see lambdas everywhere, even i'm in the toilets
;)
it's unhygienic to use lambdas in the toilet
02:44
even worst if i composed them
so I think i might have an encoding problem? can anyone help me real quick
@CriticalTheWizard 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.
spit it out @CriticalTheWizard
so I have a txt file, but it's acting really weird. to move over 1 character in Atom I have to press the arrow key twice.
and if I try to parse it as a string I get really goofy results

mystring = "this is a cat"

//this should return 't', which it does in both cases
mystring[0]

//this should return 'h', but it doesn't with my file txt file. it returns 't' or ''
mystring[1]

what is going on?
might be UTF-16,
02:46
but it says that it is utf-8
when [1] gets you 't' it's probably UTF16BE, and when [1] gets you '' it's probably UTF16LE
open it in a hex editor
how do I convert it to utf-8?
open it in a hex editor to confirm the encoding
then think about converting it
ok
is there a command I run to convert it?
on bash
probably can google for that
maybe search
"linux text encoding convert"
there'll be something
@marsouf i searched around some time ago, but there doesn't seem to be a great deal of decent resources about functional programming in javascript,
i learned by reading about FP in other languages, then just adapting those concepts to JS myself
02:58
@Cauterite thanks for the help. I think I got it.
@CriticalTheWizard did you work out what the encoding originally was?
My money is on a non-printing char or maybe a byte order mark
we may never know :(
03:28
@Cauterite yeah i got it.
it was utf-16le
ran the command " iconv -f UTF-16LE -t UTF-8 oldfile.txt > newfile.txt "
ah yes, i remember iconv
 
1 hour later…
04:37
lmao this professor answer to struggling students
> think about what the math is telling you. it's the truth and the truth will set you free.
05:09
Hi all. I currently have some audio that was encoded with Opus and then to base64. Now, I know the HTML5 audio element can take both Opus files and base64 data as its source, but any ideas for how I should go about handling where they're together?
off topic but if you have a new answer to an old, but relevant, question do you add you own answer or edit the accepted one with the new way to do it? I've seen both done
05:27
@hsimah You add your own. You should never change the core solution in the accepted answer, unless you were the one who wrote it.
good point, thanks
I did add my own answers but I think they're so old that no one will see my answer
but maybe I will get some upvotes
It's not about rep, it's about being a good digital sumaritan
Yeah I had someone edit one of my accepted answers with over 100 upvotes and he broke it :P that was weird
probably look at the first few bytes; should have a signature byte pattern if it's raw opus data
if it doesn't match the pattern assume it's base64
05:48
@Cauterite, it's opus data encoded as base64. I think just decoding it from base64 to raw and then setting the raw data as the source might work, but I don't know.
what does page size in pagination mean
@Abhi number of elements on each page, i would think?
@McLemore maybe rephrase your question, not sure what your problem is exactly
number of rows in a table in each page right
$scope.gridOptions1.paginationPageSizes this takes an array
if the first element in the array contains 2, does that mean the first page contains two rows
maybe just try that and see what happens
can you click on edit plunker and post this code and run and see in console please
var app = angular.module('app', ['ngTouch', 'ui.grid', 'ui.grid.pagination']);

app.controller('MainCtrl', [
'$scope', '$http', 'uiGridConstants', function($scope, $http, uiGridConstants) {

  $scope.gridOptions1 = {
    paginationPageSizes: null,
    useCustomPagination: true,
    columnDefs: [
      { name: 'name', enableSorting: false },
      { name: 'gender', enableSorting: false },
      { name: 'company', enableSorting: false }
    ]
  };

  $scope.gridOptions2 = {
    paginationPageSizes: null,
05:56
Hey guys I had a question about click events and the middle click button
after the reduce it returns this array ` [4, 6, 10, 4, 6, 4, 7, 9, 7, 3, 3, 5, 2, 5, 4, 5, 5, 1, 5, 4]`
but the number of rows is not equal to the corresponding value in array
I am trying to track all visits to links, unfortunately using a click event handler doesn't work for middle clicks. So, I put on a onMouseUp, but the problem with that is that it doesn't work on links (especially because the link opens up in a new window).
I don't want to do onMouseDown because they could click and drag and not visit
Anyone have any suggestions?
@Alesana the usual approach is to rewrite all the URLs through a redirector
http://t.co is an example
though most users will despise you for doing something like that
Not only users but the people who give me the links as well :P
So, I guess there is not another way to do what I am doing?
06:04
@monners yeah, I mean get some upvotes to bubble the answer up higher. The accepted answer is powershell 3 and mine is 5.
@Alesana on google, when you click (mousedown) on a link, it switches the href of the link,
works with middleclick too,
so there must be a way to get those events
maybe just look at how google does it
mousedown works, but it is not gurranteed that they visited it
I guess I will have to replace the link or something
probably the browser stops executing your page's javascript as soon as it detects a link-click
so not much else you can do
No it still executes
So I can change the link on mousedown, then when they mouseup it would go to the new link
But I just would prefer not to do that
well, if it opens in a new tab then obviously it still continues
maybe it's a security feature so you can't detect whether a link was opened in a new tab or in the same tab
or something along those lines
06:09
It opens in a new tab, page is changed and the mouseup event is not logged
Regular click event listeners work though, I don't think that is it
And you can detect if it was clicked with the left button or middle button on mousedown
what if the user does a right-click -> 'open in new tab' ?
how do you plan on tracking that?
you can't just consider all right-clicks as link visits, since there are other options in the context menu
That is a good point :|
Well
You can do an event listener for auxclick (middle) and contextmenu
I think I will just bind the event listener to click and auxclick
@Alesana Google has gotten that problem too
they came up with google analytics
:P good point
but if ya want, I can give you a hint ;)
look for "page visibility API" or something. Some sites with video's / mp4 formatted gifs uses that to pause / continue when the person is at another tab or not
combine it with the clicks and you can have a reliable data. But not 100% correct though
06:23
Oh thanks :)
After all I will be changing the href attribute on mousedown :D
Apache's Flex will be dying after adobe's flash
because it uses that lol
06:53
Hello all o/
\o
07:05
Hi
Why is this regex not working, though it is accepted here
I need to match only numbers and + sign
?
Thanks
what does 'not working' mean?
When I put it in the ng-pattern
I can type strings
and I want to type only numbers with + sign
I need it for phone number input
^\+[0-9]+
mornin
Give me a sec pls
07:10
that's the regex you are looking for
This is my directive
(function(app) {
    'use strict';

    var onlyDigitsWithPlus = function() {
        return {
            require: 'ngModel',
            restrict: 'A',
            link: function(scope, element, attr, ctrl) {
                function inputValue(val) {
                    if (val) {
                        var digitsPlus = val.replace(/^\+[0-9]+/i, '');

                        if (digitsPlus !== val) {
                            ctrl.$setViewValue(digitsPlus);
                            ctrl.$render();
Does it look okay?
// Is this considered better for maintainability/readability?
class Vector {
  constructor({ x, y, someMoreValues }) {
    this.x = x;
    this.y = y;
    ...
  }
}

new Vector({ x: 1, y: 2, someMoreValues: ... })
someMoreValues ?
if you want to use a dynamic vector, use an array :|
07:26
well, vector is an example
class Something {
  constructor({ a, b, c, d }) { ... }
}

new Something({ a: 1, b: 2, c: 3, d: 4 })
I'm not sure if this is ok, or getting JS to look too much like python
just wondering, why do you want an object as parameter
I would wrap this into a factory
the good thing about it is that everytime you read an instance creation, you don't have to look up the order of the parameters, since the names are always there
also, order simply doesn't matter nearly as much
Guys, a little help here please?
@stormec56 What's the problem?
07:29
you don't have to look up the order of the parameters, depends on the IDE?
phpstorm shows parameters in a tooltip thingie
@Oliver, I need to match regex , so that + sign is only allowed at start
and only numbers are allowed
I have this now
/^\+[0-9]+/g
But that doesn't really help..
@Nick what if you're reading code from github. Do you paste it in your ide or do you usually not bother?
I need it to allow only telephone numbers
+494443432
@stormec56 We use libphonenumber for that. But there are also complex regex
+2483846231786479326846132874617832647812364786237846123786417326412364973126849‌​23 is apparently a phone number
07:32
I don't read from github, so I don't know
734
Q: A comprehensive regex for phone number validation

Nicholas TrandemI'm trying to put together a comprehensive regex to validate phone numbers. Ideally it would handle international formats, but it must handle US formats, including the following: 1-234-567-8901 1-234-567-8901 x1234 1-234-567-8901 ext1234 1 (234) 567-8901 1.234.567.8901 1/234/567/8901 1234567890...

I can understand why you want it towc, but only if you have >3 parameters.
@Oliver, thanks, but to make it simplier.. I need this pattern
+numbers
@stormec56 There is also pre-made stuff like github.com/jackocnr/intl-tel-input
nothing else
07:33
@stormec56 Then your existing pattern should work fine
It doesn't it isn't allowing me to place + as first sign
only in between numbers
when i console.log an array it shows [3, 3, 8, 4, 6, 4, 6, 8, 6, 2, 3, 5, 2, 5, 4, 5, 5, 1, 4, 3] when i expand it by clicking the arrow in the console it shows different values.. why
I need it to allow + only in the first place, then numbers.
!!> /^\+[0-9]+/g.test("+123")
@OliverSalzburg true
07:35
lgtm
good morning
@towc of your girlfriend? :o
@towc do you have a grillfriend now?
@ARr0w my very real and existing girlfriend yes
@towc gratz man.
07:36
(that's a joke. She's not real. I better clarify)
@Oliver, what should be the input type then, maybe it is blocking it.
guys can someone answer my question
number or text
the values i see when i click the arrow are the final current values
@towc well i have hope
07:38
is my question not clear
@towc hang in there man. You'll have girl(s) some day. Don't worry.
or a boy, or a boygirl
just remember that 7 at once is tops
@ARr0w I really don't need your life advice, not right now
@stormec56 Text
07:41
@towc :<
Doesn;t work mate..
see the pageSizes in console
:((((((((((((((((((((( @towc
@OliverSalzburg, How to allow only 1 plus, this way it allows me multiple plusses
07:44
!!> /^\+[0-9]+/g.test("++123")
@OliverSalzburg false
@stormec56 The bot disagrees
You know, this should be trivial for you to try before claiming it ;D
I know.. but I messed up :D
Here is my full directive
(function(app) {
    'use strict';

    var onlyDigitsWithPlus = function() {
        return {
            require: 'ngModel',
            restrict: 'A',
            link: function(scope, element, attr, ctrl) {
                function inputValue(value) {
                    if (value) {
                        var digitsPlus = value.replace(/^\+[0-9]+/g, '');

                        if (digitsPlus !== value) {
                            ctrl.$setViewValue(digitsPlus);
                            ctrl.$render();
@OliverSalzburg :)
Hello world
@stormec56 Well, I won't rewrite it for you :D You need to find out what's wrong
07:52
Fair enough..
Just point me to the right direction
if possible
You know, you might as well just use ngPattern
I don't know what's wrong with your directive
Could it be radix in the parseInt
that is set to 10
If only there was a debugger
jesus, humble bundle, stahp! I can't read all that stuff
fatal: multiple stage entries for merged file README.md
wtf did gitkraken just break my repo?
i just checked out to another branch and.. derp
i'm being told to rm .git/index && git reset
is that safe?
the answer is yes
08:09
where is jack sparrow ? This kraken is for him !
0
Q: Regex that allows only one + sign at the beginning and then numbers

stormec56I need to match regex to allow it to start with + (only one plus) sign at the beginning and then to allow only numbers. Here is my directive: (function(app) { 'use strict'; var plusOnly = function() { return { require: 'ngModel', restrict: 'A', ...

@stormec56 did your regex not work ?
No.. it works well here
but not when tried on project
!!> '+1323123'.test(/\+\d+/);
@KarelG "ReferenceError: g is not defined"
@KarelG "TypeError: \"+1323123\".test is not a function"
08:19
@KarelG, please check my directive. Thanks
!!> '+1323123'.match(/\+\d+/g);
@KarelG ["+1323123"]
Please write what exactly should I do. Thanks. — stormec56 4 mins ago
Yeah, no
!!> '++3'.test(/\+\d+/g);
@KarelG "TypeError: \"++3\".test is not a function"
08:20
GRRRR why am i writing test -.-
!!> '+1323++123'.match(/\+\d+/g);
@stormec56 ["+1323","+123"]
if you want to start use ^
!!> '+1323++123'.match(/^\+\d+/i);
08:20
@KarelG ["+1323"]
'+1323++123'.match(/^\+\d+$/i);
this should do the work. Now back to a project I'm very frustrated with (it has barely documentation, even the db has no docs)
08:42
If I have a checkbox in html and I want to update it in real time by php, how should I do?
Periodically fetch data?
@N1ng Try ajax poll (long or short) or server side event. Other techniques also possible, such as websocket.
Thank you
09:04
when i console.log an array it shows [3, 3, 8, 4, 6, 4, 6, 8, 6, 2, 3, 5, 2, 5, 4, 5, 5, 1, 4, 3] when i expand it by clicking the arrow in the console it shows different values.. why
see the pageSizes in console
imgur.com/a/D6RBJ
clearer image
@Abhi are you mutating the array?
yeah
ok.. thats what i wanted to know.. so it's showing the current values..
Hello there!
@YannBergonzat 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.
thanks @bitten
09:12
np
@Abhi Hover over the [i]
ok..got it
I have an input field that fires "invalid" event, but I fail to see what is invalid with its value.

Here is the input:

`<input type="text" id="deploybundle_simple_site_adminPassword" name="deploybundle_simple_site[adminPassword]" required="required" maxlength="255" pattern=".{8,}" class="prestashop-password form-control">`

And here is the value in it: `123456789`

The pattern specifically asks for 8 characters or more, but... There are 9 in my value.
09:39
@YannBergonzat hmm, maybe that's not how invalid event works
Though you're right, the pattern should be okay with 9 characters.. You sure it wasn't firing while you were entering the first 7 characters?
Did you paste the value or did you type it in?
Figured out what was the problem after all
In my js code, I had a setCustomValidity with the error message in it. I fired it with less than 8 characters just to check if that worked. Then the field was never valid
turns out once you set a custom validity message, the field is always invalid: stackoverflow.com/questions/16867407/…
so I just had to reset the custom validity message to an empty string in the input event
@towc Boy, I came across this girl. You might like her. Her profile
hot
that definitely looks like a profiling scheme -_-
I mean, it's hard to imagine anything like that not being a profiling scheme
10:07
Like in the movie "Her"
It's beginning..
but at that point, you can't trust many of the actually very useful modern technologies
maybe if the app can prove that it's not connected to a backend
but then no updates and similar
I mean, you can still request updates manually without sending any extra information at all, then just transposing the local data
but then, no money from ads, so it'd have to be a paid thing
I'm going to be an old grumpy dude who won't "get in with the flow" one day
@towc That is because "the flow" is retarded and it always has been. It just takes everyone a while to figure it out
if people never took the flow, computers wouldn't be mainstream
we'd have died as a species long ago
hypes are rarely good for the people who follow it, but it helps the whole of society
Who gives a shit what would have been if "everyone did something"? This isn't philosophy class :P
point is, the flow isn't stupid
10:15
And I don't know if a Harry Potter or Fidget Spinner hype helped our society progress
it's not the best choice for you individually, maybe, but still
A question about git: How to see commit details?
oh, I was talking about tech hypes mainly
@N1ng git log
@N1ng git log maybe?
and by that tech, I mean physical tools and other stuff too
10:16
I want to see those lines been edited?
not just commit message
@N1ng git diff
...I think
yup
git diff <commit-hash>
who are the mechanical keyboard warriors in here? @Loktar ?
death to mech keyboards in offices!
https://stackoverflow.com/questions/45458195/how-to-prevent-ie-from-freezing-while-long-running-script-execution

I was wondering, can web/service -workers solve his problem?
10:27
for private use ;)
and I guess it really depends on the switches if they're annoying or not
@Nick yes. I would suggest that too either.
@Nick Those answers suck
Their respective authors should be ashamed
10:48
well, Nick, answer on that. Cheap rep for ya
Or just close it as the dupe it is :P

« first day (2482 days earlier)      last day (2691 days later) »