« first day (643 days earlier)      last day (4298 days later) » 

12:04 AM
0
Q: Easy way to do gravity in Javascript/HTML5?

hustlerincI'm looking for an easy, beginner friendly way to do gravity in a platformer. I've looked into box2d tutorials, but they all seem very complicated. All I want is a class that takes into account if my player is grounded, or airborn, and a nice little curve as he jumps. I know this shouldn't be mo...

 
 
1 hour later…
1:07 AM
Retained mode canvas? Currently the canvas can only operate in immediate mode. That is, it refreshes after each drawing operation. This makes it easy to work with, but it adds a lot of overhead. Transitions between JavaScript VM and the C++ rendering engine, calls to the video driver, waiting for vsync, etc. Wouldn't it be cool if there were a way to put the canvas into retained mode?
 
@ErikReppen I've been starting to think differently about this. Instead, you could code in IE all along. You'd probably take more care to use progressive enhancement, and you'd not have to pull your hair out solving IE bugs when you should be celebrating the completion of the project. Start with a modernizing shim for css and js of course.
If you built to IE without using any of their proprietary crap, it would be waaay more likely to simply work when you tested in Firefox than vice-versa
 
1:41 AM
@Chris Yeah given that HTML5 is really the spec that the browser vendors all wanted, modern tools and IE6 and hopefully IE7 not being commonly supported, I'm not sure it's as big of a deal anymore but a lot of these corporate intranet apps were first written quite a while ago and just given modest facelifts over the years. That said, I still think I'd rather benefit from the dev tools of the more competent browsers when first building things out.
 
Firebug light... :)
Heh, you won't catch me running off and using IE as my primary development target, just idle musing
 
Oh, I haven't tried that in a long time. I'll bet it's much better now.
 
 
2 hours later…
3:30 AM
hello
 
Hi
 
3:43 AM
\o/
@Chris progressive enhancement is fantastic
@Chris however I recommend you draw the line at js. And just serve a HTML/CSS only site to oldIE
CSS degrades nicely
@Chris I can't imagine developing in IE first then other browsers, the lack of chrome dev tools / speed really hamstrings me
 
4:04 AM
Is it okay to ask jquery questions here?
 
RT @anssik: Modernizr 2.6 now detects the Battery Status and Vibration APIs too: http://modernizr.com/news/modernizr-260/
 
4:39 AM
g'morning all
:D
 
@andrewhl JQuery is JavaScript.
 
4:53 AM
@ErikReppen Yep.. jQ is like a js framework or library of sorts or something
 
5:28 AM
dupe entry
@ShyamK It's a function that constructs and returns an object with access to a crap-ton of methods mostly accessed via prototype. It's also something of an adapter/decorator for the DOM API.
 
yes.. thats why I said its 'like' a framework :)
cos its actually not
 
Library
 
5:55 AM
I would call it a tool. Prototype and YUI are libraries. You can turn JQ into a library but core is mostly DOM API boilerplate simplified.
Not sure where "framework" fits into all of that. I guess something that's more on rails, really rather than a library which is lots of isolated bits.
 
A library is a collection of helper methods. A framework is something you build your entire program on and model your architecture according to its will.
 
Is there such thing as a tool-set?
 
Tools are anything which help you get the job done
 
Random news: Dinklage got emmy-nominated. This would matter to you if you were impressed by the totally badass little person on Game of Thrones.
I think EXTJS means to be a library but is a bad framework by accident.
 
It's related to architecture. Whether you use MooTools or not doesn't change the way you model your program, but choosing to use RoR has a gigantic impact on everything.
 
6:05 AM
Morning :)
 
Hence they call it a framework; it's the frame of your program.
 
Yeah, that's what I meant by EXTJS.
 
extjs is a framework, how do you even use it without making your whole project about it
 
But I feel like there's a distinction worth making between JQuery core and say JQuery UI. But I might just be fussing over semantics.
@Esailija Well we tried to just use its grid and some other isolated stuff. It's a bit heavy-handed for just picking and choosing to be sure.
I don't see a reason it should be though.
Also, by "we" I mean people I work with, before I got there.
I gotta crash. 'nite folks. Good morning Europe/Africa.
 
morning
 
6:14 AM
@Esailija morning :)
 
QUICK. Is there a way to get the iframe element from the content document of the iframe itself???
 
QUICK. Is there a way you can get that to make sense???
 
document.defaultView.frameElement
 
Well, just one more detail missing: From inside, or outside? If it's from the outside, and it's across domains, then no. If inside, then no problemo.
 
or window.frameElement inside the iframe
 
6:24 AM
HAHA. Thank y'all for some quick answers! Now I can get back to work!

See ya, and thanks again!
 
7:10 AM
andy is m al
 
@FlorianMargaine why does this happen every time stackoverflow.com/a/11574051/995876
accept/unaccept/accept :D
 
Hi can anybudy help me with AJAX
??
 
Help us help you
 
Hi @Zirak
can u help me
?
 
Care to be specific?
 
7:19 AM
ya
having a page with multiple drop downs
 
jolly.exe is a troll/help vampire iirc
 
[:/
I want to change other drop down values on changing one
if there are 11 drop downs then is it necery to use 11 AJAX request
?
 
Why does this have anything to do with XHRs?
 
yes
 
A valid answer for yes/no questions, which isn't the case here :P
 
7:23 AM
11 drop downs are in DIV where HTMl is returned from js files
 
Also, if you want to send data to the server, just send all of it...why do you think you need to split it up?
 
ya I was also thinking of that
 
Do someone know how to make rainbow animation for text in javascript
 
What fresh hell is this
 
ya I know @AnkitGupta
 
7:25 AM
make change color in foreground of text.
 
@jolly.exe thanks
 
Let me paste some Code Here @Zirak
 
@Esailija I usually delete my answer if OP is a help vampire
@AndersMetnik o hai, I thought about you this morning. You know, the thing you had problems to understand yesterday? It's exactly what your readEntries does
 
hello, is this code right >> float total_acv_val = (parseFloat(SumByTipe[entry]['act_val1_total'])/parseFloat(SumByTipe[entry]['bud‌​val_total'])) * 100; ?
 
7:31 AM
no
javascript is not strongly typed
 
Morning @FlorianMargaine and now I understand it, a good nights sleep helped a lot :)
 
cool :-)
 
Indeed
 
this part is the hardest one on javascript.info btw
everything but these chapters is just some stuff to learn, nothing big, nothing brain fucking
 
@FlorianMargaine is another way to write something like that in javascript?
 
7:34 AM
Yeah well, I said I understood it, but I bet I need to look it up again from time to time :)
 
@blankon91 var total_acv_val = ...
 
Blanko you dont need to parse in javascript
afaik :)
 
depends on his values
 
@FlorianMargaine okay, I'll try that..thanks :)
@AndersMetnik but my values is string and I want to parse it into float :)
 
Ahh :D
 
7:39 AM
@FlorianMargaine it works, thank you very much :)
 
@AnkitGupta I hate myself: tinkerbin.com/glABGjur
 
@blankon91 remember, every variable declaration must be prefixed with var in javascript
no matter what the type is
 
@FlorianMargaine sure I will remember it forever :D thank you
@FlorianMargaine can I add .toFixed(2) for total_acv_val
because the total_acv_val turning so many digit after decimal and I want to limit the decimal for the result.
UPDATE: I solved it :D by parsing the total_acv_val first and add .toFixed after that
parseFloat(total_acv_val).toFixed(2)
 
@FlorianMargaine I'm sure I read something else in js.info... It was said to be bad practise but there was something like g=5; or something that worked
 
8:01 AM
@AndersMetnik yep, not using the var keyword also declares a variable, but it makes it global
so it doesn't care about scope, which is just a very bad idea (tm)
@Zirak what's this regex for? /\S/
 
@FlorianMargaine So spaces and newlines won't count
 
why hello good sirs
 
@FlorianMargaine tm = ?
 
would this be a good place for a quick Jquery question? or is there a better room?
 
You can try I guess
 
8:11 AM
well, doing a good old fashion, jqeuery load ajax, and have the data type set to xml... so I can parse it as xml. However, the doctype I am dealing with (that I cannot be changing idealy) is '<!doctype models SYSTEM "/* path to dtd */">
I can see that this xml is failing to load, it's getting cancelled
I assume as the doctypes do not match up
is there any way I can tell jquery to just load that data, and then treat it as the valid xml I know it is
 
First check if it's really jquery's fault; try navigating to that page.
 
well, it's a local file, so I know it's there :P
besides, I can see in chrome that it starts loading, but cancels
but for the sake of argument, loading it in browser any way :P
 
Try sending a request without jquery
 
@AndersMetnik ™
 
huh... browser seems to failing to open the xml file...
 
8:17 AM
Bing (that sounded better in my head...)
 
Yahoooo!
 
@Zirak Heh, guess so. Looks like you're talking about bing.com there :x
 
so yeah... does the doc type HAVE to be xml for it to be read as xml?
 
If it's failing to actually open the file, then it's not a parsing problem
 
what do you mean by "doc type"?
 
8:19 AM
@FlorianMargaine Haha fair, still don't quite get why you made it though ;-P
 
the <!DOCTYPE... bit
 
@Zirak, You got a exact point but how I can change color of every char in the sentence.
 
If it were, you'd have seen an error. To my knowledge, Chrome and FF don't silently fail on xml files, they loudly complain
@AnkitGupta And what I did wasn't changing the colour of every char in the sentence...?
 
@Zirak zolly.exe's link for animate bloggertricksandtoolz.com/2011/02/…
 
I saw that, it's absolute shit
 
8:20 AM
I means animation on every second.
 
hmm... how can it fail to load a file that I have dragged into chrome?
at least I know it's not a stupid typo
4 MB is hardly going to choke the browser, is it?
 
@Zirak great, it's working what I want.
@Zirak thanks for making it.
 
If you copy+paste that I'll haunt you for all eternity
 
8:40 AM
ahh, it seems to be some security setting in chrome, by default, you can not use ajax to load local files
 
8:58 AM
hello
anybody have idea about phonegap + android app.?
 
@JDev idea about what?
 
phonegap framework for android development
 
Don't use those frameworks. The apps created with them look ugly compared to native apps.
 
@ThiefMaster I aggree with you..it slow too
 
yeah but what else we can do if have requirement like that.
:(
 
9:02 AM
What kind of requirement?
 
@Zirak I linked your correct opinion here :D stackoverflow.com/q/11576018/995876
 
@JDev did you have try titanium?
 
nops.
 
@Esailija hehe, thanks
 
what is up with jAndy? He used to be on chat all the time
and I asked him why not anymore in a comment, and he didn't respond :O
he mad?
 
let me check...
 
@JDev are you use some android API in your application?
 
I don't understand what you want @JDev, im using PG w/ JQM to target iOS and android both. works fine imo
 
@AndersMetnik so far I build an application for android with phonegap + jQuery Mobile, but it runs very sloooooww :(
even I run that application in samsung galaxy S3 :p
 
Well have build this in android first, but I have no clue on ObjectiveC and found it annoying, so I have to do it this way if I want my app on iphones as well ;-)
 
9:28 AM
1
Q: Could this JavaScript / PhoneGap code be improved to use module, or other, pattern for better readability and maintainbility?

micadelliI have a PhoneGap application that I wrote some time ago. After looking Doug Crockford's video seminar JavaScript: The Good Parts (http://www.youtube.com/watch?v=hQVTIJBZook) I was just wondering if the code could be improved for better maintainability and readability as it now could be hard for...

 
10:24 AM
AAAaaaAAaAAAAAAaaaAAAAAAAAAaa ...... TarZen //o_O\\\
Any body there
jQuery AJAX PRoblem
\Multiple AJAX request
$.ajax({
type:"GET",
url: "/AjaxLangMetaDataServlet?opt="+option+"&cid="+catid+"&mta="+meta,
success: function(data){
$("#populateLanguage").html(data);
}
});
$.ajax({
type:"GET",
url: "/AjaxPubMetaDataServlet?opt="+option+"&cid="+catid+"&mta="+meta,
success: function(data){
$("#populatePublisher").html(data);
}
});

$.ajax({
type:"GET",
url: "/AjaxEditMetaDataServlet?opt="+option+"&cid="+catid+"&mta="+meta,
success: function(data){
$("#populateEditor").html(data);
}
}); $.ajax({
type:"GET",
how to make this ajax block syncrons so that they execute in sereial maner
 
 
@jolly.exe why don't you post as a question on SO and give us a link?
 
@srini Stop spamming
Or, alternatively, if you have a question, ask it.
 
Dear @DenisPshenov not required just a simple answer needed
 
@Zirak how to create variable depending i value?
 
10:28 AM
Hi @Zirak can you help
 
@srini Been asked a bazillion times, search on the time
 
@srini which lang u r wrkng
 
javascript
 
@jolly.exe (1)Why does order matter, and if it does, use callbacks, (2)Why aren't you just sending all of them in one. If they're closely related so they need order, why aren't they bundled?
 
just use var var_name+i;
 
10:30 AM
@jolly.exe you can use async for that - github.com/caolan/async
 
@tereško Welcome back to our slice of heaven
 
ehh .. tnx
 
its not legal to shoot 11 AJAX request at one like mine .... which result in crash of server ... thats why I need smthng like that @Zirak and @DenisPshenov
 
@jolly.exe it gives error
 
10:31 AM
No. You don't. Send all data in one.
And it's perfectly legal to send 11 requests at once, it's just stupid
 
@srini paste whooooole CODE
 
hello there
 
async.series([
function(callback){
// ajax request here
callback(null, 'one');
},
function(callback){
// next ajax request here
callback(null, 'two');
},
],
// optional callback
function(err, results){
// all requests done
});
 
@Zirak let me give you image of That
 
runs away
 
10:33 AM
goatsed
 
look at the round circle gifs its the stop of server @Zirak
 
Hey folks.
I have a dumb question.
	<script type="text/javascript" src="jquery172.js"></script>
	<script type="text/javascript" src="feed.js"></script>
	<script type="text/javascript">
		$(document).ready(
		function(){
			loadFeedFromURL("http://blog.mosheberman.com/feed/");
		});
	</script>
 
@DenisPshenov thx for the code ... let me try that :>
 
The function loadFeedFromURL is in feed.js. Safari says "index.html:17ReferenceError: Can't find variable: loadFeedFromURL" why?
 
@jolly.exe don't forget to put that callback(null, 'whatever') inside your ajax request success function
 
10:38 AM
@Moshe paste code from .js to same file then try
 
@Moshe whats your filestructure like? :)
 
@AndersMetnik The files are all in the same directory, the other files appear. I suspect a syntax error.
 
Okay, just wanted to make sure, I did that mistake ones ;)
 
l:Olsss @DenisPshenov where to put this thing $.ajax({
type:"GET",
url: "/AjaxPubMetaDataServlet?opt="+option+"&cid="+catid+"&mta="+meta,
success: function(data){
$("#populatePublisher").html(data);
}
}); In your Code :P
 
10:42 AM
Gochhhaaaa
Phew phew :\/
 
Ok, all fixed, was a syntax error.
 
$.ajax({
    type:"GET",
    url: "/AjaxPubMetaDataServlet",
    data: {
        opt: option,
        cid: catid,
        mta: meta
    },
    success: function(data){
        $("#populatePublisher").html(data);
    }
});
@jolly.exe you can write it like this ^
way cleaner
 
thnQ @FlorianMargaine actually I was not gettin idea hw to pass parametters :D
 
just pass a data property, jQuery will take care of building the URL for you
 
@FlorianMargaine can you tell me how to execute Multiple AJAX requests one by one
 
10:46 AM
look at deferred objects with jquery
 
@DenisPshenov gave me a code
async.series([
function(callback){
// ajax request here
callback(null, 'one');
},
function(callback){
// next ajax request here
callback(null, 'two');
},
],
// optional callback
function(err, results){
// all requests done
});
 
11:07 AM
Hey Guys i changed my Name and Image meanwhile
 
Hey, can anyone help me with a window.history.pushstate issue ?
for some reason the second time i push the state i get my page html loaded in to the url ?
history.pushState(revision, document.title, url);
 
Hi guys, does anyone have any experience with Google Maps API or the Cloudmade Leaflet mapping API?
not sure it's even specific to those, getting an "undefined" error and don't know why
 
@breadbin nope sorry
 
11:30 AM
Is there any way I can detect if a user click on a selected text range?
 
11:52 AM
o/
 
Sam
Hi guys, im not sure how to work a google search, maybe you can help?

Ive got a div 300pixels wide, i also have a large image contained within this div (about 2000px). Im looking for a jQuery plugin that can slide that image across from right to left, then at the end of the image loop back to the start. Does that make sense?
 
why wasting time on searching a plugin for this?
it doesn't sound very hard to write that yourself
 
Sam
It might take half an hour to write, when i could find a plugin that can do it in 5 minutes
 
12:08 PM
\o
 
it takes half an hour to write that?
 
wow, an entire half hour? For code you know which works, know how it works, and can extend at will without fear? Yeah, I get what you mean.
 
It's simply background-position x animation from 0 to -1700
man I didn't realize moderator tools were this awesome
there is actually enough non answer flags that I don't have to look for them myself
 
12:27 PM
Is it difficult to make javascript talk to an ActiveX object?
 
For instance, if I want to reload an embedded windows media player after changing its source?
 
don't reload, just replace the embed element
it's faster/safer
 
Do you have an example somewhere I could see? I'm not sure how to replace just one thing like the player.
 
var player = document.createElement( 'embed' );
player.src = '';
player.id = 'player';
var old = document.getElementById( 'player' );
old.parentNode.replaceChild( player, old );
 
12:35 PM
Math related question. Is there something like the sin wave or the cos wave which is only positive? Like bumps. Progressive growth, then decline, reach 0, and grow again
 
|sin(x)| ?
 
Oh, yeah
 
that won't have the same waveform
 
Yeah
 
12:36 PM
why not simply add an offset so it's always a positive number
 
sin(x)+1
 
trying the same google image mouse hover effect any one can help or guide here I am stuck somewhere
 
It won't be as wavy, but it fits your description
ugh, why did you have to sell out Wolframalpha!? Why!?
 
@FlorianMargaine Do I need to set the parentNode earlier in my code?
 
12:39 PM
Yeah, he can do that; but I dunno. meh, ignore me.
 
@FlorianMargaine Thanks!
 
@FlorianMargaine why embed
 
@Abhishek coz it's an embed element
 
erm i am asking why u suggest to use embed ?
 
@Amaan if you don't want it to exceed 1, wolframalpha.com/input/?i=sin%28x%29%2B1
@Abhishek "embedded windows media player"
20 mins ago, by febreezey
For instance, if I want to reload an embedded windows media player after changing its source?
 
12:48 PM
@FlorianMargaine That's the same link :p But I know, divide by 2
 
Oh now i see it!
 
arf :(
yeah, (sin(x)+1)/2
 
man I'm already capped today, boring
 
@Esailija what about work? capped in it too? :p
 
nope, havent done any work for 4 days now :D I should really catch up
maybe in an hour..
 
12:51 PM
haha
 
nice, I have never seen anything get 17 stars
 
yeah I was thinking the same
 
0
Q: Can google “see” this custom javascript code which displays links from an external site to mine

webmasters0 down vote favorite I have a javascript code on my site who displays links from another site. This is what I have on my source before: <script language="JavaScript" type="text/javascript">showLink(1);</script> This is what I have copied from my source after the page has loaded: ...

 
and wondered if there were a badge for something starred 20 times
 
there are too little amount of badges tbh
 
12:53 PM
@Amaan btw something i must tell you regarding making money , yeah this is out of the blue
 
close voting is completely unmotivated
 
u should and must pay tax :P
 
why close vote? there is no badge and you get more rep by answering
 
@Abhishek I know :p
 
#TGIF
 
12:53 PM
got a PAN card ?
 
#TGIF!!!!
 
user image
2
 
and why doesn't my profile show the amount of edits I have done and the amount of close votes I have done
 
@Abhishek Dad said he'll handle the tax part
 
nice :-)
 
12:54 PM
So I guess
 
my dad refused so i got i my PAN card instead :-)
and will pay tax by end of the year :-)
 
When you moving to Canada?
 
@GNi33 oh boy.
@Amaan october , though i might wait till wikipedia hackathon in november
 
i'll be doing exactly this when i get out of work today :D
 
@FlorianMargaine btw i solved that blocking problem by a state of an art solution .. it blocks and it doesnt and it decides when to block :-)
 
12:58 PM
wut?
 
the C++ API :P
 
Horray Friday!!!!
 
it decides when it has to run a JS function so it just stops executing in the thread comes back to main JSthread for that execution and as i figured out that the JS function pushed by C++ happens on the next Tick so its quite lightweight and convienient then i thought before
 

« first day (643 days earlier)      last day (4298 days later) »