« first day (108 days earlier)      last day (4826 days later) » 

Tek
12:54 AM
@ircmaxell Well done :D
Talk about going above and beyond ;D
 
hehehe
Code-Bowling Answer
0
A: Make an application that determines if a sequence of numbers is sorted

ircmaxellHere's a quick one. Interestingly, it should still be pretty efficient, since it only iterates over the terms once. It can only work on numbers between 0 and 255... array_shift($argv); $str = str_repeat(chr(0), 256); foreach ($argv as $key => $element) { $str[(int) $element] = chr($key ...

 
Tek
2:09 AM
@ircmaxell I don't get what the point of code-bowling is?
Certainly there's an infinite ways to make the code as bad as it can be...
 
well
there's a few ways of looking at it
One is to make elegantly bad code...
As in code that's clearly "pretty" or elegant, but also quite bad
Another is to make over-engineered crap, but crap that you might still find in the wild.
it's a challenge to see what people consider bad-code
 
Tek
2:24 AM
heh, I see
 
That's my take at least...
 
Hello World!
 
hello louie
 
@jAndy Focus is the way to go, cause as of right now you are adding a tab every time someone hits enter.
Howdy David
 
Tek
@drlouielouierd He's aware of that, we discussed it but neither of us knows how to actually have the native Tab functionality :P
 
2:40 AM
I love SO always find new collaboration tools I never even knew existed :P
 
Tek
mhm
 
Here's my latest question on SO, regarding ScrollTo and anchor elements:

http://stackoverflow.com/questions/4858236/scrollto-anchor-element-at-document-loadtime

If you have any ideas just post a reply :)
 
@drlouielouierd answered. Good luck with that
 
Tek
2:56 AM
@Raynos In case you want some more rep... stackoverflow.com/questions/4857012/… <.<
 
@Tek I have enough
 
Tek
Which is why I said "in case"
:p
 
You want to catch Enter and then treat it as Tab ?
 
Tek
Yeah.
 
Just hardcode the behaviour
 
Tek
2:57 AM
Right... which I wish I knew how.
 
if (enter) {
    // tabs to next field
    getNextField().focus();
    // stops default enter
    event.preventDefault();
    event.stopPropagation();

}
implement getNextField() using .tabindex
Do you want a more generic solution?
 
Tek
What do you mean by that?
 
he probably wants a sneaky solution, like, if(e.which === 13){e.which = 9;}
 
@david that wont work :P. It might actaully, that's crazy though
 
i know it wont
 
Tek
3:00 AM
Hah, yeah. I'm not that naive :p
 
nah i tested :D
 
Tek
LOLZ. :D
 
@Tek stop the default for enter key.
then get the element with the next .tabindex and focus on it
 
Tek
I know that much, I've done that before. But it seems the only work around is to do jquery and focus the next form element.
Is it bad that I know more jQuery than actual javascript? :(
 
@Tek answered you lazy bum :P
Its not tested and is only pseudocode. You should get the idea and flesh it out
 
Tek
3:04 AM
@Raynos Oh please, we both know you wanted that juicy irresistible rep. :D
 
I'm nearing 3k :)
Then the next one is 10k >_<
 
Tek
@Raynos I KNEW IT! :D
Also grats :)
 
I like tagging things as "pseudo-code" or "Something like this"
I cant get downvoted for slipping in a bug or forgetting something :P
 
:( i only just hit 1k
 
Tek
Nice stair case rep.
lol
 
3:13 AM
ahaha
hmm, anyone have any tips for encoding stuff to JSON from .Net? I'm using a little library thing, but it doesn't feel clean
 
@Tek only started to get serious reasontly :P
 
Tek
@david Premature optimization?
@Raynos So I've seen :D
 
Change gradient from 1.2 to 10 :P
 
it's not optimising... I have an array of simple objects, and i need to serialise it as JSON
 
@david look at my graph. 1k is hard and takes a while from there on its 1k-3k in a week or two :P
It's been the same for @IvoWetzel. Look at his graph
 
3:22 AM
yeah i saw that >< you guys are nuts
 
He also rocketed up. Im behind him :P
 
Bah, answering questions :P
 
"This is bug in opera?? How I fix??" It's a good question for you @gsnedders
I like it. 0 questions, 10 answers, 50 upvotes!
@gsnedders It's kind of unproffesional to link to such a personal blog through SO :p
 
@Raynos Someday that will be gone, and there will be a sane website in its place :P
@Raynos As for Opera bugs, I normally just mention them to other people :P
 
 
1 hour later…
4:43 AM
1
Q: Prevent declaring variables without var

muntooHow can I prevent variables from being declared without using the var keyword? Can I set NetBeans to warn me about this? For example, I want a warning or something on this: var testing = 5; // ... testin = 2; // Woops, typo!

yay w3schools referenced in the answer
and the linked article is the one that says the var keyword is optional ><
 
 
3 hours later…
7:50 AM
Hi! :)
OK who thinks it's funny to star everything I say? Now really…
I've accidently closed an issue on GitHub, which was opened by me. How can I reopen it?
 
 
2 hours later…
9:39 AM
morning everyone
 
9:50 AM
Good morning. I'm using jQuery to retrieve a page using $.get. I works great, however, if the image on the page has a relative path, it tries to load the image from wrong URL. Is it possible to specify with $.ajax or $.get so that all the content on the page returned should fetch the images by some x url?
I hope my question is clear, if not, I'll try to explain better.
There is for the $.ajax
But I'm not sure if it's in the meaning you meant
 
ah, that must be what I'm thinking. Can you not use .ajax() for this purpose?
 
Sure
I'll give it a try, I just specify the address?
 
I think just the top level, as in the bit the image is getting wrong
 
10:19 AM
Hello,
Can someone please recommend a good chart plugin for jquery?
Ideally with the ability to click on a bar in a barchart, which then displays a further detailed bar chart.
does such a plugin exist for jquery?
 
@oshirowanen I don't know of a jquery specific chart system
 
@Greg How about a chart system for standard javascript?
 
@oshirowanen I'd recommend highcharts - really easy to use, and totally customisable
 
@Greg Thanks, looking into it now.
 
@oshirowanen take a look at the demo, really shows off the features and customisability highcharts.com/demo
 
10:31 AM
@Greg Thanks. Not only do those charts look good, the documentation is great. It even has click events which is exactly what I was looking for.
 
@oshirowanen I really do love highcharts - the whip google's ass
 
11:11 AM
Hmm, the content page is within /temp/Dialog/... and has absolute path for the images. And the page where I load the content is /, so it tries to load the image test.jpg from /test.jpg instead of /temp/Dialog/test.jpg
I set context in $.ajax to mypage.com/temp/Dialog but it has no difference
 
Is there any other method you can use to load the data in instead of loading a complete HTML page? Because I assume that is what you are doing?
 
Hm, not really :o/ It was originally designed for iframe
I could always fetch the part I need from the page
But still, the image abs path is a problem
 
How variant is the content you are fetching?
What I mean is the HTML structure going to change much/often?
What you could if it's much the same is process the data with PHP (or other preferred server language).
 
@ircmaxell morning, you there?
 
11:28 AM
@raRaRa Maybe you could do some clever function in jQuery that after loading the page in just goes through all the <img /> and appends the correct/absoulte path to the src.
 
Yeah I could do that
It's just a bit surprising that there's not an inbuilt feature for that already :)
 
11:42 AM
morning
 
hi
 
sup?
 
still confused to user roles on my linux box :\
 
ok...?
 
@ircmaxell I made a new user and group with access to /var/www but when I log in via ftp with that user, it tries to open /home/username (which doesn't even exist) ... so I created the directory, and then realised that the user can traverse the whole server from FTP, but can't change any files whatsoever.
 
11:59 AM
First off, I should have asked this first, but why are you using FTP?
 
@ircmaxell so I can upload files to the server, and for an application we use
 
But why FTP?
ftp is insecure
If you have access at that level, you should be using SSH/SCP
 
@ircmaxell it's only internal
 
then definitely use SSH/SCP
 
hmmok I'll look into it. Just spending today reading newbie guides to linux :D
 
12:10 PM
0
A: Mix Javascript and PHP in my design model

ircmaxellUsually, you don't want to do this. It's a problem of latency when viewing the web page in a browser. Each separate javascript file defeats caching and requires additional transfer time before a page can load. It's commonly advised to combine JS files wherever possible and practical to better ...

 
12:40 PM
uhhh
 
1:40 PM
Good Morning Again
lol...
 
@ircmaxell Good afternoon now
I think we're the only two in here
(active)
 
hehehe
 
LET'S WREAK HAVOC!
 
2:00 PM
Can anyone please help me with this
1
Q: Javascript stops running with no error message

Tom GullenUsing an Uploadify and JGrowl combo: <link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/jgrowl.css" /> <script type="text/javascript" src="js/jquery1.4.4.js"></script> <script type="text/javascript" src="js/...

I'm completely stuck :-(
 
I think the commenter missed the point:
4
A: Mix Javascript and PHP in my design model

ircmaxellUsually, you don't want to do this. It's a problem of latency when viewing the web page in a browser. Each separate javascript file defeats caching and requires additional transfer time before a page can load. It's commonly advised to combine JS files wherever possible and practical to better ...

 
Hi all
 
@Tom: have you tried stepping through the code with a debugger?
And on which browser(s) is this an issue on?
 
I was wondering if anyone could help me with answering this: stackoverflow.com/questions/4850491/…
I think that with as far as I've gotten with trying to resolve it, I now have a jQuery/Javascript issue.
 
@icrmaxell I'm not very good at debugging but ill try stepping now, it's every browser
 
2:05 PM
ok
I commented anyway
 
Uncaught TypeError: Object function (a,b){return new c.fn.init(a,b)} has no method 'jGrowl'
(anonymous function)artworkDesigner.aspx:27
c.extend.ready
When I try and run the jgrowl in the ready function
Thanks for the heads up that should be enough to work on!
 
cool
 
2:29 PM
On a slightly off topic note, how do you post to chat with the questions in like Tom did?
 
just paste the link in
 
just post the link by itself
 
0
Q: Problems Submitting Form with FCKEditor on in MVC

LiamI've a bit of an odd issue with FCKEditor in my MVC project. I've essentially got a View which renders a Partial View containing my FCKEditor (javascript, html and any other bits to make my control reusable throught my app) I'm calling FCKEditor by doing the following: <script src="<%= U...

ah ha! thanks
 
this chat is a really nice bit of kit
 
2:37 PM
First time I've used it to be honest
Never thought about it until I came across my seemingly unanswerable question :)
 
@Shikiryu reddit/js ?
was just looking at that
 
Javascript Genius ..Douglas Crockford -> uk.video.yahoo.com/watch/111593
@oshirowanen try www.highcharts.com
 
@Greg I agree. A work of art.
Oh
My browser scrolled up, so something from ages ago looked like it was the last message >_>
Hmm, it keeps scrolling to the top and back down every time I post something.
 
@Wolfy87 chrome 10?
 
2:48 PM
Yup
Known bug?
 
@Wolfy87 dunno if it's known by Stack Overflow, but I have certainly noticed it.
@ircmaxell maybe you would like some points on server fault?
1
Q: Jail Linux user to directory for FTP login

GregI'm planning on using vsftpd to act as a secure ftp server, but I am having difficulty controlling the linux users that will be used as ftp logins. The users are required to be "jailed" into a specific directory (and subdirectories) and have full read/write access. Requirements: - User account...

 
hehehe
responded
 
@ircmaxell but vsftp supports ssh
 
3:04 PM
Why do you want to use vsftp rather than a proper SSH client (which happens to be built-in to Linux)?
 
@ircmaxell oh :\ didn't know that
@ircmaxell or did I? putty is ssh isn't it?
 
putty is a client
sshd is what you're looking for
 
I connect to the server using putty to access the shell - I can't see how putty could be used for transferring files?
 
3:18 PM
Sorry, was on the phone
You don't use putty for transferring files. Well not directly at least
 
@ircmaxell I just had a penny dropping moment :)
 
Use something like winscp.net/eng/index.php
 
@ircmaxell I'm able to connect using filezilla, SSH mode... but the user admin_ftp has access to the whole directory structure :\
 
it uses the same wire-line protocol (SSH), but looks like FTP
@Greg: Correct
that's why you setup a chroot jail
 
ok thanks for all your help, I'll get googling now I've grasped this basic concept :P
must put this room back on topic ....
anyone know how to brew a nice cup of coffee, preferably using jQuery?
 
3:21 PM
lol. I consider on-topic whatever people want to talk about as long as it's not derailing conversations
 
I want to talk about carrot cake.
 
var coffee = $.makeCoffee($.additiveFactory().add($.makeCream()).add($.makeSugar()).add($.makeSugar()));
 
@ircmaxell nice use of design patterns
 
:-D
 
2 sugars? seriously?
You must be kidding right?
 
3:25 PM
lol
Fine: var latte = $.makeCoffee($.additiveFactory().add($.makeMilk().steam()).add($.makeSugar()).add($.makeEspresso()));
 
that seems rather inefficient as two spoons of sugar have to be manufactured just for a cup of coffee
 
@Greg: inefficient, perhaps. But flexible...
 
serious note... what is the difference in efficiency between chaining methods like that and traditional declaritive coding?
 
I personally prefer declarative programming, not because of efficiency, but because of clarity
 
+1
 
3:29 PM
@ircmaxell I agree. It's the worst to have to debug chained code
 
yup
And for readability
My favorite book. I recommend it to everyone
 
(@ircmaxell is a commercial for this book and the lithium framework) (note for new in chat)
 
I was thinking of buying that as it was recommended by my university, but I thought it'd just end up sitting on the shelf with the others :\
 
What's wrong with that?
 
hehehe
@Greg: That's a book you'll read once cover-to-cover, then reference every once in a while for the rest of your career (and re-read every now and then)...
If there was one book to recommend to programmers out of all others, this would be it
@Shikiryu Yup, that's me...
And I'm not involved in either oddly enough...
 
3:41 PM
@Tek - if you get another 408 please mention it in here or any other room I see, I need the URL you were trying to hit, your IP when it happened, and the exact time (and your timezone so I can convert)
 
@NickCraver it's nick craver! how did you manage to escape the self executing function??
 
He's back \o/
 
Woah!
 
@Greg very carefully :)
 
lol
@Greg: easy, he through an ImNickCraverLetMeOutException()
 
3:47 PM
:D
 
and was caught ?
 
@Shikiryu I saw that typo :P
 
¬_¬
At least, I made the correction myself :D
 
@Shikiryu It doesn't need to be caught. It's Nick Craver. He can catch his own exceptions if he chooses to at the correct place in the stack...
 
it was funny to see it get corrected
 
I should flag it to moderator >_<
 
lol
Go for it. I'll say no
 
D:
 
4:09 PM
tldr?
1
A: Should search/get methods that retrieve rows from a database be instance methods or static methods?

ircmaxellWell, the question is, how do you want it to work... There are a few patterns built around this concept. If you want to get one: If you have many similar things (like types of people), then you might want an Abstract Factory. In that case, you'd likely not want it to be static. But then a...

 
@ircmaxell stop reminding me I need to finish reading code complete
 
hi all
 
lol
@Raynos: It's good in chapters, so there's no need to cover-to-cover in one session like some other books
 
I'll get round to it! (Have it on the kindle >_>)
 
I need to do the same..
 
4:11 PM
Another favorite that I'm still in the process of reading:
doesn't like e-reader reference/geek books. I like my e-reader for novels and casual reading, but I prefer hard-copies of reference books so I can see and feel and annotate, etc...
 
* adds to list of books
oh wait
i have safari online..
its an oreily book, i might have access
 
That book was recommended to me.
I felt I had my career under control, but decided to get it anyway
wow
that's all I can say. There's so much that just makes sense and ways of managing people in there that blows me away
 
added to wishlist, in case one day someone will be generous enough...
 
sweet its on safari books online
 
nice...
 
4:15 PM
bleh I know I should probably move on.. I am not challenged at all, we have no deadlines, and nothing is really expected of me
 
@Loktar: that's what the first few chapters of the book are about
 
(gah seriously... I hate my coworkers.)
 
Im going to start reading it today
thanks for the heads up on that
 
@Shikiryu: I'm the kind of guy that I love to loan out good books and pass them around. I have my reference library, but I also let anyone borrow whatever they want
@Loktar: No problem, I've found it quite helpful
 
haha @Shikiryu as people my coworkers are alright.. but I have to explain such basic things, such as basic web concepts. For instance one of our devs had no idea what ftp was.
we are web developers..
 
4:16 PM
lol
 
Would the community frown on the statement "I have a pdf copy of code complete 2 lying around if anyone wants to read it but is too cheap"
 
in the government all you need is a clearance.. there are no tech interviews.
 
I would @Raynos....
 
I was just asked to find a mistake in an oracle request ... 114lines.
 
@ircmaxell I personally bought a copy because its a good book but I like pdfs
 
4:18 PM
Personally my feeling is that things that are worth it (like these books) are worth every penny...
 
code complete is really cheap on amazon (used) if I recall
 
alright, 4 books in wishlist. Almost my birthday \o/
 
Really depends whether your employed or a hobbyist coder. Proffesional software developers should buy them but for hobbyist it's an arguable position
 
not as cheap as I thought
 
@Raynos I'll adjust that. It really depends whether you're serious about becoming/being a good coder
@Loktar: No it's not. But it's worth the money IMHO.
@Shikiryu My wishlist on amazon is currently at almost 50.
 
4:20 PM
@ircmaxell I guess so.
 
oh yeah definitely, I bought it a few years ago. Didnt realize vs 3 is out.
 
@ircmaxell I hope you're not in my case : buy a house in a couple of months... less to spend in books :(
 
@Raynos It's a minor distinction, but I think one worth making. Since there are plenty of non-professional developers who still could benefit from reading it...
@Shikiryu I spend about $1k per year (give or take) on books...
 
@ircmaxell that's an impressive amount. I should get around to learning more from books.
 
Not all about software/programming
 
4:22 PM
Is using struct to emulate inheritance in C a "common" pattern?
@ircmaxell is that 1k on non-fiction books? research/learning i.e. not recreational.
 
I read a fair bit of fiction, a good bit of abstract programming (non-language or domain specific), a lot of math (60% math), a bit of physics, and some philosophy...
And out of fiction, prob $50 to $100 per year, since they tend to be cheaper than good books otherwise
 
@ircmaxell I see. Applied or abstract Maths, i.e. Math to use in development or abstract math for the sake of knowledge.
 
Both
 
@ircmaxell how do you make the time to read and do part-time recreational development?
 
4:26 PM
only books i read are zombie books as of lately. People keep sending my free ones because of zombiebooks.com lol
which is auto updated, i really do nothing with it
but whatever ill take free books anyday
 
@Raynos I don't do much recreational dev...
hehehe
 
lol typo in that book, "Who do I do when my boss lies to me?"
 
it's not a typo. Who do you do when your boss lies?
lol
 
Well not my boss at that point, relationship is over! lol
 
<html>
<head>
<basefont face="Arial">
NOOOOO
 
4:33 PM
@Nyuszika7H at least it's not
<basefont face="Impact">
 
Anyway, it was posted on Monday, July 19, 2004…
@Greg You've got a new avatar? Nice! :)
 
@Nyuszika7H yes I changed it earlier
 
@Greg why is basefont bad?
 
@Raynos not standards compliant. But I meant to emphasise my hatred for "impact" :P
 
lol
 
4:37 PM
WHY no regex lookbehind in JS?
 
@Greg <basefont face="ComicSansMS">
 
@Shikiryu you will go to hell for that
 
Is microsoft sharepoint evil?
I know dreamweave is evil but im not sure whether sharepoint is in the same league
 
@Raynos never used it
I thought it was just one of those "extras" in the office suite that nobody ever touches
probably just packaged in there to keep the developer happy
 
@Nyuszika7H: likely performance... And/or the fact that they just didn't include it, and it's not seen as an important enough feature to add it back in...
 
4:43 PM
@ircmaxell It's important!
 
@Raynos Like all things, sharepoint can be abused and used for evil.
The question is not is it evil, but does it have non-evil uses
And yes, it does have plenty of non-evil uses
 
How do you do this in JS? /(?<=foo)bar/
 
@Nyuszika7H So says you and me, but not everyone sees it like that...
 
I was looking at some auto generated html from sharepoint
 
Sharepoint is excellent for document sharing and collaboration.
 
4:44 PM
<table>
  <th></th>
  <th></th>
  <th></th>
  <th> // here is your content for that value
    <div> // opening a div? :S ok fair enough
      <table> // what are you doing?
        <tr><td>
          <table> // Seriously? another table?
            <tr><td>
              // your content
  </close junk></th>
</table>
 
For building websites, it's puke...
 
I hate auto generated html like that
 
yup
 
It won't even work with php.js :/
 
php.js is a bad idea
there's a reason php is php and js is js
and it uses eval() everywhere
 
4:53 PM
uhhh... what?
wow
just wow
 
Are you series? php.js Porting the php standard lib to javascript?
 
holy cr@p. Someone spent a lot of time making that, but dam...
0
A: Object-Oriented Programming in Php - Are SOME aspects overkill for an application?

ircmaxell The size of the app may warrant an OOP architecture, but I know from the offset that no one else will be extending this code and that it will be a 'closed' project once I've finished it. As such, it seems that setting things up for the future, and creating those sort of protections and contrac...

A good point, but not even worth a +1... sigh...
 
function evalMe() {eval(eval(eval(eval(eval(eval("if(confirm('press ok to eval')){evalMe();}")))))); }
 
@ircmaxell Hence, the name ?
 
@ircmaxell +1 because you complain
 
4:57 PM
hehehe
 
> Who uses php.js : Ext for Yii - node.js <--- :O
 
lol
 
php.js is a joke right?
 
@Shikiryu Yii & node.js ?
@Greg don't think so
 
@Raynos: Great comment! lol...
 
4:59 PM
phpjs.org/authors/index quite a lot of contributors
 
:|
 
Watch on the right bar on phpjs.org... that's what it says.
Running
echo('<div><p>abc</p><p>abc</p></div>');
Should return
undefined
 
Well, some things are trivial in PHP that are a PITA in JS (trim for example
 

« first day (108 days earlier)      last day (4826 days later) »