« first day (873 days earlier)      last day (4091 days later) » 

12:02 AM
http://www.slideshare.net/tottys/dont-code-crap-in-2012-architecture-future

This is the worst shit I've ever read/seen
 
Agreed
 
Hey ppl
can someone help me
I wanna
 
Can somebody explain what $(this).data("num"); would do? I'm trying to read the API but I'm so confused, I'm trying to figure out how to center google maps on table row quick
click*** not quick
 
fill a div from the buttom up
@rlemon what type of whack PowerPoint was that?
 
@rlemon Oh. Dear. God...
 
12:14 AM
@rlemon What in the fuck?
 
thank Feeds
I clicked on the link, clicked on the profile.
he links it, and made it
and believes it
 
He's so full of shit ... I can't even explain.
I seriously hope he didn't present that to somebody.
 
like this?
sorry he links it from his other profiles
 
That's actually fucking retarded
 
how does it at all make it cross browser??
 
12:21 AM
Anyone in here who wants to make less happy Octavian more happy?
Buy me this.
 
> Out of Stock
no can do padre
 
I DON'T CARE! DO WANT!
 
Hello.
http://jsfiddle.net/Schoening/g5kTJ/1/
What the heck ? :p
 
Shit ... how can it be out of stock? Dammit!
 
toFixed somehow returns it as a string?
11
Q: .toFixed() returns a string in JavaScript

Derek AdairAm I missing something here? var someNumber = 123.456; someNumber = someNumber.toFixed(2); alert(typeof(someNumber)); //alerts string Why does .toFixed() return a string?

^ answer
strange but makes sense
 
12:26 AM
!!> (3).toFixed(3)
 
@phenomnomnominal "3.000"
 
obviously
!!> 3.000
 
@phenomnomnominal 3
 
var b = 1.5444;
b = +b.toFixed(1); // cast to number after return of toFixed
console.log(typeof b); // number
b = b + b;
console.log(b); // 3
 
But you lose the 'toFixed'ness of it
 
12:28 AM
no, the string is what the + is applied too
so the fixed is applied, then you're recalculating
 
Oh yeah, i guess i've never thought of any usecases for toFixed other than displaying a number to a certain dp
 
CoffeeScript is good
 
@rlemon cool, ty. Not sure I get why the string got applied to the + instead. But it seems to work ^^
 
12:50 AM
+"1" turns 1 into a number
really it's hackish
@OliverSchöning Number(b.toFixed(1)) is probably better
 
1:09 AM
What's the current best practise for dealing with CSRF?
 
Tokens
 
Oh my god. Interfaces everywhere. I'm about to go blind.
When you're writing stuff like mapper.Map() and resolver.resolve(), ffs that should set off some kind of instinct that you are doing something horribly stupid.
 
not necessarily
revolver = { resolve: function() {}, unresolveOrSomething: function () {}} would be reasonable
 
1:25 AM
This is C#. resolve and mapper are from Classes named the same thing. Each with one method exposed and of course interfaces on freaking everything.
 
Yeah that sounds Javaesque. people should stop
 
HAMMERTIME!
 
HAMMERZEIT!
 
!!/echo stop
 
1:31 AM
@rlemon "stop"
@rlemon stop
HAMMERTIME!
HAMMERTIME!
 
YES!
hammertimed himself!
I win
it's hammertime roulette
!!/choose stop halt nothing
 
@rlemon stop
HAMMERTIME!
 
hehehe
 
“ Any fool can write code that a computer can understand. Good programmers write code that humans can understand. ” - Martin Fowler
 
rhoooo @rlemon, please, stop
 
1:38 AM
HAMMERTIME!
 
!@#$ if I see one more C# post where somebody has decided "Write to an interface" actually meant "Write to the interface construct" my head is going to explode.
 
guys do you know an edit in place on button example?
 
If I was to use $.ajax({ is there something I can use the handle the response?
 
1:57 AM
@XCritics the response: callback
 
@SomeKittens could you put it in a context real quick?
 
@XCritics Like it says in the docs
 
!!/ jquery ajax
 
@XCritics look at that
 
1:58 AM
@phenomnomnominal and I can callback from a php file to retrieve information
 
Static typing will prevent most bugs
 
@phenomnomnominal So quick question, I'm reading the documentation, but on the php side, how do I set a call back for certain variables, in success: function(data) how do I make that data come as something I can issue into variables?
 
I'm not sure what you mean by on the PHP side
 
!!/tell XCritics google php JSON encode
 
@SomeKittens Command php does not exist.
 
2:09 AM
You want to use AJAX in PHP?
 
Don't forget to use JSON.parse() on the client side.
 
@phenomnomnominal no like, I have this
function updateMarker() {
  $.ajax({
    type: 'POST',
    url: 'php/updatemarker.php',
    success: function(data) {
      alert(data);
    }
  });
}
 
and when I receive the data, from php, I want it to be parseable into certain values, so I can fill the client side fields with the proper variables
Last time I tried to do that, it returned the value, 'true' and that was it, no string
 
2:12 AM
So in the php, you need to get the data from $_POST, fiddle with it, and then use json_encode to convert it into JSON
 
Do I need to echo the encode, or just put json_encode, in a nut shell I just want to retrieve something from the database, and send it back to client side with variables so I can assign the things retrieved from database to text fields
 
success: function(data) {
  alert(data); // Then this should be a string
  data = JSON.parse(data); // This should be a javascript object
}
There are examples in that link
 
@phenomnomnominal yeah I know, I'm asking the things I can't seem to be told on the manual, like will the values be the same on the JS side as they are assigned in the php side?
 
Presumably
 
Hi
hey, how can i get all my
(function(){

   var canvas = null,
        ctx = null;

  function set_canvas_vars(){
    canvas = document.getElementById("canvas");
    ctx = canvas.getContext("2d");
  }

  function draw_rectangle(){
    console.dir(this);
   //ctx.fillStyle = 'red';
    //ctx.fillRect(50,25,250,100);
  }

  function draw_grid(){
    //for(var x = 0.5; x< )
  }

  if(Modernizr.canvas){
    set_canvas_vars();
    draw_rectangle();
  }

})();
into one object?
easily?
 
2:19 AM
Am I allowed to hate "The Good Parts?" Is that okay?
 
@MikeBoutin look up the module pattern
something like:
var canvasStuff = (function () {
  return {
    func1: function () {},
    func2: function () {}
  }
})();
 
so all stufff will not be in the global window object?
 
well if you don't add a var it will be
 
@phenomnomnominal trying to follow the example so I did     $arr = array('groute_id' => $gRouteId);

  }


echo json_encode($arr);
and on client side I did function updateMarker() {
  $.ajax({
    type: 'POST',
    url: 'php/updatemarker.php',
    success: function(data) {
      data = JSON.parse(data);
      alert(data);
    }
  });
}
but the alert just says [object, Object]
Why is that?
 
because you need to use console.log
data is now a javascript object
 
2:28 AM
@phenomnomnominal How might one do that :)
 
!!> ({}).toString()
 
@phenomnomnominal "[object Object]"
 
console.log is a function
 
so just console.log(data)?
 
2:29 AM
ok and that will give me and assign a variable client side for me to use?
 
Hm weird, now it just says 'undefined'
All I did was put alert(console.log(data));
 
because console.log returns undefined
don't alert anything
what browser do you use?
Chrome?
 
Firefox
 
!!/ google development console on firefox
 
2:31 AM
Oh so how am I gonna debug and see if its actually returning the values I need if it always says undefined?
 
@phenomnomnominal [Console² :: Add-ons for Firefox](https://addons.mozilla.org/en-us/firefox/addon/console%25C2%25B2/) ; [How To Use Firefox's Web Developer Tools](http://www.howtogeek.com/105320/how-to-use-firefoxs-web-developer-tools/) ; [Firebug](http://getfirebug.com/)
@phenomnomnominal [Web Console - Tools | MDN - Mozilla Developer Network](https://developer.mozilla.org/en-US/docs/Tools/Web_Console) ; [Console² :: Add-ons for Firefox](https://addons.mozilla.org/en-us/firefox/addon/console%25C2%25B2/) ; [Error Console | MDN - Mozilla Developer Network](https://developer.mozilla.org/en-U
 
I have firebug
 
console.log logs data to the web console
in your case it will log to firebug
so use that, open the console, and there it will be
 
oh ok I see it now, the alert says _firebugIgnore is that just cause the console is open?
 
2:32 AM
you don't need the alert
 
Oh you're right I guess
If I just want it to assign variables, do I only need JSON.parse(data); and nothing else in the success field?
 
You probably want something like this
var data;
$.ajax({
    type: 'POST',
    url: 'php/updatemarker.php',
    success: function(data) {
      data = JSON.parse(data);
    }
  });
 
@phenomnomnominal but then the alert just says object, unless you mean looking at the alert in the console log
How do you insert a break in the line
when typing here
So I have
  data = console.log(JSON.parse(data));
  $('#inputRouteNumber').val(groute_id);

And then it doesn't return anything, but the console.log says
Object { groute_id=

87

}
 
data is { groute_id: 87 }
 
@phenomnomnominal I'm so lost right now lol, so I don't use groute_id for the variable? What do I put in val() then?
 
2:38 AM
data.groute_id
 
@phenomnomnominal finally, I tried using Ajax a long time ago, and this is the first time it has ever worked, I'm so happy right now thank you so much
will the $.ajax always be supported? Or am I gonna have to learn the long drawn out way of doing it
 
$.ajax is quickly becoming the only useful thing that jQuery offers
But you should learn the long version anyways
And also, don't forget about $.get and $.post
 
@phenomnomnominal but it terrifies me haha, do I just use the json_encode for the htmlresponsetext?
 
anyone here know where I can find an ajax paginator and edit in place (with edit button) example?
 
That's a fairly specific example.
 
2:46 AM
+#if defined(__alpha__) && defined(CONFIG_PCI)
+       /*
+        * The meaning of life, the universe, and everything. Plus
+        * this makes the year come out right.
+        */
+       year -= 42;
+#endif
	-- From the patch for 1.3.2: (kernel/time.c), submitted by Marcus Meissner
 
As soon as we started programming, we found to our surprise that it wasn’t as easy to get programs right as we had thought. Debugging had to be discovered. I can remember the exact instant when I realized that a large part of my life from then on was going to be spent in finding mistakes in my own programs. — Maurice Wilkes discovers debugging, 1949
 
3:04 AM
@phenomnomnominal will "$gArrivalTime":"5:47 AM" will that colon mess up my JSONencode?
 
try it and see
 
@phenomnomnominal figured it out, one more quick question, I have

google.maps.event.addListener(marker, 'rightclick', function() {
var id = id;
updateMarker();
});
}

Is that var specific to each listener created?
 
You're only creating one listener there
 
its part of a loop, but the question remains
 
Try it and see
 
3:14 AM
@phenomnomnominal oh you
 
It's called learning buddy, you'll appreciate it later
 
@phenomnomnominal I know, and I do appreciate as long as you point me in the right direction I don't expect a full complete sentence on why and how it works, just if I get stuck, a push is nice
 
writing libraries is more fun than I thought it would be
 
Could anyone tell me if I HAVE to use jade or a template engine with express? cause i would like to just use html wicked bad
 
@Four_lo What's "HTML Wicked Bad"? Haven't heard of that one.
And no, you don't need a template engine, but I've found Jade to be very useful. If you want templating power while still using vanilla HTML, try ejs.
 
3:24 AM
@Four_lo, just use Jade, it's very nice
 
@Four_lo dude you get the best barrels ever dude
 
    //TODO: Get better at naming things
    for(var thing in expected) {
 
@thanks for the advice kittens, @phenomnomn i havent seen the nice side yet, maybe shes playing hard to get but you really think its the way to go? @shea i dont know what your talking about man. ill google it though @ kittens forgot the word wicked is just a new england thing
 
As a New Yorker, you New England people are weird.
 
lol yes. google that entire sentence
 
3:34 AM
What's nice about Jade is that you'll never have to worry about an end tag again.
 
well i'm not from maine weird, but ya
@kittens i guess i just love closure
 
Where exactly?
 
New hampshire, nashua
 
Ah, nice. I've got relatives in/around Boston
 
nice your invited to the fourth of july party! 5th annual, live band, whole neighborhood gets down!
everyones invited
 
3:37 AM
Ha, sounds fun! I'd love to come, but if everything goes as expected, I'll be in California by then.
 
wooooo!!! nice
 
So how far have you got in your node learning?
 
@SomeKittens Oh, then you can BBQ with us
 
as soon as i think im moving i just slam into a wall and then get distracted googling joe pesci facts, but I am just messing around with express while i peak some CSS to get comfortable before i get ahead of myself again
 
BBQ kitten sounds good
 
3:41 AM
@Four_lo Welcome to learning programming. Glad you're still with us, not many make it this far.
@Shea YOU MONSTER!
 
@kitten thanks i appreciate it, its fun sometimes
 
You should comment all your code
 
ha ya i started to realize the hard way, I havent been too good about error handling. I was going down the route of using the safari developer tools am I on the right track?
 
@Four_lo I'm partial to Chrome's. Never used Safari, I'm a Linux guy
 
3:53 AM
@phenomnomnominal one last question and I'll leave you alone, for data: I read the documentation, but how would I format, routeid=id, I have it as

var dataString = 'route=' + id
 
And what does that give you?
 
the alert says routeid=#
is that propper?
SyntaxError: JSON.parse: unexpected character
[Break On This Error]

data = JSON.parse(data);
I'm getting that
 
can you do a console.log(data); before that line?
 
@phenomnomnominal I fixed it, it was on the server side of things in the php file
Deleted a closing " by accident
 
Yeah I thought it would be
 
3:57 AM
WHERE route_id = ?"))

I deleted that " by accident damn prepared statements
 
Just consider yourself lucky that you have prepared statements
My old boss thought they were pointless as "escaping and mysql_ is all you need"
 
@SomeKittens haha
I'll ask that elsewhere
 
@kittens, i just was assisted today in putting together a fedora server so i will have to check that out
 
Is this propper?

if ($('#actionSelector').val() == "addmarker") {
  $('#submit_marker').val('Test');
}
it's a <selector> element
 
use ===
 
4:10 AM
@phenomnomnominal hm.. Not working as intended, it's supposed to change the text of the button if the <select> is === its <option value="addmarker">
Do I need to wrap it in some sort of function?
$(function() {
if ($('#actionSelector').val() == "addmarker") {
  $('#submit_marker').val('Test');
}
});
That's the entire thing
oops I have 3 there
I changed the wrong =='s on the wrong if damnit hopefully it works now, maybe I should go to bed
 
change addmarker, to "bingobango"
 
Not sure if serious?
 
Im just kidding
 
lol alright
if ($('#actionSelector').val() === "addmarker") {
$('#submit_marker').val('Test');
}

Not working as intended
$('#actionSelector').change(function() {
if ($('#actionSelector').val() === "addmarker") {
$('#submit_marker').val('Test');
}
});

@phenomnomnominal and this don't work either x.x
 
I'm a noob so do not take my advice as fact, but it seems to me you are matching a marker value that looks like it goes out to like 5 decimal places? could your value be slightly off. log it?
 
4:20 AM
Why do I even bothering with jQuery-ui....
it always seems to be more annoying than it is worth...
 
Bootstrap!
 
It have anything for resizing?
 
Bootstrap::: yurk
 
like responsive?
 
As in the way you can resize the windows in jsfiddle
so you make one thing bigger while making another thing smaller
 
4:27 AM
I saw ONE and only one site, using bootstrap, that didn't look like a bootstrap website
 
Its such a common thing, there has to be some libraries out there....
jqueryUI kind of does it but just makes it a pain in the ass...
of course, I do have it 99% of the way there: jsfiddle.net/twiz/4yeHs/2
 
Who has a good way to detect when an AJAX request is made?
 
@phenomnomnominal Client-side?
 
i can usually just smell em
 
Yeah
found it
 
4:36 AM
hello
 
Greetings!
 
HAMMERZEIT!
 
thou shalt
thou s halt halt
halt
 
@SomeKittens Hello, how are you, do you knoe how i can see if a string contains a 11 number word?
 
4:39 AM
!!/google javascript regex
 
@Connor I'm unfamiliar with the term "11 number word"
 
11 <-- 2 DIGIT number
word <-- 4 LETTER word
 
I assume you mean something like "31238475693"
 
@SomeKittens or you're "trying" to be clever
 
4:40 AM
you're*
@SomeKittens is clever, he doesn't need to try.
 
@phenomnomnominal well he failed
 
@Connor I fail to see how that answer moves us closer to you solving your problem.
 
^that's what I assumed but teach a man to burn a fish with fire and... it will be cooked?
 
@ErikReppen I thought along those lines, but it was just too vague.
 
@SomeKittens oh, so they say you're clever, yet i didn't say i had a problem. Not Ever
 
4:43 AM
@Connor I'm still not sure what you meant tbh but if you mean 11 characters/letters in the word, you use the length property to check. 'word'.length === 4
 
@ErikReppen that's right a burnt fish is cooked (CLAPPS)
 
@Connor You've got about 10 seconds to redeem yourself before I move everything you say to the bin because it will entertain me.
 
@ErikReppen ok, but it will be something like this "Hello test test 888476374853 bonjour"
 
MMMM... MMMMM.. I can taste the hate in here... and it is delicious.
 
@SomeKittens Take yourself while your at it
 
4:44 AM
3 mins ago, by phenomnomnominal
you're*
 
burn
@Connor, i told you
 
@SomeKittens sorry, i gathered you are easily confused
 
yourString.split(/\s+/) === ['Hello','test',<etc..>]
 
!!/ google javascript regex
 
4:45 AM
We get it dude, you're a badass. Cool.
 
@ErikReppen im not sure what the string will be i want to check if it has the numbers it may not
 
That's what regular expressions are for
 
@phenomnomnominal who was speaking to you?
 
You should probably learn more. That help I gave you covers a lot of bases.
 
This is an open forum. By definition you are talking to everyone, you ignorant douche.
 
4:47 AM
Too bad @rlemon isn't here...
 
@phenomnomnominal there is no rules saying i have to talk to people that have nothing better to do than be a complete dick
 
@Connor You are correct, there isn't a rule saying we have to talk to you.
 
We have all tried to help you.
 
@ErikReppen yes, but i dont get it in there you like are defining static words, i am not
@SomeKittens i didn't say there was
@phenomnomnominal tried
 
@Connor But it is common courtesy to not instigate bullshit... haha
 
4:48 AM
..."static words"? This isn't Java.
 
Yes, your lack of understanding, and unwillingness to learn prevented us from being successful.
 
Your mother must be so proud.
 
Lets try again.
 
@Connor you clearly don't know any JavaScript. Nobody's going to get their butthole screwed up tighter than a programmer being asked to hand you code and you won't understand why until you stop asking for cut/paste solutions in the wrong places and actually try learning things. === means equal to. I showed you how to split any string with spaces into an array of words.
 
@SomeKittens and yours must have kept you locked up, you cant even share your name :)
 
4:50 AM
@Connor He has no name... he is literally a litter of kittens
do cats have litters?
 
@Connor ..what kind of a comeback is that?
@twiz Yeah, but there's two kinds.
Just don't confuse "cat litter" with "a litter of cats"
 
@SomeKittens one that made you have nothing better to say than "what kind of a comeback is that?"
 
@SomeKittens haha indeed
 
var yourString = "Hello test test 888476374853 bonjour"
yourString.match(/\d{11}/)
Shit man... kids these days
 
@phenomnomnominal We get it dude, you're a badass. Cool.
This is like a Fucking Playground!
@phenomnomnominal miniclip.com/games/en
 
4:54 AM
Why does this not work?

<script src="js/admin.js"></script>
<script>
  <?php while($stmt -> fetch()) { ?>
  var long = "<?php echo $gLongitude ?>";
  var lati = "<?php echo $gLatitude; ?>";
  var title = "<?php echo $gTitle; ?>";
  var id = "<?php echo $gRoute_Id; ?>";
  setMarker(lati, long, title, id);
  <? } $stmt -> close(); $mysqli -> close();?>

</script>
It should call the setMarker function from the admin.js
 
@XCritics long var?
 
@phenomnomnominal ?
 
@Connor A "Fucking Playground" ehh? That either sounds really fun or disturbingly pedifile-ic
 
long var is not valid JS
 
@phenomnomnominal I don't understand, like the name long is reserved for var? or ?
 
4:57 AM
@twiz or you have a sick mind, bet your a catholic right?
 
@phenomnomnominal Where are you seeing long var?
 
> long var = "<? php echo $ gLongitude?>";
 
13 mins ago, by SomeKittens
3 mins ago, by phenomnomnominal
you're*
 
@phenomnomnominal I can assure you it's var long not long var lol
 
Yeah, it's var long
Unless I'm going crazy, which would explain Connor.
 
4:58 AM
@phenomnomnominal haha dyslexia....?
 

« first day (873 days earlier)      last day (4091 days later) »