« first day (3259 days earlier)      last day (1675 days later) » 
00:00 - 16:0016:00 - 00:00

12:11 AM
@OTLT-LCar Well to get the spider to stop crawling just use this
crawler._signal_shutdown(9,0)
 
user11867329
You're being so funny I almost shot it.
 
user11867329
@KevinB opinion?
 
abort abort
sys.exit("Kill it with Fire")
@Trisped hasn't spoken in four years
 
user11867329
We salute him.
 
user11867329
Ok Steph listen...
 
user11867329
12:15 AM
I need to sell candy...
 
......
!!pedophiles
 
Dec 20 '16 at 20:20, by Madara Uchiha
@Luggage You know you're doing it right when they start harassing you
 
Sorry, first thing that came to mind.
 
user11867329
12:37 AM
oof
 
user11867329
I might stand this one out.
 
@StephanS I think the last time I talked here was during the row vs record debacle. I don't know, it has been a long time.
 
user11867329
So about my candies
 
ok....
what about them
 
how long does it take to learn react.js
is it a hard library to learn?
 
user11867329
1:01 AM
I need to sell about 3.5k candy pieces, Random values from 1 to 50.
Separated/Sorted in three mandatory categories:
*=~$1
**=1-5
***=5-25+

the candies were free, so we don't need to think about giving more than their value.

Three only possible orders:
Container 1 = $5 - 10 units
Container 2 = $10 - 20 units
Container 3 = $20 - 40 units

I need a smart way to average out the candy distribution.
What combination of which category candy to give for any new order.
Based on the current inventory (already labeled by category and potentially the accurate exact value) AND the fact that $10 contai
 
user11867329
The main goal is to make the first $5 container sold to have a vaguely similar value than the last $5 container sold.
 
morn
 
 
1 hour later…
2:15 AM
hi
 
2:44 AM
does anyone here work for microsoft?
 
@Adan why?
 
i want to be a software dev for them
 
You can send them your resume?
 
that didnt answer my question
 
@OTLT-LCar so (candies) c, (3.5k) m, (amount used $) a. So m = a * c
Lol wait I didn't read the extra pair of the question, give me a second
I would need to know if the percentages you've taken off (e.g. 25%-30%) is a constant. Will that discount always apply or is it only when they buy a large amount of one of the candies
Without the percentage part added in you could probably get away with doing a nested loop
 
4:01 AM
hi
      if jq --arg build_number_arg "$build_number" '.build = $build_number_arg' $version_file > tmp.$$.json &&
	mv tmp.$$.json $version_file && rm -f tmp.*.json; then
	  echo "$version_file sprint version bumped from $current_version -> $bumped_version"
	else
	  echo "Failed to  update the file's build property"
	fi
I thought the if..else here would fail if the mv tmp.$$.json $version_file fails
but it still leaves tmp file behind instead of deleting it
any way to break if the 'mv' fails?
probably need to break it down further
 
 
2 hours later…
5:53 AM
hi every body is there any event for trigger when items of a dropdown changed?
that change can be content or count
 
6:15 AM
Hello, Dr. Nick!
This will let you know if the DOM tree changes
applied to a dropdown, you can know if items are added or removed, or simply changed
 
@Neil thank you
 
@zohreh though ideally you would know the dropdown has changed because you wrote the part where you're changing it
but understandably, maybe you didn't write that part (library or whatnot)
 
 
1 hour later…
7:48 AM
                                                                                                                                                                                 .
 
7
?
 
Why is 6 afraid of 7?
 
because 7 is a convicted six offender?
 
😂
 
8:05 AM
The joke I was going to give was "Because 7 is a fucking psychopath!" actually :)
so yeah, anti-joke
 
8:18 AM
I'm looking for a way to find specific time formats in a string using regex
They will look like this: MM:SS or M:SS
I"m a total noob with regex so any help would be greatly appreciated!
 
chronos
use a library
 
working a lot with time? Use an API.
look for moment.js / luxon / chronos-js
 
Thanks for the tip, I'll check those out! @BenjaminGruenbaum @KarelG
 
eh, they only manipulate dates, how do those help parsing them from a string?
 
@BenFortune You're right, I just checked chronos and I know momentjs. Those libs don't help me parse the time formats from a string
I feel like I just want to search the string for a colon and then check if there's numbers before and after it
 
8:28 AM
([0-5]?[0-9]:[0-5][0-9])
someone try and break this
 
@BenFortune 01:00 AM
 
@KarelG matches that fine
 
and yet that's not minute:second, that's hour:minute
it would be interpreted as minute 1, zero seconds
 
oh bat's
 
oh right lol
 
8:30 AM
I've always thought it was a bad idea to divide minute and second in the same way you'd divide hour and minute
 
8:42 AM
@BenFortune Thanks Ben, works perfectly
 
@user10198470 I wouldn't trust it
 
@BenFortune why not?
 
Because I wrote it, and there's probably a million use cases where it doesn't work
like @KarelG's above
 
Ok, well thanks anyway :)
 
@user10198470 in addition to that, it depends of the context as well (since you said that you are looking for that in a string)
like it would be fine if the string is "I shall not be there at 1:00 because I want to sleep"
 
8:56 AM
Attempting to find context in a string using regex.. Oh dear.. someone please put out the fire.
 
@Neil lol
 
but would it if you do "And if I may quote Job 1:15; "The Lord said to Satan, ..omitted.. Then Satan went out from the presence of the Lord". Does thy convey some heresy?*"
(had to double check the job's number <.< )
 
Clearly the job is to be performed at 1:15
 
And to make the fire a little bigger, how would one add the optional h: or hh: to the previous ([0-5]?[0-9]:[0-5][0-9])
 
((?:[0-2]?[0-9]:)?[0-5]?[0-9]:[0-5][0-9])
but that would allow also 29:00:00
no way to avoid that using regex
 
9:09 AM
@Neil Thanks!
@Neil That's ok
 
also this assumes that if you see NN:NN, that it would be minute:second
probably better to assume it would be hour:minute instead
So ([0-2]?[0-9]:[0-5]?[0-9](?:\:[0-5][0-9])?)
 
@Neil Normally that would be better but in my case it's more likely that it will be minute:second
 
ok, then use the previous
 
@Neil I will, thanks a lot:)!
 
I think at this point you're better off checking ((?:\d+?:)?\d+?:\d+) and parsing that using a lib
 
9:16 AM
true, if you're going to perform additional checks anyway, then regex should be used to find potential times, not validate them (let the code be inflexible at that point)
 
9:36 AM
mornings
 
\o
 
you guys know why the doubleclick on table stops to work after autoload table?
hi Neil, morning
 
mornings
 
9:50 AM
is this code wrong?
$(document).ready(function() {
	var table = $('#pedidos').DataTable( {
    ajax: "data.json"
} );

setInterval( function () {
    table.ajax.reload();
}, 30000 );


} );
because it say's "Uncaught ReferenceError: $ is not defined"
 
@NoobDEV-GBL you probably did not load in jQuery in your document. Add that base script
and use const instead of var there
 
@KarelG you are right, that was jquery load
but, fixing that is saying that i have problems whit id's
DataTables warning: table id=pedidos - Ajax error.
i only have one table...
 
that is a vague error
do you get a json response? (check network tab).
 
if i remove the id stops that error
 
then pedidos probably does not exist
 
9:58 AM
I imagine, because it probably wouldn't find anything to handle
 
humm
 
@KarelG that wouldn't be it. it would still return an empty jQuery object
 
i will try to use other id to see if that happens again
i change the id and still happends
i think the code is duplicating id's then get error
 
yeah but there is "ajax error", so my first thought is to check the ajax. Hence I suggested to check it first
 
@KarelG sorry then, Can you tell me the best way to do this?
 
10:09 AM
open developer console (F12) -> go to "network" tab. Ensure that "preserve log" is checked. Reload the page. Check the request. Is it 200? What does it return?
that preserve log is optional (can be ticked of. but I keep it checked by default)
it gets cleared when you reload the page (unless that checkbox got ticked)
 
1) verify that a message was sent to the server
2) verify that a message was sent *from* the server
3) verify that the status and message content are what you'd expect
4) profit
 
it give error on send request
 
@NoobDEV-GBL ok, well table.ajax.reload() isn't a standard ajax request
time to look into the documentation to understand if you're using the library properly
 
ok then
Reload the table data every 30 seconds (paging reset):
 
@NoobDEV-GBL I don't see any URL or URI
you should be setting one for an ajax request
 
10:17 AM
do you have a data.json file on the same path ?
(just add it in the address bar)
if not, then the path is not what you seek
 
no i dont karelG
maby this is not the corect code i shoud use
i just whant to refresh the tabledata updating pagination and still have the doubleclick funcion working
 
yes. That is an example. It uses data from an url 'data.json'
just adjust that string to the correct url
 
hoooooooooooooo
i see
for exemple i just change "data.json" to "../../includes/select/select_t_oficina.php"
 
I love windows
5
 
na , that didnt work..i still noob
 
10:36 AM
@ShrekOverflow 😀 starred it. SEE. CONFESSION!
 
Its a great example of what happens when you prioritize profits over anything, what tasteless design & software looks and feels like. Perfect example of fooling a customer looks like.
 
@ShrekOverflow now you'll be recorded for all of history for having said that
 
@NoobDEV-GBL that is an odd path. Are you not using any servers? Routes?
 
think of your grandchildren reading this
 
@Neil They'll also read the next comment
 
10:37 AM
If they do
if
 
I think you overestimate the attention span of the future generations
 
You are underestimating my parenting skills
 
future generations? You do not have been on social media Neil
 
I an underestimating the parenting skills of your children
 
10:38 AM
they just react on something without even checking the content
 
remember my kids will be half Russian, half Indian
 
@KarelG In fact, why wait until future generations?
 
user6568562
To be fair, reacting without double-checking the validity has always been a human thing
 
@KarelG wen i'm testing this typ of codes i use direct query on database
@ShrekOverflow that woud be nice to see
 
11:03 AM
G' Morning.
Yet another lame Wednesday in highschool.
 
ya
mornings mate
if i use this code:
<script>

    setTimeout(function(){
   $( "#pedidos" ).load( "/dist/includes/stock/reqs/stock.inc.php  #pedidos");
}, 12000); //refresh every 12 seconds

</script>
it works fine on refresh, the problem is the double click on row to open modal for exeple won't work
 
event delegation
 
any fix exemple?
 
No, go do some research
 
fine
 
11:37 AM
@NoobDEV-GBL Dont worry, youll get used to it, people here are just very serious about "Help Vampires" and require atleast some attempt at research.
Finally finished my console API: codepen.io/SkylerSpark/pen/JjPZGLP
it can render values of variables and execute functions : Variable.exStr.String.setValue: 'Hello'
Still trying to figure out how to execute a function with arguments though.
 
@TaylorSpark use the Function constructor
 
what
no
I mean you could just press f12
 
@TaylorSpark if i was one vamp i probably shoud not be out on sun...
but i understand what you mean
 
11:57 AM
setTimeout only runs once
so either your comment or your code is wrong
 
@TaylorSpark there is a saying: You can lead a horse to water but you can't make him drink, meaning we can give you tools, pointers or even complete code examples, but that does not mean that you get taught how to code something. That is done by doing research, comprehending how it works and writing the code yourself.
we aren't here to "work" for others.
 
@KarelG i know and i am glad for all the help...
still lernning all the time
i was able to refresh the table, the problem is i get no pagination now, so now i'm tryng to fix that
 
12:13 PM
is that not just a datatable option?
(been a while that I used it tho)
 
@KarelG well,that's what i'm researching at this moment
 
👍
 
12:32 PM
I have an ajax function which is being called on an onclick event. But I don't want the function being called when page is loading what can I use?
 
what you have sounds like what you want already
unless you've written it wrong
 
^
 
i.e. .onclick=func();
which I'm now suspecting is the case
 
in that situation, nothing is done at the click action unless func() returns a function
no?
 
true, but I suspect it isn't doing anything when you click :P
 
12:36 PM
onclick is returnig an ajax function and when success another function is being called
sory an ajax request
 
show us
 
I don't understand that sentence. Can you show a snippet?
don't want to have a pyramid head
 
ok
 
@KarelG that would make finding hats very difficult.
 
nah. there is already one I can use. I have to visit a hilly place somewhere for that tho.
 
12:40 PM
function scan_onclick(execute = 0) {

    if (execute == 1) {
        $.ajax({
            type: "GET", //rest Type
            url: "myurl",
            dataType: 'json',
            data: {get_param: 'value'},
            async: false,
            contentType: "application/json; charset=utf-8",
            success: scans_response, // this is another function
        });
    }
}
 
why is that called scan_onclick?
is that running in a loop?
 
this function is called onclick it is working fine I simply don't want to do a request when the page is loading
 
it won't
 
how do you bind the function to the click event?
 
whats the point of if (execute == 1) {
if you don't want it to run just don't call it
 
12:42 PM
seems a guard state (to overcome it)
there must be something dirty
 
when the page is loadig it takes a bit the user is still able to click the button so evrey time the button is clicked when paged is loading an request is being made
 
well now that's the bit of the question you should have lead with
 
execute == 1 is used for another scenario
 
bind it to the button after the entire page has loaded
 
> how do you bind the function to the click event?
element.onclick = ...
element.addeventlistener....
in html: onclick="lolo"....
ect
I DEMAND ANSWERS
 
12:47 PM
I am simply doing onclick="javascript:scan_onclick(execute = 1)";
@rlemon how?
 
depends on what you need to wait for
 
it is used for a popup and when save the save the form the page will load but the link to popup is still visible. when page is loading
 
@luffy that is uhm ... why not just javascript:scan_onclick(1) ?
and inline click binding is meh.
 
@KarelG sorry i am already using like that this is very old code
 
that should not do any action when the page is loading
unless the said function is being called somewhere.
(outside the click attribute)
 
1:00 PM
like I said function is being called when user click a link. when saving the form it take like 3 seconds but the link is still visible so user can click the link so if user click the link onclick is being called
is it possible to use e.preventDefault(); in this scenario
 
@user10198470 this is literally what chronos does
 
Hey ! Just a quick question, are native apps faster than hybrid ones ?
 
@AlexandreDaubricourt Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
 
@BenjaminGruenbaum not really, I just wanted to detect MM:SS or M:SS or HH:MM:SS etc. I don't want to reformat it into some readable string. I also feel that adding a whole library to do this seems like overkill
But thanks for pointing me to that library. I was looking at npmjs.com/package/chronos-js which is obviously not what I needed
 
@luffy why don't you ... disable the link? Or even remove the listener?
show a loading icon instead
 
1:12 PM
Anyone worked with lokijs ?
 
@KarelG I can't do that it is more a table links.
 
remove the listener then
 
@KarelG How do I chek page is loading?
 
I tried like this but not helping:
   if (document.readyState === "loading") {
        execute = 0
    }
 
I hate using normal JS for window.onload and such
I find jquery for some reason makes it easier, even though Jquery is basically just bulky JS
Hey could someone help me with this canvas object?
I made a little function that converts the canvas into a PNG and open a new tab.

However, when I added a new object that draws on the canvas, my function now does.. nothing?
function saveImage() {
 var c = document.getElementById("canvas");
 var d = c.toDataURL("image/png");
 var w = window.open("about:blank", "image from canvas");
 w.document.write("<img src='" + d + "' alt='from canvas'/><br>");
 w.document.write("<a href='" + d + "' download='Canvas Image'>Download Image</a>");
}
codepen.io/SkylerSpark/pen/ZEzMMWK Canvas drawing script is in here
(its too big to paste here)
 
// ur hmtl
< ... onclick="scan_onclick(event)"

// js
function scan_onclick(event) {
  event.preventDefault(); // assuming element is <a>
  if (!event.target.dataset.clicked) {
    event.target.dataset.clicked = 1;
      $.ajax({
        ...
      });
  }
}
@luffy ^
 
Im getting this error
PBkNWnPJYnNM:33 Uncaught DOMException: Failed to execute 'toDataURL' on 'HTMLCanvasElement': Tainted canvases may not be exported.
    at saveImage (s.codepen.io/SkylerSpark/debug/ZEzMMWK/PBkNWnPJYnNM:33:12)
    at HTMLButtonElement.onclick (s.codepen.io/SkylerSpark/debug/ZEzMMWK/PBkNWnPJYnNM:27:31)
canvasses may not be exported ;-;
Why does it say "tainted"... this is a new error to me, never seen it before
 
1:53 PM
el.addEventListener('click', handler, { once: true });
@luffy (cc @KarelG)
 
I am aware of that. But he's working on legacy code. And yeah it means that I am encouraging bad practice. 😕
 
@TaylorSpark look it up.
 
bruh
it requires dropbox or a server
both of which I dont have
 
why would you need that?
 
It says that the error occurs because of security measures (Reasonable) and says you need a php webserver, or a cross domain host to be able to export the canvas
 
1:59 PM
A off topic question, might be a stupid one, do we have to plug a electric guitar to a power source ?
 
@PremRamman Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
 
Hey guys ! Long time :)
 
just fix your CORS settings
 
@TaylorSpark well a ) php has nothing to do with this. b) you don't need dropbox. you need a host that will serve images with cors headers
imgur serves with cors headers
 
2:00 PM
unfortunately imgur is blocked here
just like dropbox
AND github
 
then find another one
 
and pretty much every other useful tool
 
or stop wasting time at school and do your school work instead
 
Dude, please mind your own business, Im not even doing school work right now, Im watching a presentation from another group
 
@PremRamman I think so.. maybe ._.
 
2:01 PM
dont assume im immature and dont do my work ;-;
 
Everytime I login, I find a comment of someone wishing rlemon birthday wishes
 
Hi ALL. Best advice: never argue with rlemon...
 
oh, happy birthday btw, @rlemon
 
alright. good luck with your code.
@Neil thanks. I'm old.
 
happy belated birthday rlemon :D
@Neil Thanks
 
2:02 PM
it was on the fifth.
 
though probably the fact that I reference Nelson from the Simpsons is an indicator that I, myself, am not so young either
 
I was wandering if some of you knew how was working budeling (I guess this has something to do with this).

I don't understand why when I do
`import PhotoSwipeUI_Default from 'photoswipe/dist/photoswipe-ui-default'`
It works (from node_modules) but when I do
`import PhotoSwipeUI_Default from './photoswipe-ui-default'`
From a copy of this exact same file it does not works with the error
> "export 'default' (imported as 'PhotoSwipeUI_Default') was not found in './photoswip-ui-default'
 
maybe because you are not exporting anything? how does the content of the file you are trying to import look
 
2:24 PM
There is indeed no export
But how does this work in the node_module ?
Does it have to do with wbepack ?
I've related my question there
1
Q: How does import/export from node_modules works?

BaldrániI was wandering if some of you knew how was working bundling (I guess this has something to do with this). I don't understand why when I do import PhotoSwipeUI_Default from 'photoswipe/dist/photoswipe-ui-default' It works (from node_modules) but when I do import PhotoSwipeUI_Default from '...

 
77
Q: Can't require() default export value in Babel 6.x

XGHeavenIn Babel 5.x, I can write the following code: app.js export default function (){} index.js require('babel/register'); require('./app')(); Then, I can run node index.js with no errors. However, using Babel 6.x, running the following code index.es6.js require('babel-core/register'); requir...

 
So you're telling me that webpack goes up to find the root of a my modules in the package and build over it ?
 
@KarelG @rlemon thanks a lot for helping
 
 
1 hour later…
3:40 PM
sill not able to find a solution for me..
 
:shrug:
 
Have you tried harder?
 
@NoobDEV-GBL what's your issue
 
  const contractEndDate = suppliers
    .map(
      supplier =>
        `${supplier.name} ${Moment(supplier.contract_end_date).format(
          'MM/DD/YYYY'
        ) || empty}`
    )
    .join('; ')
I fucking hate our linting/prettier rules
 
{
  "presets": ["next/babel"],
  "env": {
    "production": {
      "plugins": [
        ["transform-react-remove-prop-types", {
          "removeImport": true,
          "ignoreFilenames": ["node_modules"],
        }]
      ]
    }
  }
}
in order to remove propTypes from the final build I have added that file
how can I make sure that is having an effect on the final code?
can I manually check if propTypes is there?
 
3:56 PM
@ndugger ya mate, read a lot of decomentation trying stuff no end -.-
@Cereal i'm lookin for a way to update my datatable and grid but not the whole page...
 
@Aurelius yes
@NoobDEV-GBL that's impressively vague
the answer to that question, as you've presented it
is "use javascript"
 
no, I read the SO blog
 
@Cereal that's not even his original question
impressive
 
use TypeScript noob
😉
 
he got paid to write that too
Imagine being paid to write that
 
3:58 PM
@Cereal i know...i'm using it, the problem is when makes the refresh datatable the double click won't work, still not finding a way to fix it
 
who's wen now?
 
00:00 - 16:0016:00 - 00:00

« first day (3259 days earlier)      last day (1675 days later) »