« first day (2011 days earlier)      last day (2934 days later) » 

user5020521
12:00 AM
have I made a mistake?
 
user5020521
shouldn't I have done it ?
 
@Riccardo990 it's generally a bad idea, yeah
believe I'd delete that line if I was you
 
user5020521
wow can you flag the message as offensive so that it will be removed
 
click it
 
user5020521
click what
 
12:07 AM
you'll see a yellow arrow on the lefthand side
your message
and you'll have an option to delete
it's probably fine, but law of averages on the internet says never do that
 
user5020521
no I haven't
 
user5020521
I can't delete it
 
you moused over the line of text (sorry not clicked)
and you don't see the triangle on the left hand side show up?
wonder if it's been too long
 
user5020521
the time to delete it is probably up
 
right , yeah
 
user5020521
12:09 AM
so if you flag it as offensive it will be removed
 
user5020521
did you do it ?
 
I'm not a moderator, just tried
I'm sure it will get clipped out
 
user5020521
well at least is offensive for you buddy
 
user5020521
thank you for flagging it as offensive
 
user5020521
:)
 
12:11 AM
haha, np
 
user5020521
btw did you understand what is my problem?
 
user5020521
did you click it?
 
not sure I have the time for a deep dive right now honestly
about to put kids to bed, just kind of compulsively clicked the link
what's the problem in pill form?
 
user5020521
now you don't have to go deep in it
 
user5020521
in pill
 
user5020521
12:14 AM
if the google maps api script is loaded codeAddress is executed if codeAddress succeeds the function which displays the coords is executed and an ajax request too
 
user5020521
so the problem is this
 
user5020521
if you need to create more than one record how can you make the conversion without reloading the scritp?
 
user5020521
the callback of loadScript is codeAddress the function which converts a street address into google maps coords
 
user5020521
and loadScript event is onClick
 
so you get a function or it calls a function?
sorry, lacking context
you load a script that is a function?
 
user5020521
12:16 AM
loadScript fires when you click save button in a generic form
 
k and what gets loaded?
 
user5020521
if the script is loaded the callback of loadScript is executed
 
user5020521
the script is the google maps api
 
user5020521
that allows me to use the geocoder class
 
the loaded script, right?
 
user5020521
12:17 AM
yeah
 
ok, just step through that function and find the reference to the google api and call it directly
 
user5020521
the classic gmap script that has the dev's api key
 
user5020521
wait
 
if it doesn't put it on the window, get a reference to it and put it there yourself or pass it to another part of your app
k
 
user5020521
if the script is loaded the street address you entered will be converted into coords
 
12:19 AM
ah, so it's an api call then
have you looked at the script that gets loaded?
 
user5020521
if the conversion succeeds the ajax request to send these coords to database will be executed
 
user5020521
function loadScript(src)
{
    var s,
    r,
    t;
    r = false;
    s = document.createElement('script');
    s.type = 'text/javascript';
    s.src = 'http://maps.googleapis.com/maps/api/js?key=AIzaSyAaMAfu7S2AITODrGJzVkIYBXlZR3FYhuQ&';
    s.async=true;
    s.onload = s.onreadystatechange = function() {
        //console.log( this.readyState ); //uncomment this line to see which ready states are called.
        if ( !r && (!this.readyState || this.readyState == 'complete') )
        {
            r = true;
 
user5020521
basically is r is true codeAddress callback is called
 
what is codeAddress(); ?
is that yours or googles?
 
user5020521
the callback function of loadScript
 
user5020521
12:21 AM
here it is
 
user5020521
function codeAddress() {
    var geocoder = new google.maps.Geocoder();
    var address = document.getElementById("via").value;
    address += " " +document.getElementById("civico").value;
    address += " " +document.getElementById("cap").value;
    address += " " +document.getElementById("citta").value;
    address += " " +document.getElementById("prov").value;
    console.log(address);
    var lat=[];
    var lon=[];

    // next line creates asynchronous request
    geocoder.geocode( { 'address': address }, function(results, status) {
 
I'd say just call that again when your next address is entered?
instead of loading the script
put one more closure around that script function and persist "r" so that if you call it again and the api has loaded it just runs without reloading the script
if you're using the same element id's that is
it looks like all that codeAddress function does is pull some elements and use the api
so once the api is loaded, it's ready to use without reloading the script unless I'm not understanding something
right?
 
user5020521
the fact is how can I change some values without reloading the script if the function that loads the script is called when you click save
 
user5020521
????
 
oh, you don't have control over that code?
 
user5020521
12:25 AM
this is what is driving me crazy
 
user5020521
basically this is the warning in console log
 
do something like this
 
user5020521
You have included the Google Maps API multiple times on this page. This may cause unexpected errors.
 
@Zirak or you can just implement your forms the right way, and require a hidden server generated auth/proof field.
 
user5020521
this is the warning
 
12:27 AM
1 message moved to Trash can
@Shane Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
1 message moved to Trash can
@Shane Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
 
user5992646
Will putting all me css media queries in <head> help load website faster in portable devices?
 
wtf, I hit ctrl K
var loadScript = (function () {
var r = false;
return function loadScript(src) {
// same as before
}
}());
 
user5992646
!!tell Shane format
 
@Shane Format your code - hit Ctrl+K before sending and see the faq
 
user5992646
lol
 
12:28 AM
lol
 
so it has to be capital, got it
 
user5020521
@Shane whenever you click save button the script is loaded
 
user5020521
that's why it is loaded at least twice
 
here's the question, do you have control over that code?
can you change it or is it something you have to work around?
if you can't change it, then curry it with the function I gave you above
 
user5020521
I can change it effectively because I've written on my own and I know every single line
 
user5020521
12:30 AM
btw let me tell you what is my goal
 
k, so take "r" out of that closure, because you are setting it to false every time you call it
 
morning
 
I have to go unfortunately, kids need to get in bed
 
user5020521
well just let me tell you this
 
@Shane idk what you're talking about, but change return function loadScript(src) to return function (src)
 
12:31 AM
then I've got a late night ahead of me wrestling with knex and ducks and some test suite that's causing my implementation to fail
 
user5020521
if I take that r out of the closure I will fix it
 
@Shea you can name it or not, in the linter's I'm used to you always have to name functions
 
no
 
oh right yeah, same name
yeah
 
return an anonymous function
just do it
 
12:32 AM
can't change it now, time's elapsed
 
if you want to name it then do this...
 
well, I understand that most people can
but I'm used to an environment where CI will kick it out
so it's habbit for me
 
return functionName;
function functionName () {
//...
}
 
user5020521
@Shea did you understand my problem?
 
no
 
12:33 AM
from a "I would prefer as little issue as possible" perspective would it be best to let say
$('#div').load('form.html') or to create the form with javascript?
 
as stated here
2 mins ago, by Shea
@Shane idk what you're talking about, but change return function loadScript(src) to return function (src)
 
user5020521
I load the google maps api script whenever I click a button on a form
 
user5020521
if the gmap api script loading succeeds the function to convert a street address into gmaps coords will be executed
 
user5020521
if that function succeeds another function makes that values visible entering them into the form fields
 
user5020521
the problem is that the save button of my form has an onclick event that calls the function that loads the script
 
user5020521
12:37 AM
so the gmaps api script may be loaded multiple times and that may cause unexpected errors
 
@Riccardo990 I am having a similar problem right now
 
user5020521
@happy are you writing the same code as mine?
 
the solution I found to works goes as
window[ the_name_of_your_function ]();
same in the sense of the way it works, yes
 
user5020521
@happy did you understand what I need to do
 
your problem is that sometime you click the button and nothing happen, yes?
 
user5020521
12:40 AM
did you click it
 
yes
 
user5020521
well listen to me
 
user5020521
now
 
user5020521
make a fake add
 
user5020521
click aggiungi
 
user5020521
12:40 AM
keep the console open
 
user5020521
and leave all the fields blank
 
@happy don't do that
 
?
 
user5020521
@Shea what are you talking about
 
user5020521
?
 
user5020521
12:42 AM
@happy did you make the fake add?
 
user5020521
keeping the console open?
 
Yes I did
 
user5020521
do it again
 
user5020521
you will see a google maps warning
 
there was a error message the first time: one for test.js on a remove function with a fixed value and another because of multiple google maps api include
 
user5020521
12:45 AM
that is what I'm talking about
 
what is running on server side?
 
user5020521
the multiple google maps api include
 
user5020521
server side some rows were added nothing more than that
 
@Riccardo990 for future, try services like localtunnel or ngrok
 
is it possible mapi fire before the data get in ?
 
user5020521
12:49 AM
what are these services?
 
user5020521
and why are suggesting me ?
 
they proxy your traffic (as in traffic directed to you) basically allows you to open your port to general world without giving them an IP and you opening ports
 
user5020521
I'm unable to use them
 
user5020521
btw did you understand my problem?
 
no I will have to read the conversation
 
user5020521
12:50 AM
I have a google warning whenever the google maps api is called multiple times
 
user5020521
the google maps api script is loaded asynchronously
 
user5020521
and the function that loads it has a callback function that converts a street address into latitude and longitude
 
I think a solution would be to call the google map api and wait for it to load before anything else
 
user5020521
the function that loads the script is called when you click the save button in a form
 
user5020521
and how may I do it?
 
12:54 AM
possibility: instead of preventing the form to send, make it send, then when the user land on the sent form server side script, make it come back to the main page and for google map api, make it apply after the data is loaded
or, have a callback on the script that load your google map api and make that script call the part of your code that call the data
a callback in other word
 
user5020521
and what if I load the scritp on the page load instead of on click?
 
that is part of the solution imo. but you will still have to re apply the effect on the new added data
 
user5020521
I will
 
user5020521
what about window.onload
 
or you could have an infinite loop timer that run the same check every x seconds
and apply effect on any newer data
 
user5020521
12:59 AM
you will see the solution in a while
 
1 message moved to Trash can
@happy Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
 
@Riccardo990 do you make use of sandbox for your dev hosting? the reason why I am asking is because most of the time we do not apply the same setting as production server and exposing it to the internet can provide attack vector to the unknown
 
TIL php has destructuring. Not bad
 
jailing is an expression for isolating virtual host
 
user5992646
Hence, jailbreak.
 
1:11 AM
@TodoPertin best practice would says dev shall not be in the same network infrastructure as production but we all know it is simply not always the case.
 
user5992646
@happy ok. :)
 
@TodoPertin have you heard of "Panama paper"?
 
user5992646
@happy where Leo Messi's name came up?
 
yes
 
user5992646
I have heard of it but I do not know much about it. I just know it was about a tax fraud system.
 
1:14 AM
The legal firm working for him used a vulnerable plugin in their CMS and as it happens, their web hosting also hosted their email so 11.5 millions of document were leaked because they shared services
they hosted email and web on the same server
 
user5992646
@happy was he really involved in it?
 
@TodoPertin I don't know
 
user5020521
I did it
 
user5992646
@happy he would be stupid if he did. so much will be at stake.
 
user5020521
document.onload=loadScript();
 
user5020521
1:16 AM
so the script is loaded only once
 
That function is immediately executed -- it's not waiting for the onload event. Remove the ()
 
@Riccardo990 I think you are going in the right direction my friend
 
user5020521
execuse my ignorance but why have them to be removed?
 
if you add () it's like you are sayin do it right now but also make copy for later
 
user5020521
so I had better remove them else I might mess up my code
 
1:20 AM
@Riccardo990 it's more like: if you don't remove it the effect is that document.onload is ignored
it's like it void the effect
 
user5992646
does a "tab" white space consume more memory than four "space" white spaces?
 
user5020521
strange thing @happy
 
user5020521
if I remove them the script is not loaded
 
user5020521
else it is successfully loaded
 
@TodoPertin it souldnt matter because you should minimisze your script output and apply compression if your objective is to consume less bandwith
@Riccardo990 is it possible your browser is caching?
 
user5992646
1:23 AM
@happy wow really nice answer. you read my mind as well.
 
if you open your browser console, within your setting does it prevent caching as long as dev is opened?
 
user5992646
"read"
 
user5020521
I don't know
 
which internet browser are you using?
 
user5020521
chrome
 
user5992646
1:24 AM
Will moving my CSS media queries just after <body> before web page elements load improve website speed?
 
843
Q: Disabling Chrome cache for website development

joel234I am modifying a site's appearance (css modifications) but can't see the result on chrome because of annoying persistent cache. I tried shift+refresh but it doesn't work. how can i disable the cache temporarily or refresh the page in some way that I could see the changes? thanks.

 
user5992646
if you didn't know, I'm totally a noob.
 
@TodoPertin you mean outside the head?
 
user5020521
thank you
 
@Riccardo990 you are welcome ;)
 
user5020521
1:27 AM
I go to sleep now thank you for everything man
 
user5992646
@happy I mean just after <body> opening tag.
 
@TodoPertin do not worry; the more I learn the more I realize I know so little
 
user5992646
@happy ok. :)
 
@TodoPertin I think it is better to stick to the standards. Yes, there is big website like Facebook and Google, who have weird way of doing stuff but this is not common practice.
 
user5992646
@happy what about only the media queries? not the whole css?
 
1:31 AM
@littlepootis feeling incredibly normal.
@Abhishrek what happened?
 
that make sense because there is circumstance where you will not want the same experience for say a printed page versus a mobile viewpoint
 
Look I am using windows 10 for studies, so I won't signin to my main account or use email etc. I don't trust windows 10 :( @Abhishrek @littlepootis I'll be back to that one at around 2PM today.
 
@jarvis have you read the license you accepted when you decided to use Windows 10? It is part of why I do not use WIndows
 
user5992646
@happy yes, exactly.
 
Now now... don't accuse me of "deciding" to use Windows (10 or otherwise). It is just forced here because of academics.
 
1:36 AM
@jarvis from a legal perspective it do not matter, I am just pointing it out
 
Thanks for pointing out. thankfully Jarvis and everything on this account is not my real name or email or whatever. sigh
@happy So this wasn't true for previous versions of windows?
 
let me share you a story: A friend installed a new ip camera and accessed it from its windows phone. Few hours later proof of Microsoft Bing bot was in the camera server
2
@jarvis not as clear as clear as now. They are combining TOS of OneDrive, Outlook and WIndows under the same roof. By default and in the name of the experience almost all your data is "exposed".
 
Oh. ok. Good to know. So apparently I still can't trust Microsoft even after all this open-source spree of theirs. Windows 10 is quite recent :(
Not that I did even for a minute, but they did grab mine and many other people's attentions at once.
 
I am not saying Microsoft is evil. I think they do a wonderful job but not in tern of protecting your personal information
 
/me goes back to studying which is actually technically immoral
 
1:49 AM
Hi, I have a Prestashop store and I have a question about setting up Cloudfront to server images and static files through S3 bucket
I've simply changed Cloudfront's "Origin" value to S3 bucket path and images were broken
any idea?
 
hi all
i have a query on this todo list which i am creating
function updateTodo(){
	var chkid = this.id.replace("cb_"," ");
	var itemText = document.getElementById("item_" + chkid);
	/*console.log(this.checked)
	this.nextSibling.style.textDecoration = "line-through";*/
	if (this.checked){
		this.nextSibling.className = "checked";
	}else{
		this.nextSibling.className = "unchecked";
	}
}
 
hey guys can you have a look at this? I am not sure if the js calls are correct here
http://stackoverflow.com/questions/36683870/dynamically-search-sql-table-and-display-on-html-using-php-and-javascript
 
@YohanBlake 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.
 
if i click the checkbox that particular class to updated but that is not happening
can somebody help me what is wrong
initially I am having like this
	if (this.checked){
		itemText.className = "checked";
	}else{
		itemText.className = "unchecked";
	}
the both condition are not working
 
@Mahadevan is there a particular reason not for using the property that check the state instead?
something like
$(this).attr("checked")
 
2:06 AM
@happy thanks for the reply but i a looking for simplicity
 
@Mahadevan how is it not simple? it's like 1 vs 5 lines of code
 
@jarvis hij, you're alive?
 
i have one more question
then
this means the current object why current code not working
can you please explain me
 
what is the purpose of your code, from a general perspective?
 
@jarvis I've come across a batch script that disables a fuckton of location, keylogger services.
 
2:11 AM
when user click the checkbox the item has to select
 
@littlepootis is your computer infected?
 
if (this).attr("checked"){
		itemText.className = "checked";
	}else{
		itemText.className = "unchecked";
	}
is this correct @happy
 
it depend of the context, that is my point
 
@happy no, I'm talking about windoge 10
 
@littlepootis put it that way: how can you disable functionality from within a compromised system?
 
2:13 AM
@jarvis windows is secure, and even if widnows is not you can use chrome and trust chrome, and stop being a jackhole
 
@happy because when i tried this i am getting error Uncaught SyntaxError: Unexpected token .
 
@happy live long and prosper!
 
@happy I'm telling him I've come across a batch script that disables the built in spyware
 
@littlepootis you cannot do that
 
Apparently, you can
@Abhishrek you need more sleep :p
 
2:16 AM
@Mahadevan I would like to help you resolve the problem you are having but in order to do that I need to understand what is the purpose of the code you show, from a general perspective. What it mean is your code should be fine but it depend on other code and context.
 
@littlepootis nope, awal needs to stop being an ass.
 
@littlepootis how can you trust a compromised system to provide you a logic you can trust?
 
@happy i am not getting clearly what is the purpose of the code you show, from a general perspective
 
@littlepootis also he has access to my BizSpark account with which he can install an insanely trimmed down version of windows
 
as i told when the user click the checkbox that particular class has apply to that value
value or list
 
2:18 AM
@Mahadevan this is unfortunate of you not explaining your code but it is up to you, and up to me not to help you if I feel like you are not helping me, helping you
 
sorry @happy you want me too explain line by line
can you please explain me i am not getting clearly
or you want only that condition
 
@happy his system wasn't compromised?
@Abhishrek what is that trimmed down version of windoge called?
 
Embedded Industry Pro :P (valid till windows 8), I think from 10 it should be Enterprise. That thing doesn't even install media player stuff
 
He might as well use Windows server
 
@littlepootis I am just assuming here; if one run a batch script that stop keylogger service location I am assuming the OP think the system is compromised. Based on that, it seem logical to me not to trust a system logic if the system is flawed.
 
2:24 AM
@happy I don't get wat u mean. Pls explain like I'm five (I actually am 5).
 
@littlepootis this is too much, good night
 
@abhishrek does windows have an init process?
 
2:44 AM
logonui.exe or winlogon.exe
iirc
 
2:54 AM
actually, it's wininit.exe
 
3:07 AM
Why web worker is related with HTML5? Web worker(window.Worker) is a javascript function constructor
link1 and link2 says it
 
HTML5 encompasses more than just HTML
 
How html5 is relevant to Web worker? Web worker is relevant to javascript
 
HTML includes new JavaScript APIs relating to the DOM
 
html is just the presentation code(tag based lang)? How html includes JS api's relating to DOM?
Ecmascript spec drives JavaScript implementation. w3c spec drives html
 
Need some input
I need to sleek up that fieldset data
Having trouble finding a super modern way to display otherwise unordered list data
 
3:25 AM
progressbars for numeric data, swatches for color data?
 
Sorry, these are all player custom descriptions. They fill out the data, or not
So progress bars for numbers wouldn't work
 
user5992646
!!define ATF
 
@TodoPertin ATF (US, law enforcement) Alcohol, Tobacco and Firearms
 
user5992646
@CapricaSix thank you.
 
@overexchange HTML5 is abused as a buzzword for several browser technologies that came at about the same time.
 
3:34 AM
@SterlingArcher imo
 
And no, those APIs are not related to DOM.
 
@Shea list data, not actual lists lol
 
huh?
I just like the look
 
use left justified variable width flow layout. Make it so ugly it's beautiful.
Input dependent changing dynamically for extra points
 
3:53 AM
@AmaanC xD https://twitter.com/JoeSondow/status/721391970904588292
@rlemon @SomeGuy This guy is a regular at our game night - he's funnier in person
 
4:24 AM
@littlepootis Using right tech words for an introduction is very important. Otherwise, idiots like me can get confused easily
 
4:55 AM
@overexchange Well, we can't blame them.
 
5:41 AM
"People don't really write in Javascript anymore. People write in jQuery" _ Jake Weary
!!google Jake Weary
 
 
2 hours later…
7:24 AM
any link to deleted question? I need the color
np found one
 
How can I get those input's values and put that values into another one's name and type attributes plnkr.co/edit/…
 
7:38 AM
Does web worker execute as a thread in process?
 
@overexchange yes
 
So, In a 1-1 thread model OS, every worker thread will be assigned to corresponding kernel thread. corrrect?
 
The browser is free to choose whichever model it likes.
 
which model are you talking about?
 
Chrome maps between one to few tabs to one process. I doubt it would ever spawn an extra process just for a web worker, but it might spare you a kernel thread.
Firefox uses one OS-process, ever.
My current instance of Firefox has 3 tabs and 154-157 threads, changing rapidly.
 
7:47 AM
Are these 155 user threads from a single process?
 
This is what the process manager sees
 
Threads can be launched through window.Worker(). Are you saying that your web client program(in 3 tabs) is using window.Worker() that launches worker threads?
 
@overexchange no, it's one "thread" in the browser. It's not an OS thread. Browsers can use green threads or whichever way they choose to implement workers.
 
@FlorianMargaine Ideally, the goal of window.Workeris to use kernel threads from 32 core CPU(say). correct?
 
Depends. Are you a super-beefy iPhone that has 5 hours of battery that needs to last 6 hours?
 
7:54 AM
@overexchange no
 
ok. so what is the goal?
 
to do some computation not blocking your main tab
looking at blink's source, they create a fake new tab, hence reusing their "one thread per tab" model
 
for that I'd just use a RAF loop
 
@JanDvorak no, heavy computation will still block the UI
 
Non-blocking doesn't necessarily mean concurrency.
 
7:56 AM
@overexchange did you copy paste this from wikipedia?
 
@FlorianMargaine Not if you ration the computation in a way that yields to the event loop frequently enough.
 
@JanDvorak but then it means the overall computation takes longer
 
Workers utilize thread-like message passing to achieve parallelism.
 
if you just do it in a web worker, you get a non-blocked main UI, and a fast computation
 
7:58 AM
You still need a fiber per worker at least.
 
a fiber?
 
A user-land thread
 

« first day (2011 days earlier)      last day (2934 days later) »