« first day (1081 days earlier)      last day (4092 days later) » 

00:00
then they won't compete for global variables
as long as your code uses var as it should
$(function(){
    alert("file1");
    var articleList = document.getElementById('rec-ball-articles-list');

    $.ajax({
        url:"/buzz/articles/retrieveArticles.php",
        type:"POST",
        success:function(msg){
            alert("HELLO");
            console.log(msg);
            articleList.innerHTML = msg;
        }
    });
}
like that?
That one will not pollute
I still can't believe it because of the same variable names....
Wasted so much time
You must be careful to not pollute the global namespace, the EPA will be pissed
define epa
00:02
shameless plug: if you use coffeescript you would never run into this issue
environmental protection agency
is that actually something in programming or just random stuff you made?
It's a joke, about pollution and the environment
The feds aren't really gonna get you
@Mr.IDon'tCare It's a pun, the EPA is a US government agency that deals with real-life pollution
00:03
but, JS gurus might get you
@Mr.IDon'tCare: Why do you mix jquery and plain DOM functions? Using either is fine, but don't mix them like that.
@Mr.IDon'tCare Open up port 80 and give us your IP
=> var articleList = $('#rec-ball-articles-list'); and articleList.html(msg);
With coffeescript, you have to explicitly add your variable to the global namespace. It's nice, that you don't have to worry about it, but you can do it easily if you want to
@ThiefMaster I am not completely sure about how I would do $.ajax in pure JS, so I did it in Jquery, but I tried to keep everything else in Plain JS
00:05
but some people hate coffee, mostly because of significant whitespace, i guess
Ahhh nm, I see you figured it out
yeah, XHR is super ugly when done without at least thin wrapper - and jquery does have a pretty nice wrapper
You act like I couldn't get your IP right now if I wanted to anyways
00:06
lol @Shea
@Shea The question is, why would you want to?
No reason to anymore, is there?
@Jeremy I hate how difficult it is to read the js when things go wrong
why add extra overhead?
I don't have that issue.
When I write coffee, I can see the js
it's just less typing, and masks the "bad parts"
Will there ever be (or is there) a programming language that has syntax of that of a truly high level language (VB etc.) but has the capability to operate like a low level language (C++, C)?
00:10
" the capability to operate like a low level language" ??
like Java and it's JIT compiler?
@Mr.IDon'tCare: VB is an ugly toy language. if you said C# on the other side .....
I mean deal with low-level drivers. Get down and do the dirty work like C/C++
@Mr.IDon'tCare Like JS with memory management?
at least in C# you can include "unsafe" code which pretty much allows you to do lowlevel stuff
Heck, even Assembly for that matter.
00:11
You can do assembly in JS
for drivers you don't want a managed/GC'd language
@Mr.IDon'tCare You can call native extensions, lookup FFI
then you can use high level languages, but use C or ASM for ciritcal bits
So you have to use multiple languages after all.
or you can call a python function in your ruby
There is not one single language that can do it all?
00:12
I don't understand your question...
Java!
@Mr.IDon'tCare ECMAScript, it just depends on the context
@Mr.IDon'tCare Why would you want one? That's like asking for one screwdriver that can handle every screw. Tools are specialized for a reason.
Except for JavaScript, which is perfect in every way
@Jeremy lol
s/screwdriver/hammer/
Haha, JS is the greatest of all.
00:14
at least it's not as bad as PHP ;)
I remember when I thought PHP was cool...
PHP is not so bad
dark times
It seems people in JS room enjoy dissing PHP, but people in PHP room don't do that for JS all that much.
At least I haven't seen them diss JS as much as JS people diss PHP.
Apples and Oranges
00:15
They did until Node.JS happened
PHP is backend
JS is in browser
PHP people use JS, too
s/is in/was in/
@Jeremy Yeah, what I mean to say is that people in this room typically make fun of PHP. But if you go into the PHP room, you don't really see that happening against JS all that much.
JS is in browsers, servers, databases, game programming, low-level assembly, etc.
"low-level assembly" no
00:17
@Mr.IDon'tCare No, they'll just hold you down and slit your throat if you mention JS there
heh, that was redundant.
as opposed to "high-level assembly"
I have yet to understand the point of Assembly.
I like top be on a high level when I write assembily
@Mr.IDon'tCare continue your computer science education, and you will one day understand
Assembly is about the lowest you can go, before you hit binary afaik
It's not useful for web developers
It's useful for understanding computer architecture
00:20
A lot of low level languages are written in ASM....
It's like atoms and molecules
@Jeremy The pace at which the computer industry is advancing, it will be pointless to learn about it a couple of years from now when they are typically non-existant.
CPUs will be nonexistent in the future?
that sounds awful
@Mr.IDon'tCare stay in school
No, but mobile devices and tablets seem to be dominating the market a little more than PC makers would like.
and tablets don't run Assembly?
@Mr.IDon'tCare stay in school
00:23
@Mr.IDon'tCare Look at it as if ASM were the CPU's language.
@Jeremy o/
@Mr.IDon'tCare ASM is not PC-specific.
Many video codecs are written in ASM on tablets
I was just talking about PC in general.
It might not be now, but the PC market is on the verge of going down.
your jokes... no longer amuse me
And that leads me to Microsoft's Surface.
1. If they selected one random person from this JS room to lead their advertising department, they would have sold more of those devices.
00:25
Yeah, I don't much care for this conversation anymore either, since I feel ignored
He probably thinks I'm still after his "super secret IP address"
@Shea who are you?
@Mr.IDon'tCare here is an amazing article about your really specific argument.
5
2. Its nice that the tablets are just like any others in terms of form but also give productivity, but does MS not understand that people are on their tablets because they feel like relaxing, not doing productive work? They already have a PC for that.
00:27
@SomeKittens I haven't quite figured that out yet, ask me again later
who who, who who?
@rlemon ...
@Mr.IDon'tCare something about your name makes me suggest you really do care, quite a lot.
@phenomnomnominal As my computer science teacher once told me about how nearly every computer science question can be answered, "It depends."
00:30
Mine told me "If I ever catch you doing that in an assignment, I'll immediately fail you"
Mine told me "Computer Science is an art. I can't teach you how to be Picasso, so here are your tools and i'm here to answer questions. Go!"
4
Mine told me "Don't mention this to anyone."
I taught @phenomnomnominal ....
Mine was Google :(
Now I feel underprivileged and stupid
mine was also a math teacher standing in on cs...
so there was also the BS factor
00:32
@rlemon always showed me his tools
> phenomnomnominal you ready for Object Oriented Programming?
Stop making me test your unit
I'll stop when you prove P=NP
Done.
N = 1;
@phenomnomnominal Brilliant.
So simple
Where's my million dollars?
how has it eluded us?
m59
m59
So..with javascript and especially when using angularjs, I know how to write an application by describing what the application is and does. The way you would talk about it pretty easily translates into they way the code looks. Is there no way to do that in php?
@m59 ask php people php questions
m59
m59
00:41
tried that.
lolz
I guess not then
m59
m59
There's apparently 50,000 ways to make php code work and no articles about any of them tell you what that actually means.
It's fun.
hey! someone stared my quote. I feel I should tell you it is my quote, my HS CS teacher was a joke and I never went to university.
@rlemon if a homeless person said that, i'd still appreciate the quote
Hell, if a unicorn said that, i'd still appreciate it
00:43
:)
I am a unicorn by day..
!!> np = true; console.log(p=np);
@SomeKittens "undefined" Logged: true
In high school, I had a math teacher that fought to have a CS class
I think he got it for 1 or 2 semesters
then "budget"
"budget" === "We're more willing to invest in bombing sandy countries than your child's education"
00:46
I mean, how much oil can your child's education yield?
m59
m59
Oh dude, it's the new thing in DC. They stopped using water a long time ago and replaced it with crude oil.
Toilets, showers, drinking, swimming, etc.
I took the AP CS AB exam in high school, even though my school didn't offer any courses to prepare for it, or any CS courses at all my jr/sr years
I guess, I learned everything I know about Computer Science from Calculus...
01:03
@phenomnomnominal Wanna stare at a wall of music no one else likes, and some occasional blurbs no one cares about?
Oh, well I sent you a friend request
i just accepted it
I swear I just got DDOS'd
Every site went down except Google, but they all worked on the second computer
Gotta be honest, dissapointed that nothing on your page has anything to do with Andrew Jackson Jihad
01:06
I used his birthday, does that count?
I meant the band
Oh, I never heard of them
01:38
@Mr.IDon'tCare WOW. Wow. That's it, you're done. I hereby officially revoke your programming license. Turn your keyboard in to the midget at the door.
@synth3tk hehe, well.
 
1 hour later…
02:55
¯( Í¡° ͜ʖ Í¡°)/¯
03:28
03:42
@Jeremy shouldn't the birth date be there?
judging by that hair
03:57
Could anyone maybe help me out real quick on a AJAX question: stackoverflow.com/questions/19102187/…
I like your function Fail()
Hahaha thanks :P
I haven't done php for a while
but I think your string interpolation might be wrong: $sql="INSERT INTO DB NAME (user_round, user_name) VALUES ('$stage', '$name')";
$sql="INSERT INTO DB NAME (user_round, user_name) VALUES ('{$stage}', '{$name}')";
or something?
@Jeremy they are equivalent
it should theoretically work
04:07
they both suck. Use prepared statements
damn you php
you win this time
How would I use a prepared statement here?
first, replace the deprecated mysql_ with mysqli_ or PDO. Second, read a tutorial on either of these. Third, realise I've written the steps backwards :-)
@user2582299 why is your question tagged html5-canvas? lolwut
@rlemon You should consider calling your followers Lemonade
04:18
@user2582299 $sql = sprintf('INSERT INTO table_name (user_round, user_name) VALUES ("%s", "%u")', mysql_real_escape_string($_POST['name']), $_POST['stage']);
Sorry, typos
Last one I promise lol
Eff
"user_round, user_name" are backwards too
haha, nice catch
@Shea better, but you should still use prepared statements instead.
That's probably the core reason @user2582299 code fails
Yes! Otherwise... tell me the URL so I can exploit your database plz
Yeah, but let him find that out
I haven't written a good JOIN for a couple months
oh, they're in the right order in OP's question
pish
04:25
Yeah, I just noticed that
There's probably so much more wrong with it though, I could only imagine what connect.php and his db schema look like
For all we know, user_name is a primary key
@Shea user_id is the primary key, Yeah i'm new to php, I did make a login/register and simple forums though, set-up my linux server and all. Really new to it all thanks for the help though.
Well, then you can't INSERT duplicate primary keys...
Can I offer you an UPDATE?
@user2582299 anyways, 404 normally indicates the URL itself is wrong.
That what I meant, for all we know he's getting errors from that
@user2582299 You'll get it, just keep trying. The best thing to learn first, imho, is debugging, which isn't too hard
Hi, need help 0how to retrieve the data from database using webSQL ?
04:32
@user2384323 did you try searching first?
@user2384323 u wot now?
webSQL. Ugh. People are still using that?
i tried both webSQL and IndexedDB but i'm not retrieving the data from database
you should use the server to access the database. Opening your database open wide is a bad idea.
this is what i tried pastie.org/8368663
@JanDvorak but my database is local database
i just want to retrieve the data from database
04:35
@user2384323 so, somewhere else you created a database, right?
@Jeremy yes, but my database is already exist
So why isn't your code working?
@geniuscarrier 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.
@user2384323 I have reviewed your code and found bad formatting.
i'm not exactly whether the database is opening or not, but i'm getting

console.log("Transaction success");
04:40
@user2384323 SELECT `column` FROM `table` WHERE `field`='value';
@Shea i want to get the distinct values of "Subject" from Data table
SELECT distinct(Subject) FROM Data
try without the parens
SELECT `Subject` FROM `table` GROUP BY `Subject`;
Or (like @JanDvorak said) SELECT DISTINCT `Subject` FROM `table`;
@Shea @JanDvorak i tried yours query but its displaying blank page nothing is displaying only "Transaction success" is displaying in console
Normally, in any other language, it returns a DB object
04:48
i tried query in SQLManager query is displaying the results
@user2384323 chances are there's no data in the database or there's no #list
@JanDvorak this is my html file
 <!-- Start of first page: #one -->
    <div data-role="page" id="one" >
        <div data-role="header" data-position="fixed" >
            <h1>Multi-page application</h1>
        </div><!-- /header -->

        <div data-role="content">
			  <ul data-role="listview" data-filter="true" id="list"></ul>
        </div><!-- /content -->

        <div data-role="footer" data-position="fixed" >
            <h4>Page Footer</h4>
        </div><!-- /footer -->
    </div><!-- /page one -->
@user2384323 Idk how good this is, but read this tutorialspoint.com/html5/html5_web_sql.htm
Specifically, the "READ Operation" section
@Shea i tried this also
Show me this part in your code tx.executeSql('SELECT * FROM LOGS', [], function (tx, results) {
It expects a callback with two params, the second being the results
I imagine you're logging the first param
04:54
var databaseSync = null;

try
{
   databaseSync = openDatabase("database", "", "database", 10 * 1024 * 1024);
   databaseSync.transaction(function(tx){
      tx.executeSql('SELECT distinct(Subject) FROM Data', [], function (tx, results){
       var len = results.rows.length;
      var results = [];
	  console.log(len);
  for (i = 0; i < len; i++)
  {
    var row = results.rows.item(i);

      $("#list").append('<li><a href="#" id="">'+ row.Subject +'</a></li>');
	      $("#list").listview('refresh');
Well, first of all distinct(Subject) isn't what we said
Second, function(){console.log("Transaction success");} is what you're seeing
@Shea but this query also displaying the same results
@Shea hmm..yes
And how would you know that, if all you see is "Transaction success"?
Third, that's really poorly formatted, gimme a sec to prettify it so I can actually see the structure
i just try i tried it whether the console is showing any text or not
So this is what you have
databaseSync.transaction(function(tx){
	tx.executeSql(
		'SELECT distinct(Subject) FROM Data',
		[],
		function (tx, results){
			....
		},
		function(){
			console.log("Transaction success");
		},
		function(tx, error){
			console.log("Error" + error.message);
		}
	);
});
The "Transaction success" should actually be replaced with the error callback
The last callback is doing nothing
05:00
@Shea yes
ohh
So you have a problem with your SQL syntax.
but i tried that query in SQLManager i'm getting the result as i want
Not all SQL are the same
SQLManager appears to support MySQL, SQL Server, PostgreSQL, etc but you're using Web SQL
@Shea so the problem is in query
I'm not sure that SQLManager supports Web SQL
Yes
05:05
@Shea i'm using SQLite Manager for testing my queries. In webSQL we wont use SQLiteManager
Nevertheless, get rid of the middle callback so you can see what your error is
@AbhishekHingnikar I don't even....
Stop making me feel dumb
@Shmiddity makes me feel dumb
Esliaja makes me feel dumber
and Benji makes me feel dumbest ;-) [[but thats cause of .... angular ]
@Shea i try with console.log(len); in function (tx, results){....} its npt working
05:12
you all make me feel like dumb rock
I WANT TO FIND IF A SQUARE IS ENCLOSED BY A RECTANGLE ... RAWRRR
@AbhishekHingnikar NO. ONLY BY ROUND SHAPE THING.
@user2384323 We've hit a brick wall, I told you what to do. Show me the error, or we cannot proceed.
@Shea i tried in chrome there is no errors, but in firefox it shows error as

ExceptionReferenceError: openDatabase is not defined
63
Q: How to check if a point is inside a rectangle?

FreewindThere is a point $(x,y)$, and a rectangle $a(x_1,y_1),b(x_2,y_2),c(x_3,y_3),d(x_4,y_4)$, how can one check if the point inside the rectangle?

RIGHT I will fucking do it this way
LOOK AT THAT SITE ... GENIUS ALL FUCKING AROUND MAKING ME FEEL SHIT WORTH
05:17
I thought you could do that with Algebra
@Jackson 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.
@AbhishekHingnikar I DON'T EVEN. 2+2 MAKES ME RECONSIDER ALL THE LIFE CHOICES.
static boolean isSquareInRectangle(sx, sy, sw, rx, ry, rw, rh) {
    Rectangle2D s = new Rectangle2D.Double(sx, sy, sw, sw),
                r = new Rectangle2D.Double(rx, ry, rw, rh);
    return r.contains(s);
}
I remember my 6th grade teacher teaching us graphs, and mentioned it, but then side stepped with "we won't even get into that right now"
THE FUCK JAAVAAAAAA :-| trust in javascript has been lost
05:19
@Shea I can do it with both my hands and some of my feet.
@AbhishekHingnikar fun fact: this is valid (but stupid) Ruby code
thats java :-/
javascript feels so naive in front of that shit
I know, but it's valid syntax in ruby as well
def new class
  class.new
end
of course, Rectangle2D.Double is hardly going to return a class... :-)
05:33
Math.prototype.pointInsideRectangle = function(point,rect){
    var xx = point.x - rect.x1;
    var yy = point.y - rect.y1;

    var partial_by_width = xx * ((rect.x2 - rect.x1)/rect.w) + yy * ((rect.y2-rect.y1)/rect.h);
    var partial_by_height = xx * ((rect.x4 - rect.x1)/rect.w) + yy * ((rect.y4-rect.y1)/rect.h);
    if( 0 <= partial_by_width && partial_by_width <= rect.w && 0 <= partial_by_height && 0 <= rect.h ){
        return true;
    }
    return false;
}
this kind of worries me
i have to loop over all points :-/
That looks fucking mental
@phenomnomnominal my rectangle is at an angle making it worse :-/
so do the rotation to align it first
doing so :-/
but this is a HORRIBLE solution
i dont believe this is the only way to do it :-/
just change your basis
05:42
can someone please tell me how can i run this javascript from code behind using ScriptManager ... window.opener.FillTextFromPopup('yourTextString'); window.close();
@Shea @JanDvorak i'm not getting any errors
@user2384323 Sorry bud, you're on your own for now. It's time for me to wind down
@AbhishekHingnikar well you need space partitioning if you don't want to loop over everything
enlighten me :->
!!wiki Quadtree
05:47
@Shea ok np.Thank you :)
A quadtree is a tree data structure in which each internal node has exactly four children. Quadtrees are most often used to partition a two-dimensional space by recursively subdividing it into four quadrants or regions. The regions may be square or rectangular, or may have arbitrary shapes. This data structure was named a quadtree by Raphael Finkel and J.L. Bentley in 1974. A similar partitioning is also known as a Q-tree. All forms of quadtrees share some common features: * They decompose space into adaptable cells * Each cell (or bucket) has a maximum capacity. When maximum capacity is ...
You're welcome
^ yes
06:02
now i gues
my brain is a GCing bitch
I have used quad trees before (XD)
and forgot em L:
0
Q: Validate URL entered by user

user2129623I have already checked previous answers on the SO. I know they are cool. Here is my chance: I am taking values of textbox and passing it to function to validate. It passes url correctly but not doing validations. Can someone check where is the bug? I could not identify <html> <head> <t...

06:20
@Zirak The obvious solution to use preg_match would be to use ajax to call a PHP page.
@AseanJazz 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 Thank you
0
Q: Is there any way to hide keyboard in Android 4.0.4

Asean JazzI don't know that's possible or not, my question is : Is there anyway to hide keyboard in Android 4.0.4 using jQuery or Javascript? Because I developed application that using mobile device Android. <input type="text" name="input" id="input"/> As we know, when We focus to textbox, soft keyboar...

@AseanJazz Is that about standard browser javascript or about a Cordova (or similar) based application ?
I using mozilla firefox...
Any advice guys with my question ?
Quick question, how could I display only certain buttons with Html5-canvas depending on a variable? Like only display the first 2 buttons if variable =2, but 3 if variable =3? I'm using:
buttons = [ [10, 10, 50, 30],[70, 10, 50, 30], [130, 10, 50, 30] ],
06:33
@KavithaKGowd 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.
@user2582299 show and hide when it changes
sudo /etc/init.d/government restart
@SomeKittens Why did the lights suddenly go out?
    angle = angle || 0;

    var sin = Math.sin(angle);
    var cos = Math.cos(angle);

    var rect = {
        w  : w,
        h  : h,
        x1 : x1,
        y1 : y1,

        x2 : x1 + w * cos,
        y2 : y1 + w * sin,

        x3 : x1 + w * cos + h * sin,
        y3 : y1 + h * cos + w * sin,

        x4 : x1 + h * sin,
        y4 : y1 + h * cos
    };

    return rect;
Can anybody point any mathematical mistakes i am doing there ?
i am trying to generate a rectangle with a point x1,y1 as reference at an angle angle
seeml fine, but shouldn't the angle be stored in the rectangle?
06:48
the angle is global
but for some reason using this my rectangle gets Skewed.
@AbhishekHingnikar it isn't Radians/Degrees is it?
ah, sorry. One of those sines need to be subtracted
two
the matrix is {c s / -s c}, not {c s / s c}
whaaaat ?
oh noes not again the same sine-cos
06:54
x4 : x1 - h * sin,
x3 : x1 + w * cos - h * sin,
friken ... i will go re-learn maths today
if you subtract the other two sines, you'll rotate in the opposite direction
cool :D
// i kinda really need to pay attention to maths
ah, the signs of sines :-)
Need Help on this Que...
0
Q: JavaScript does not execute in emulator (PhoneGap in Android)

MDroidI am facing a strange behavior in my PhoneGap Application.I am new to this so your every help will be appreciable. I've made an application in PhoneGap(Cordova) where I have designed two Index.html file. Using Index.html file when I click on Icon(my_notification_new) I move to Notification.html....

07:04
@MDroid I don't understand your question
I don't even see any javascript
@JanDvorak substracting the two sines makes it skew again :P lol
@AbhishekHingnikar screenshot?
are you subtracting all of them?
oh dear yes :-/
fixed
tehe mis-understood u
:( Ohh.. because of my English? @Jeremy See my update
Is there a web service [other then wolfram] to plot points ?
07:16
I use a J console
@AbhishekHingnikar The best for analyze the particular point is numberempire.com/graphingcalculator.php because you can move and can use the zoom on the graph or mathe-fa.de/en
thank you so much :D
Of anything and let me know what was the website useful!!!
@TimTakel 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.
@Preethy 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 added code for tool tip display when hovering the pointers in the google map.It is showing the tool tip but the content is "undefined". How can put the corresponding content related to the pointer into the tool tip box.The code is :

function initialize() {

var myOptions = {
zoom: 11,
center: new google.maps.LatLng(29.7,-95.4),
mapTypeId: google.maps.MapTypeId.ROADMAP
}

var map = new google.maps.Map(document.getElementById("salon_map"), myOptions);

var locations = [
__newmapdetls__
];

for (var i = 0; i < locations.length; i++) {

« first day (1081 days earlier)      last day (4092 days later) »