« first day (1725 days earlier)      last day (3224 days later) » 

9:00 AM
yet another way to say it: git is not like your mom
 
user3119231
there must be a human on earth whos able to solve this quest...
 
user3119231
1
Q: Prevent image from moving with scrolling background

Maurice BambenekI am working on a scrolling background which is moved by mouse. I want to add images like sticker to it, so the blip is always in "north america" for example. But in all cases it doesn't worked. I think there is a huge problem with calculation. Maybe you can help me out. Thanks. Maybe this will ...

 
@Maurize your fiddle shows a blank waiting curtain brah
a ton of 404s in the console
 
user3119231
uno momento.
 
9:04 AM
to get img size
but I used jQuery
 
for no reason
 
because it's a modified code from SO
 
also btw that won't work at all
 
user3119231
@AwalGarg then correct me.
 
why
 
9:06 AM
@Neoares because load doesn't happen until you append to dom
@Maurize that was aimed at neores
 
user3119231
@AwalGarg ah okay :D
 
I guess $('<img/>').attr('src', url) is creating a tmp image
 
@Maurize I am no expert in this graphics stuff, but can you try naming your variables to suit readability? what does tX or cY mean?
 
t from terrain
 
and an explanation of the calculations used in comments can greatly help I think
 
9:09 AM
and c from blip (?)
 
user3119231
c for child :D
 
user3119231
so blip is right
 
so what is terrainX? terrain's X coordinate? (isn't terrain filling the entire screen?)
 
user3119231
here you go my friend
 
9:11 AM
I just thid this console.log("X:" + e.clientX + ", Y: " +e.clientY);
paste this and you will understand
 
hello guys
 
@machun 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.
 
hi
!!afk breakfast
 
user3119231
@Neoares good appetite
 
i want to ask something but i'm not sure if my question is better posted here on stackoverflow or other stackexchange site, so i wanted to confirm it first
could you guys help me please /
 
user3119231
9:13 AM
sure
 
i am doing my first javascript profiling
 
user3119231
paste code and question
 
user3119231
for huge codes jsfiddle.net
 
but i'm using kendo ui, then when i do the profiling there no function that i recognized . think it all being wrapped or something
 
user3119231
hm sry im out. never heard about it.
 
9:16 AM
function Person(first,last,age) {
   this.firstname = first;
   this.lastname = last;
   this.age = age;
   var bankBalance = 7500;

   this.getBalance = function() {
      // your code should return the bankBalance
      return this.bankBalance;
   };
}

var john = new Person('John','Smith',30);
john.getBalance();
john.getBalance returns undefined, why?
 
!!s/ this.b/ b/
 
var bankBalance = 7500;
 
@AwalGarg function Person(first,last,age) {
this.firstname = first;
this.lastname = last;
this.age = age;
var bankBalance = 7500;

this.getBalance = function() {
// your code should return the bankBalance
returnbankBalance;
};
}

var john = new Person('John','Smith',30);
john.getBalance(); [\(source\)](http://chat.stackoverflow.com/transcript/message/24304003#24304003)
@AwalGarg function Person(first,last,age) {
this.firstname = first;
this.lastname = last;
this.age = age;
var bankBalance = 7500;

this.getBalance = function() {
// your code should return the bankBalance
return bankBalance;
};
}

var john = new Person('John','Smith',30);
john.getBalance(); [\(source\)](http://chat.stackoverflow.com/transcript/message/24304003#24304003)
 
:(
forgive me
y u no preserve formatting cap
 
@StevensHaen rather, you want this.bankBalance = 7500;
 
9:19 AM
@FlorianMargaine he said "private var"
 
sorry, this._bankBalance = 7500; then
 
how is that private?
 
@AwalGarg It's private by convention.
 
it has the underscore
 
9:21 AM
@StevensHaen You assigned the variable to bankBalance, not to this.bankBalance
 
@StevensHaen what a terrible way to do things
 
Also that ^
 
@MadaraUchiha no, it's just a terrible way to do things
mixing classical with closures
 
@MadaraUchiha look it is just a terrible way ok? listen to florian FFS
 
9:25 AM
@MadaraUchiha his lip movement doesn't match the caption
 
ugh
I hate sites like this
 
I don't. That site helped me gain the initial knowledge needed to understand wtf is going on.
But it is true that they are not the best way to learn.
 
@AwalGarg It's not that hard giving initial knowledge without introducing bad practices along the way.
 
agreed. but they still do their work, so I don't think they deserve "hate". They deserve suggestions and feedback.
 
user3119231
Am making progress: bm-designs.de/test/
 
9:29 AM
@Maurize Not moving at all for me.
 
@Maurize ^
 
user3119231
sry, thought I got it :D
 
user3119231
that was just start pos.
 
Hey guys. I have this bit of code. I am trying to move the looper and currentFrame variables into the animateSprite function, so that when I call animateSprite() on 2 jQuery objects it doesnt increment everything on the same currentFrame variable. Does anyone have any suggestions? Right now when I move them in there I get a currentFrame is not defined error. :/
I don't feel like flooding the js tag with this so I thought why not ask it here
 
@Maurize by explanatory comments, I meant why are you doing the calculations that way. How do you know that you have to add subtract clientX from tX? How did you arrive at that algorithm?
 
9:33 AM
@RizkyFakkel for starters, don't animate with setInterval
 
user3119231
@AwalGarg my thoughts are that If I want the blip stay in north america I need simply the terrain position and substract the mouse position
 
!!tell RizkyFakkel mdn requestanimationframe
 
user3119231
I don't know what I should think anymore:D working since yesterday 24/7
 
@FlorianMargaine Why is it terrible?
 
9:34 AM
@nhahtdh By assigning a function to this.whatever, you create a new function for every instance
 
Can I reverse an animation when I'm not hovering on an image with requestAnimationFrame? @MadaraUchiha
 
@RizkyFakkel Have you considered using CSS transitions?
 
@MadaraUchiha Make sense.
 
@Maurize ew, draw it on a physical graph paper first. figure out what the hell happens when the terrain moves and what co-ordinates change, and how to reverse them for the blip. then apply them pragmatically.
 
posted on July 07, 2015 by Alex R. Young

I've decided to stop writing DailyJS. It's part of my weekday ritual, and so it's a difficult decision to make, but it's time to move on to other things. I love writing regularly, but mistakes have started to creep in that mean it's difficult for me to publish articles with

 
9:35 AM
What is the correct way to implement the same feature, though?
 
@MadaraUchiha I don't want it to be smoothed out, which is what CSS transitions do, right?
 
Hey guys - if we put console.log inside try...catch tags, it won't cause any problems in a non-compatible browser, right?
 
@Polyducks ... You're supporting IE7?
 
@Madara only 8 and beyond
@Madara I'd assumed based on the MDN that there are still browsers without console.log support.
 
9:39 AM
@Polyducks shim the console object instead
 
Then you don't need to worry about try/catching console.log calls.
 
I've seen IE9 not have console defined unless F12 tools are opened
 
@Awal does Madara have a point?
 
@ivarni You're right.
 
Aha. So it's a good safety net to have. There's no harm in including it.
 
9:40 AM
@Polyducks Shim the console. object instead, Awal is correct
 
Madara is the overlord here, so he is right indeed.
 
@MadaraUchiha I have seen that snippet of code all over the place, as the way to implement private member. Can't see any alternative for that.
 
window.console = window.console || {log: function() {}};
Or something like that.
 
Questioning Madara's intelligence brings a tsunami. Just FYI.
 
@MadaraUchiha Hm yeah that's not really what I'm looking for. I'm actually looking for jumps of x pixels, so for example 45px 90px 135px etc. A smoothed out movement would look weird on a sprite image.
 
9:41 AM
@nhahtdh Your need for private variables doesn't justify the problems this approach causes.
 
@Madara godlike. Thanks. I'll do some google research.
 
@MadaraUchiha Throwing this approach aside, is there any other approach to implement private member?
 
Performance problems, your method is not on your prototype, will not work properly with class syntax, etc.
@nhahtdh Add an underscore before private member's names and treat them as private by convention.
 
@MadaraUchiha I highly dislike this approach.
I have to deal with the stupid underscore in all my references.
 
@AwalGarg No, you don't. Because you shouldn't have that many references....
The entire point is that you do not reference anything with _ from the outside.
 
9:43 AM
Not a big fan of underscores. Makes sense to differentiate them from other things though
 
@MadaraUchiha in the internal definition of the function/constructor/methods.
 
@AwalGarg Well, I don't see a better approach.
 
Reading elsewhere, it seems that there is no good solution for that: eclipsesource.com/blogs/2013/07/05/…
 
And attaching functions to this is certainly not good enough.
 
Just don't use the _. Name it like you normally would, and document them as private.
 
9:45 AM
So, just so we're clear, you guys promote the idea of any private variable (function scoped etc) to have an underscore to mark it as such?
 
@Polyducks No
Private scoped variables is another thing
 
@Madara Sorry, just trying to learn.
 
We're talking about private members on an object.
 
It's not like the user can't access a variable just because it has an underscore before it.
 
oooooooooooor
just use the module pattern
 
9:46 AM
aha, gotcha.
aren't all variables inside an object accessible from the outside anyway? Is giving them an underscore telling the user that they shouldn't?
 
just use a sane language like PHP
:P
 
user3119231
lol next step - terrain x and y are % so I have to calculate in % (better cause ar)
 
oooh @Maurize, what are you building?
@Maurize still the house in the hills?
 
user3119231
@Polyducks noooo, bm-designs.de/test
 
user3119231
now blip on the map :D it is easier to understand what I want.
 
9:51 AM
@Maurize I have a tall screen. That image looks amazing on it.
 
:/
 
Ego?
 
user3119231
@Polyducks thanks but my script doesn't work. I have to calculate % x and y of image to let north america be north america
 
Story?
 
user3119231
Tall Problem :D
 
9:52 AM
Ah, I see @Maurize.
 
user3119231
@Polyducks any idea?
 
I have a feeling you'd have a much better time of it if you moved terrain as a div instead of a background image.
 
Or maintained a state object.
 
Then just put the pointer inside that div
I think you can do this mostly in CSS to be honest. It'll save you a ton of time.
 
user3119231
@Polyducks Moving terrain as div? Check website.
 
9:56 AM
Then you use your lovely script to move the terrain div. Tada, problem solved.
lol just saw that you'd moved my script onto your site haha
 
user3119231
@Polyducks working awesome -
 
:>>>>>>>>>
 
user3119231
I like how simple designed everything is :D
 
oh my god that's the first time I've been relevant on this chat
haha I'm so glad I could've helped!
 
user3119231
This was ironic.
 
user3119231
10:00 AM
www.bm-designs.de/test xD
 
Uhhh that's not right lool
 
haha I just push it off the page. You'll have to work on attaching it to the mouse movement.
you have to set the center point as 0,0 instead of 50% which I think is what you have it at at the moment
 
Is there any way to pass a variable to a hover() function? I currently have a variable above a hover function, but the hover function says it's not defined.
 
I have a feeling that's a scoping issue
have you tried defining the variable within the hover() call?
 
user3119231
I think we must use background position because the user should be able to move arround on the map.
 
user3119231
10:02 AM
but the idea with absolute position isnt that bad
 
No, you should oversize the terrain and limit how far it can move.
Put it inside a wrapping div which hides the overflow
anyway, I've got to go back to work now. Best of luck to you Maurize!
 
user3119231
@Polyducks see you polyducks, thanks.
 
That or set the pointer as a background as well. It's possible to have more than one background image. Google that, yo.
 
@Polyducks Yes I have, unfortunately it didn't do the trick.
 
I love it! baconipsum.com
 
10:11 AM
@argentum47 @Abhishrek @uselesschien quora.com/… what. the. absolute. fuck.
IIT-K student accepts cheating openly on the internet, gets 700 upvotes on quora.
 
> Bacon ipsum dolor amet picanha leberkas jerky turducken pig hamburger biltong, cupim beef bacon fatback ribeye shoulder. Prosciutto meatball turducken pastrami flank short loin ham hock doner tail sirloin meatloaf turkey ham. T-bone short ribs corned beef boudin, tri-tip ham hock ground round. Capicola pancetta porchetta pastrami fatback turkey picanha beef ribs pork chop landjaeger frankfurter chuck chicken.
 
wtf
meal ipsum?
oh, baconipsum xD
 
10:28 AM
103
Q: Upcoming login changes

Anna LearAs y'all know, our current flavor of "global authentication" leaves a few things to be desired. It's flaky, requires a page refresh, etc. etc. Wouldn't it be nice if you could just sign in once and be automatically logged in across the network? We are ready to roll out Stage 1 of Project "Make...

> If you see any issues... Good luck, because you probably can't log in to report them here.
Hahahahaha
 
user3119231
Lol made progress I think. check console - bm-designs.de/test
 
@Maurize Any reason you're not using Google maps/leaflet?
 
user3119231
@BenFortune of course. there are enough.
 
Go on...
 
user3119231
Will recieve huge amount of gps data. I won' t give it to google. Never.
 
10:34 AM
lol
 
takes off tin-foil hat
You should use leafletjs.com then
 
user3119231
@BenFortune thanks, but It is not up to precise location. Should only be an overview.
 
Doesn't have to be. No point re-inventing the wheel.
 
user3119231
so admin can see where are the people on the world and count the users per country.
 
and that needs to be on a map why?
also, how many users do you have?
 
user3119231
10:37 AM
@phenomnomnominal but I need to display the number on the country. so I have to set position of blips to the country. and important: the blip must stay there
 
user3119231
www.bm-designs.de/test inserted some more infos to console.
 
user3119231
 
@MadaraUchiha page not found :( I want to see ^^
 
@MadaraUchiha so he is?
 
He is.
 
user3119231
10:59 AM
awesome, can you explain me more?
 
Explain what in particular?
 
user3119231
@BenFortune you are using google maps api?
 
@Maurize No, it's using leafletjs
 
user3119231
@BenFortune hmm, okay. nice. I'm trying to calculate. I accepted challenge already :P
 
All I've done is create a map from your image. You can add markers using L.marker([lat, lng]).addTo(map);
I think they're calculated on a 1:1 pixel basis
 
user3119231
11:02 AM
@BenFortune It's very cool. If I can't finish it for myself I will give leafletjs a try :D
 
are you loooking to work on the Google map api?\
 
@NisalUpendra 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.
 
user3119231
@NisalUpendra nooo, I want simply to let the blip stay in north america all the time. No matter of screen resolution and shit :D
 
user3119231
bm-designs.de/test you can test it and view source code
 
morning
 
11:08 AM
Ello
 
user3119231
heyho
 
Hello!! Could someone take a look at my question:
0
Q: FFT procedure for evaluationg a polynomial at $N$ Fourier points

Mary StarThe following is the recursive FFT procedure of Algorithm for evaluationg a polynomial of length $N$ at $N$ Fourier points. Algorithm (FFT - fast Fourier transform). Input arguments. $ \ \ $ integer $N=2^m$ $ \ \ $ polynomial $\alpha (x)=\sum_{i=0}^{N-1}\alpha_i x^i$ $ \ \ $...

I am trying to implement the algorithm, but I got stuck...
 
What does that have to do with JS?
 
You can write algorithms in JS. So all algorithm problems must be written in JS.
 
11:13 AM
I can't math.
 
I can't.
 
user3119231
I can't
 
user3119231
Lol this is why my script never gets finished :D:D
 
Register a finish script request by pressing Ctrl+W on this tab.
 
user3119231
Ctrl+W? oho we got a badass over here.
 
11:16 AM
you think it will close your tab?
cool, don't try then.
 
user3119231
I won't - Please do it first.
 
grabs popcorn
 
reddit.com/r/talesfromtechsupport/comments/3cadem/… Last time I heard this story I fell off my dinosaur laughing
 
11:28 AM
@BenFortune yep, soap
 
It's god awful, why can't they implement a RESTful service like everyone else.
 
not sure if I'm reading this book right, I try to figure out the code by myself instead of reading the explanation.. :P
 
snopes.com/business/genius/where.asp I have read this (and variations) many times, and I like this very much. True brilliance.
 
I have created two parent <div>. Inside the first parent <div> I have written a loop,where twenty child <div> is getting created. I want at the time of child <div> creation, when the height of the first parent <div> will get full, then the rest of the child <div> will automatically get transferred into the second parent <div>. I failed in every try. I am just sharing my basic codes.
 
@BenFortune How does auth work? My dad's trying to get a response, and all he's getting is a 404. Suspect missing credentials, but doesn't know what he needs to supply
 
11:33 AM
@KendallFrey With ParcelForce it's literally just an auth block in the XML
 
same for Fedex
nothing in HTTP then?
 
1 message moved to Trash can
@Maurize Please don't post unformatted code - hit Ctrl+K before sending, and see the faq.
 
Not that I know of, are you hitting the correct namespace?
 
namespace?
 
user3119231
Something like this possible?
 
user3119231
11:34 AM
<script>
    var blips = { id: "1", x: "5%", y: "5%" }
for (i in blips) {
    document.write(blips[i][id]);
    document.write(blips[i][0]);
}
</script>
 
What are you using for requests?
 
URL?
 
user3119231
@CapricaSix sorry, honey.
 
No, PHP/Program?
 
JScript
 
11:35 AM
You using node-soap?
 
no
not using node
 
You're using ajax?
 
fucking ancient dialect of JS
@BenFortune kind of. the MS COM object version of XHR
 
user3119231
anybody? somebody?
 
Didn't know it worked over XHR
 
11:36 AM
What did you use?
One of their libraries?
 
oh
@Maurize Your question is unclear
 
The connection is something like
 
that as written won't work
 
return soap.createClientAsync(this.wsdl, {
	endpoint: this.url
});
 
user3119231
11:37 AM
I want to call values under a key
 
user3119231
for example blip[i]["id"]
 
but none of those values has an id property
 
The WSDL has an namespace of http://www.parcelforce.net/ws/ship/v5 but actually makes requests to https://expresslink-test.parcelforce.net/ws/
 
guys can somebody help me out?
 
Bleh, Fedex requires a login to get to the documentation...
 
user3119231
11:39 AM
better example:
 
user3119231
<script>
    var blips = { { id: "1", name: "North America", x: "5%", y: "5%" }, { id: "2", name: "Russian", x: "30%", y: "5%" } }
for (i in blips) { //loop through table
    document.write("Name: " +blips[i][name]); //give back
}
</script>
 
@Maurize That's not better, it's even more invalid
did you mean an array?
 
user3119231
yeah - check var blips
 
crl
[{},{}]
 
user3119231
lol what a dump tutorial. told me to do it like I did
 
11:41 AM
to iterate an array, use for..of in ES6 or a normal incremental for loop with an index
 
@KendallFrey This is what the xml and headers look like for a normal request: gist.github.com/xbenjii/a25f3b2e1c2330c607e5
 
What's with the non-standard SOAPAction header?
(I hope it's non-standard)
 
user3119231
worked. thanks, that was it :D
 
everyone hypes about web services but when it comes to questioning they all turn there back
 
@Maurize, @KendallFrey, bro any one plz help?
 
user3119231
11:44 AM
@Amit yo, whats up
 
@KendallFrey you never told me you are Amit's bro.
 
I have created two parent <div>. Inside the first parent <div> I have written a loop,where twenty child <div> is getting created. I want at the time of child <div> creation, when the height of the first parent <div> will get full, then the rest of the child <div> will automatically get transferred into the second parent <div>. I failed in every try. I am just sharing my basic codes.
@AwalGarg :)
 
you wrote a loop inside a div?
I... uh, how?
 
user3119231
@Amit give us code or paste pastebin or somewhere
 
@KendallFrey I think it's just what SOAPUI sends.
> An HTTP client MUST use this header field when issuing a SOAP HTTP Request.
 
what you want will never happen.
do it manually via real JS/DOM code.
 
how?
 
@BenFortune That might be the issue, worth trying
I lost all trust in the thing after seeing this line in the documentation:
Referrer: YourCompanyNameHere
 
LOL
 
[sic]
 
11:50 AM
@Amit embeddedjs.com <- you might like this
 
Referrer: Some guy told me
EJS is poo
 
user3119231
@Amin
 
user3119231
for (i=1; i<=10; i++) {
  alert(i);
}
 
it's an html precompiler who runs js in a similar way to php, meaning that you just put that thing in that, and the return is what you'd "echo"
 
@towc meh
 
user3119231
11:51 AM
@Amin don't forget to set in <script> tags
 
@AwalGarg wrong ping, sorry :P
 
@Maurize, r u telling me?
 
@towc that won't work anyways. he wants to detect offsetHeight.
 
user3119231
@Amit yes, this will work. as I see you want to create childs from 1 to 14?
 
getComputedBoundingBox or somehting? should work
I don't think I fully understand what he wants
 
11:53 AM
guys help else i will get murdered today by my faculty.
 
user3119231
what do you want exactly man?
 
@Maurize, no, I want to create childs from 1 to 20
 
@Amit RIP in peace.
 
user3119231
easy man. let me edit.
 
ooooh
ok
 
11:54 AM
@Amit I will write you a fiddle demonstrating how to do it. But you will have to rewrite it to suit your needs.
 
he didn't actually need a way to implement the thing
 
Look in my pastie, i have created two parent divs. inside one parent div i have written a loop for creating 20 child divs.
 
user3119231
 
@Maurize - just get the closing script tag and div tag in the right order, and that works
 
user3119231
@adeneo corrected already
 
11:58 AM
So why post faulty code ?
 
user3119231
 
user3119231
stay cool, mate.
 
@Amit jsfiddle.net/wyLcxe1w here. try to understand how that code works, and ask if you get stuck.
@Maurize do not recommend using document.write please.
 
@Maurize - that's still the wrong order ?
 

« first day (1725 days earlier)      last day (3224 days later) »