« first day (1541 days earlier)      last day (3425 days later) » 

12:00 AM
I pushed somethings I did when I was 13 to github
it's so bad written, that I feel tired of fixing all that
but the code works without bugs
but again, its ugly
 
When I didn't know about JSON and objects, for sending data to the server I would .join, which would result something like this "HELLO1&&OTHERDATA"
Omg so silly haha
Look at that ugly code
text = i[2].replaceAll("♑☵☫","&").replaceAll("♌♆�","|"); // Get text
so
ugly
 
heh - good story though
Reminds me of the time I wrote out a fake grep in Python because I didn't know the real one existed
 
good times
well, not that good
Hey what do you think of this: prntscr.com/5o70b5
 
uh, JSFiddle?
 
12:09 AM
ok
wait
 
hey, i have a bad understanding of javascript and async. Have been trying to learn abit about async and callbacks. But im really confused. How can something be async if it doesnt use callback? Help would been much appreciated if anybody have got time
not sure if that made any sense tho
 
@Anonym.. what do you mean? Can you give an example?
 
stackoverflow.com/questions/3709597/… if u see at the main answer at this question
 
@Catgocat Neat
 
12:13 AM
if he uses json instead of jsonp, how can it be async?
 
@SomeKittens It's configurable.. very configurable look down the code at the bottom.
 
@Anonym.. It's still an AJAX call
 
I am going to push it to GitHub..
Someone might like it.
 
but if i use jsonp. The request gets send and it continues on rest of code. and when the response return it calls the callback function right?
 
correct
 
12:22 AM
but what does normal json do then ?
i dont understand how it can be async if it doesnt do that
 
Done!
@Anonym.. I don't think you get Javascript
 
i think u are right ;D
 
You should watch some introdutory EventLoop videos, so you can get how it works.
If that is what you are having problem with.
 
i dont understand how the async thing works
 
Async in javascript.. is not really async
When some async function is called.. it will be executed after all the other code is executed, so it doesn't block.
Async = EventLoop
Go watch some introdutory videos.
 
12:27 AM
but what i wrote "The request gets send and it continues on rest of code. and when the response return it calls the callback function right?" is correct right?
 
@Anonym.. Say I have some chores to do today - I'll need to clean the bathroom and unload the groceries when my wife gets back from the store
 
I'll give an example
 
Async means I give my car keys to my wife, so she can go to the store. That's the initial async call. While she's at the store, I can clean the bathroom. When she gets back I can unload the groceries. That's the callback.
 
function1()

setTimeout(function(){
alert("This will be executed after all");
}, 200);

function 2();
 
If I try to unload the groceries before she gets back (Work with the data returned from the async function before it returns), there will be problems.
 
12:30 AM
Function 1 executes, then the async function setTimeout will go to the next loop as in 200ms will be executed, then function2 is executed, then the event loop runs again untill it has passed 200ms and executes function alert
 
but how is that possible if u dont use callbacks?
 
it's just a regular function
 
@Anonym.. There are other ways of managing asynchronous code - promises, for example.
 
hmm, ok
thx for the help. i think i will get some sleep and read some tomorrow
1 last thing if u are still there. how is it possible to send a request to another site using datatype json, and not jsonp ?
i thought i would get that cross browser origin error or whats it called but it didnt happen
 
12:48 AM
As the owner of "another site" I can setup CORS headers, which are a way of saying "it's cool if other sites ping me"
 
ok, thx
 
1:48 AM
hi
i would like to know why this doesnt work: pastebin.com/ppY3saJd
currentItem is undefined in the setTimeout function
 
@qd0r setTimeout doesn't pass any such argument
L5
 
hm?
so how i can make it public?
 
What do you think L5 does?
 
a drunken typo
a shit i spent so many hours on this script. i'll post it tomorrow on freelancer.com if you are interested let me know. i think i'll offer 100$
 
2:08 AM
What do you think line 5 does?
 
user2620028
@rlemon have you had any troubles with outputting video from your system76 laptop to a monitor. I am having issues with a monitor i bought last night that looked really good on display and now when output from my 76 it struggles to even render text without it looking blurry.
 
never tried
 
ah L5 means line 5
yes i googeled for a equivalent in js for a sleep/delay and found this function
 
user2620028
ok. I will keep looking. I have got the thing configured to where i can read stack overflow chat room text but it is definitely not the best. The color profile looks like it is miles off too and i usually cant tell the difference between color profiles lol
 
in this case i want to sleep 5 sec in the foreach iteration
 
2:13 AM
What do you think (currentItem, index) in function (currentItem, index){ does?
 
i know that it doesnt work jan dvorak. i'm not stupid
 
user2620028
I might just be sitting too close :/
 
OK... have you just called me drunk and stupid?
 
no?
 
Fine then...
 
2:15 AM
i'm sorry if you misunderstood.
 
m59
It seems if I do:
.then(function() {
  // some stuff
  return buffer; // this will be an array rather than a buffer
});
Anyone know what's up with that?
 
@m59 context?
 
m59
are you referring to this or do you mean you need to know more?
 
What sees it as an array? Where does buffer come from?
 
user2620028
@rlemon nevermind. It was an unavoidable case of i have the display settings set way off because i am blind.
 
m59
2:19 AM
getBufferAsync.then(function(buffer) { // <-- is an array now
 
uhm okay. i think i'm too tired. i'll post it on freelancer.com and give you the link tomorrow, okay jan? as i said i will pay around 100$ :)
 
m59
the function returns a buffer, and the then function receives an array.
 
Perhaps the buffer is an array?
 
m59
not sure what that means... it's a buffer when I return it. It's an image.
 
yep a buffer is a byte[]
 
m59
2:22 AM
ah! I need to do data instanceof Buffer ?
yuppity
 
Wait, are we talking about Java, or Javascript?
 
m59
node
I don't know what I'm thinking. Tired. Break time.
 
Javascript has ducktyping...
 
@m59 js kills us all
 
It doesn't killl me. It kills spam, though.
 
2:31 AM
10 years ago i thought we dont need javascript.
an now it's such an essential bitchy scripting language. unbelievable
 
You can still compile to Javascript
 
great
 
dunno about killing, JS pays my rent
 
Javascript is great for killing time
 
i prefer other languages
but sometimes i have to use it :<
 
2:44 AM
is there anyway to create a category in jsfiddle ?
 
@underscore ...category?
 
ex: jsfiddle.net/myUserName/jquery/hkjksdl
 
@underscore not really
 
jquery is the category
:((
Do you know any place where i can store it ?
category wise
 
set up a web with a redirect controller :)
 
2:45 AM
lol
Finding a free service
 
neocities?
 
its not too hard to build your own. 20mins?
shrinkurl.us maybe this one when you register
dont know if the keyword will be in the url
ah perfect use tinyurl.com
 
Folks, are there good books for familiarizing with architecture of e-commerce kind of web sites?
 
3:01 AM
Not really
Mainly because there's all kinds of architecture.
You looking at building one?
 
@SomeKittens Yes. Essentially, the web site is a detailed RFQ (request for quote) form. The payment can be handled manually.
My challenge is that the form is long, detailed, somewhat tedious. I want to encourage the visitors to chew through it (in one sitting or several) and not give up.
The reason why I'm asking about e-commerce sites is that some of them have anonymous cart. I could in turn make an anonymous form.
 
ah, fun
In that case, you'll want to store the form progress in localStorage and paginate it
 
@SomeKittens I've looked into localStorage. Yes, that's something I could use. Enough (more than enough) browsers support it. Besides, my customer is a tech-savvy guy/gal with up-to-the-minute version of Firefox.
 
that's handy - better than the guy with IE7
 
@SomeKittens I also want to be able accept files (PDFs, pictures) through the form. I wonder if localStorage can accept files.
 
3:13 AM
not really
 
I didn't get a pony for Christmas :(
 
On the easy side, the transaction volume will be low (unless somebody tries to attack the site). 20 submissions a day, maybe.
 
You could auto-save the form via AJAX
that'll let you keep files
 
@SomeKittens How did people do anonymous cart before there was localStorage? Did they enter the cart into the database under a dummy user ID and set a cookie with that ID in the anonymous customer's machine?
 
Along those lines
 
3:18 AM
@SomeKittens Do you mean that the files would be uploaded to the server via Ajax during auto-save?
 
@NickAlexeev correct
 
@SomeKittens I could make a temporary (on the order of a week or so) directory for each anonymous order. Natural limit - one anonymous order per customer.
 
@NickAlexeev sounds like a plan
 
@SomeKittens The name of each temporary directory could be a GUID or counter or some other kind of auto-generated value.
I'll have to think how to prevent destructively-curious people from overflowing this.
@SomeKittens All right. This sounds like a plan. Thank you for this sanity check!
 
No problem
 
3:58 AM
@NickAlexeev i suggest you to use shopify :)
great support, well documented library, easy to set up
 
m59
!!> typeof new Date();
:'(
So, console.log(new Date()) actually logs the result of new Date().toString(), right?
and then an object that contains objects like that, if you want to interact with the object as though those are strings, you'll need them converted... is there a better way than JSON.parse(JSON.stringify(obj)) ?
 
 
2 hours later…
6:24 AM
@Zirak So you like 'em messed up?
Two questions: How messed up, and what kind of messed up?
@m59 I didn't understand the question. Can you set up an example?
 
m59
6:45 AM
@SecondRikudo
var x = new Date(); // object
x = JSON.stringify(x); // string
x = JSON.parse(x); // string
//vs
var x = {foo:'foo'}; // object
x = JSON.stringify(x); // string
x = JSON.parse(x); // object
See why this is useful?
 
var x = new Date(); // object
x = JSON.stringify(x); // string
x = new Date(JSON.parse(x)); // object
 
m59
I particularly DON'T want to do that.
Running recursive functions on objects gets really screwy in js
 
Well, if you're stringifying it, you don't really have a choice.
 
m59
In my case, I just stringifiy/parse and then check that the result is still an object, if not, I use the original value
 
7:27 AM
35
 
8:12 AM
Anybody bored enough to help a girl out with promises?
http://stackoverflow.com/questions/27763543/how-to-apply-promises-to-app-get
 
I don't promise girls anything.
 
no one here knows promises :P
0
A: How to apply promises to app.get?

Benjamin GruenbaumMongoose already returns promises if you don't provide it with a callback so your code in: allBills = new promise(function (fulfill, reject){ Bills.find(function(err, bills){ if(err) reject(err); fulfill(bills); }); }); Could really jus be: a...

There you go
 
8:35 AM
Wow, I just answered 3 random questions from the front page today - I forgot how easy it is to get upvotes for general stuff.
 
Thanks @BenjaminGruenbaum :)
 
If you changed your name and profile pic because you think you got help because you're a girl that's not the case. I've answered pretty much every second promise question posted in the last year in StackOverflow and the once I didn't were answered by jfriend and Bergi before I could answer them or weren't good questions for SO to begin with.
People here don't really care that much about your gender when you enter a room. On the other hand if you have any more promise questions feel free to ping me with those :D
 
@phenomnomnominal True gentleman.
 
@NickAlexeev I try
Did a reverse image search and nothing came up
 
8:57 AM
@Zirak piquerism
NSFW/L
 
@SomeGuy HOLY FUCK
 
9:27 AM
@phenomnomnominal I did warn you
 
10:13 AM
Hello guys. Did someone manage to enable code quality and code coverage checks in scrutinizer for javascript/node app?
 
0
Q: Multiple File Upload Extension Validation in JQuery

user3454479i am unable to get the Exact validation for multiple file upload. Here my form like this Upload Attachment(s): <input type="file" id="client_attachments" name="client_attachments[]" class="client_attachments"> <div class="addbutn"><a href="javascript:void(0);" id="add_more"><i class="fa...

any one help me
 
11:18 AM
I'm having an issue with a PHP/JS setup on a Drupal-based site which is supposed to log the shopping cart details to a .txt file when the user clicks the "checkout" button as a failsafe incase the order details don't get sent in the email (as it happens from time to tome). The log only works if the user is using Chrome. I can't figure out why. I have the following open question on SO
0
Q: PHP/JS log of order details to text file only works in chrome, not other browsers

Ali SamiiI have a simple PHP file which logs the details of an order to a text file. It is used on a custom shopping cart in Drupal using the form_wizard which collects the order details (what was ordered, where to ship it, etc) to a cookie, then processes the order via PayPal. When the user clicks the ...

The cart is not tied to the database, so the only record of the order details are in the cookie that saves the buyer's choices during the order process which then get sent in an email as an order confirmation. Sometimes, the cookie details don't get sent, so the idea is to create a backup log of the order details by saving those details to a text file.
 
    I want this:

    function MyScroll() {
        window.scrollBy(100, 100);
        alert("pageXOffset: " + window.pageXOffset + ", pageYOffset: " + window.pageYOffset);
    }

    But without alert! automatically display console (I need to see this in console).

    console.log("pageXOffset: " + window.pageXOffset + ", pageYOffset: " + window.pageYOffset);???
 
@UlisesContreras Where is the problem exactly?
Have you tried it?
 
@SecondRikudo do you have any suggestions? I don't get any console errors.
 
@AliSamii How does your code look?
 
@SecondRikudo I'm watching a exercise, I need to see my "position scroll" in console.
I have this but this is with alert! I want without alert.
 
11:33 AM
I'll post it to a gist.
 
@UlisesContreras So where is your problem?
@AliSamii Oh, sorry, I replied to the wrong person
Your code in the question is OK, no need another Gist
 
OK :)
 
    @SecondRikudo

    function MyScroll() {
            window.scrollBy(100, 100);
            console.log("pageXOffset: " + window.pageXOffset + ", pageYOffset: " + window.pageYOffset);
        }

    This is posible???
 
@UlisesContreras Have you tried it???
 
@SecondRikudo Yep, but say pageXOffset: 0, pageYOffset: 0 in my console. :))
 
11:34 AM
Don't ask "will this work?" try it and see
 
If you need, I can create a gist with the entire PHP form_processor which manages the shopping cart (and generates the cookie). I just put the snippet of code related to the tie-in with the JS as that is what I thought was most useful.
 
@UlisesContreras I can't reproduce. Please create a jsfiddle.net example of the problem.
It works fine for me.
 
Sometimes SO depresses me. It's so easy to rep on shit.
 
@BenjaminGruenbaum It's also very easy to get money on shit. It's not just SO it's life :P
 
11:41 AM
@UlisesContreras You need to save it first
@AliSamii I don't see anything in your code that would make the request to logcart.php not be sent.
 
I answered 3 questions from the front page today for 175 rep. Absurd
 
@SecondRikudo jsfiddle.net/w39y0coh/3

When I do scrollY show position in px.
 
@UlisesContreras this is for code. If you're not posting code please don't format your messages for code
 
@SecondRikudo Nor do I, but there are two issues:

1. It only works with chrome for whatever reason which I cannot determine. And
2. When it does save the data (with Chrome) it saves the data twice (not a big deal, if I could solve the first issue, this is not important).
 
@AliSamii Try to make a simplified case
Make a page that all it does is send the ajax request with the proper parameters
See if that works.
 
11:45 AM
ok
 
@UlisesContreras that example doesn't work for me
 
@SecondRikudo And for me not too. How I can to see my position scrollY in console?
 
That's actually pretty interesting...
Nevermind, jsfiddle does funny things
@UlisesContreras jsfiddle.net/w39y0coh/6
jsFiddle already does onLoad on its own, you need to cancel that
 
@SecondRikudo how? Update again? jsfiddle.net/w39y0coh/7
 
@UlisesContreras The fiddle settings at the top left of that page
By default jsFiddle sets it to onLoad, so it wraps your code with window.onload = function() { ... };
 
11:51 AM
@SecondRikudo Fiddle Options? Say many thing.
 
I set it to no-wrap <head>
Oh MySQL Workbench, why must you torment me so?
 
@UlisesContreras Still same result... I see 100/
 
@SecondRikudo Me too..! My problem is that! How I can to see my scrollY in console? :))
 
@SecondRikudo yup
@SecondRikudo your fault for using MySQL :D
 
11:57 AM
@BenjaminGruenbaum No, it's my workplace's fault. It's my problem, but it's my workplace's fault.
 
@SecondRikudo I want this but without do CLICK w3schools.com/jsref/met_win_scrollby.asp
 
Are you a member of your workplace?
@UlisesContreras what is the issue?
 
@BenjaminGruenbaum The decision was made before I was a member of my workplace.
About 3 years prior.
About the same time they decided to use PHP as well.
 
@SecondRikudo still your fault somehow, I just have to figure out how :D
Also - beer this Wednesday?
cc @Mosho
 
If you're paying, sure.
=P
 
11:59 AM
@BenjaminGruenbaum Holla, Benjamin, my problem is simple, I want to see my scrollY in console. I'm reading this developer.mozilla.org/en-US/docs/Web/API/Window.scrollY
 
I honestly don't mind buying you a beer :P
Just pay for the burger :D
 
XD
@UlisesContreras I want you to stop, calm down, and listen to what you're being told.
 
@UlisesContreras and where are you stuck?
 
It's the second time I'm telling you to not format normal messages like code
And now you're starting to ping random people once I started to talk to someone else.
Please stop, or I will kick you.
 
@BenjaminGruenbaum I'm this so bad. lol jsbin.com/jikitonoju/1/edit?html,css,js,console,output I need to detect my scrollY, simple.
 
12:01 PM
It works though, what do you want?
Hangouts is hard :D
 
@BenjaminGruenbaum show my scrollY/scrollX in console. :))
 
Yeah it does that
 
@BenjaminGruenbaum how i do that? :)) in jQuery is easy, but I love JavaScript native.
 
You're confusing me, ask your question on Stack Overflow.
 
@SecondRikudo

I have one <main> with height:900px; is ok, now, when I do scroll, I want show by console.log, what is my position.
 
12:06 PM
You were warned twice.
Play nice.
Hi @SterlingArcher what's up?
 
I should write a script to watch when a user gets kicked...
 
How would you know?
 
I'm wondering the same
 
@JanDvorak Hello, you know show scrollY by console.log?

developer.mozilla.org say:

Summary
Returns the number of pixels that the document has already been scrolled vertically.
 
It's probably better to kick anonymously and invite the user to a private room and explain to them why - kicks are anonymous to not create a stigma.
 
12:10 PM
@BenjaminGruenbaum i'm gonna do an one day Angular workshop for srilankans. Can you give me an idea as a start up point ?
 
@BenjaminGruenbaum I thought the consensus was to announce our kicks?
 
@JanDvorak It is, I think it's wrong though - I'll bring it up at the meeting at the 15th.
@underscore egghead.io videos - only make them do them.
 
@BenjaminGruenbaum speaking of which, why isn't the event sooner?
 
wanna get the subscription ?
 
@underscore Decide on a 4 hour project (or users can come with their own idea) and they all actually make it - divide the project into a smaller bits each one requiring one new thing from Angular: data binding, creating a controller, $http, creating a service, creating a directive, scope inheritance, talking between controllers etc.
 
12:12 PM
Why can't I kick myself, BTW?
 
Each task links to the relevant lecture etc.
@JanDvorak it's once a month. SecondRikudo said talk to him if someone has a problem with the date.
 
@BenjaminGruenbaum you mean to decide it first ? or decide from their idea in the workshop ?
 
@underscore decide it first - maybe provide a few alternatives. If you feel like walking the extra mile you can make it modular and have 3-4 minute one on ones with them building the plan with them.
 
I must consider about the less javascript students
so i wanna make their mind full with object , arrays, prototype inheritance so on
 
Ah
I thought it was for JS students
 
12:21 PM
Some of they are software engineers
BUT
they knows jquery
 
lol, if they know jQuery they know enough JS for Angular :P
 
They don't have a knowledge of object and arrays
yeah :D
 
So what?
They can learn it while they're building stuff
 
hmmm
How ever people's mind fully with jquery
It's hard task to make their mind to angular
isn't it?
 
I've seen far too many people on SO who think they know jQuery, and actually know next to nothing about "real" JS.
 
12:25 PM
Agree
 
Also, a lot of them don't know even jQuery itself
 
yeah
 
Also, the same is true for Angular - most Angular devs don't actually understand it.
Pretty much for every technology :D
Heck, I'm sure there are plenty of bits of JS I don't know.
 
We can't learn all
 
we can 8|
 
12:30 PM
That's the most downvotes I've seen in a while
 
jQuery is the PHP of client-side programming...
 
Oh look, edit by bjb, meta police what a surprise.
To be fair his edit is good :P
 
@BenjaminGruenbaum developers asking from me don't we need PHP frameworks after learning angular ?
 
Oddly enough no close reason fits it. I'm thinking about cv-ing as stupid.
@underscore that's kind of depressing.
 
A lot of they think angular js is like a php server side language
 
12:36 PM
Then tell them it's not :P
It's that simple.
 
I'm having trouble with the animationend event listener - it fires straight away. Here's an example: jsfiddle.net/yr73rhy2
Anyone know why?
 
@Grim... you're invoking change rather than passing it as a function.
It's for the same reason setTimeout(alert(5), 500) executes immediately.
 
Ah, so I should do function () { change(holder); } ?
 
That might work
 
Hmm, then it doesn't fire at all. Let me fiddle for a bit and I might come back. Thanks!
 
12:43 PM
You also need browser specific prefixes
Adding animationend is not enough - you have to add mozAnimationEnd and webkitAnimationEnd too iirc.
 
Tried that just now, still no joy
Ah, you do one at once. Excellent!
 
You can't add multiple event listeners like that in native JS
Yeah, exactly.
 
Thanks, @BenjaminGruenbaum!
 
Sure, have fun :)
 
12:58 PM
Guys, how can I send an object (with methods) into an anonymouse iframe?
 
anonymous iframe ?
 
@SecondRikudo .toString the methods and send the rest as JSON with sendMessage.
 

« first day (1541 days earlier)      last day (3425 days later) »