« first day (970 days earlier)      last day (3985 days later) » 

2:02 AM
keep in mind the channels are picked at random
are not the best
"channels" also is not the correct term, just roll with me
 
@rlemon How bout you finally finish lemonmeme for hte love of fuck
I keep going there to make memes, but to my avail, nothing
You know what, just transfer me ownership of the domain, I'll finish it
 
All this does is remind me of LOGO tinker.io/8b4e8/6
 
Looks like an MS screensaver
@BenjaminGruenbaum Would you ever tutor online?
Or suggest anything for learning math
I might need to re-learn trig if I take this job doing HVAC
 
Hmmm, what country are you from again?
 
Canada
 
2:14 AM
Hmm, probably not (tutoring online for money)
Sorry, I do that too much as it is (tutor trig :P)
 
Haha, damn, was thinking on the way home you'd be my saving grace :P
 
I can recommend great resources, but they'd be in Hebrew, you might want to ask guys at the math exchange chat
They'd probably know the canonical literature
 
Is khanacademy any good
 
It's a good place to start, like an "Hello World"
I can recommend Michael Spivak's calculus, but that might go over your head
Note, he has two books, don't read calculus in manifolds that's an advanced calculus book
 
2:16 AM
You need the one just named "Calculus"
 
Take a glance at that, suggest what I should know going into the exam
 
That looks very basic
 
I'm half retarded
Express 3/8 as a decimal number.
A. 0.240
B. 0.267
C. 0.375
D. 2.667

Not even once
 
You don't know how to solve this sort of thing?
 
3/8 on a calculator isnt it :P
but on the fly, I couldn't do it
(fast anyways)
 
2:18 AM
It can't be D since it's less than one. It can't be A since it's more than 1/4. You're left with B and C
Multiply either one by 8, see what gets you 3
 
The area of a circle with a diameter of 240 mm is
A. 75.36 cm2
B. 150.72 cm2
C. 452.16 cm2
D. 1,808.64 cm2
 
These are psychometric questions, don't read Spivak for those (read it because it's beautiful though)
These exams usually have books written for them
 
What do you mean x.x
 
Wassup all?! Finally got a 2-month ongoing problem fixed
 
Books of "how to prepare to exam X"
 
2:20 AM
Which polynomial expression would have a value of -2 when x = -2 ?
A. 2x2 + 2x - 2
B. 3x2 - 4x + 1
C. x2 + 3x + 2
D. - x2 - 4x - 6
 
As for the circle one, the area is given by Pi*R^2
 
Thanks to * ahem @BenjaminGruenbaum
 
Approximate Pi = 3
 
So what's new in the land of JS?
 
@Gacnt D makes no sense (too negative), C makes no sense 5x is too low
Approximate either A or B, A is 4 -4-2 which is -2
Makes sense
Also, B can be ruled out because of the odd number
 
2:21 AM
How did A become 4 -4-2
 
No need to calculate anything, just approximate and asset that approximation
 
oh did you do 2x-2
read it wrong
 
These sort of questions don't require a deep understanding of math, they require dirty hacks of doing this sort of stuff fast in your head.
 
The math and science parts will murder my face
What does 6.4 liters of water equal in imperial gallons?
A. 1.408 gal.
B. 3.635 gal.
C. 5.628 gal.
D. 5.632 gal.
 
These aren't math, they're 'who knows more hacks for doing fast arithmetic'
@Gacnt That's just a 'knowing units' question
 
2:23 AM
Go through this practice exam with me, help me understand, I'll paypal you $50CAD for your time (when it's time)
 
A galleon is ~ 3.7 liters
 
Not anytime soon, but if I accept the job offer, could be 6 months from now, I'll learn some through hands on, but if I don't feel comfortable by school time, I'd ask you :)
 
No need for paypal, I'd have to pay my accountant more than the 50 dollars just to make it work :P
 
What's your currency?
 
ILS (Israeli Sheckels)
I'm off to bed though, we can talk Math tomorrow :)
 
2:25 AM
Okey doke
 
Math is beautiful, these sort of questions are just silly, I know the type, they test nothing but knowing dirty hacks and approximating quickly
 
!!convert 50 CAD ILS
 
@Gacnt 178.0906ILS
 
Is that a lot?
 
When a gas is heated it
A. expands.
@Gacnt that's about an hour of my work after taxes, little less probably
 
2:27 AM
Well, I'll pay whatever you want :D but like I said, it won't be for a few months that I will need to borrow your time
 
We'll talk then then :)
Maybe I'll be broke
Good night!
 
kk :)
@darkyen
@phenomnomnominal You don't happen to have a developer account I could throw my i5 UDID on so I can download the iOS7 beta?
!!listcommands 1
 
Server error (status 500) occured (message probably too long)
 
chat.stackoverflow.com/transcript/message/9939428#9939428 I missed it, this was my 100K message.
 
2:44 AM
 
Who here lives in America?
 
2:58 AM
hmm been trying to sync my progress bar to server time with JS all day still won't work >.<
does any one know if JS has the ability to detect when the user's machine's clock changes?
ideally every time 1 second occurs
 
@Dave the clock changes way more often than that
 
i know but i can always check x amount of ms
but i want it to sync to their clock properly
 
The best I can think of is:
var now = new Date().getSeconds();
(function fastCallback(){
  if(new Date().getSeconds() == now){
    setTimeout(fastCallback,1)
  }else{
    setInterval(slowCallback,1000)
  }
})()

function slowCallback(){...}
 
ok will tweak around with it
thanks
 
if there are mutliple entries in the database with the same url differentiator, then how does the website decide which page to load.
Like say if you have two entries with the word "admin" for url-name in the DB.
 
3:08 AM
@Dave hold on a little
 
?
 
and your website url structure is like youwebsitename.com{url-name value}
then there would be two urls with the same text: yourwebsitename.com/admin
which page would it load?
 
setTimeout(function(){
  setInterval(slowCallback, 1000)
},1000 - new Date().getMilliseconds());

function slowCallback(){...}
@Dave ^
 
ok thank you
 
You might still get 3ms off
 
3:12 AM
3ms is not going to be noticeable by the user so it should be ok
 
Just hope the initial timeout doesn't get delayed
can be counteracted by not trusting the original timeout, and calibrating on each tick instead.
 
my current method is server time compare to machine time that difference is what i have to remove to keep it in sync but if they edit their machine time it will no longer be correct
 
(function update(){
  ...
  setTimeout(update, 1000 - new Date().getMilliseconds())
})()
^this looks cooler IMO
 
true
 
also, it's not susceptible to the initial drift
I'm wondering if it could fire just before the seconds rolling over, however.
Then it would refire 4ms later
 
3:17 AM
i could for example every 60 seconds recall server time to correct for it slowly drifting out of sync
but thats going to cause bit of server stress
 
Drifting out of sync? Computer clocks are pretty impressive nowadays.
You may assume the drift is constant.
 
yeh but what stops them editing their machine clock manually :P
 
You could resynchronize if the wall clock changes by more than one second per second, but is it worth considering?
 
well its a game which requires reasonable syncing to server
 
@Gacnt nope.
 
3:21 AM
I don't even remember if I ever set my computer clock. Instead, one sets the synchronisation settings nowadays.
 
yeh it does it auto - but if u have a timer that says "30 seconds wait time" forward your machine clock 30 seconds itll end the wait
and it wont be worth checking server time every second that goes by to be sure
my server would explode :P
 
If you just want to wait for 30 seconds, why bother reading the wall clock?
You don't need to tick with the user's clock
 
i don't follow ? if i have server time how can i compare server time to now without machine time via js?
thats currently how im checking if 30 seconds passed
(i get server time via ajax btw)
 
timer = 30; setInterval(decrementTimer, 1000). Period.
The users can't fast-forward that.
 
yeh but this timer continues if they log out
so the server time has to be involved in some way
they can't manipulate interval timers ?
did not know that
 
3:26 AM
$.ajax("load-timeout/",setTimeout.bind(window, decreaseTimer, 1000))
 
i always thought for some reason you can edit machine speed for development tools
guess i was wrong there :P
 
You can modify setInterval, but so you can modify XmlHttpRequest
or, even easier, the server response
 
well ill still have a server check once client decides time is complete just encase
sadly even that still adds a few ms's
 
Then just load the timer once and then tick away while ignoring the wall clock.
If you don't compensate for RTT, you won't even hit the server a millisecond too soon.
is that a game you're making, or are you just bugging your users rapidshare-style?
 
no its a game im making
its a RTS isometric in canvas
 
3:34 AM
RTS, and you're afraid to talk to the server more often than once per minute?
Normally, when one says "real-time shooter", I imagine a persistent connection being open.
with data flying back-and-forth several times per second
with each millisecond of round-trip-time being a millisecond of severe lag
 
it wont require 100 % real time
just close enough ie < 100ms
 
3:49 AM
you still need a persitent connection, and you can transfer the server time over that
 
so u suggest websockets?
 
what are you using instead?
 
just time passed from a time stamp so the players start at same time
 
how come you don't need any more interaction after that?
 
the rest is based on events the user does to update server
the other thing server checked is pathfinder and how long it should take to walk there
so if an event happened "before" the pathfinder would of had them walk there they must of cheated some how
 
3:57 AM
so, do you need any more synchronisation? If client data is valid, use them, otherwise, disconnect the client with a nasty JSON. Client will trust its environment, then, and doesn't need to synchronize to its wall clock.
{"status": "fatal-error", "subtype":"desync", "message":"client machine or game data has been tampered with"}
 
4:15 AM
 
anyone here./
?
 
4:35 AM
0
Q: How to force the htm5 game to landscape using javascript?

AllI want to lock the game in landscape in android and ios devices. so that if a player try to play in portrait mode. It should be forced to be in landscape mode for that i tried to do something like this $(window).bind('orientationchange resize', function(event){ if(event.orientation) { ...

 
Who's here?
 
@DemCodeLines i think no one except me
 
@Gajini Do you know JS?
 
a bit
 
Then tell me why doesn't the follow work:
@BenjaminGruenbaum Are you still there?
We have a situation here.
 
4:46 AM
no idea dude
@DemCodeLines do you know how to force the portrait mode to be in landscape ?
 
If you mean in JS, then no. I am not very good at JS at all. Sorry.
2
Q: Force “Landscape” orientation mode

user1599537I'm trying to force the "Landscape " mode for my application because I my application is absolutely not designed for the "portrait" mode. How can I do that ? any suggestion ? thanks

?
 
I'm back from answering.
 
@janakshah 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.
 
@JanDvorak Perhaps you could answer something for me.
Your choice.
 
@DemCodeLines I took a look
 
4:52 AM
:(
No, i haven't posted it on SO yet.
Unless you saw what I just deleted.
 
@JanDvorak
17 mins ago, by Gajini
0
Q: How to force the htm5 game to landscape using javascript?

AllI want to lock the game in landscape in android and ios devices. so that if a player try to play in portrait mode. It should be forced to be in landscape mode for that i tried to do something like this $(window).bind('orientationchange resize', function(event){ if(event.orientation) { ...

 
@Gajini CV'd
 
what
 
@JanDvorak would you like me to give you the code with problem in it?
 
@Gajini closevoted as a duplicate
@DemCodeLines post it
 
4:55 AM
I have the following code:
var form = document.getElementById("signUpHome");

form.onsubmit = function returnVal() {
    var signUpemail = document.getElementById("signUpemail").value;
    var signUptagName = document.getElementById("tagname").value;
    if (checkEmail(signUpemail)) {
        validate(signUpemail, function (isValid) {
            if (isValid) {
            	validateTagName(signUptagName, function (isValid) {
            		if (isValid) {
            			form.submit();
            		} else {
            			jQuery(function(){jQuery("#tagname").validate({expression:"return false;"});});
It is supposed to validate an email textbox as well as another textbox
 
@DemCodeLines Y U NO use jQuery for event binding?
 
@JanDvorak but i tried in the same manner
 
Except it doesn't.
@JanDvorak I was suggested this way @BenjaminGruenbaum in order to keep track of what is going on.
@JanDvorak But if I don't use the argument for the second textbox ("tagname"), then it works:
 
@DemCodeLines did @BenjaminGruenbaum really recommend not using jQuery for event binding even though jquery is available?
 
form.onsubmit = function returnVal() {
    var signUpemail = document.getElementById("signUpemail").value;
    var signUptagName = document.getElementById("tagname").value;
    if (checkEmail(signUpemail)) {
        validate(signUpemail, function (isValid) {
            if (isValid) {
            	form.submit();
            } else {
            	jQuery(function(){jQuery("#signUpemail").validate({expression:"return false;"});});
                //alert("Email Already Exists, please choose another.");
@JanDvorak He said this way would be better for me to learn. I will eventually shorten it down to JQuery stuff, but after I learn it fully.
Anyways, why does it stop working?
?
 
5:01 AM
WTH is this? .validate({expression:"return false;"})? What kind of plugin would require you to send a function to it as text?
 
That is the JQuery Validation plugin mixed in, don't worry about it. I just don't understand why the main thing isn't working.
 
@DemCodeLines check if the AJAX returns as expected and its callback is called
 
window.addEventListener('orientationchange', function (evt) {
switch(window.orientation) {
case 0: //portrait
case 180: //portrait
case 90: // landscape
case -90: // landscape
}
}, false);
@JanDvorak how can i force rotate from portrait to landscape in case0 and case 180
 
Never mind I fixed it.
 
5:06 AM
@Gajini you can rotate the content 90 degrees
This can be done in pure CSS
 
@JanDvorak that is my issue ! i dont know css at all :(
 
@Gajini see the duplicate question please
 
#warning-message {
display: none;
}

@media only screen and (orientation:portrait) {
#placeholder {
display: none;
}

#warning-message {
display: block;
}
}

@media only screen and (orientation:landscape) {
#warning-message {
display: none;
}
}
i done something like this
but thing is it is not forcing me to landscape when it is in portrait
 
define "force". This will display a #warning-message in portrait mode.
 
@JanDvorak yes , force :: I want to lock my game to run in only landscape mode. if i rotate to portrait it should be in landscape only
 
5:12 AM
Rotation would be -webkit-transform: rotate(90deg);
 
@media only screen and (orientation:portrait) {
#placeholder {
display: none;
} -webkit-transform: rotate(90deg);

}
shall i do some thing like that?
 
no.
First, it's a property. place that inside some rule.
 
ok
 
Second, it doesn't make sense to hide something and rotate it.
 
@rlemon @Loktar
have got a demo for your metaballs ? I NEED TO STEAL THAT CODE
 
5:15 AM
@JanDvorak Ok
 
Third, you probably want to add the corresponding vendor prefixes for other vendors as well (and preferably an unprefixed version too).
 
@media only screen and (orientation:portrait) {
#placeholder {
display: none;
-webkit-transform: rotate(90deg);
}

#warning-message {
display: block;
}
}
@JanDvorak is this senseable
 
@Gajini format your code this is your last wrning
 
@Darkyen sorry i will use pastebin now on
 
no you can use this but if you format because of @phenomnomnominal's awesome userscript we see pretty printed code
for example
@media only screen and (orientation:portrait) {
    #placeholder {
        display: none;
        -webkit-transform: rotate(90deg);
    }

   #warning-message {
       display: block;
   }
}
 
5:22 AM
better now :-)
 
how to do that ?
 
select all and press ctrl + k
btw @phenomnomnominal fails with media queries
 
!!/tell gajini format
 
k i will do it
 
@gajini Format your code - hit Ctrl+K before sending and see the [faq](http://chat.stackoverflow.com/faq)
@Ayyaz Welcome to the JavaScript chat! Please review the [room pseudo-rules](http://rlemon.github.com/so-chat-javascript-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.
 
5:22 AM
Hello, How are you?
 
fine, thanks. Almost employed
 
I am an android, i am a machine brain i can always be functional @Ayyaz
 
hi all...
 
@MirkoCianfarani hi
 
@JanDvorak congratulations on getting employeed
hope you find good work conditions and amazing teammates with no apple geeks
 
5:24 AM
@Darkyen @JanDvorak where i did wrong on that css
 
you made everything an id is that what you wanted to do :?
and display:none for placeholder will make hit hidden
 
@Gajini you're hiding the element you're rotating
 
css transforms only work on block's
 
@Darkyen o'rly?
 
yes
they wont work on inline, which is also pretty illogical [last it tested]
 
5:26 AM
 @media only screen and (orientation:portrait) {
            #placeholder {
                display: block;
                -webkit-transform: rotate(90deg);
            }

            #warning-message {
                display: block;
            }
        }
now ?
 
works ?
ps orientation might not be supported
unless you are using a mobile device
 
yes i am using mobile device
android
i cleared cache and checked though but not worked
 
Maybe device doesnt supports media queries for orientation ?
 
hi gajini
 
try removing the media query code and try :P
 
5:28 AM
@Gajini perhaps you want to hide the warning message?
 
//if that is so, i would be dead ... i will shoot myself with an ak47
 
@JanDvorak yes
@web2students.com hi
@Darkyen :(
 
> EMI -- you may not listen to this song
> me -- oh well. I'll have to listen [to the whole concert](http://www.youtube.com/watch?v=o7wprk-yYNY) instead.
 
@JanDvorak you like skillet ?
 
@BenjaminGruenbaum i totally missed this image while i was on jsPerf...absolutely hilarious
 
5:31 AM
@Darkyen is that a band? Never heard of them
 
@Darkyen how can set rotation in css if i remove media query?
 
@Darkyen I prefer this
 
@BenjaminGruenbaum i'm really glad @Esailija starred it
 
try it nd i try urs
 
@Darkyen I did listen to it. It's not my favorite style but I'll keep them in mind
 
5:36 AM
@Darkyen no i dont know to do that without media query . google is giving all links with media query
 
@Gajini you'll have to set the style from javascript if you can't use media queries
 
@Gajini did it work with media query removed, yes ?
then use javascript
to do the same task as media query
on deviecs that dont support your query
 
or, you can set a class on the document body
 
^ that too
btw thats the way i emulate mqueries in css/js
for slower devices :P
@JanDvorak if u dont belive profile mQuery vs classy behavior
 
body.portrait #container {-webkit-transform: rotate(90deg)}
 
5:39 AM
@JanDvorak that will be bad
 
omg. i forgot the term of a non multi-dimensional array. what is it called again?
 
.portrait #container{
}
is much better option
because the all element selector :-( will slow down your class selector :P
 
@vincent single dimensional array.
 
  window.addEventListener('orientationchange', function (evt) {
        switch(window.orientation) {
            case 0: //portrait
            case 180: //portrait
            case 90: // landscape
            case -90: // landscape
        }
    }, false);
so i have to do stuff in portrait to rotate into landscape
 
@vincent lol use google.
 
5:41 AM
yeah kind of that
 
@Darkyen how can write css there?
 
@Gajini document.body.classList.add("portrait")
 
No
dont screw IE old android's have broken support for it
but well shimming it is not that hard :P
 
K, then: $(document.body).addClass("portrait")
 
^
@JanDvorak here is a challenge
write a classList shim :D
you can do it, not that hard.. but can you :D
Element.prototype.classList = ?; there is your hidden and only challenge :D
 
5:44 AM
@Darkyen spec pls
 
you see there is a shim right under it (XD)
 
so you want me to write a short but improper version of the shim?
 
no
i want you to write a more understandable version of that shim :-)
 
support for non-alphanumeric classes required?
 
not really
 
5:53 AM
I'm pretty sure I can't get a reference to the element without using property accessors.
 

« first day (970 days earlier)      last day (3985 days later) »