« first day (2474 days earlier)      last day (2699 days later) » 

05:00
If you want you can
exclusivity you know what I mean. It's like a document. you own each others reproductive ability
is it easy to migrate from mysql to another db format like mongo
or postgres
with regards to React is there a difference between onChange={this.onChange} and onChange={this.onChange.bind(this)}?
I've seen both
seems redundant
one is in the class and the other is in the constructor
05:20
@Arrow My son certainly consider me his private property.
lol, that's because you are :)
@hsimah yes, there is a difference because of the value of this
errr let me expand on that
please
the first one, if you use 'this' inside the onChange function, the scope will be the onChange function whereas for the second one 'this' is the object containing the onChange function
give me a sec to make a fiddle so that i can prove it to myself as well xD
@Sheepy People think because you have kids that they are your property. But it's the other way around. They require your assistance, they will take more than they give. So Kids own their parents.
05:27
we're moving to azure to host our .net applications
some numpty has nuked all my app services
It's one of those
Sleight
of hand tricks, evolution has played on us.
all my sites. all my databases. everything has been deleted.
@Arrow sleight ;)
and I was offered $250 for my son in cambodia when he was a baby
but other than that I agree
He's now pretty active. Not merely walking. Climbing stairs and railings. Playing traditional Chinese piano. Pulling cables and drawers. Eating whole grapes and cherries. But he doesn't speak. At all.
everyone develops differently
my little guy wouldnt stand at all
then he started running
Wow, everything but the talking?
seems like a sign of intelligence
05:31
I think he learned to associate "mama" with milk at the age of two months or three. Then I think I did too good a job of understand his needs, so he doesn't need to speak. Now he just look at me when he has something he wants.
yeah I wet my pants in bed forever my parents tell me. Is that a sign of intelligence also?
@William must be, 'cause I did it too
It's a sign you let go of stuff that bothers you.
you'll need to open up your console log
That is impressive, communicating without words.
05:34
@derp thanks that explains it
althoguh if you are using factory functions, i don't think you need to use the bind function
because you're not messing with constructors and what not
@Arrow When you take care the same baby 7x24 for nine full months.....
@Sheepy does the communication go both ways?
hold up @hsimah
I talk to him a lot (should be obvious :), and he seems to be listening. He seems to understand simple commands like come or give or go, but whether he's in the mood to listen is another matter.
05:38
anyone familiar with github?
@William Is that a joke?
can you ping someone on github from any issue
basically I pinged someone but they are not in the thread
@Sheepy
@William what is your issue with github
I've noticed that at this early stage kids are still trying to piece things together. Like how to use their arms legs, make noises, and use psychological extortion on their parents to get what they want.
Kids are dangerous.
@derp you removed the .bind(this)?
yes
not only that
its using React.createClass
and the value is inside the object that is passed into that factory function
anyone use livescript
05:46
(a factory function is something that creates something without using 'new')
okay, but how would using bind change the functionality? I am looking at a react component I want to use and their examples all have the bind call - nothing I have done thus far has used it. I am using createClass.
maybe it used to be using es6 classes initially but then they changed it over the factory functions and forgot to remove the bind?
@Arrow You mean they just cry until they get it. (sigh)
i'm hoping somone more knowledgable in es6/React can answer why we need to bind on event handlers in es6 classes and why we don't in facotry methods
05:51
i hope they ping me if and when they answer because it's knock off time
@William Ok. Not sure about that. I only ping and got pniged in relevant issues.
I believe so we will find out
something something execution contexts
I want a SO plugin that shows people acceptance rates before answering the question
Good idea. But I don't care. If I have an answer to contribute (rarely), I just write it and leave it.
05:58
crying is their trump card when that does not work, they will use their goo goo gaga. Most people don't know this, but kids are mostly cartilage, I have heard stories of them falling 5 stories, they just get right back up and start running, they are tougher than they look.
@hsimah oh lol Using React.createClass will automatically bind this values correctly for us
@Arrow I'd be cooked alive by three families if that happens to my son o_O
well, no one is going to let their kid fall five stories... but if you live in a two story house or a 5 story apartment building, it might provide some peace of mind.
uhhh @Arrow, i think @Sheepy lives in hong kong
you know, the place with 50+ storey highrises and what not
Hong Kong is weird. Too crowded, i heard a small apartment will run for more than a million
06:10
same in sydney/melbourne
this is a million dollar apartment in sydney
really Sydney/Melbourne, the county the size of the United State with the population of Texas
1 bedroom apartment in the city
we gots proper healthcare here xD
okay in melbourne a million gets you a three bedroom/two bathroom apartment
I am totally confident that my son won't live to regret his action if he does fall out of the window......
lol how many floors up are you?
i like javascript but not java weird i know
06:14
God forbid @Sheepy
@derp how many sqft is that
I have a problem in executing my function where in the first function will insert data to mysql then return a certain id and will declare it to global variable, the second function will call the first function and used the global variable that the value comes from the first function
first function:
    function insertItemtoDB(value,data){
        var transct = $("#transact").val();
      $.ajax({
      type: "POST",
      dataType: "json",
      data: {item:value,maxid:data,transact:transct},
      url: 'deduct_inventory.php',
        success: function(data){
        // $("#descname").val(e.length);
        receiptid=data
        alert(receiptid)

        }
    });
    }
Second Function:
@Arrow the sydney one or the melbourne one?
 function submitInventoryOut(){
      $.ajax({
      type: "POST",
      dataType: "json",
      url: 'getMaxId.php',
        success: function(data){
          receiptid = "HR"+date()+
            if($("#itemname-out").length){
              insertItemtoDB(item,data)
              alert("item")
            }
both
Earvin, check for callback functions or use jquery's promises
06:17
hmm the melbourne one doens't say
but i'm guessing its around 100ish sqmetres
@derp I've lived as high as 28. I'm currently at fourth. But the floor is higher than usual, so it's more like six.
whish is about 1076.39 square feet
use when() for your first func and then then() to execute the second func. You can pass args from one to another more cleanly
the sydney one was soemthing like 65sqm
@KarelG the problem is that the data from the first function is delayed on passing it to the global var
ohhh
06:18
so 700 square feet
when and then
@KarelG will check on it. Thanks!
the when documentation has an example with ajax
buy and rent it out on airbnb
06:18
t\u2661rk
should be
türk

What type of encoding is it, utf 16 or unicode or other ? how can I change it to normal utf 8 ?
I believe JavaScript is technically utf-8 by default or am I wrong
@Sheepy do you own your flat or rent
can it be done by javascript, I mean the converting ?
yeah falling six floors
that's a splat
06:21
@William JavaScript "use" utf16 internally. JS itself is not encoding aware and has no native charset function.
@KarelG so I can use when(insert function) like that?
@Arrow Own. Rent does not save money, so it's better to own.
I'm currently using byte arrays as object keys by converting them to base 64 strings
Is that the most efficient way?
wait, what are you doing?
I literally just said
06:25
@EarvinNillCastillo you need to provide a deferred function (just return the ajax :P)
@Tobiq Ok, I get what you mean now. Why'd you want to to that?
@KarelG ok thanks! I'll search for more example. I think this is exactly what I needed
IIRC string functions transforms to utf-16
... I just explained that I convert them to base64 strings what's confusing
I want to do it because I'm using them as a key to my object?
!!> 't\u2661rk'.length
06:26
@KarelG 4
^-- see
It's so weird I was just reading about his
It uses unicode so the string byte length varies
Now back to my thingy, is base64 most spacially efficient?
Or should I use ascii?
I believe ascii uses 7/8 bits which is the best density, right??
uhm ... it's best to step back to your initial problem or you will end having an XY problem
Who?
what do you want to achieve with using those bytestrings as keys
you, Tobiq
06:30
Ascii is the densest encoding sunset of unicode, bytewise, right?
I'm taking byte array keys that are associated to data I have
Hi, in Nodejs
I'm using app.use(express.static(path.join(__dirname, ''))); to serve the files from nodejs. but I don't want to expose my code in server.js and other files. how can I do it? Can anyone hemlp me on it.
Simply change folder or move files
@Strikers I don't understand the question.
@Tobiq No. There is Base85, for example. It depends on how many characters you can use.
@MadaraUchiha I'm using nodejs as my server side script. To serve the js and other files I'm using app.use(express.static(path.join(__dirname, '')));
06:32
Base 85 is denser???
It use 85 characters instead of 64 (thus the name), so it's denser.
But I think you can just join the content of the array as a string, can't you? That'd be shorter than any base conversion.
What r u talking about....
@Strikers I understadn the question not sure except change directories
I'm asking about getting the best byte-byte ratio
Lol I said change directories or moe files simple
JavaScript string does not need to be composed of valid utf characters. If you just want to use byte as string key, you can use those bytes (actually shorts) as characters.
Wikipedia: Base85, Base128
06:35
I'm vary aware of that and it's irrelevant
I'm asking is ascii is the densest sunset, you know how unicode works right?
Uchiha
Yes. And there is no such encoding as Ansi. Don't be fooled by Microsoft. My notepad's ansi has tens of thousands of characters.
Are the ascii characters the best density of chars @uchiha, from what I know JavaScript would pack 2**7 chars pers byte
Possible chars per byte*
Lmfao no one even mention ansi
Lmfao wtf r u on about
@Tobiq my gut instincts tell me you are right but I would have to check
@Tobiq All js strings are two bytes per character. If you mean English data and independent from JavaScript, UTF-8 is as dense as ASCII.
> Both UTF-8 and UTF-16 are variable length encodings. However, in UTF-8 a character may occupy a minimum of 8 bits, while in UTF-16 character length starts with 16 bits.
06:41
Which is js
Or nodejs*
I don't think what Sheepy said is correct but I'm no expert on encodings. I just work in english
JS is neither. JS string is ultimately just a series of shorts. Some features work as if it is just a short array (UCS2), a few will parse it as UTF-16.
Fk shorts are 2 bytes
Are utf 16 chars 16 bits wide
(at the minimum length)
Yes. And grows at a factor of 16 instead of 8.
How are they then differentiated from higher wodths without a header/metadata
If its variable length
06:46
lol my co-workers out of office mail
I know in utf 8, the first few bytes denote the width of the char
> I am on paid leave right now until 6 August. I will respond after that.
> -> If it's not urgent, but you're also not patient, go send a mail to my manager, <name + mail>.
> -> If it is really urgent, please tweet me using #YOUAREINTERRUPTINGMYVACATION.
> In other situations ... just call 112?
@Tobiq Some bits only exist in higher words, never in lower words, so a simple scan can reveal whether it is LE or BE, if there exists any extended characters.
Of utf-16 is 16 bits wide there's no space for header, how is the width found
sheepy is right UCS2 and UTF16 mathiasbynens.be/notes/javascript-encoding
06:48
Arrow what's the width of a 16bit char
"width" in which context ?
Note that js only need to know encoding (including LE/BE) on reading text (from file or stream). Its internal string is always consistent.
the length of string or size in memory
former: depends, latter: 16 bit
Im asking how many bits are used as the header and as the chat itself.
Been asking for some time now the same questions
羊 <<< Here is a character that is two bytes in (most) "Ansi", three bytes in UTF-8, and two bytes in UTF-16.
06:51
Char***
Omg.. What is so confusing
I just learned -A and -B parameters for grep. Let the choir sing, oh my god how incredibly useful!
In utf 8, the first 128 chars are 8bits in length, and the final bit is the header, denoting that the char is 1 bye wide
What about utf16??????
Utf-8 is just optimized for 1 byte characters
It can do more, but it's not very efficient at doing so
I give up... Thought it was such a simple question
Nothing simple about Unicode
06:55
@Tobiq If you look at wikipedia, "U+0000 to U+D7FF and U+E000 to U+FFFF" - i.e. UCS2 - are represented as one 16 bit code in UTF-16.
All I'm asking for is the densest unicode sunset, just as u mentioned ascii is the densest utf8 sunset!!!!!
Subset
I do kinda just wish there were a table where it would just tell you the best Unicode Charset to use for which language
Ascii uses 7/8 bits in utf8. What happens in unicode?????//
@Tobiq ascii and utf-8 overlap for 8 bits, or at least I had understood it this way
@Tobiq In UCS2/UTF-16, each english character is 16 bits. In UTF-32 (e.g. Windows), each is 32 bits.
06:58
Though then it isn't clear to me how it would extend a character
................................
2
Q: express-validator custom validator using MySQL always returns undefined?

CodyI am trying to create a custom validator using in express-validator to validate unique email. Here is the code: app.use(validator({ customValidators: { isEmailExists: function (param) { console.log("isEmail exists"); // check email already exists or not ...

@Cody 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.
How can it be variable width without a header!?!?
Utf-8 sunset. You realize that you just came up with the coolest grunge band name?
07:00
I am trying to write a custom a validator using express-validator (using mysql), but the problem is i it always returns undefined, not matter what.
@Tobiq Ascii is not a subset of "Unicode", by the way. It's at best a subset of UTF-8. It's not fully compatible with UTF-7 and certainly not UTF-16/32.
If anybody know how I can do this pls help
@Tobiq Checkout high surrogates and low surrogates. These are UTF-16 and I think easier than the mechanism of UTF-8.
did someone notice chrome behaving weirdly lately with history api?
In utf 8, the first 128 characters user 1 bit for the header, completing the byte. What. Happens. For. The. First. 2**16 bits in unicode!?!?!?!?!?!?!?
07:02
@Tobiq what are you trying to do? Let's start with this..
@Tobiq Well, if you really, really wants to jump right into UTF-8 which is the most complex: kunststube.net/encoding
If you're writing your own Unicode parser, don't.
Are all 16 bits used only for the character? Pleassseeee just answe my question
@Neil Been there, done that. It was a dark age before unicode is popular............
@Tobiq there are no bits in unicode. unicode is not an encoding
07:04
Utf16
@Tobiq No. U+D800 to U+DFFF is used as surrogate. And I mean UTF-16.
@Sheepy Ouch. Did it come out somewhat okay in the end?
@WesStark technically there are no fixed bytes in utf-16 either
@Tobiq can you ask the question again in one sentence only. don't have the time to read all that
@Neil It's me, of course it is ok. XD I pride myself in knowing what I am doing.
hey neil \o
07:05
@WesStark o/
So,finally, HOW MANY BITS ARE USED SOLELY FOR THE CHAR, IN the 2 bytes
@Sheepy I don't envy you. I wouldn't touch that task with a 10 foot pole
Caps lok
@Tobiq 15 bytes can be used for a single unit character in UTF-16.
Took u 20 minutes to say the number 15
07:07
Yeah I still don't really understand what you want to understand. I tried my best...
@Tobiq 2 11 U+0080 U+07FF 110xxxxx 10xxxxxx
@Tobiq don't go that route. There is only pain and anguish where you're going...
11 bits,
en.wikipedia.org/wiki/UTF-8 <- not sure what you mean
Only 11 bits??
@Tobiq And the best part is we are both correct, it depends on the context! :)
07:10
Buffer.toString(encoding)
Weaklings. I use floating point-based bit encodings with support for imaginary numbers
Which encoding gives the smallest string, IN BYTES
@Tobiq UTF-8, if English.
P.S. Don't use ASCII.
Don't like utf-8 or utf-16? Try a utf-12.5 +/- 15i
Utf uses 1 bytes only
Utf8
And u said js string use 2 bytes peer char
07:12
it does
@Tobiq depends on the content is the best answer
But usually it's gonna be utf-8
The content is byte araay....
that's why I not really answering at this moment because your question is too ambiguous
0-255
@Tobiq this means literally nothing at all
07:12
^--
a byte can represent everything, it depends of how you want to read it
Yeah. Not understanding is ok. Not trying to learn is more problematic...
Let me say it again..
Buffer.toString(encoding)
Which encoding results in the smallest string in butes
I've feed my baby a whole cream cake while we're throwing answers to see which sticks.
I.e, which encoding will give the best density
I'm sorry and I know that this would upset ya, but I'm repeating again: your question is still an ambiguous question
07:15
^
Wha don't u understand
@Tobiq something is lost in translation here.. If you're converting a byte array to a string, you don't get to pick an encoding.. You have to know what it is..
What should I clarify
The bytes are RANDOM
give an use case because you can do everything with that Buffer.toString method
I JUST WANT STRING REPRESENTATION
Which is why I get to pick encoding...
Do you understand now????
07:17
It will be gibberish no matter what encoding it is. If you want a 1 to 1 conversion byte to character, use ascii
But just don't allow byte 0
@Tobiq Don't use toString. View it as a Uint16Array and create a String from that 16 bit data. If it's not too short you may also want to apply lzma to the string and create a shorter raw string.
that caps is not needed. We are trying to help you, but you come up with a vague question. It's like asking a maintainer which oil leaves a dense sticking when attaching pipes
Crypto.randomBytes(8).toString(encoding). as you can see I don't care about the output I just want a raw string representation because I'm going to use it as a key. Which encoding will be densest???
ok, now we got some more clearance
Ok so reforming the question: how do I generate a random key?
07:20
The bytes at mot random its just an example
https://stackoverflow.com/questions/45288199/express-validator-custom-validator-using-mysql-always-returns-undefined

Does anybody know how to resolve this issue ?
is it somehow related to your torrent questions ?
just checked your questions :)
@KarelG are you telling me ?
@Tobiq What I mean above is you don't need any encoding to map raw bytes into js string.
No point mapping it into a string unless you wanted to send it to the client
07:23
Cody, that wasn't for you
In which case you'd use base64
Heh, that's why I asked that torrent question, Neil
Surely u can't just map raw bytes to strings u need an encoding
@Neil Why no one use Base85. It's just ssssslightly slower. :(
@Sheepy I personally prefer base 9 and three quarters
07:26
I'm personally don with this chay
@Tobiq Encoding is only meaningful for text, human-readable text. JS doesn't care whether its strings are human-readable. We have been putting binary data in js string before Node exists.
Oh, turns out that base85 is a real thing
@Neil isnt any base a Real thing though?
I also do not care if the strings are readable... I just want a flipping string representation of the array
@Neil Yes! And unlike many higher base none of the characters need to be escaped in js!
07:28
@KamilSolecki I suppose in a general sense
I mean you could technically create support for any possible base, Although good luck with that :D
@Sheepy I honestly thought 64 characters was approaching the limit.
Still no answer
@Tobiq I've said it twice, you can just turn that buffer into uint16array and then straight into a string. Reliable, fast, and short.
U can't do that.....
07:31
@Tobiq let's set aside the fact that we have answered you numerous times by different individuals. We're also not obliged to help. A little courtesy is in order please
Every string in java script Is utf16, how many different characters can u fit into the 16 bits
For utf8 u can fit 127 chars into 8 bits
128*
@Tobiq No. Some part of JS knows utf-16, but js characters are just 16-bit shorts. You can use all 16 bits. It just won't be UTF-16. But it's still a perfectly valid js string.
I'm sorry for being harsh, but you don't comprehend the character encoding very well. Your question still does not make a sense because of (1) ambiguous ("dense" in which sense? From what? Why as key ? ), (2) improperly description of the problem (you want a "dense" string representation for keys) you're trying to solve. We have tried to help you (and tutored you) for 30+ minutes and you still come up with that.
AFAIK, if you use either utf-8 or utf-16, you end up using same memory footprint (if working with english characters) ...
This article compares Unicode encodings. Two situations are considered: 8-bit-clean environments, and environments that forbid use of byte values that have the high bit set. Originally such prohibitions were to allow for links that used only seven data bits, but they remain in the standards and so software must generate messages that comply with the restrictions. Standard Compression Scheme for Unicode and Binary Ordered Compression for Unicode are excluded from the comparison tables because it is difficult to simply quantify their size. == Compatibility issues == A UTF-8 file that contains only...
That table sums up the usage and bytes nicely
the problem is still that js uses 2 shorts for that utf-8 :P
07:39
The code range represents the different characters
sorry for nitpicking * back to work *
/me * back to baby *
hey sheepy do you have opinions about pattern matching?
*back to w.. uh.. Back to reddit*
any of you guys actually?
07:41
Anyone here have experience with axios? I have been stuck on a problem for more then a week. Posted a question but it was never answered. I have posted bounty. If anyone interested please look at my problem.
@Sisir appears it has a lot of depedencies
just a comment
you mean the if statement?
or commented out codes?
@William I have a strong opinion of pattern matching! The bastard!
@Neil ok have you read the proposal?
07:50
or commented out codes?
Relative paths dont work with grunt sass , but absolute paths work (on windows ).. . .
I'm losing my mind here
@William I was just kidding. You asked if we had opinions about Patten matching
most of them are devDependencies only two dependencies
@William .match or something different ?
how to use javascript alert in html action link?
07:58
@MohanSrinivas 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.
@MohanSrinivas <a href="javascript:alert('test');">link</a>
thank you.

« first day (2474 days earlier)      last day (2699 days later) »