« first day (2308 days earlier)      last day (2638 days later) » 

12:00 AM
restaurant poutine is always shredded cheese
and that isn't poutine
 
I find the entire concept a bit odd
 
@rlemon there are a lot of worse things you can do, IMO
 
@tereško same reason as someone listens to music while they work.
something familiar to dull out the background
@KendallFrey idk man. cheese curds is like.. the one thing that makes it a poutine
otherwise it's just fries with gravy
adding any other cheese shouldn't be called a poutine
 
jQuery question: say I have an element and I would like to use .last() to get the last element with a specific class. Can I do that?
 
so you have an element, and you want to get the last.. element? child? sibling?
please be more specific
 
12:12 AM
@rlemon Sorry, last sibling
Alternatively, say I want to get the last sibling that does not have a certain class. Can I do this?
 
how do you have the original element?
 
@rlemon $('#vote').siblings().last()
If that's what you're asking
 
like this?
.siblings takes a selector
either one works I suppose
@SirCumference
 
@rlemon Huh, neat
Thanks!
 
12:33 AM
sometimes it feels like ADHD is just the modern "indigo children" bullshit
while there are some, who have actual issue, most of those just lack .. well ... parenting
 
adhd is (from what I hear) quite common. using it as a blanket to coddle the child I think is wrong, but the diagnosis I don't disagree with. although I do think there is obviously varying degrees
 
most of "ADHD" is just "being a fucking child"
and, as allways #notAll
 
@tereško As someone with ADHD, it makes reading 20x harder, and even as an adult you end up losing focus at multiple points in a conversation
 
granted mis-diagnosis happens. but I'm not going to tinfoil hat that shit. I was diagnosed with adhd and looking back I was much more hyperactive and had troubles in school than my peers. I did however grow out of it
 
@SirCumference as a person who listens to audiobooks while programming, I cant relate :(
 
12:40 AM
@tereško Audiobooks are a bit of a saving grace :)
@rlemon Same. I had a lot of trouble making friends because I was so hyper in middle school.
I grew out of it by high school though
 
I had a saving grace of an older brother who was popular and who didn't annoy people. so up till grade 9 that was okay. by then I was kinda growing into my own and I think controlling most of my hyperactive tendencies. although even now (when no one is around) I still have fits of energy
 
I'll be listening to someone give me a task, accidentally daze off and have to ask someone nearby "what did he just ask me?"
 
see I lost most of that around 25
 
I'm only 18 :P
 
I can concentrate on things if I really try
 
12:46 AM
@rlemon Same. And once I start concentrating I get a ton of work done, nothing else matters.
 
as a youth computer and engineering was the only thing that kept my interest, so I suppose that was also a saving grace
it was all new stuff at schools. and being adept at it made me look better even tho I got 60% in most other subjects but math and science
 
Say I have two classes, one of which is a kind of wrapper over the other, to provide an API to external code, while leaving most of the functionality only available to internal code. (It's basically a hack to get C#-like internal). What should I name the two classes?
 
@rlemon I'll usually try and convince myself that the subject is interesting, even if I hate it
That helps a lot, surprisingly
 
@KendallFrey don't do that
 
To be completely honest, I was hoping someone would tell me "don't do that and here's why" :P
lol you
 
12:50 AM
@rlemon Uh, probably dumb question, but can I also make it exclude elements with display:none?
 
:visible
 
That's convenient. Thanks again :)
 
np
note: that is a jQuery added thing
it isn't available in regular selectors
 
hello
is their anyone using eclipse?
here?
 
is that still all java?
 
12:55 AM
I use sublime text.
very goodt IDE
 
eclipse is for any language you have plugins for
but yes, java is the main target for it
 
you can develop android on eclipse right?
I did learn it once in udemy.
 
What onload does? e.g. scriptTag.onload = implementationCode
 
when I was using it it was built in java
 
aye.
it is built in java
 
12:57 AM
where implementationCode is callback
 
the 'shell' is available for other use, too. It's a whole system.
 
@ZicoPL it means "when this script tag loads, call this function"
 
i should work on an electron / isomorphic browser boilerplate. An 'everywhere' app.
 
@rlemon whether I need this when I loading 3 scripts dynamically?
 
no clue
 
1:00 AM
@ZicoPL if possible, use a module loading library.
module loader
 
yea this is 'module loader'. Without onload ma script not execute before next added...
 
which is normal and proper.
 
can i paste here link to my topic? It will be easier explain what I mean to stackoverflow.com/questions/42125007/…
 
I was actually suggesting to just use a pre-made module loader like requirejs, systemjs
 
@webnoob answered me quite well but when I don;t use callback my 1st script not execute before next code..
 
1:07 AM
if jquery is the script you want to load first, can't you just put a <script> tag in the html earlier?
or is it dynamic?
 
@Luggage I heard about it but I'm so close to solving problem via simple & short script
 
I mean.. do you need to load on-demand?
 
dynamic
 
ahh, ok
 
first is 'document.addEventListener("DOMContentLoaded", function() {}' :)
my site where i test it :P horbaczewski.info
and i don't know why jquery not work after added by dynamically scripts ;/
console report error in 'var $ = jQuery.noConflict();'
'$ = ..' is below function (where I add dynamically scripts)
I had something to screw up :(
i paste here my short func where are adding scripts:
`var loadJS = function(url){
//url is URL of external file, implementationCode is the code
//to be called from the file, location is the location to
//insert the <script> element

var scriptTag = document.createElement('script');
scriptTag.type = 'text/javascript';
scriptTag.setAttribute('nonce','22os9h3sdfa');
scriptTag.src = url;

/*scriptTag.onload = implementationCode;
scriptTag.onreadystatechange = implementationCode;*/

document.body.appendChild(scriptTag);
 
1:17 AM
that doesn't use the callback you had before. What you call "implementationCode"
You need a callback to wait for the script.
This has a simple script loader, very similar to yours, but return a "Promise": bradb.net/blog/promise-based-js-script-loader
 
"implementationCode" is a remnant of the previous function stackoverflow.com/questions/14521108/…
 
Promises are the standard way to deal with asynchronous code..
yea, implementationCode is needed.
 
"You need a callback to wait for the script." ok but how I can do this callback :P
 
well, a callback is needed.
1 min ago, by Luggage
This has a simple script loader, very similar to yours, but return a "Promise": https://bradb.net/blog/promise-based-js-script-loader/
If you don't know about Promises, you should learn. they are used everywhere.
 
:D
Sorry about the awkward call @Luggage. I was totaled by the jet-lag
 
1:21 AM
it wasn' awkward.
 
Promises it no easy understand
it's my begining with js :P
 
Sure then are. Just call .then(function() { ... do this after promise is done ...});
You need a callback anyway, a a promise is the standard way to do that.
A newish standard (few years)
unless, of course, you can just put <script src="jquery.js"></script> in your head like a normal person
 
@Luggage so which hotel you booked?
 
Americana
 
" .then(function() {' is $(document).ready(function(){ from jquery?
and dubel document.addEventListener("DOMContentLoaded", function() {
?
 
1:27 AM
Rephrase, please. I don't understand the question.
 
may I mistaken clue :P
better is in bottom of body tag :P
 
Sure, in order that you need to load.
But for dynamic, your script looked ok, before you removed the callback.
 
yes, I guess
:(
I try understand way to do that via callback and promisses
Could you paste here or my topic prepared example? :)
I know that I demand a lot..
 
1 message moved to Trash can
@ZicoPL Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. For posting large code blocks, use a paste site like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
 
but I have no idea how to adjust it
 
1:37 AM
That site HAD a prepared example. They even show an example, at the bottom, of loading two scripts.
 
@CapricaSix sure, I forgot. I'm sorry It never back :P
@Luggage ok i tried do something and wrote this: pastebin.com/x8xtFvTb
@Luggage I guess that is completely wrong what I wrote..
I need script.js from site, which u send me?
use*
 
2:10 AM
oi
 
Okay so I realize that JS (and other languages) can't multiply/divide floats with accuracy, but it can add/subtract right?
 
!!> 0.1 + 0.2
 
@Meredith 0.30000000000000004
 
I will take that as a no :O
 
@Alesana technically speaking it's perfectly accurate, just imprecise
Also, it's not the operations themselves that are imprecise, it's the numbers you use.
 
2:20 AM
Hmm, so accuracy and preciseness is not the same?
So the math is accurate, but the floats are not precise?
I guess with dollar amounts I should do...
!!> ((1.23*100) + (4.23*100)/100)
 
@Alesana 127.23
 
No not that lol
 
Use integers for money
 
It is not for storing money values just displaying it, but it should be fine to do..
!!> ((1.23*100) + (4.23*100))/100
 
2:23 AM
@Alesana 5.46
 
Right?
 
Use integers for money
Or a money library
 
for displaying it, use toFixed
and definitely use integers for discrete values such as currency
 
Ah okay, so store it in cents value to begin with?
 
yes
or tenths of a cent if need be
 
2:24 AM
Probably 1/100 cents
 
depending on your needs
 
Ah okay I have to change a lot of my code
 
It's useful to know which numbers JS can represent exactly
In general, it's numbers that can be written in a binary fraction
or, fractions that are based on a power of two
so 1/4, 1/16, 1/4096 can be represented exactly
 
It's the same rule as decimal
 
Oh that's interesting..
 
2:26 AM
Decimal has the same problems with precision
you can't store 1/3 as a decimal
 
But you can store 0.25?
 
you can
Every binary fraction can be represented as a decimal, but not the other way around
 
Interesting, I can't think of a practical use to store 0.25 as a decimal when you can't store 0.24 but I am sure there is one
 
Remember you can still store a value that for all most intents and purposes is 0.24
 
Usually your error is small enough that it doesn't matter
 
2:29 AM
it's not exact, but exact enough that it's physically unnoticeable
 
In typescript is there a difference between capitalizing a type, string String?
 
But it's important to avoid using floating point arithmetic for things where precision is a really big deal
 
Also is there a site that has the documentation easily generated for the type?
 
My app is just for displaying statistics in money amounts, the whole app doesn't actually do anything with the money.. would it be okay, in that case?
 
Like when dealing with money
 
2:29 AM
47
Q: Typescript: difference between String and string

Paul0515Does anyone know the difference between String and string in TypeScript? Am I correct in assuming that they ought to be the same? var a: String = "test"; var b: string = "another test"; a = b; b = a; // this gives a compiler error! The compiler says: Cannot convert 'String' to 'string' Is tha...

@Alesana if you're doing calculations, you might still get funny results
 
Didn't a space ship explode once because of floating point arithmetic?
 
In particular, if you ever need to compare two numbers for exact equality, you probably shouldn't be using floating-point numbers
 
Thanks, but is there a site for all the typings documentation rather than browsing the github repo of that typing
 
Seriously @Meredith???
 
Nvm apparently they converted a double to a 16 bit int and the rocket blew up
 
2:31 AM
Oh my god
 
@Meredith There was one that crashed due to incorrect conversion between units, but I don't remember one with rounding errors
 
Anyways I the only calculation I am doing with the money is a dollar amount with a whole number and adding dollar amounts so I suppose it would be okay for my app.. especially since I've already built so much into it with storing floats haha
 
Wow I couldn't imagine being responsible for that one
 
2:34 AM
in the age of git blame :S
 
3:26 AM
git config user.name "wasnt me"
 
sometime non-programmer don't understand the usage of git.
they think after they push through the git then the source code is final and can't be reverted.
this happens to designer and admins who don't code that much.
 
3:49 AM
@jacobian All the more reason to use it. If they can't tell the difference, then no harm, no foul.
 
It seems to happen in chrome but does it happen in all browsers that $(document).ready(); is called when a file is loaded via ajax $().load(); function?
 
4:23 AM
@Luggage I enjoyed that show, the main actors were all pretty funny and it was really upbeat and cheerful for that sort of show.
 
@Meredith If you mean Ariane 5, it blown up because a program is putting a double into a short int. The int overflowed.
@KendallFrey That'd be Nasa's Mars Orbitor, which is another rocket...
 
 
1 hour later…
5:41 AM
this.allItems = this.events.filter(event=> new Date(event.start_time) === this.fromDate && new Date(event.end_time) === this.toDate);
is this correct? if event.start_time is a string
 
can I upload 300MB of my project to github?
what's the maximum size of coding project that can be uploaded there?
 
You can go upto 1gb
 
and bigger than that I had to use github premium right?
 
yes
this.allItems = this.events.filter(event=> new Date(event.start_time) === this.fromDate && new Date(event.end_time) === this.toDate);
is this correct? if event.start_time is a string
 
6:17 AM
So, some helpful anonymous user edited one of my very old answers:
 
well it does hurt
 
lol
 
6:34 AM
I'm trying to pull with rebase, and after being told a patch failed the status shows 2 deleted files
which should not be deleted
how should I proceed?
 
6:58 AM
is GH being a lousy POS for anyone else?
 
7:19 AM
@Sajeetharan the js Date(string) will use .parse method. However, it's recommended to use new Date(year, month, day,...) which you have to handle it yourself.
if you're only storing strings, you don't have to construct a date object.
 
7:34 AM
@jacobian You can type that question into google to reach github's quota faq, which is official, detailed, up to date, and explains to how to handle large files. Paying does not seem to be a direct solution.
 
@Sajeetharan That works only if start_time is an iso date string: stackoverflow.com/a/41345095/893578
@Mosho You mean a case like this? stackoverflow.com/questions/11956710/…
 
not really, during a rebase
 
Did the rebase success or fail?
 
one of the patches failed
 
7:44 AM
Hmm. I haven't tried undeleting file in the middle of a rebase. If you haven't finished the rebase, I think you can finish it and checkout the two files from a commit before they are deleted.
 
I didn't delete anything
that's the problem
 
@littlepootis there's a major conference in Oxford at the end of march, you can probably still apply for a scholarship (they pay for your travels as well) 2017.render-conf.com
 
nor did any of the commits
 
Hi
 
@Mosho My git-fu is limited so... good luck.
 
7:47 AM
do say that you know me. You can also probably crash at where I live
 
thanks :p
 
exception":"invalid_parameter_exception","errorcode":"invalidparameter","message‌​":"Invalid parameter value detected","debuginfo":"Missing required key in single structure: component
 
@jack 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.
 
@KarelG thanks
@KarelG how can i check if start and end_date is not null
this.allItems = this.events.filter(event=> new Date(event.start_time) === this.fromDate && new Date(event.end_time) === this.toDate);
 
exception":"invalid_parameter_exception","errorcode":"invalidparameter","message‌​":"Invalid parameter value detected","debuginfo":"Missing required key in single structure: component
what should i doooooooo????
 
7:50 AM
with the same query
 
not null? js has truthy falsy coercion
 
@jack add the missing keys and/or right parameter values
 
if the event.start_time is not null then check for filter
 
@Sheepy can I see your github page sheepy? I want to know what have you been doing lately
 
1 message moved to Trash can
@jack Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. For posting large code blocks, use a paste site like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
1 message moved to Trash can
@jack Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. For posting large code blocks, use a paste site like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
 
7:53 AM
listen to him jack.
or just use jsfiddle.net
 
her
 
ok sorry
 
caprica six is a woman? I thought it was a bot
 
@towc it doesnt work for me
 
is capiraca six an RO?
 
7:56 AM
@jacobian yes
 
@jacobian github.com/Sheep-y And yours?
!!> !! "Are you a robot?"
 
@Sheepy true
 
stackoverflow.com/questions/42129686/… please answer this . its too important
0
Q: error in using REST service to upload file in moodle

jackI want to use moodle's REST api to apload a file to moodle. this is my code in java script: var domainname = 'http://192.168.1.75/moodle'; var token = '7e086857a2c98be468d804c5be8a1fae'; var functionname = 'core_files_upload'; var serverurl = doma...

 
I have no memory. Every day I must have a look at a few MDN pages to check for example whether maps have a set or a put method...
 
@DenysSéguret Quite typical. Donate to Mozilla for the future of Internet. :)
Using Firefox also helps, as their main income is Firefox homepage partnership. :D
 
8:07 AM
I already do my part for the future of the internet. Nobody helps me pay my dedicated server hosting only free add-free softwares
 
lol
 
How do you iterate on a Map instance's values on IE11 ? (edit: looks like forEach is a solution)
 
@towc again thanks for your advice with the normal calculation. Worked as charm. Also checked out the 3D theory about it. By the way, its interesting because the z value of my normal vector shows a sequence of 1, 0, -1 when only one axis is rotated but with two rotating axis, that is if they rotate the same amount rotate(1, 1) , my normal vectors z coordinate only shows a value between 0 and 1, opposed to previously -1 - 1. Doing rotate(1, 1.2) works though. The values have to be different.
 
@DenysSéguret forEach
Or polyfill
 
answer pleaseeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
 
8:21 AM
@jack Please don't repost your question, at least no so soon. If we can help we will. Same for SO - if someone see it and can answer, they will.
@jack SO is a question and answer site, not a fix my problem now site. Try expertexchange for that.
 
when a user logins in, a cookie is set in its users column "token"
if another user tries to login into the same account, if a token is already set, deny the login
but what if the user having the token removes the cookies?
login is lost for everybody.... right?
 
@neoDev Cookie only exists on client side. If you want to reject multi-login to the same account you need to remember who is logged in recently in database. Normal approach is to kick the first user out, not to reject the newer login.
 
I want to reject the new login
I need to clearify the things to myself for now
 
You can set an expire on the old session. So that the account won't be locked forever.
 
I am not using php session or something lik ethat
everything is custom code by me
so there is now garbage collecting, sessions handlers etc
 
8:37 AM
Or in database. Session is a common server side concept, not php. As I stated above, you need to it to detect multi-login to same account.
 
I will draw a logical diagram for clearify myself the things
xD
what I do is: if username and password are ok, then
check if database has token (cookie)
check if client has token (cookie)
and now I am thinking what to do
 
1. if username or password not ok, reject.
2. if database has cookie and client not have cookie or not same cookie, and the database cookie has not expired, reject
3. if client has no cookie, create one and add to database. either way, update the last seen time in database
@neoDev Note that you need to update the last seen time for every action, least it expires (allowing others to login) when you are still in the system.
 
I destroy the token (cookie) in the database, by updating a cell to 'false'
 
@MadaraUchiha forEach apparently doesn't work in edge
I was baffled
had to polyfill that
 
anyone use angular cli
 
8:48 AM
@Sheepy what is not clear for me is:
 
0
Q: Add 5 minutes to current time javascript

venkat14I am getting the current date as below: var now = new Date(); I want to add 5 minutes to the existing time. The time is in 12 hour format. If the time is 3:46 AM, then I want to get 3:51 AM. How to add 5 minutes to the "now" variable? Thanks

tss
 
- if db has no token and client has no token
- if db has no token and client has token
- if db has token and client has no token
- if db has token and client has token
I need to figure out the mechanisms to:
- allow only one session (first user who logins in)
- do something when a client deletes the token (valid to destroy the db session)
ok I draw a diagram and then I come back... !!afk drawing himself a diagram
 
9:08 AM
Could someone please look at this library and tell me how beautifully it has been structured, designed, architectured or something alike
https://raw.githubusercontent.com/eligrey/FileSaver.js/master/FileSaver.js
 
@tereško thanks
 
i´m trying to send a base64 img string to my express/ node server. I always get is too long. Maximum length is 128. I search for a solution, which pointed me to increase the default limit property inside the bodyParser. But I still get the same error. Do I have to do something else?
app.use(bodyParser.json({limit: '100mb'}));
app.use(bodyParser.urlencoded({ limit: '100mb', extended: false }));
 
@Mathematics uhm... to be safe, you should use hasOwnProperty over in to check if an object has a given property
the latter searches in the prototype chain
 
or is it more a problem with POST
 
9:20 AM
@KarelG this library is using object literal pattern and then prototype, initially it looks ok to me, but I consider myself experienced enough to say if it's good enough so that I could learn from it, if it makes any sense
 
@elsololobo just a guess (since i don't use that framework), did you have set the Content-Length property of your GET request ?
 
what is a javascript variable?
 
@KarelG no i don´t have. And it´s a POST request, is that wrong?
 
according to w3: JavaScript variables are containers for storing data values.
but is that really correct?
there not really containing something, but rather pointing to a memory space right?
 
that "w3" that you used = w3schools ?
 
9:26 AM
yeah
 
@SuperUberDuper why you digging into it by the way ?
 
w3schools is garbage. Please don't check their webpages. They may have some "useful" informations, but in general, that site contains bad information
Eh, those were times that people came to SO with questions why "something didn't go as they want" while they learned from w3schools
 
@Mathematics I'm trying to teach someone
 
I am gonna turn 30 in 3 years and it scares me, it feels like I have become an adult
 
your still young
 
9:33 AM
easy for you to say because you are comparing me with you
 
You're still old :P
i'm from '91
 
If you pass a primate type by value (is referenced to by x), why does x not change after, unless you pass it wrapped in the the object
 
@KarelG you will soon join the elite uncle club with me
 
objects are passed by reference it seems and primative types by value
but people say references are always passed by value
 
@SuperUberDuper For a second I thought, you were comparing me with some variable x
Objects are passed by references while primitives are passed by value
God it feels like I have yet to do so much in life and I have like 3 years to do it XC
@KarelG Are you not feeling scared of getting old ?
 
9:44 AM
@SuperUberDuper call by sharing
@FlyingGambit that's a mental aspect... If you feel fine, fresh and young, you won't feel as an old brat.
 
does someone have experience with MSSQL and column type image?
asked our database admin for a table where i could put in base64 string´s for images, and he gave me a table with a column of type image
never worked with mssql, would that be the correct type or shouldn´t it be varchar or whatever
 
It's deprecated apparently
 
but could i insert base64 string there or is this wrong?
do i have to convert it to a img serverside?
 
do you really need to store images as base64 ? Base64 is heavy and makes only sense for very specific communications
 
no i could also do it on a other way i guess
 
9:49 AM
save the image to disk, storage is cheap
 
but then i would have to implement a filesystem logic, or?
 
What? Just save it and store the path.
 
hm ok
 
keh image column
 
why not use varbinary(max)?
 
9:52 AM
that was the Q what datatype would be appropriate for a base64 string on mssql
 
I would use both, db for path info and (redundant) filesystem for storing images.
 
ok seems to be easier.
but converting an img for client-server communication to base64 is still right?
 

« first day (2308 days earlier)      last day (2638 days later) »