« first day (1724 days earlier)      last day (3228 days later) » 

9:01 AM
Well, I have to multitask as well..
tries to find some good tuts on how to really write JavaScript
 
@Gemtastic Read Eloquent JavaScript followed by JavaScript: The Good Parts
 
Isn't that a book?
 
They're both light reads, and they're both great.
They're both books.
 
Can you get them online for free?
And legally
 
Yup.
And yup.
 
9:03 AM
:O
 
Yes, they are great for learning javascript.
 
Are there ways to really write javascript? I thought the idea with javascript was that you should be able to smash your face in the keyboard and still produce working code? :o What have I missed!?
 
@JakobMillah You have missed the fact that it is a programming language and you cannot write it by smashing your face or putting a monkey in front of the keyboard.
 
9:04 AM
@Sheepy There's a tiny chance that it would succeed though ;)
 
@JakobMillah no, that's perl
 
Guys, I'm having a breakdown here in my office. My media queries are being ignored by the page. Anyone got a clue on CSS usual pitfalls?
 
@FlorianMargaine Argh, I guess I am at the wrong section then.. Bye :D
 
@Polyducks unsupporting browser? Wrong syntax?
 
@jakobMilah what are you asking?
 
9:08 AM
@Sheepy Then I'll waste no time in reading it!!!
 
@Gemtastic They are also great for correcting wrongly learned JavaScript.
 
@Jan Hey Jan :) Shouldn't be the case. I'm using chrome and the syntax seems sound...
 
I made something: jsbin.com/vanomejepi/edit?html,js,output (best works with gzip enabled on server)
 
@Jan in that the mqs were working one minute, and then all of them shut down the next day
 
@Sheepy I've only learned the syntax so there's not much to unlearn really
 
9:09 AM
sounds unlikely
 
@Polyducks Just fooling around :) I was asking a question a bit further up though, but not of major importance. I will solve it
 
@Gemtastic Read them. You'd be surprised.
 
@Jan This is why I'm going nuts
 
Hey has someone a idea how I can solve this pastie.org/private/uzawh5gs8ifgkyjfwy5klg
 
check the latest git changes
 
9:09 AM
I made that and would like to change a html div order based on the screen resolution
 
@Duikboot what's the issue you're having?
 
But how can I make it change when you go to more then 1000px again? It only works 1 tie
 
@Duikboot oh okay. One sec then...
 
I want to change the HTML div order on mobile device
 
@Sheepy It's hard to re-write a clean canvas ;P
Besides, what little I have learned I've learned from you guys...
 
9:11 AM
no testers? :(
 
@Awal No thanks haha
 
jQuery('body') is ugly. Also, why aren't you using $?
 
@Duikboot I'm not a great fan of jQuery, so I'm not sure how it's attaching an event
 
oh
 
@Duikboot I have no idea if there are fancy ways to change order of divs in javascript, but it can relatively easily be done using CSS? I think
 
9:12 AM
c'mon atleast confirm it is working for you :(
 
Uhmm. not sure there is a good x-browser solution to change the div order in a media query.
 
@Awal Well, I open it and it asks me to upload a file to obfuscate...
 
@Duikboot check display flex
 
@Mr_Green Flex isn't crossbrowser yet
 
chrome frame :-D
 
9:13 AM
@Gemtastic A clean canvas is all the reason you need to start with these two books. We are teaching you to get a good start.
 
@Polyducks your observation skills are exemplary. what happens after that? :)
 
@Awal cheeky... let me try uploading a file. I don't need to host the code, do I?
 
@Polyducks nope
:D
 
9:14 AM
@Sheepy And I appreciate it extremely much. If you got any other idea I'm very sorry! This is priceless!
 
Fine... one sec.
 
@Polyducks must be a valid javascript file
 
@Awal wow, that's obnoxiously inflated...
 
@Polyducks A 94% browser support is pretty cross browser I think.
 
^This
 
9:17 AM
@Sheepy depends on application. If you're making a site for the elderly or a company that only runs IE9 like I am...
 
@Polyducks cool, last thing, can you include it in an html document and see if it works the same way before obfuscating?
 
@Awal sure
 
thanks!
 
@Awal I must say though, there's a key flaw in your program
 
what is it?
 
9:18 AM
@Polyducks IE9 means they're on XP right?
 
17:07: Loot of a cyclops: 26 gold coins, a halberd, meat, a short sword

Is there a simple and fancy way to select the digit before "gold coins"? Lets say I have a long list with lines like that and I loop through to find all "gold coins", is there a way to like determine from my current position get the closest digit in front of the string?
 
@Polyducks I consider that a special requirement, not a general cross browser / cross platform requirement.
@ivarni Vista or 7. Un-upgraded.
 
@ivarni Unfortunately, yes.
 
@JakobMillah define "fancy". Regex should work.
 
@JakobMillah RegEx is your friend, friend!
@Awal rewriting my code to be less of a fuckabout...
 
9:20 AM
@Polyducks Argh... RegEx is mind***** :D I'll take a look at it ^^ Nice to learn anyway
 
I think regex is fun
I wish I had more time to play with it
 
@Mr_Green spoiler alert
 
Mohahah, too late! Copy pasted that :D Thanks!
I'll learn it anyway. It seems useful
 
Yes, @Awal - it works!
 
no problem
 
9:22 AM
@Polyducks thanks! are you able to decrypt it in anyway? (devtools count)
 
@Awal Major flaw though - If I really didn't want people to see my code, I wouldn't want to upload it to a site online
 
@Polyducks yeah it is just for fun...
 
Wow, regEx seems like an extremely strong tool.
 
I guess it's not possible to dynamically import modules in ES6? I have an array of module names and would like to make an object out of them but can't figure out how...
 
@Awal I can't see anything from my original source, if that counts
 
9:23 AM
@MarttiLaine no, not possible to dynamically import modules in ES6
 
@Awal I really like how quickly it works though
 
@FlorianMargaine Okay, that's a bummer.
 
@Polyducks it converts source code to binary whitespace which makes it pretty much impossible to decrypt without some sharp eye
 
@MarttiLaine not really. Do you dynamically import packages in java, systems in C#, headers in C/C++, etc?
 
@Awal aren't you a smart cookie? Now make a copy and paste version with javascript ;p
 
9:25 AM
... smart cookie?
 
@FlorianMargaine see the jsbin link above :D
 
Sweet obfuscator is sweet
Obvious security issues with passing a javascript you want obfuscated to an unknown server though
Right guys, I need to go and debug the fuck out of these media queries. Thanks for your help!
 
9:37 AM
found regexr.com, the person behind that should get an award.
 
user3119231
Hello everybody, can someone help me with this little background script? I have to keep the childs position and prevent them from moving, if background is moving. jsfiddle.net/ttdwd7vu
 
@Maurize Welcome to the JavaScript chat! Please review the room pseudo-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.
 
@Polyducks turned a 4 KB js file into a 247 KB js file. I'd say you should have a pretty good reason for doing that to your clients :)
2
 
isn't "console" a reserved word in javascript?
 
@Mr_Green no
 
9:39 AM
@ivarni Serves them right for using IE9
 
user3119231
@Mr_Green noop, this isn't the problem.
 
@Maurize nice animation
 
@ivarni also turned my 54 byte program into a 5kb one
 
@FlorianMargaine thanks
 
user3119231
9:40 AM
@Mr_Green yeah but I need to calculate the childs position, so we got a 3d view of elements like links and stuff.
 
@ivarni gzip turns it back into 4kb
 
user3119231
So anyone have an idea how to solve this problem?
 
@Maurize which childs are moving? I didn't get your explanation
 
user3119231
You see houses moving with the background. I want the childs fade out if you move the mouse (and so background) to right.
 
user3119231
So I need to prevent the childs from moving
 
9:44 AM
to me childs (houses) are not moving
 
user3119231
If you move cursor over the background the background is moving. the houses are visible.
 
hey, I'm struggling with basic JavaScript stuff: gist.github.com/wonderb0lt/a7460bb4b736943abeac In the second file, the result of the "constructor" call is always undefined. Returningthis in there returns "window". Can anyone tell me what basic thing I'm doing wrong?
 
user3119231
For ease. How to set house position to x 0 y 0 from BACKGROUND?
 
@wonderb0lt because you're not calling the constructor with new
 
9:47 AM
@Maurize I have no idea. ask on SO and share link here, if you have time
 
Yup, that's it. Thanks @Florian :)
 
17:09: Loot of a cave rat: 2 gold coins
17:09: Loot of a ghoul: 30 gold coins

I want to select both of these monsters with regEx, is there an "or" solution to it?
Kinda like: /a (\w+\s\w+ | \w+)(?=:)/g <-- but its not working obviously
Same by adding both "a" and "an" in front of the string
The result should be; "cave rat" & "ghoul"
 
user3119231
@Mr_Green huh? I've shared link already. jsfiddle.net/ttdwd7vu/6 Even If I scroll background this shitty house should stay at left: 0 and top: 0 from background. So it would fade out if I move to far to right or bottom.
 
user3119231
Better example_ jsfiddle.net/ttdwd7vu/9 at start house is in middle of screen and if I enter mouse it gets in border.
 
user3119231
But it should be alway in middle even if I scroll background
 
10:03 AM
hi
 
@danish443 Welcome to the JavaScript chat! Please review the room pseudo-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.
 
ok
 
@FlorianMargaine Thanks, already reading there a bit ^^
 
user3119231
10:16 AM
anybody idea? to my problem? jsfiddle.net/ttdwd7vu/9
 
@Maurize if everyone is being quiet then it might be that no one knows the solution. please ask on stackoverflow.
 
@Jan Found the bug with the @media queries. Someone had copied in their code and forgotten to end a curly brace -_-
@Maurize remind me what you want to do again? Make the house fade out?
 
@AwalGarg :o
 
user3119231
@Polyducks I want the house prevent from moving with background. If I set position left: 0, top: 0 it should stay there and If I move background too far the house will automatically stay out of view
 
in angular what does "view not registered mean"
 
10:41 AM
You mean you want to attach the building to the background?
 
user3119231
Yes.
 
...then put it within the background element?
I mean, put the house within the terrain element
and then give the terrain element a position: relative; so the absolute object sticks to it
 
user3119231
Let me try.
 
user3119231
(function(){
	var console = document.createElement("console");
	document.body.appendChild(console);
	console.innerHTML = "Console: Inactive";
	console.style.background = "rgba(0, 0, 0, .5)";
	console.style.fontFamily  = "calibri";
	console.style.textAlign = "center";
	console.style.position = "fixed";
	console.style.fontSize = "20px";
	console.style.width = "100%";
	console.style.color = "#FFF";

	var terrain = document.getElementById("terrain");
	terrain.onmousemove = function(e){
		var tX = 1 / this.clientWidth * e.clientX * 100;
 
user3119231
@Polyducks no, house is moving with background
 
10:45 AM
@Maurize Don't override the console variable.
 
user3119231
@Madara Uchiha I think this doesn't matter. It is only for information
 
@Maurize You're disabling the use of console.log and other console methods within that scope.
Also, wait what? There's no such thing as a console element...
 
user3119231
@MadaraUchiha Renamed it to logger, house still moving :D
 
@Maurize Doesn't move for me.
 
I'm using Chrome. House is at 0,0. I'm finding it hard to understand what the wanted outcome is.
 
10:49 AM
^
 
user3119231
jsfiddle.net/ttdwd7vu/11 lets pretend it is a game and the house will be hidden so the player has to move mouse to find it.
 
Okay :)
 
user3119231
It would be never hidden cause it is always directly in screen.
 
I was telling the same to him that the house isn't moving
 
You want the house to move with the picture? As you move the cursor?
 
10:50 AM
Yes
I need help with the thing itself. How do I update the script on the page?
Not used JSfiddle like this before
 
@Polyducks Make changes, hit Update button on top
 
oh, click update... duh.
 
user3119231
Am I'm only with firefox who's house is always in the view? I want it to get the fuck out of screen, if I move away from it.
 
That's the plan, but that happens on Chrome too
 
10:51 AM
@Maurize You aren't clear about what you want. I'll ask again
 
You're not alone
 
Do you want the house to move with the picture, as you move your cursor around?
 
The idea is that the house is stuck to the background like a sticker
 
user3119231
DING DING DING!
 
user3119231
That is the problem. I don't get it in position like a sticker.
 
10:54 AM
Me either, that's what our task is :)
Is there a reason the terrain is absolute instead of relative?
 
@Maurize You have coordinates you want the "sticker" to be relative to the image.
 
user3119231
@Polyducks not really, I think it could work with relative, too. @MadaraUchiha I think you got it now.
 
You need to write a function that accepts those coordinates plus the current background position (i.e. the coordinates of the image relative to the viewport), and returns a set of coordinates for the sticker, relative to the viewport.
 
@Maurize can you try with relative? Everything seems to disappear if I try to make it relative
 
user3119231
@Polyducks tried, too. We need to use absolute.
 
10:57 AM
@Maurize what is the functionality that absolute is providing over relative?
 
The only challenge you have is that your image coordinates are in percents
 
Better go. I'm meant to be working. Best of luck to you @Maurize
 
@Polyducks Absolute positioning takes the element out of the natural flow
 
user3119231
@MadaraUchiha I've tried since hours. I'm here because of this. @Polyducks I dont remember...
 
@Maurize You want this
 
10:58 AM
and this is broken
 
function stickerAbsoluteToRelativeCoordinates(stickerCoordinatesOnImage, imageCoordinatesOnScreen) {
   // your code here!
   return stickerCoordinatesOnScreen;
}
The // your code here! is basically just changing the percent values to pixels, and doing some addition.
 
user3119231
@MadaraUchiha I'm trying since hours and I know it is up to this line: childs[i].style.backgroundPosition = x+" "+y;
 
user3119231
I got your method already at it doesn't worked.
 
hey that fiddle looks really nice to me. can you put cookie pics on it instead of the house icon?
 
lol @Awal
 
11:00 AM
I can live at that place with cookies, my laptop and an internet connection for life.
 
user3119231
@AwalGarg lol :D If you can give me solution I will put 1000 cookies there
 
@MadaraUchiha shall give the solution on my behalf. I will take the cookies. KTHNX!
 
@Gemtastic I have no source.
It comes from the basic meaning of what an asynchronous function is and how it works.
An asynchronous function is a function which performs a long action, but we don't want to wait for it.
Like you said, your function takes about 20 seconds to run. It's a shame that we'll have to block the thread for 20 seconds (and what happens if someone else wants to do work too?)
 
Well, then it means jack other than reasoning what it could be, but I want to know how it ACTUALLY is and how I know when to see what. Would be awkward if not all GAS is asynch but I think they are because all of them up until now are...
 
So an asynchronous function is a function that performs its actions in the background, while letting other stuff run
 
11:08 AM
Except that in JavaScript, there is no background.
 
I know how asynchronous is and means, and THAT'S why I'm puzzled by why my code works
 
@Gemtastic Because none of the actions there are asynchronous.
 
@AwalGarg Continue?
 
@Gemtastic JavaScript doesn't have threads (by default)
 
@MadaraUchiha Then where can I find in google's api or otherwise what is what?
 
11:09 AM
@Gemtastic Like I was starting to say
 
Are all of them synchronous or only the ones I've used?
 
@Gemtastic it is possible that your function was memoized and returns the result immediately from cache. Which is bad design, TBH.
 
If an asynchronous function returns immediately, how do you use the result of the long operation?
 
@AwalGarg No, it is not cached
Not by me at least but I can't swear to what google does behind it's scenes and from my API I can tell that the data is valid and new
 
Then the function is synchronous. Which is also bad design, TBVH.
 
11:10 AM
You either provide a callback (lambda) to be invoked with the appropriate values when the function is done, or the asynchronous function returns a Promise object, that represents the eventual value resulting from that function.
When none of those is there, it's almost assured that the function is synchronous.
 
@AwalGarg Go tell Google. There are a lot of things that are more than bad with GAS and GS
 
And if it comes from a Google API, then no surprise. Google APIs are mostly made to deliberately torture developers.
 
@AwalGarg You're preaching to the choir.
I still wish there was a solid source that explicitly stated what to expect.
I've come to the same logical conclusions as @MadaraUchiha but just because I reasoned it so, it doesn't mean I'm right.
It makes it more likely when an other developer I actually trust to be skilled comes to the same conclusion, but it feels like we're Socrates and Plato here philosophizing about how it must be given the evidence and the logic we can draw from how we know JavaScript is supposed to work.:P
Source wise, we're both kinda pulling it out of our asses
 
I don't know why are you are putting your time on this. Your function is sync and there is nothing you can do about it. Use it and move on.
 
I'm afraid shit's gonna blow yo.
 
11:16 AM
what function, show code
 
no function, hide code
 
reported :c
 
I want to become a better developer and understanding why my code works and doesn't work, I think it's important.
 
why var a = 12 works
hm..
 
@Neoares It's way up in the chat
 
11:16 AM
You just did. The function is sync. That's why.
 
Also in a question on SO
 
how much up
 
3 nautical miles.
 
that are very muches, I leave
 
@AwalGarg Yeah, but as I said, I want a better source than logic, because my experience with Google so far is that logic isn't their thing...
 
11:18 AM
@Gemtastic what API is it, and do you have a direct link to the JS file containing the API code?
We can always inspect what the function actually does.
 
@Gemtastic to be fair, GAS is kind of backwards. I wouldn't seriously learn JavaScript through that.
Synchronous functions are bad practice in JavaScript.
Anything that's IO bound (filesystem, network, socket, database, etc) should be asynchronous.
 
@MadaraUchiha <nit> long running syn...
 
@AwalGarg Um ok, well, I've only written simple exaple, my code runs long with many functions written synchronously, but I can't show it because of company copyright so you'll have to do with this:
 
Only CPU bound actions (arithmetics, object manipulation, string manipulation, etc) should be sync.
 
0
Q: Is google apps script synchronous?

GemtasticI'm a Java developer learning JavaScript and Google Apps Script simultaneously. Being the newbie I learned the syntax of JavaScript, not how it actually worked and I happily hacked away in Google Apps Script and wrote code sequentially and synchronous, just like Java. All my code resembles this: ...

@MadaraUchiha Tell that to google
 
11:20 AM
@AwalGarg How would you define "long running"?
@Gemtastic I don't have to deal with their crap, you do.
 
:o
 
@MadaraUchiha But I'm 100% powerless to change their source code
 
If you want to learn JavaScript proper, take anything GAS does with a truckload of salt.
@Gemtastic And I'm what, the source code fairy? :P
 
@MadaraUchiha In core JavaScript, it is the set of the negation of the actions you listed.
 
@AwalGarg Thank you :)
 
11:22 AM
@MadaraUchiha Oh I am, that's why I kinda asked you and not adressing the entire JS room.
 
user3119231
fuck this shit, I'm going to become hairdresser :( jsfiddle.net/ttdwd7vu/21
 
Remember that this conversation started with me expressing my difficulties in finding a source confirming my theory (which is the same as yours) int he java room :p
 
morning
 
Right, so like I said. GAS may be good to get acquainted with the syntax and stuff, as well as working with APIs outside the browser.
 
@MadaraUchiha Just to state an example of the negation, reading from localStorage is long running, and it is terrible design mistake that localStorage is synchronous.
 
11:23 AM
But it apparently not really filled with good practices.
 
@afonsomatos morning~
 
@AwalGarg Yup.
 
@afonsomatos morning at 12:23 in portugal?
 
IMO: All of google is a design mistake >_>
 
yeah
well I haven't had lunch yet
 
11:24 AM
I forgot u were a student
holidays?
 
yup :)
3 months
 
nice
I have only 1 month :(
 
@Maurize still not solved it?
 
user3119231
@Mr_Green I'm getting mad of this. -.-
 
user3119231
We are now at the point where we say: We want the house work as sticker to the background.
 
11:25 AM
take a break and try a little after
 
@Maurize why hairdresser? xD
 
goes back to read the JS books I was linked ^_^
 
user3119231
@Neoares Seems like I'm to stupid to solve this shit.
 
kek
so hairdressers are stupid
 
0
A: Shortest program that throws StackOverflow Error

afonsomatosJavascript ES6, 21 eval('{'.repeat(1e4))

 
user3119231
11:31 AM
So, If I want the blip keep staying on north america. bm-designs.de/test
 
user3119231
Even if I'm moving on worldmap.
 
user3119231
Anybody an idea now?
 
hm..
 
Anybody able to help? I am getting a "too much recursion error" using a jQuery on.('click') event
 
@JustSteveKing code?
 
11:37 AM
 
@JustSteveKing What are you trying to do?
 
@MadaraUchiha Basically when I click on the link with class toggle-trigger I want the next element in the DOM with the class of text-toggle to appear. It is like a "Read More" link but the content is hidden
 
!!> (0, eval)('+'.repeat(1e7))
 
@afonsomatos "SyntaxError: expected expression, got '++'"
 
@JustSteveKing api.jquery.com/next
jQuery is a DOM traversal library
 
11:40 AM
@afonsomatos "SyntaxError: expected expression, got '++'"
 
._.
 
@MadaraUchiha My structure to work with is a little funny as I tried next()
 
!!> ('+'.repeat(1e7))
 
@Neoares "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++‌​+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++‌​+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++‌​+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++‌​++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ (snip)
 
@MadaraUchiha <parent><parent><click me></click me></parent></parent><next><target></target></next>
 
11:42 AM
I wanted it to actually parse
because on my end it causes stackoverflow
 
@MadaraUchiha I have managed to fix the "too much recursion" error. However it is still not doing what I need. On each click, what it will do is console.log the first instance on the page - not the next one in the DOM tree: pastebin.com/7L32Fbsw
 
anyone here use janus for vim? What is the extension mapped to #?
 
user3119231
lol making huge steps over here
 

« first day (1724 days earlier)      last day (3228 days later) »