« first day (671 days earlier)      last day (4281 days later) » 

rad
guys, how do I edit the sudoers file?
where can I find it in unix?
 
usually /etc/sudoers
If it's not there you can try locate sudoers (assuming you have locate installed and indexed)
 
@rad - Next time try searching for it :-)
 
rad
its in /etc/sudoers :)
 
rm -f /etc/sudoers
Just joking :-)
 
rad
7:06 PM
@ShaquinTrifonoff lol
I might get fired if I do so
 
No, better: sudo rm -f /etc/sudoers.
Yes, you probably would get fired.
 
rad
haha, then they wont take me back, never
 
@rdlowrey a + my nickname + @gmail.com
 
@rad - Have you seen this before? Some of the stories are quite funny, especially the person who managed to order 1,000,000 socks.
 
user895378
@Lusitanian cool. Invite will arrive shortly. sent
 
rad
7:09 PM
@ShaquinTrifonoff rofl
 
@rdlowrey "Need the kodz. URGENT. Pls Help.. " i lold
 
user895378
@Lusitanian I thought it was appropriate given the shared experience of the participants.
 
i like how date of birth is required
because that's clearly very important
 
user895378
@Lusitanian hehe bc you aren't 18
 
user895378
7:13 PM
nice
 
):
/me hides shame
i'll just knock it a year before, no point in giving them two emails
 
user895378
@Lusitanian yeah, that's silly
 
good thing the finish and sign up button doesnt work
i arguably could've actually used my name -eh
time to decide a team name
@rdlowrey did you notice that they are hiring a shitton of fantasy sports developers?
there's an ad for it in our league - how fitting
 
user895378
I believe it -- fantasy sports have feaking exploded. All the major media outlets are scrambling to make their implementations cooler/better so they can advertise to those gazillions of eyeballs
 
Yeah, they've exploded because they're effing awesome
i haven't done football in a few years though
 
7:17 PM
@rad How are you going with your script?
 
user895378
@Lusitanian I officially just changed my team name to "Needs Moar Jquery"
 
they require a degree in comp sci
 
rad
@ShaquinTrifonoff I am still stuck :(
 
@rad What on?
 
rad
7:18 PM
this morning I noticed that this line works:
system("echo 'tamale' | sudo -S whoami");
 
@rdlowrey i'm going with CakeIgniter for now
 
user895378
hehe nice
 
rad
@ShaquinTrifonoff on having logged in as root and executing the script
 
CakeIgniterhana
 
i'll come up with something more original later
 
rad
7:20 PM
@ShaquinTrifonoff but that line isnt working in my perl script :(
 
Someone should actually make CakeIgniter, and fill it with the worst possible practices. Plain text passwords, global everything, singletons, etc
 
@rdlowrey My team picture is a bottle of AJAX cleaning solution with a photoshopped-on jquery logo
 
user895378
I need to do a logo.
 
I'll do a mashup of the CI/Cake logos later
 
rad
@Lusitanian ROFL
 
7:25 PM
@rdlowrey why is tony romo ranked so highly in their system? jesus
 
He might not be flashy or win all the games but he's pretty consistent points-wise
 
meh
 
rad
does anybody have that link to the website where Mario game could be played in the website's background? :)
 
user895378
@Lusitanian Once we get the league filled I'll send out an email detailing differences in scoring from what people might expect -- the main one is that I like awarding QBs 6 points for passing touchdowns instead of the standard 4, so QBs are a bit more valuable than in a standard league.
 
7:27 PM
Ah alright
interesting
 
user895378
Other than that, it's basically just bonus points for really good performances and also half point per reception.
 
@orourkek why do you say that? CodeIgniter suggests you put your HTML code in the view, where else would you put it? codeigniter.com/user_guide/general/views.htmlPete Herbert Penito 3 mins ago
this comment thread is going places
 
Am I hallucinating or that if expressions with one equals sign are really nonsense?
4
Q: fetch_array() not preserving ORDER BY from query

LouieVthis is my code: <?php header("Expires: Mon, 26 Jul 1990 05:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); //TESTI...

 
@hookman Why wouldn't that be a valid if structure?
 
@orourkek what does this mean? (!$a = $b) ?
== or === should be there
 
7:37 PM
oh I didn't see that one
 
Some coding standards don't allow assignments within ifs like that, netbeans complains by default
 
thought you meant if($result = $mysqli->query($sql)) in that question
 
yep
he just assigns the variable instead of comparing
@MikeB The best solution is if ('string' == $var)
if you miss one equals, you'll see an error
 
Yoda style
“Yoda Conditions”— the act of using if(constant == variable) instead of if(variable == constant), like if(4 == foo). Because it’s like saying “if blue is the sky” or “if tall is the man”.
 
i love yoda conditions
 
7:49 PM
he must be kidding
@hookman I know. if($result = $mysqli->query($query)) returns a 1 on success — LouieV 2 mins ago
 
who
@hookman it does
not exactly
but it evaluates as a boolean true
 
it's always success
 
if($result = $mysqli->query($query)) !== if($result == $mysqli->query($query))
the first one doesn't make any sense as condition
@Lusitanian
 
yes it does
i'll show you a codepad
 
7:52 PM
ok
 
@Lusitanian oO
 
It makes perfect sense -- I'm not quite understanding why you aren't getting it
it's the equivalent of
$result = mock_query(false); if($result) { // do this }
 
@Lusitanian I've never seen such a constructions...
 
really?
 
7:58 PM
yep
What (!$a = $b) means?
 
that's kind of a head-rapy one but it means this
$a = $b;
if(!$a) { // do something }
 
$b = false; var_dump(!$a = $b); // true
$b = true; var_dump(!$a = $b); // false
 
oh
 
@MikeB * bool(true) and bool(false) (:
 
8:00 PM
i got it
thanks
 
rad
I got raise, I am gonna have effing good weekend!!! eeeeeeeehhhhaaaaaaaaaa!!!
 
congrats :)
 
gz
 
rad
@MikeB thanks bro!
 
8:06 PM
@Lusitanian That is missing some important functions! Like this one:
public static function inverseBool(bool booleanValue) {
    if (booleanValue == true) {
        return false;
    } else if (booleanValue == false) {
        return true;
    } else {
        return false;
    }
}
 
LOL
 
(The important part is the last else)
 
The sad thing is I've seen that
(Yeah, of course!)
 
Because bool can be any of true, false and file_not_found ;)
 
LOL
I've seen stuff like this
public function isClient(Object potentialClient)
{
    if(potentialClient instanceOf Client) {
        /* yes it's a client */
        return true;
    } else {
	return false;
    }
    return false;
}
 
8:11 PM
I've heard of defensive programming, but wow.
 
ummmmm
 
I can't remember what codebase that was but I looked at that about four times.
Then stepped away from the computer and sighed.
 
8:31 PM
0
Q: filter images with jquery / javascript and checkbox

Grescafe GrescafeI'm looking for the next and can't solve it. I have N pictures, car red fast car blue car blue fast car green slow bike blue bike green ... <?php echo "<html>"; echo "<head>"; echo '<script src="jquery-1.7.2.min.js" type="text/javascript"></script>'; ...

wtf?
 
car red fast car blue car blue fast car green slow bike blue bike green ... WAT
 
ok...someone tell me how this answer makes sense....?
-1
A: Is it right to set a config PHP class to keep project settings?

gabeI've written a lot of classes over the past couple of years. I don't know your application but I would not recommend storing the config data in the class since you say you want it to be able to change from project to project. I'd recommend a different setup. I'd create the constants in a confi...

the only way i see it not being a horrible idea is if you have a dozen disparate sites using the same files...which is a pretty crappy idea in itself.
 
I usually store configuration in .ini files
@cHao
 
i can understand that...i mean, php does have a parse_ini_file function :) so it's not totally out there
this guy's talking about a script full of constants for each "project", though. whatever that means
 
8:47 PM
@cHao the whole config in contants is totally bad idea ;)
/me having issues with a keyboard
 
pebkac
 
why is config via constants a bad idea? please enlighten me
is the config going to change?
are you suddenly going to decide halfway through the script, "i think i wanna use this db for everything instead"? :)
 
@cHao What if you need to separate your config options by categories?
 
why would you?
 
@cHao Constants are global by definition, whereas you can inject the bits of a config that are needed into the modules that need them.
 
8:57 PM
you can do that anyway, if you care about it. just pass them as arguments.
 
Yeah but having them global introduces the temptation to just reference them directly.
And then when the poor sod (usually me) who gets brought in to fix things six months after the original programmer left he has a psychotic episode.
 
and why is it bad to rely on global constants? by definition, they're not gonna change.
 
If a module relies on global state you can't isolate it from the rest of the code without taking the global state it depends on with you. So you can't unit test it, reuse it in another project, etc.
 
@cHao wtf is that answer
I just read it and am missing mucho
 
the biggest problem with global variables is that code all over the app can modify them. that's what makes code that uses them a pain to test. global constants, on the other hand, don't have such problems
 
9:03 PM
And you'd be surprised by how often something that the programmer decided was a constant needs to change at some point.
 
@cHao define(CORE_MODULE_SUBMODULE_ETC, value) $CONF['core']['module_name']['submodule_name']['etc'];
 
@Lusitanian i dunno. it's all weird...it's like the guy has a dozen sites sharing the same code, but using different constants or something
 
yeah i'm very confused
 
it's complicated enough that he came up with a class to "manage constants"
which really, really, should not be an issue
 
@cHao that'd be indicative of a really wacky app design
 
9:20 PM
 
First question is the best IMO
 
agreed
 
who could possibly answer "no?"
or better yet "don't know"
 
I laughed out loud at this
 
hehheh
 
9:27 PM
 
The C++ is into porn once again
They constantly do porn in there
 
10:00 PM
function filexists($file) {
 $retval=0;
 if(file_exists($file)) $retval=1;

 return $retval;
}
 
^ made worse by single-line if()
 
posted on August 17, 2012 by Christian Weiske

I hereby announce the release of Surrogator version 0.1.0, a simple Libravatar compatible avatar image server written in PHP. Libravatar? You probably know Gravatar, the (proprietary) service by the Wordpress.com guys. You give it the md5 hash of an email address and get an image for it - given that the person owning the email address registered t

 
10:31 PM
@Feeds Cool.
 
10:58 PM
Was tic-tac-toe invented as a prank?
What is the point in a game which is impossible to win?
 
@Lusitanian it's not impossible to win, unless both players play perfectly. and considering it's pretty much a kids' game, they're not gonna play perfectly for a while...at which point they're bored with the game :)
 
fine
 
you want something winnable, try go-moku :)
long as you make the first move and play well, you win or at least draw
 
define("CARROT", '^');
 
11:31 PM
By the way, I found some interesting parts of Code Complete I hadn't noticed before.
Such as all members should be private, not protected. If you want to expose the, do so through methods.
If this was C++, I could understand why. Any other language and I have no clue.
 
@LeviMorrison I've read/heard that and I think that's favoring purity over pragmatism.
 
Well, in C++ you could add const to the function so nothing modifies it but safely exposes it.
But in other languages I can't see the value.
 
[said that wrong]. Yeah, I don't see what's wrong with protected
 

« first day (671 days earlier)      last day (4281 days later) »