« first day (1408 days earlier)      last day (3542 days later) » 

12:08 AM
ok, I'm having another attack of braindiarrea
trying to implement .rotate on my special canvas
I have a ctx.post method which takes an x, a y and a color as arguments
in a normal case it would take the cell of the table at that x and that y and set it's background color to that color
and this is slow, but has always worked
for translation is simple
just add it's offsetX to x and offsetY to y, which are set by translateX, translateY and translate
then the ctx also has a rotation value
so I'd do x*=Math.cos(this.rotation); y*=Math.sin(this.rotation)? (obviusly for the sake of optimization sin and cos are set when using the .rotate method)
that doesn't seem to work
 
since on a rotation of 0 (which is just a canvas without rotation) y would always be equal to 0, and that doesn't help
 
Finally prepare for war !!
 
@AbhishekHingnikar looks cool!
 
@towc its multiplayer :P
and am on pc now ^_^
 
12:13 AM
@AbhishekHingnikar perfect... let's go!
anyway: how would I go about doing that .rotate thing?
 
what .rotate ?
 
read above
 
and we can't go yet T_T ... server in india would kill latency
err its 6 am my time
i probably won't understand a word.
 
lol
XD
anyway, I'm not sure if my host supports websockets
but I could host it if you want
or use heroku
AbhishekHingnikar base question: how does ctx.rotate(radiants) work
 
!!google canvas.rotate example
 
its kinda hard to explain
esepcially since ihae forgotten it
 
@AbhishekHingnikar that looks cool :P
 
@Loktar idk how to make the spin in orbit though :-/
but i am getting there :P
 
@AbhishekHingnikar let's say I wanted to draw a point on a canvas and rotate it around it's origin
given x and y of the point, and rad as the rotation
x*=Math.cos(rad); y*=Math.sin(rad), right?
in case there was no rotation, y would always be set to 0... so I'm doing something really wrong
 
@towc don't ask me ask loktar
he is >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> me
in canvs
 
12:20 AM
this is actually trigonometry, but anyway
 
I just use .rotate
 
@loktar, could you tell me the answer? I wouldn't even know what to google
 
well. It depends
one way is to use rotate
 
@Loktar I'm trying to emulate .rotate on my aCanvas library
 
12:21 AM
and I'm interested in the maths
 
 var ctx = document.getElementById("canvas").getContext("2d"),
        x = 150,
        y = 180,
        angle = 0,
        velX = 0,
        velY = 0,
        thrust = 3;


    function draw(){
        velY = -Math.cos(angle * Math.PI / 180) * thrust;
        velX = Math.sin(angle * Math.PI / 180) * thrust;

        x += velX;
        y += velY;
        angle+=2;

        ctx.fillStyle = "#fff";
        ctx.clearRect(0,0,400,400);
        ctx.beginPath();
        ctx.rect(x, y, 10, 10);
        ctx.closePath();
thats another way that should get you closer
just increases the angle each step
 
again, I'm not trying to make a dot go sequencially through a circle
> I have x, y, angle.
to rotate x and y around 0;0 with that angle, what do I do??
erm..
wow...
I managed to find what I was looking for
nvm
 
haha
6
A: HTML Canvas - Dotted stroke around circle

LoktarLive Demo calcPointsCirc takes 4 arguments, the center x/y, the radius, and the length of the dashes. It returns an array of points, x,y,ex,ey. You can just loop through the points to draw the dashed circle. There's probably much more elegant ways to do this but figured Id give it a shot. funct...

I just got an upvote on an answer where I used that too :P
sorry only half paying attn my wife was showing me a convo on FB
 
oh, it actually works
x=x*cos(rot) - y*sin(rot);
y=x*sin(rot) + y*cos(rot);
 
12:31 AM
@AbhishekHingnikar I wanna play it!!!
 
the ai sucks atm...
i need to make a better physics engine :-/
@Loktar how do you make something orbit ?
 
like real orbit, or fake?
fake is like the 2nd example I posted above
thats an example of real orbits
although I wont claim my math is perfect at all
 
@AbhishekHingnikar have a value called frame which you increment by less than 0.1 at every update of the point, of point x=Math.cos(frame); y=Math.sin(frame)
 
@Loktar ah well i got to give it a tangential velocity ... i see
 
/me goes to play Rome Total War 2, goodluck @AbhishekHingnikar it looks really cool
 
12:54 AM
welp this is weird :| How are you supposed to get the head of an iframe?
 
!!tell corvid google get head of iframe
 
m59
 
I feel like this should work though
editor.on('input', function(v) {
    var doc = document.getElementById("sitePreview").contentDocument;
    var head = doc.getElementsByTagName('head')[0];
    var styles = doc.createElement('style');
    styles.type = 'text/css';
    styles.innerHTML = session.getValue();
    head.appendChild(styles);
});
 
m59
I kid not, I shed a tear over the awful code.
 
1:23 AM
Hello! (:
 
@SainathKrishnan 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.
 
I have two domains... say www.exampleserver.com and www.exampleclient.com. I have a JS page on exampleserver, which is included in exampleclient. Using this I am able to query a database on the server, and display some info as a widget.

My question is : Will I be able to access any information the other way around? Client to server? For example, whenever a page load fires up the JS page, it can store number of hits by using a simple counter. Can I also access data like the IP Address, Browser, etc?
 
1:44 AM
codepen.io/darkyen/full/oqjHn <- @towc final public version for tonight
 
@AbhishekHingnikar looks pretty good!
just add 100 more bases and you're set!
 
@towc lol nah
the AI makes its own bases
and in the game the decay rate is pretty high
so you have to make bases in order to be able to go and attack enemy bases
 
and all this built in angular?
can you explain me why?
 
@towc idk
the original project was in angular where i made the effect
 
ok :D
 
1:52 AM
was too lazy to take it out.
 
lol
 
bloody hell angular will help writing game's ui overlays :P
 
Particle.prototype.thinkAndAct
lol
also, sincerely, it looks much better without the frags
you could readd the crazy connection lines though
 
@towc the reason why i am doing that effect is to show that they are unstable
u will see a use very soon ;)
incoming ... several types of particles
 
@AbhishekHingnikar you could add some kind of repeated glowing effect
the more frequent is the glow change the more unstable it is
the little lines just hurt the eyes in my opinion
 
2:02 AM
am trying to achieve that
 
XD
what? blond cement hair?
2
 
hey why isnt ng-include working here? github.com/tejas-manohar/api-bits/blob/master/app/views/… — feel free to clone and run npm install && bower install and then grunt serve
 
 
1 hour later…
3:22 AM
' \t\r\n ' == 0 // true
 
 
2 hours later…
5:11 AM
!!> +" \r\n\t\r 123"
 
@copy 123
 
5:37 AM
mlklk
 
@NicolasS.Xu 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.
 
@CapricaSix you silly. That's not an attempt to communicate. This is a lurker accidentally smashing his face against his keyboard.
 
@JanDvorak Maybe that's a greeting in his language
You ignorant
@NicolasS.Xu mlklk to you, sir
 
@copy only english is allowed here anyways
 
german is sometimes allowed
 
5:45 AM
only in small doses
 
5:58 AM
!!what is mlklk
 
@AwalGarg No definition found for mlklk
@AwalGarg It means I aint got time to learn your $5 words.
@AwalGarg My pocket dictionary just isn't good enough for you.
 
@copy ^ if caprica no know it, it no exist. get the point
@JanDvorak you called her silly, now she won't leave you.
 
@JanDvorak, my mistake. I just typed a random word to see if it can actually show up on screen.
 
why did you doubt?
 
as developers always like to say, "assume nothing, expect everything"
 
6:03 AM
principle of least astonishment
 
how can I clear all data of a single website from chrome?
 
Format your hard drive
 
browse it in porn mode
 
room topic changed to JavaScript :: Always helpful: Read this link: rules.javascriptroom.com. Before asking inform yourself on the XY problem goo.gl/taIqf | Angularjs is on topic here. stop asking. [ecmascript] [javascript] [phrasing]
 
@JanDvorak no it is of the localhost... and it is messed up. so I want to clear all data, but not of other websites.
@copy probably the least sarcastic and least funny room title ever assigned. nice...
 
6:07 AM
@AwalGarg for(k in localStorage) delete localStorage[k]
 
@JanDvorak localStorage !== localhost... I meant the local site I am testing and learning things on! WAMP SERVER
127.0.0.1
 
PHP? so sorry
 
@JanDvorak client side javascripting and php scripts for xhr testing and learning... nothing else. I swear.
 
s/PHP/Windows s/PHP/Apache s/PHP/Mysql
 
don't look at me like that. I don't use php...
!!afk power cut ughh!
 
6:11 AM
then explain your wamp stack
 
6:23 AM
@JanDvorak i just didn't want to go through installing php and setting things up manually, so I installed wamp. but if we could please stick to the main question...?
 
which part of local data do you want to delete?
 
@JanDvorak all cookies, browsing data, history, saved passwords, cache etc. from localhost only.
 
6:39 AM
11
A: Google Chrome - Clear Cache for Specific Website

Serra South@dwurf Ctrl Shift + F5/R is Hard Reload, doesnt empty cache. There is a simple way to do what OP wants: Open Dev Tools by pressing: Ctrl+Shift+I Now by just leaving dev tools open, click and hold the reload button next to the address bar. Now a somewhat 'hidden menu' opens. Choose: "Empty Ca...

ha! I can google dat. ok??
 
6:50 AM
How much do web app projects start at? In terms of pricing?
30k?
40k?
 
Depends on the project
 
I need to send a proposal to a client
for a school interview booking system
Django backend
Plus phonegap app along with the web app
15-20 pages for the web app
and about 10 -12 screens for the phonegap app
how much would that go for?
 
Take how many hours it's going to take you and mulitple that by your hourly rate.
 
I can't say for sure but I'm guessing about 800 hours - 1200 hours
 
Don't forget to multiply by 10
 
6:52 AM
lol
The industry rates seem to start from 50k - 1m$ depending on the size of the project
well the big co's charge that
independent contractors as far as what people tell me charge around 30k-150k depending on the size
 
@Neil I'll take my chances with the building fire, thanks.
 
@monners Yeah.. burning building and I see that? Nope. Nope. Nope. Nope.
 
7:14 AM
aaaand just ordered Soylent
 
hey
someone knows about Application.OnTime in VBA?
I want to pass more than one parameter to its Procedure Argument
I checked this:
but it doesn't work
 
0
A: express thows error as 'cannot call method set`

dystroyIn here : app.set('view engine', 'jade'); var app = express(); you assign a value to app after you call a function on that value. So of course app is undefined when you do the set.

 
7:29 AM
Not sure if code generated by Markov chain or human brain
 
probably a bunch of copy-paste from random blogs...
 
You're right, Markov chains usually get the order right
 
Yes, if markov chain programing can achieve anythin it's preventing the use of a variable just before its assignment...
 
8:01 AM
@copy ola
codepen.io/darkyen/pen/wIylp - unexpected but is now featured :D
 
@AbhishekHingnikar Looks cool
 
:-) thanks
i am trying to forge it in a game, would u like to help ?
 
8:32 AM
That's the hardest part
Phrasing
 
@copy If the lead singer of Coldplay can get away with that phrasing, so can you
 
room topic changed to JavaScript :: Always helpful: Read this link: rules.javascriptroom.com. Before asking inform yourself on the XY problem goo.gl/taIqf | Angularjs is on topic here. stop asking. Reg room here: chat.stackoverflow.com/rooms/59354/ecmascript [ecmascript] [javascript] [phrasing]
 
What is Coldplay
 
8:52 AM
lol
@Gidimotje: Hier op StackOverflow kan je antwoorden 'accepteren' als blijk van dank. Dit doe je door op het groene vinkje te drukken bovenaan naast een antwoord. Ook kan je op het pijltje naar boven drukken om iemand 'nog meer' te bedanken. — Jean-Paul Mar 22 at 12:56
 
9:28 AM
@copy blissful ignorance
 
Hi,
 
@ravi 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.
 
!!do I take my TS implementation or rewrite to js or something else?
 
@BartekBanachewicz something else
 
well fuck
I didn't really think what that something else might be
 
9:36 AM
!!should bartek reroll
 
@JanDvorak Yes!
 
!!reroll ?
 
@BartekBanachewicz That didn't make much sense. Maybe you meant: roll, troll
 
ah, would require keeping last request per user.
!!do I base on my TS implementation or start from scratch?
 
@BartekBanachewicz do I base on my TS implementation
 
9:37 AM
yeah I thought so.
thanks @Caprica
 
@ Caprica Six thanks, my question is : present my project using xml dom parsing for request & response to server, now we changes same modules xml to json so in response page how to find response is xml or json
please save my days.
 
@ravi fiddle pls; too much code for chat
1 message moved to recycle bin
 
@ravi how about you save our hours by not posting that?
 
also, we don't do homework.
 
@BartekBanachewicz Rewrite to JS
 
9:41 AM
@copy that would require me writing js
which is a serious drawback
VS2013 has this funny feature
that shows you the generated code on the right
and I gotta tell you, if I were to write this thing on the right by hand, it wouldn't be fun
 
sorry. i created fiddle for JavaScript : jsfiddle.net/ravi06/gwqejuor
 
Compared to Python or Ruby? Yes. Compared to TS, I don't know
 
TS is shitty.
 
Yes
 
but overall, JS-today is more shitty
 
9:43 AM
Maybe not
 
you can use at least basic static analysis tools from TS and that's enough to warrant its use imho
 
Depends on the static analysis tools you have for JS
 
I CBA to configure them
TS is much less annoying to set up
If anything, I would rewrite all of that to Haskell, which might make sense, because the backend is also in Haskell
 
Not sure if...
 
Haste has canvas bindings already IIRC
 
9:50 AM
:lol:
 
there was a communication protocol for server -> client stuff
that wasn't websockets
 
I found SSEs, but I am not sure if that's what I remembered
is there anything else like that?
@BenjaminGruenbaum oho, yep
 
I don't think compiling a language to JavaScript will ever work, unless that language is designed for that purpose
 
Also, lol at Haskell running on the client side.
 
9:52 AM
@BenjaminGruenbaum Elm has no problems with that vOv
 
I have to say that the last few days writing UI in a strongly typed language that's stricter about its typing as C# has been nothing but a hassle.
 
you suck vOv
ugh why is MDN using PHP as an example
what's wrong with them
 
Lol, a year and you haven't learned :D
 
@BenjaminGruenbaum I was joking FYI
 
Which is why your harvest thing isn't done by now :D Just sayin'
 
9:54 AM
no, it's not because of that
it's because I literally stopped working on it
 
I was joking FYI :D
 
> The server-side script that sends events needs to respond using the MIME type text/event-stream.
hmm
someone wrote a comet plugin for scotty
 
uh
i am not sure where to add my SSE handler code
what request is being made by the browser? GET?
 
10:38 AM
> As of Firefox 22, it does not appear that there is any way to distinguish between different kinds of error events.
amazing
amazing.
 
1 message moved to bin
3
 
11:00 AM
@ThiefMaster great work
 
how do I fix that?
you know
if all W3C specs are like this:
[Constructor(DOMString url)]
interface EventSource : EventTarget {
  readonly attribute DOMString url;

  // ready state
  const unsigned short CONNECTING = 0;
  const unsigned short OPEN = 1;
  const unsigned short CLOSED = 2;
  readonly attribute unsigned short readyState;

  // networking
  [TreatNonCallableAsNull] attribute Function? onopen;
  [TreatNonCallableAsNull] attribute Function? onmessage;
  [TreatNonCallableAsNull] attribute Function? onerror;
  void close();
};
I don't really get why typed languages aren't a thing on the web :/
 
11:19 AM
@BartekBanachewicz you have to keep the server connection open
meaning
while( true ){
     if( data ){
         flush(data);
     }
     sleep( n );
}
 
@AbhishekHingnikar which might be a problem in the framework I'm using :/
 
@BartekBanachewicz and that is ?
we use a node.js server with redis pub/sub for sse :P
 
@AbhishekHingnikar Scotty
 
which language is that ?
 
11:24 AM
okay no clue then :P
Okay guys i am getting a Macbook Air for 25% discount and it is brand new.
should i buy it ?
 
I'm anti-apple
 
@BartekBanachewicz hahaha
 
@BenjaminGruenbaum it's really not funny
 
@BartekBanachewicz use typescript or dart ?
 
11:31 AM
I have a thing in TS now
but I've opened that code and reminded myself immediately why I didn't really like TS
eh Wai has EventStream implementation but Scotty doesn't support it yet
I'll leave that for later
 
@BartekBanachewicz because it's horrible to write function signatures all the time.
Static languages on the web require really strong type inference. Most languages don't have that
 
why aren't static languages with good type inference a thing on the web then
 
Why aren't static languages with good type inference a thing in general :D?
The closest I've seen to something I can use was Scala and that's not even close.
Both Scala and Haskell give me hard to track bugs when I use inference in non-trivial scenarios and I end up having to specify the types myself anyway.
 
you're weird vOv
 
@BartekBanachewicz I'm actually building UI right now with a statically typed relatively functional language using a relatively functional coding style. I'm not a huge fan of the complexity involved tbh
 
11:45 AM
@BenjaminGruenbaum Objective C ?
 
lol, Objective C isn't type safe nor is it functional :D
 
wait objective c is not statically typed ?
 
@AbhishekHingnikar it's C-typed :P
 
i need more sleep
bbl
 
Morning peeps
 
11:49 AM
@AbhishekHingnikar Objective C has a bad type system.
 
i am going back to bed... i worked till 7 am and destroyed my current work day -_-
> Here are the things i need to do
Finish website with 4 interactive demos, and then make this responsive -_-
I'd say i am in trouble... aren't i ?
deadline : today
 
ASR
12:05 PM
hi
how to hide all the links when loading document in jquery?
<div class="wrapper">
<ul class="tabs">
<li><a href="javascript:void(0); return false;" rel="#tabcontent0" class="tab active">Home</a></li>
<li><a href="javascript:void(0); return false;" rel="#tabcontent1" class="tab">Danone Change Impacting</a></li>
<li><a href="javascript:void(0); return false;" rel="#tabcontent2" class="tab">Danone Change Not Impacting</a></li>
<li><a href="javascript:void(0); return false;" rel="#tabcontent3" class="tab">Danone Emergency Change</a></li>
<li><a href="javascript:void(0); return false;" rel="#tabcontent4" class="tab">Danone Expedite Change</a></li>
@BenjaminGruenbaum hi
 
@ASR by learning javascript
 
@ASR oh, I know!
 
ASR
@AbhishekHingnikar :)
 
/me::redbull inside.
 
ASR
how to hide the all the links expect home link... i dont know how to access each link can u give me
idea
 
12:09 PM
select them all and filter out what u don't want
 
ASR
12:26 PM
@AbhishekHingnikar hi can we put two classes for one html elemen?
 
> The POST method is used to request that the origin server accept the entity enclosed in the request as a new subordinate of the resource identified by the Request-URI in the Request-Line.
very not readable.
 
Dad
translate:lo
 
lol I thought Zirak got drunk, changed his display name, and came here :P
 
hm
my error 500 spits out errors to html
that's not very good I think
 
Dad
@AwalGarg hahahahahahahahaha it's me yaaaa i'm drooonk yo n't see?? xD
Kidding. I'm dad
 
12:46 PM
What nodejs templating engine do you guys use?
 
ASR
@AbhishekHingnikar i did
i know about u....... u r a good hardworker
 
lol joke of the day ^
 

« first day (1408 days earlier)      last day (3542 days later) »