« first day (1006 days earlier)      last day (3934 days later) » 

12:03 AM
@monners <html> music?
 
@SomeKittens Eh?
 
sitecore?
 
Was in reference to your gif. One step forward, two steps back
i.e., Sitecore
well, pre-MVC Sitecore
 
12:21 AM
Ah. I saw it as something like a genre, "post-sitecore" or something like that
also, genre is the dumbest word to spell.
 
@phenomnomnominal Oh.. My.. God.. Deb just seen him kill....
GOOD THING SEASON 7 IS ALREADY DONE OR THIS WOULD BE A CLIFF HANGER I WOULDNT KNOW WHAT TO DO
 
Hey
 
12:37 AM
@SomeKittens I disagree, bureaucrat is the dumbest word to spell
 
Ooh, good challenge
 
@SomeKittens Are you in a country that writes 'center' or 'centre'?
 
Center. U.S.
 
you guys get pinged for all my game related stuff.
 
12:52 AM
in angularjs ng-repeat the new item always add to the last. Can we add new item from top ?
 
heh interesting @rlemon
 
@Gacnt, yeah, that was the hardest fucking wait of my life
@SomeKittens love me some post-sitecore :P
 
If you like dubstep, check this song out: grooveshark.com/s/Unison+Knife+Party+Remix/49Twl3?src=5
 
1:08 AM
@KendallFrey Niiice
 
anyone want to critique some random code? :P codereview.stackexchange.com/questions/28625/…
 
Use moar semicolons.
 
@KendallFrey meh, I never really saw the point of semicolons
 
0
Q: Waiting until all images are loaded with JavaScript

DoorknobHere is my code for preloading the images for my game: // ===== PRELOADING ===== // // first, make the images array var images = { player: mkimg('images/player.png'), ... // omitted for brevity }, imagesLoaded = true // then, wait until all the images are loaded before starting the game ...

 
GET
 
1:10 AM
oh thanks @Feeds
 
I never really saw the point of automatic semicolon insertion. That's one of the first features of JS I would change.
@Feeds LOOOL
 
@KendallFrey well, it exists, and I take advantage of it :P I don't see any real reason to use them, when they automatically get inserted anyway.
 
When you run into a case where a semicolon is not inserted and it breaks your code, don't say I didn't warn you. It does happen.
Since JS allows labelled breaks, you could continue the outer while loop instead of breaking the inner loop.
That would let you get rid of the flag
 
@KendallFrey I know
@KendallFrey oh okay, I knew there was some way to make that less messy :P thanks
 
I'm too lazy to write up a proper answer for you :P
> I am not using jQuery.
 
1:14 AM
@KendallFrey that's fine :P Thanks for the help in any case :)
 
lol (^_^)=d
 
@rlemon Interesting. Isn't actually as awesome as the title makes it sound. Just a level editor!
I like being kept up to date with the pings!
 
We have some very strong idioms with our internal variable naming. I could really fuck with someone's head. Like calling a variable dbInventory instead of dbCustomers, when it really stores the Customers table.
for (var i = 0; true; i++)
I am almost ashamed. Almost... but not quite.
Actually, I don't need that anymore. :/
 
@Amaan it is still impressive even as a level editor
 
1:31 AM
Hey what's a decent open-source C compiler on Windows? Or at least the least-worst open-source C-compiler on Windows?
 
0
Q: Node.js or V8 as a Platform for High End Local PC Game Development?

Erik  ReppenAs a Web/UI dev rapidly expanding into more wide-open generalist territory, the more I learn about how its done in other languages, the more I love JS for architectural and basic messaging/event-driven concerns. For the record I am most certainly not a full-blown game-dev (although I did once wri...

 
What the... I totally did not time/game that.
 
I think Feeds is sentient.
23 minutes ago it posted a question that had been posted just minutes before.
 
I will be really pissed if somebody thought giving it access to Predator drones was a good idea.
I'm already pissed about giving Obama access to predator drones.
 
@ErikReppen Does gcc work on Windows? I think it should.
 
1:34 AM
Didn't occur to me. I assumed Unix/Linux but I'll check it out.
 
If it doesn't, get cygwin :)
I'm 95% certain it will though.
 
I need to pony up for a bigger SSD. It's made me too conservative about partitioning drive space for another OS (and no I don't wanna dual boot - I'm old and curmudgeonly and it's just not right).
Ha ha, thank you for that: stackoverflow.com/questions/6394755/…
Also I didn't think to use cygwin. That might be laziest/easiest.
 
1:53 AM
Refactoring challenge: get me a Date object set to one year from now in one statement/line better than new Date(new Date().setYear(new Date().getFullYear() + 1))
 
@SomeKittens new Date(new Date() * 1 + 31536000000)
actually, new Date(new Date() * 365 * 24 * 60 * 60 * 1000) @somekittens
 
Sounds good
 
Tried setting up XAMPP/WAMP, but failed miserably.
 
2:13 AM
643
Q: Can we have the ability to rescind a close vote before it closes?

cletusSometimes you vote to close something and the OP then changes it to fix the issue or issues. You can't take a close vote back though. It would be nice if you could. With the new Duplicate close changes and the review queues, it's even more important to be able to remove accidental or erroneous...

How did I just notice this? :D
 
@Doorknob Leap year?
 
@Dennis what is?
 
You're hardcoding 365 so it'll be off by one day every 4 years
 
new Date(new Date() * 365.25 * 24 * 60 * 60 * 1000) :P
 
and you're doing too much multiplication
winding up with new Date(4.333406302092888e+22)
 
2:26 AM
new Date(Date.now() + 3.154e7)
 
Hmm... Windows Updates just installed a service pack.. which nullifies RemoveWAT :(
 
@SomeKittens new Date(Date().replace(/\d{4}, function(year){ return ++year;}))
 
goodnight everyone
btw, you guys are the rudest bastards in the world
36
 
2:41 AM
@bushdiver Does that mean you like us :)
 
new Date(Date().replace(/\d{4}/, function(year){ return ++year;})) actually, since the browser whines when you don't terminate your regex literals
 
@Loktar I'm stalking you on twitch.tv :)
 
3:00 AM
@Dennis This is all in node
 
Hi. I want to move the selected checkbox item to textarea. Can anyone tell me how can i do it with js? The selected item are just numbers..
 
@user1939393 You take the value of checkbox stuff and get string value of textarea
 
@user1939393 Have you tried breaking the problem down into smaller parts?
 
then append the checkbox value to the textarea string value then set this value again into textarea
 
Node will want you to terminate your regex literals too
I was just pointing out a typo I had in the original message
 
3:03 AM
Yeah, that looks like the best solution. Friggin' leap years.
 
can novice programmers feed their family?
 
the numbers are shown dynamically
so i didnt set value forthem
@O0oO0oOO0ooO
 
test
 
It'll break in about 8000 years, but if you are looking for a simple one-liner, it'll work
 
@Dennis Oh darn. Guess I'll be fired in 8000 years then.
 
3:07 AM
@BenjaminGruenbaum: I just wanted to let you know that I took your earlier advice to heart.
I replaced Linux with Windows on the MacBook.
Thank you.
 
Actually, Kleene star: /\d{4}\d*/ - grab a number that is at least 4 digits long. You're all set
 
/\d{4,}/?
 
@minitech or someone who's better at regex than I am
 
Let the novice programmers' families eat CakePHP.
 
3:23 AM
So what's up?!
 
Trying to remember wtf CakePHP was good for and whether it still is atm.
 
Uhm...ok...?
 
Bad pun -> voyage of discovery/re-discovery!
I dunno, I've basically decided after 6 years of random codebases that I don't ever want to look at one written in Java and/or C# ever again. nothing against the languages. It's what mediocre devs do with them that make me crazy and sadly there's a lot of mediocre devs on those fronts.
 
@minitech You're welcome and remember. Microsoft is always better :P
 
In JS you're either useless, competent or good. There is no competent-enough gray area.
 
3:33 AM
jQuery?
 
I'll allow for competent enough to plug in a very simple plug-in on a disposable throwaway site for an interactive firm with jQuery.
Until some dumb twit actually wants to tweak something of course. Then they discover what they aren't paying for.
 
in Lounge<C++>, 1 min ago, by Ash Ketchum
Are consumers really stupid and is Apple's decision to focus on user-friendly products instead of usability products actually correct?
 
Yes. But not for users like us. Which is why I hate apple.
 
3:48 AM
I like Apple products but dislike Apple.
 
(cough apple sucks cough)
(cough sony sucks too cough)
 
The only reason I don't dislike Apple is because of Steve Jobs.
 
(cough RIP steve jobs cough)
 
What about him? he was a manipulator. he pushed his employees too hard. he did no work himself.
 
True story. The day Steve Jobs died, I saw Apple people putting their last messages to Steve via stick-it notes on the windows of the Apple Store in downtown Chicago.
Their might be a brand-loyalty problem there. Just maybe.
 
3:53 AM
Steve jobs fans: suck this
 
Loved the Lombard though. Everything since has been overpriced crap in a pretty box. The OS is slightly superior but really all OSes suck. They really do. At least Linux is free and can delete a gig or twenty in less than a minute.
 
@CCInc Ok, but that's ignoring the point. Its like saying whatever Jobs accomplished has no value.
 
Which it did. Have no value, that is.
> he was a manipulator. he pushed his employees too hard. he did no work himself.
 
Everything has a root and with that logic, no one should be accredited for anything.
Bill Gates is credited for Windows, but he didn't actually develop the technologies that power Windows, so he doesn't deserve any recognition. Zuckerberg shouldn't get credit for Facebook because he wrote Facebook in PHP and without PHP, there is no facebook.
 
The difference is, Bill Gates actually WROTE THE CODE
 
3:58 AM
Didn't Jobs make NeXT?
 
!!/google NeXT
you suck bot
 
LOL!
 
LOL
!!!
 
Jobs did some impressive shit. He had good market instincts. Much better than Xerox obviously. But still a total douchebag who shat on his employees and stole from his friends. And more of a business idol than a tech champion IMO.
 
You know what's funny? Apple sued Jobs and his company NeXT for some inside information he had known from Apple.
 
4:01 AM
Jobs deserves everything because he invented smartphones
and chinese people worship jobs and apple
 
You know what's even more funny? Jobs dissed them: "It is hard to think that a $2 billion company with 4,300-plus people couldn't compete with six people in blue jeans."
 
The second you even try to tell me that I have to pay you to change my battery however, you're on my shit-list for at least a decade.
 
Imagine if Twitter said "Listeners and Listening" instead of "Followers and Following," how would you react?
 
@AshKetchum "oh"
 
@O0oO0oOO0ooO ?
 
4:05 AM
I would react to it like "oh"
 
Is that good or bad?
 
I don't know
I think it's netural
 
Like, "Oh, nice?" or like, "Oh, that's messed up!"
 
yeah, whatever! =D... heh
 
And he's the guy we can thank for having to work with Objective C when somebody convinced some asshat client there's no substitute for writing their Apple, Android, and WinPhone apps separately.
 
4:06 AM
screw them all. I don't need twitters account because I have 0 friends =(...
 
is there a way to send a pointer into a function so if the value changes for that variable else where the function will also have the new value ?
 
Attach a property directly to the function and it will be persistent.
 
well i send this to it:

my_function(myobject.the_value );
a time out is used on my_function so it calls every 2 seconds
 
@Dave what? just say

function(){
var yourValue = 12;
}
 
now if i change the the_value else where
 
4:10 AM
e.g. function incrementer(){ return incrementer.i++; } incrementer.i = 0;
 
its still holding the old value of it in side the my_function
ill make a SO question so i can write it out better
 
function logValue(){ console.log(logValue.value); }
logValue.value = 0;
logValue(); //0
logValue.value = 1;
logValue(); //1
 
the object is never called in the function
its passed to it
 
@ErikReppen I haven't seen that technique in years
 
but then from then on its self contained due to time out calling itself
 
4:18 AM
@Dave what's the timeout look like?
 
Is there any significant performance difference between using a 'switch' comparison versus an if/else if/else chain?
 
@JanDvorak I'd favor an object with an internal var but sometimes I find that handy.
 
function upgrade_bar(bar,percentage) {
console.log(percentage);

	bar._timer = setTimeout(function () {
            upgrade_bar(bar,percentage)
        }, 10000);
}
its called like this:

upgrade_bar(div,myObject.percentage);
once its inside that function if i change myObject.percentage its not changed in the function
 
there might be an extra boost if the switch cases are compile-time constants
(as in, it'll be much faster)
 
How would you explain the difference between nonincreasing and nondecreasing order?
 
4:21 AM
patterned order
 
@JanDvorak So there's no potential downside to using a switch (appropriately, of course) over an 'if' chain then?
 
*shrugs
 
can you give me an example?
 
1, 2, 3, 4, 5 (non-decreasing)
5, 4, 3, 2, 1, (non-increasing) :P
 
for every 1 + do the next one as - 1
so it be like 0 1 -1 2 -2 3 -3
 
4:22 AM
@monners sometimes an if chain is more readable, but if the cases are constants, use a switch
 
thats a pattern its not really up or down or its both
 
@monners I wouldn't use a switch where reordering the cases might matter
 
so basically non-decreasing means every next element isn't less then previous, and increasing means every next element is greater then previous
 
hmm
depends
is A < B
that would be increasing but their not numbers
 
4:24 AM
@monners where the implicit assumption that at most one case always applies fails, I'd stick to an if chain
 
@Dave move bar_timer = setTimeout outside of the upgrade_bar definition.
 
but its meant to be calling over and over
only time it ends is when bar is removed from the dom
 
@JanDvorak So a switch should pretty much just be used for range evaluation or set value comparisons?
 
Oh right. Move out and switch to setInterval. Sorry.
 
not bad.
 
4:28 AM
Bar and percentage are locked inside the closure. They should be referenced from an outer scope.
 
yeh thats what i want to do is send a reference of it rather than the value
 
@monners or regexes (but they shouldn't be order-dependent (too much))
 
also not bad
!!/urban pineapples
:(
@Zirak...
 
you brokedededed it
 
So try barObj = { bar:<value>, percentage:<value> } and pass that in. Objects are passed as pointer values.
But you may still have a closure issue. I'm rusty. !@#%ing Java and C#.
 
m59
4:39 AM
I just got to an interesting bit of my cms... I'm loading my plugins via ajax, so...I'm now in my php file with something like:
{
  "plugin" : "nameHere",
  "options" : {
    "sampleOption" : "sample value"
  }
}

Now I need to load the specified plugin with those options....but I can't figure out what that actually will look like.
 
@Dave this works:

function upgrade_bar(bar) {
console.log(bar);

bar._timer = setTimeout(function () {
upgrade_bar(barObj.bar++)
}, 1000);
}

var barObj = { bar:0 }
upgrade_bar(barObj);
Also I may have misrepresented as a closure issue earlier.
Objects are passed by reference. Well, technically by value but the value is a pointer basically.
 
i understand
 
@m59 nothing on the client-side web should ever load plug-ins with Ajax. That's retarded. Stop using it. Manage dependencies by placing script tags in the right order. Anything you don't need on a page was already cached the first time you loaded it. And don't even mention Drupal. I might get violent.
... and hurt myself of course. Since I'm at home alone and have no power to reach across the internet and slap the authors of Drupal.
 
m59
@ErikReppen I don't see how anything you said applies...
can you explain what you want me to do?
The user sets the options in the admin panel and assigns the plugin with those options to a place on the page
When you go to some page, that page is looked up in the db, and the page information is sent to js
js then takes it (via angular directives) and builds the page.
I don't know a lot about Drupal, a little more about WordPress, and a ton about Joomla. I feel like I beat the pants off of Joomla. @ErikReppen
I'm open to suggestions on how it could be done better.
 
4:58 AM
What do you mean by plug-in? A widget getting plopped into the HTML somewhere or a script file dependency that should never be loaded via ajax because to do so would reveal a stunning ignorance of how browsers actually handle loading pages on the web?
 
m59
I still don't get what you mean by the second statement there. Nonetheless, my plugins are basically their own little world.
If not for the options, an html file would suffice. It would have the scripts included
I use angular, so the scripts are controllers, the html file is the view and the options are the model
I think I'm going to have to take the wordpress solution and have my php file create a script tag with the options json and append it to the beginning of the plugin
 
I know little about Angular, but my impression is that the model is a larger frame you plug those options into and it handles the rest.
Everything that uses the options should be loaded already.
 
m59
I don't think we understand each other at all haha
it happens.
 
5:14 AM
@m59 when people say "plug-in" on the client-side web I'm thinking they mean "Dependency-Management" wherein they load in a script file containing everything needed to create desired behavior on a given page via ajax when some neat-o dependency management system tells them what kind of page they're on. There's rarely any good reason not to load that dependency via a script tag in the HTML.
You know what page(s) you're writing the HTML for so why throw resources out the window on a system that figures it out for your later and then actually loads something in every single time that could have been loaded once and forever cached when loaded as a script tag?
I don't know if that's your exact situation there as people I like, like Angular, but I suspect the MV? frameworks are a complete waste of time based on what I've seen of them so far.
 
m59
Do you mean, maybe just return the options from the server and have my angular stuff load the script and html?
it has to be dynamically loaded one way or another. There wouldn't be any point of having a cms if it was all static.
 
I mean serve your pages with every JS resource needed before we even start thinking about Angular or some CMS. If the CMS has a system where you add things to a page and it sticks the needed script tags into the HTML that will be there when you load that page as an end-user, then sure, that makes sense. If it's loading in script files via ajax, that's almost always really stupid.
But I don't know what you're using and haven't used it so can't solve your more immediate problem of how to make whatever it is work the way you want it to.
 
m59
you just said the exact thing I described makes sense, lol
but wait, the only way to do that thing without loading scripts via ajax is to jumble my html, php, and js.
html can't dynamically load anything, so js is the only option. My server-side is informative only.
 
You don't need to dynamically load. Why don't you know what's going to be on your pages before you load them? And even if you sometimes have script files linked on pages where you don't need them it costs you nothing if they've loaded on any other page once before.
When you load with ajax it costs every time.
Ick. Or it can actually. You can cache with Ajax. Ignore me. I'm a ranting loon.
 
m59
lol, what's confusing me...how in the world could I know what belongs on the page before I load it?
 
5:26 AM
Are you doing 100% client-side templating?
 
m59
yep
100% separation of concerns and only 1 accessible php file
 
That explains a lot of the confusion.
 
m59
that php file serves my rest api, but also returns a page's information if I ask
if you post plugin info to it, it will make a plugin, so those could even be accessed from the api. Crazy stuff =D
 
Okay, so what I've seen of angular model files is more than just some options objects. There's data-binding and references to actual things on the page that make it possible for angular to auto-stick your widgets in the right spots. Where is that?
 
m59
the model is the server
js is the controller
My plugins are actually data-bound to the template, as I currently have it.
If at some point after everything is loaded, I changed the value of something like content.header, the header content would change (I could load different plugins, etc)
 
5:44 AM
Yeah, I've been reading up on it more. Not sure what problems the approach solves for me.
For instance, you have options. You have no idea where in this monolithic apparatus it makes sense to put them.
 
m59
now that I've been thinking on it, it's reasonable that I could load the plugin right from angular and leave the server out of it.
That's not an angular problem, lol. That's just that I'm avoiding the server-side language like the plague =D
angular is awesome for the 2 way data-binding and dom manipulation
It reduces code size by like 75% on average and the readability is amazing.
I guess those two go hand in hand lol
 
I was already burying the DOM for implementing widgets and binding events to data changes I guess. It reminds me too much of all the old thin-client server-side models where they just stuck this huge layer on top of how everything worked and then basically duplicated the layer underneath it. Verdict's still out on Angular but Knockout in particular is really bad that way IMO.
But I do agree that you shouldn't be muddling with DOM stuff at the highest levels of your code.
I guess I just don't 100% trust Google with JavaScript as awesome as V8 is.
Way too many attempts to make everything work and act a lot more like Java.
 
6:00 AM
IE8....
 
I'm sorry...?
 
user1596138
!!use $400 for a laptop or \ use $400 to fix my motorcycle
 
@Jhawinsss use $400 for a laptop
@Jhawinsss \ use $400 to fix my motorcycle
 
user1596138
So do both.
 
user1596138
Because this is a quantum $400 we are talking about, I will use it for two things at the same time.
 
6:13 AM
Morning Folks!
I have a style css property-
.someting
{
background:url('./some/path/icon.png') 0px 0px no-repeat;
}
I want to achieve the same via jquery
 
user1596138
Alright
 
i tried-
 
@O0oO0oOO0ooO That didn't make much sense. Maybe you meant: user
 
jQuery(".something").css('background', 'url(./some/path/icon.png) 0px 0px no-repeat');
but not working
what might be the reason
 
6:17 AM
@udaysagar Are you trying to move up one directory by using './' ?
 
nope
that's present directory
 
Then lose the '.'
 
user1596138
@udaysagar Open the inspector and see if the properties are actually on .something
 
ok, i give a try
 
90% sure it's a problem with your url path
 
6:18 AM
ok @Jhawinsss
 
user1596138
@monners Not if it's working as part of a stylesheet.
 
@Jhawinsss What do you mean by that?
It's js, it's an in-line style insertion, it has nothing to do with the stylesheets
 
user1596138
If it works when he puts it in a stylesheet (within <style> tags) then it can't be the path.
 
Unless you're compiling .less on the client-side that is
 
user1596138
6 mins ago, by uday sagar
.someting
{
background:url('./some/path/icon.png') 0px 0px no-repeat;
}
 
6:21 AM
dropping . in ./ isn't working guys
 
Ah, I missed that part of the convo
 
user1596138
He put it in a stylesheet here.
 
user1596138
It's all good.
 
user1596138
@udaysagar You're gonna have to make a fiddle of it.
 
ok, i give you fiddle
 
6:22 AM
Just a hunch, but try using 'src' rather than 'url'
or using the full path of the asset in the url, i.e., 'http://www.whereever.com/resources/imgs' instead of '/resources/imgs'
 
user1596138
^^ Definitely try the full path.
 
src isn't working @monners
i should not use full path as my app is portable..
 
user1596138
It's url()
 
user1596138
For the sake of debugging try it.
 
you mean drop the single quotes inside?
i did it already
can i use local images in fiddle?
 
user1596138
6:27 AM
!!bananas
 
user1596138
I need to go to bed. Good luck.
 
no9
good morning
0
Q: Adding a simple confirm/cancel dialog in jQuery 1.4.2

no9I have put a clickable span into every list item and it works fine. For the moment it invokes a simple alert. Now I would like to add a simple cancel/confirm dialog. Each selection should call a function. Here is my code (note the alert where the span click invokes): <%@ Reference Control="~/K...

 
@no9 wth are you using jQuery 1.4.2?
 
no9
if someone feels like explaining why cant i get dialog to work ....
@BenjaminGruenbaum its a fetish
hehe u know how it is to get a very old project to work with ....
I have proposed my boss to invest in developing new version of program, but you probably get an idea what kind of answer I got ...
"why, it works fine"
 
6:47 AM
@Jhawinsss @monners This is working-
jQuery(".something").css("background-image", "url('./some/path/icon.png')");
 
lol
0
Q: Negtive reputation of users in review audits

Benjamin GruenbaumI was reviewing posts today and got the following post to review: Note how the user has negative reputation. If I may add "seems legit".

 

« first day (1006 days earlier)      last day (3934 days later) »