« first day (2701 days earlier)      last day (2472 days later) » 

14:00
@Cereal oh my god this is brilliant
!!> [1,2,3].toString().endsWith('3')
@rlemon true
many pages use a variant of bootstrap
those would be easy :P
I'm doing a calculator app and I want to prevent things such as "20++20", so I have an array with things that can't repeat themselves.
btn(b) {
  let s = this.state;
  let signals = ['%', '*', '-', '+'];
  switch(b) {
    case 'C':
      s.r = '0';
      break;
    case '=':
      s.r = eval(s.r);
      break;
    default:
      if (s.r == '0') {
        s.r = b;
      } else {
        // Don't mind this, only messing around
        if (signals.lastIndexOf(b) == 1) {
          return;
        } else {
          s.r += b;
        }
      }
  }
  this.setState(s);
}
The issue I'm having with indexOf is that it returns the position on the array, not on the string, so I can't check it with b.length for example
20+%20
14:05
if(typeof variable === 'string')
Thanks @rlemon ... but you should change the position of (index, node) to (node,index)
var reg = /(\+\+|--|\*\*)/
'10++20'.match(reg)
'10+20'.match(reg)
returns null if it doesn't match
if (s.r.slice(s.r.length -1) [magic here to check if this string is in signals array]) {

}
@Tschallacka I'll take a look at match(), thanks.
forget the percent signs
var reg = /(\+\+|--|**|%%)/
I wouldn't fuck around with any of that. run the maths, check the results. action there
don't try to parse and build your own expression
function evalMaths(str) {
  try {
    const result = new Function(`return ${str}`)();
    if (Number.isNaN(result)) {
      throw new Error('NaN calculation error');
    }
    return result;
  } catch (error) {
    throw new Error(`invalid expression error: ${error.message}`);
  }
}
something like that should work fine imo
unless you wanna actually parse it all and never eval anything, which would probably be the most tedious, but 'best'
14:13
@rlemon I think it's better to treat this exception in a non-intrusive manner
instead of trowing an error, just not allowing it to happen
open your calculator for example and try to type ++
do whatever you want.
I'm just pointing out the easiest and most accurate way to determine if the math will work, is to run it
Also, a quick math test. No tricks, but respond as soon as you know the answer. Start with 1000. Add 40. Now add 1000. Now add 30. Now add 1000. Now add 20. Now add 1000. Now add 10. What do you have?
Yeah, this check should be done on case '=', indeed.
var reg = /(\+\+)|(--)|(\*\*)|(%%)/
'10--20'.replace(reg,function(match) {
   switch(match) {
       case '--':return '-';
       case '++':return '+';
       case '**':return '*';
       case '%':return '%';
   }
});
@Tschallacka Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
14:18
@Tschallacka What about +-/--9+/? You see?
I think the easiest way is to have an array of characters that can't repeat themselves as a group
@Neil 4000?
@Ikari Hmm, no
@LucasBustamante you'll have harder rules than that
oh, 5000, right?
@Ikari no :)
14:22
goddamnit
Though I know you're not using a calculator. Most people mess this up if they're not using a calculator
just how the brain works I suppose
oh, right :P
heh, 4100
it's a neat trick
indeed
I tried it at work.. a good 80% mess it up
14:24
picks up mouse, hold's it like a microphone "Computer?" "Cortana?"
Speaking of mouse.. I've never used the extra two buttons of my gaming mouse
so many games use the third button, and my mouse stinks for the third button
I should switch mouses back
thanks for the reminder
it's got that scroll thing that you can push down to simulate the third button, but you pretty much have to put all your weight into it
been using one of those mini mice since last summer
it sucks.
but I needed a small mouse
14:27
There is no third button...
You just use the scroll wheel to scroll...
"mouse3" is when you push down on the scroll wheel
I have a logitech m705 never want a different one. Ideal for gaming. Especially the free scroll function
at least for mine it is
Pressing the scroll wheel feels.. awkward
I don't feel that it is, you get used to it when you realize how much crap utilizes it.
14:29
"Hey Cortana, google javascript exceptions" - opens bing search #feelsbadai
I use Linux.. and the extra buttons are set to Back and Forward by default.. :|
yeah, I don't ever need to use it except for gaming
And I've just tended to remap it to the keyboard
yeah, those third and fourth button on my mouse are a pleasure to navigate on the browser
that's the biggest thing I missed
btn(b) {
  let s = this.state;
  let sinais = ['%', '*', '-', '+'];
  switch(b) {
    case 'C':
      s.r = '0';
      break;
    case '=':
      // Remove last character if it's a signal
      if (this.inArray(s.r.slice(s.r.length -1), sinais) !== -1) {
        s.r = s.r.slice(0,-1);
      }
      // Try do to the math
      try {
        s.r = eval(s.r);
      } catch(error) {
        throw new Error('Error: '+error.message);
      }
      break;
    default:
      if (s.r == '0') {
        s.r = b;
14:31
back/forward buttons on the mouse
Done and working :D
I need to remap them to something more useful :|
But I dont know what
get the logitech m705. it has back and forth button, and has a free scroll function. press small button, normal scrolling, press button again, scroll 10.000 lines in 1 second
I also love the back and forth button for eclipse, to go back in my f3 history when editing javascript files
I use the G502, it's sweet
Guise, I need a fresh look on a little piece of code, to make sure I'm not overcomplicating anything. This is basically mouse drag -> camera panning, in React:

https://gist.github.com/Kamilczak020/677047a55ce94681bdfc7557398be257
14:34
Discussion topic of the day: Could there ever be an invention that would make mouse/keyboard obsolete?
eye/brain based stuff?
brainwaves?
/me eyes microsoft lens
ez, VR
AR/VR with eye tracking, maybe
14:34
yeah but you still have to type your name, even in VR
@rlemon Nice :D
eye tracking might make this harder, not easier
cortana type my name
Cortana type my password?
@Neil Are you saying you're not already coding by voice input?
14:35
Cortana write a 1000 word essay?
cortana open function err method no scratch that
@OliverSalzburg I'm old fashioned
987 ducks were in the water and each and every one said once quack quack quack quack quack quack,
maybe, something like connecting VR our CNS (Central Nervous System)?
voice sucks
brain based sounds better
14:36
I think I should map my extra mouse buttons to Copy and Paste..
that also exists
especially when you get to the precision and speed of your brain thought
that 144p thumbnail
I’ll never get technology implants, except for fake organs. I wanted to stay human as much as possible.
14:37
and also your brain isn't really that fast
temporal coding. imagine writing the code and hope future you does it
so for typing it's useless
but if you could use mapping of concepts to certain brain functions
you coudl speed it up, if the software could recognise intentions and guess the corresponding code
yay, more grammar stuff:
consider you have a woman called "Better McBetter"
ussually when a woman marries to a man, she inherits the surname of the man.
if Betty marries "Peter Pot", her name will now be "Betty Pot-McBetter"
what do you call the second surname (aka, McBetter)?
ide please write me a site like facebook. kthxbye
> ussually when a woman marries to a man, she inherits the surname of the man.
Wow
Someone call the gender police please
14:39
@OliverSalzburg sorry, but it is true
maiden name
women steal men's names
first name, married name, maiden name
it's their maiden name, but having both just means you have dual last names
Hyphenated name
In the Western tradition of surnames, there are several types of double surname (also double-barrelled surname). If the two names are joined with a hyphen, it may also be called a hyphenated surname. In British tradition, a double surname is heritable, and mostly taken in order to preserve a family name which would have become extinct due to the absence of male descendants bearing the name, connected to the inheritance of a family estate. Examples include Harding-Rolls and Stopford Sackville. In Hispanic tradition, double surnames are the norm, and not an indication of social status. A person will...
14:40
so, maidenSurname and maidenInfixes ?
That is even better, cause it makes it sound like a gun
just make one field
name
let the customer decide what they want to fill in
it's clearly prevState.lastName
pervState ?
@KamilSolecki what if you were married more than once
14:40
This has nothing to do with maiden name
@Tschallacka we are dealing with data from a 3rd party
ah
just concatenate it into one field
and it is in dutch, but we dont want our models and such have dutch names
it makes code horrible
i'm dutch too
im not dutch
im butch
14:41
I’m a duck
just make it one field. You rarely need to seperate the two
it gets harder too
i guess ill go with maidenSurname and maidenInfixes
Hendrik-Coen van Vollhenhoven tot Diepgetrouwen de Derde
@Wietlol he he he he name
14:42
OMG
@KamilSolecki 0.o?
Obligatory hyphenated name post
I thought the update would fix it
@Wietlol auto correct. Anyways, why do you need a separate thing for it? It's really just two things: maiden name and last name
we are dealing with the data of the third party
and we must store it exactly that way
And last name can be x-y-z-whatever
14:44
If it's separate, than that is because "Pot-McBetter" is the last name and "McBetter" was the maiden name
But "McBetter" would also be the maiden name if her current last name was "Pot"
Hi fellow human beings I am from a school and I have close to nil xp with programing. Coming to point, please guide me how to even begin learning programing. I seek to start with java scripts or python. I started using book but got wandered away and was unseccussful.
@KingTut Welcome to the JavaScript chat! Please review the room rules. Please don'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.
Pot is a pretty dope last name btw
> java scripts
@KingTut step 1 is to use the correct name of the language
it isn't java scripts or java script. it's JavaScript.
14:45
@KamilSolecki we fully integrated Jaba into King Tut
@CapricaSix Thanks
@KingTut jokes aside, do you have anything in mind what language you wanna start with?
This will be very opinionated across many people, but my personal idea is to take any language and just start working with it
write a todo app
XD
MVC pattern..
@OliverSalzburg did you lurk from some pot ?
14:46
Sorry I wasnt paying attention to spelling. yes i heard from people that javascript and python are easy to learn. I decided to start with java scripts
@cswl ZSG Pattern
@KingTut ok thing no. 1 again
sorry *javascript
javascript easy ?
14:47
> I started using book but got wandered away
That is a very accurate description of my reaction to textbooks
"Oh no, I'm wandering away!"
"Oh noooooooooooooooooooooo"
@rlemon .net
yea, I forgot
.NET C#
14:48
.NiET
@KingTut probably the most common go-to for your first program in something like a simple calculator
Speaking of shitty russian memes. Anyone here have the smallest bit of curiosity about the nerve agent used in the salisbury poisonings?
.nier
@Vap0r niet
speaking of weebshit, I watched the live action fullmetalalchemist last night
14:49
rip
how was it @Cereal?
@rlemon thank you ill try to stick with this one
I liked it. Wish they didn't do anime mannerisms, though
huh. Ill check it out, then
Tell me people how you all learn to program, did you also read books and write programs or watch youtube videos
14:50
I never liked* learning from YT videos when it comes to coding
I found something I wanted to make, then tried to make it
Using whatever sources I found to help me along the way
We prayed to Anck Su Namun
There is also the question... Why do you want to program.. because you like computers and want to learn how to control them... (something like that..) or just because you want to get paid.. :|
I started with books. nothing else was available.
@KamilSolecki cyka blyat
14:51
moved to blogs and youtube lateron in life
@Cereal watch Evangelion :B
Ew anime
@KingTut I started with books. When I was starting coding there already were plenty online resources, to which I slowly moved. But yeah, books are always a nice resource.
@KamilSolecki Wouldn't 'het' be closer? I realize it's not a true Cyrillic 'h' (or whatever the fuck its called).
Now I usually take blogs / talk with people / look at source codes
14:52
Why documentation is not even in the list? It is the ultimate best resource to learn "something"
@KingTut you merely adopted the code. I was born in it, moulded by it.
documentation is great after you have a handle on things
I'm with @Teomanshipahi
I pretty much live in documentatio
ok so what did you do when it got boring, actually I started learning from book and got bored due to sequential strcture or i dont know.
@OliverSalzburg thanks for posting that video XD
14:53
@KingTut Learning without a purpose is boring
@Vap0r are you a bot
3
Find something you actually want to make
Then learn how to make it
@KingTut I was programmed to respond "no"
So you wanna learn because you want to.. or just... get it done... and finish the semester.. :|
there's a reason "documentation" and "getting started" are usually two different guides.
14:53
maybe a simulation
@cswl these questions aren't necessarily important
@hilli_micha cyrylic is read totally different than its written
!!is vaper a bot
... erm.... beep boop
@hilli_micha Nope
14:54
@CapricaSix THANK YOU FINE HUMAN
@KingTut Go big or go home? ._.
@cswl there is no computer programming course in our school
PLEASE CONTINUE TO CONSUME BIG MAC THROUGH FACIAL INPUT.
Getting started is mostly considered as, copy/paste the code, run it, and figure out the rest. Not everyone is doing it, but I see a lot.
@Cereal what that means
14:55
WILL NEED MAC ADDRESS FIRST
i want you banned for that
@Vap0r I mean.. you're welcome
@Vap0r fine the human
@KingTut basically what Cereal said. If you want to enjoy coding, find something you would like to code first. Any idea works, really.
revealed
14:55
@hilli_micha lol love you too
@hilli_micha wat
The first big thing I made was Tetris in qBasic
more hypothetical questions!
if you have a clear unique identifier of an entity, (like a license plate number in a car), would you still use an (unrelated) int column as primary key and simply make the license plate have a unique constraint?
> consume big mac through facial input
Second was a mandelbrot viewer in java
14:56
I don't remember my first programs
is there any more inputs out of the face?
but I'm confident they sucked
mandelbrot! that was one of my first programs.
oh cool but how will i make something when i dont know how to make it
You split it up into parts
14:56
my first 'program' was in Delphi, where I'd turn on / off a lightbulb by clicking a button
@Neoares There is only one compatible input for food on your face.
@KingTut poorly at first
Then better over time
Step 1: Find what you want to make
@KingTut life must be hard with that type of thinking
With repitition
14:57
just start trying
Step 2: Find out how to get a program to actually run (Hello world)
you'll fail a bunch and learn a bunch
"How do I draw to the screen"
I wrote a tweet stream store-er or something as my first program
"How do I draw a circle to the screen"
14:57
@hilli_micha well...
i like to eat spaghetti from my nose
ah I understand
if you can figure out how to type in this chat, you can probably figure out how to get something really basic going.
Meanwhile, why on earth and event handler called as "reducer" in a framework?
Just to make it look different or cooler than others?
to type in this chat is not ez, 123 if you agree
14:58
yes not ez
So you do mathematics stuff huh
You could write programs for solving mathematical stuffs :|
123
not ez at all, you need to watch out for those Canadians, when they start typing in chat, they make another language entirely.
Programming is really just knowing a thousand tiny things, so you can't really book-learn it
yes
at least if you want to be on point
14:59
@cswl in my school they teach mathematics and sciences and languages
I wanted to integrate with the chat, so I started eating poutine
with cheese turds?

« first day (2701 days earlier)      last day (2472 days later) »