« first day (914 days earlier)      last day (4259 days later) » 

15:02
Ok, so they're not equal (it'd be 0 if they were equal). If you echo out each individual character's ordinal value ( ord($c) ), do they match?
@Chris one sec.
@ircm string '_default' (length=11)

string '_default' (length=8)
this too confirms they're not the same
@Ariane yup
now, you can encode the string in hex to see the raw values... bin2hex()
@ircmaxell I see it's very different but I can't make sense of it.
paste the result here
efbbbf5f64656661756c74
5f64656661756c74

Whatever it means, those are the two supposedly identical strings. @irc
15:17
The byte order mark (BOM) is a Unicode character used to signal the endianness (byte order) of a text file or stream. It is encoded at . BOM use is optional, and, if used, should appear at the start of the text stream. Beyond its specific use as a byte-order indicator, the BOM character may also indicate which of the several Unicode representations the text is encoded in. Because Unicode can be encoded as 16-bit or 32-bit integers, a computer receiving these encodings from arbitrary sources needs to know which byte order the integers are encoded in. The BOM gives the producer of the text a...
change your editor to not save with a BOM...
uhm, okay.
I HAVE UNCOVERED A SECRET!!!
@irc It didn't seem to change anything when I removed the option and saved the file again.
@ircmaxell YOU are NOT Anthony Ferrara. It's quite obvious from your nickname ircmaxell which clearly spells: "I are C. Max L."
15:20
@Ariane you may need to either recreate the file, or remove the BOM by hand
it likely won't strip one that's already there
@irc Never mind, I'm silly. Changing the parameters of the PHP file won't do anything to change the TXT file I get the info fron.
@ircmaxell now I only need to find out what the C and L stands for
MGE
MGE
how to convert 0,1553 to 15 ?
or 0,84394 to 84
@irc Thanks .
@Gordon I Really Care at the Maximum about Losers?
@Gordon Good luck!
@ircmaxell thank you
@Gordon Cheetah and Leopard.
@DaveRandom try again
15:29
I'm trying to set up a cron job for the first time, this is the job/code I used, it's not working, any thoughts as to what I'm doing wrong?
*/1 * * * * /usr/local/bin/php home/webapps/php3/app3/cron_test.php
Chicken and Lickin'?
@irc Is this the right way to set $thisItem to the last file (in the alphabetical order) of folder /_default ?
$defaultStyleDir=opendir('styles/custom/_default');
while($thisItem=readdir($defaultStyleDir)) { }
closedir($defaultStyleDir);
no, because it will be false at the end
@elong Your link broke.
sorry, I don't know what that means (link broke)
15:31
@irc Ooooh.
@elong You visibly put a link to your file, but it's full of asterisks so no one can get to it.
@irc What would be another simple way?
sorry not a link, that is the cron Job
*/1 * * * * /usr/local/bin/php home/webapps/php3/app3/cron_test.php
@elong then someone else has to help because I don't know anything about that :p
ok, thanks for the try
You could change the loop to: while($tmp = readdir($defaultStyleDir)) { $thisItem=$tmp; }
but depending on order is not something I would recommend
@irc Actually I found better.

$all_files = scandir("/my/path",1);
$last_files = $all_files[0];
Whoops the pasting went wrong
@irc re-never mind. This requires the installation of an extension.
But why don't you recommend depending on order?
Does PHP sometimes not use the same file ordering?
15:36
order is no something you can rely upon...
@irc It's a folder that's going to be filled with only files like 1.css, 2.css, etc., the versions of the theme. Am I doing it wrong?
it depends on the underlying filesystem
for example: ext3 is ordered not by name, but by inode number IIRC. which is unpredictable (but deterministic)
Uhm, okay. I'll do it the complicated way then.
No, just use scandir
array scandir ( string $directory [, int $sorting_order = SCANDIR_SORT_ASCENDING [, resource $context ]] )
BUT, beware that it may not be what you want, since 15.css will be < 9.css...
15:46
@irc Yeah I'll be doing it with if's. I'd like to know, will PHP properly compare two strings containing numbers or do I need to convert the strings?
@DaveRandom Cesare Leopoldi
since he's italian
@Gordon closer, but still not
@Ariane sort() can understand the difference, if you tell it to
I know this isn't a CSS room, but does someone know a way to put the footer at the end of the page, BUT if the page is too short to fill an entire screen and push it to the bottom, put it at the bottom of the screen?
<h1>User Management</h1>
<p>&nbsp;</p>
<?php
$host="localhost"; // Host name
$username="root"; // Mysql username
$password=""; // Mysql password
$db_name="tester"; // Changed database name
$tbl_name="test_mysql";
mysql_connect($host, $username, $password)or die("cannot connect");
mysql_select_db($db_name)or die("cannot select DB");
$sql="SELECT * FROM $tbl_name";
$result=mysql_query($sql);
$count=mysql_num_rows($result);
?>
<table width="400" border="0" cellspacing="1" cellpadding="0">
<tr><td><form name="form1" method="post" action="">
(see full text)
i have above code , i want a help on same
@Ariane try to use div while defining footer
WordPress is not being targeted because it's the most popular, it's because their login system is as water-tight as a tea-strainer.
15:52
@irc I meant in an if. Like uhm.

$variableA='1';
$variableB='6';

if($variableA>$variableB) //will this comparison be done properly?
@Pavan What do you mean?
@Ariane its called as a sticky footer , try google you would get loads of links for this
@Pavan Thank you.
Welcome :)
@PavanGjakati did you just spam a wall of unformatted spaghetti code with no mention what the problem is and demanded us to help you. did I get that right? no offense. just curious.
not really Gordon . I am not sure of it . I have been reviewing lots of posts
15:55
0
Q: Few questions about OOP (PHP)

user2286576I am very new to OOP, Actually I am not at all, I haven't even tried anything better than echoing an object in OO. I have a few questions regarding OOP in PHP. 1. Do I have to have a great background of knowledge in PHP before starting using OO in PHP? By 'great background of knowledge' I mean,...

@PavanGjakati ah ok. must be my poor perception then
:)
do i have anybody helping me for my queries ?
@Ariane sometimes
I just found out one of my coworkers didn't watch the Simpsons. Anyone hiring?
16:10
LOL
sometimes (like today) i feel that my coworkers were hired just based on that criteria
I think I might hire based on the opposite criteria.
morning ....
Part of me wants to open a bounty because I like this answer:
5
A: Is this a good hashing password function in PHP? If not, why?

Rixhers AjaziQuick answer: Use bcrypt (when it is ready) or password_compat library from ircmaxell - it's a bcrypt library. Long answer: This is too complex and outdated for current technology. Md5 should be avoided and just salting isn't good enough. Use bcrypt and save yourself the headache. You migh...

16:42
@ircmaxell Go for it. It;s not like you will loose your delv powers because of it :P
why on earth does an answerer have 8 upvotes on this?
@Hiroto Because he answered something obvious and those are upvotes of approval?
80 rep for pointing out a typo on a TL question with that much rep in the first place (which should really point out that he's interested in SO's quality, I hope) is just...
no. you should comment then delete shopping questions from a new account with a made up name like testing321 which shows no research effort and is a typo question
@Hiroto I didn't say it was good. I just gave an explanation.
@PeeHaa埽 once it's eligable, I will
Hello can anyone give me an idea about MVC
@MuadhProgrammer ask and find out
@MikeB I am asking about Model view control
How to start to understand and using this concept
@MuadhProgrammer Go through @tereško's top posts: stackoverflow.com/users/727208/teresko
i am about 5 breaths away from braining my "coworker" with tire iron
17:24
25
A: in MVC, where do you draw the line between a controller and model?

GordonThe line between controller and model is actually quite clear. Model is your application's heart. It contains the business/domain logic required to solve the problem your application was written for. The Model is usually layered into several other layers, e.g. persistence, services, domain, etc....

@MuadhProgrammer Basically, it's a way to separate the three main parts (tiers) of your application: The Controller handles the requests, as well as processing user input (POST and GET), the Model handles the "heavy" business logic, and the View handles the output for the user (i.e. the pages the user see)
/ducks
@Pheagey Ummm.. No.
@Pheagey thanks :)
You should delete that before I move it to the trash myself (wrong and misleading, sorry)
:P
17:26
done
@ircmaxell huh wtf? how is md5 not broken for password hashing in the way I mean it?
Did I miss another memo?
Thanks for all , What tools can I used in MVC?
@MuadhProgrammer MVC is a design pattern. You don't use tools in it. You implement it somehow.
@MuadhProgrammer What do you mean by "Tools"?
17:29
@MuadhProgrammer Frameworks that follow mvc commonly ship with code generators or scaffolding
Or do you have a relaxter stance on broken :P
@MadaraUchiha I keep trying to close that window ><
@PeeHaa埽 meaning that MD5 is "broken" refers to the preimage and collision attacks it's vulnerable to
both of which require knowing the source text to attack
@MikeB Clicking anywhere outside of it should close it.
yeah. broken :)
17:30
If not there's an (X) button
I replied to that commetn
@nacin @SandyS1 For the short term, I agree 100%, but if you *never* break BC, you never can clean up from mistakes. Never cleaning == dirty
@MadaraUchiha I mean Tools used to building the software in easiest way
@MuadhProgrammer MVC is a design pattern, it doesn't have tools
@MadaraUchiha No, I mean I keep (mindlessly) clicking the (X) on your image expecting it to close - instead it pops the image open in a new tab
17:32
wb
@ircmaxell might as well cc @internals :P
@MuadhProgrammer brain is said to help. and text editors.
@MikeB Oh lol
@PeeHaa埽 internals gets it. Register globals was removed...
@MadaraUchiha can we design tow view and depending on if condition call on on screen with MVC ? Please ,
17:34
@ircmaxell :-)
user895378
gratz @DaveRandom :)
user895378
Yup. @NikiC has ~4k rep in upvotes from that one answer
Also gratz @NikiC but everbody already knows you're our wonderkid. @DaveRandom on the other hand ;)
user895378
17:36
Pretty legit.
@rdlowrey upvoted now!
@MuadhProgrammer no offense, but you said you want to understand the concept. so how about you start reading the links we gave you and then come back with questions that make more sense in the MVC context. Right now you get across somewhat help vampirish.
user895378
@ircmaxell Really? I didn't know rep-cap worked that way :( I thought it was only a per-day limit.
it is
but most of those upvotes prob came in mass
17:39
@rdlowrey I plan on finding out one of these days :p
@Gordon Thank U very much , I will reading and building some simple project Thanks
user895378
Yeah, I think I've only hit the daily rep-cap like three times
I've lost over 1640 rep due to rep-cap
DOWN WITH THE REP CAP!
17:41
repcap is useful.
It's such a stupid "feature"
@Gordon lulz
@lester PHP 3 was not ugly in my opinion. PHP 5 is ugly in my opinion, the reason being I don't believe OOP was implemented properly. — xaav Jun 6 '11 at 22:36
@xaav Aren't they fixing OOP implementation in PHP 6 though? — blissfreak Nov 19 '11 at 20:47
hehehehe
@ircmaxell How did you calculate that? Is it possible to find out Jon Skeet's missed rep?
Wanna see how to drive an idiot insane?
17:44
@MikeB stackoverflow.com/reputation
and then did a search for [0]
@ircmaxell php6 hahahaha.... no one uses php6 now that PHP7 is available
@MikeB I think it's more than his actual reputation
rep cap was reached via rep from upvotes only on 1 days
D:
@Gordon you germans...
days represented 965
rep cap was reached via rep from upvotes *only* on 39 days
earned at least 200 reputation on 48 days
earned 0 reputation from suggested edits
@MadaraUchiha LOL, I actually put on headphones before I clicked it... Well played good sir
17:45
@ircmaxell =)
I still suck :(
days represented 769
rep cap was reached via rep from upvotes *only* on 15 days
earned at least 200 reputation on 22 days
earned 22 reputation from suggested edits
I backed this guy today: kickstarter.com/projects/clintgc/…
@ircmaxell @SandyS1 It's very dirty! But it is also very worth it. Just requires us to be more clever and careful.
@MadaraUchiha that's awesome
@ircmaxell :D I know
@nacin @ircmaxell @SandyS1 Or simply incredibly good at jumping around avoiding crap :P Seriously?
17:49
@ircmaxell get that guy's internet license!
Oh, xorg update?
will it crash my pc?
/me rolls a dice
@Ocramius onward guinea-pig! report back your progress :p
days represented 1212
rep cap was reached via rep from upvotes *only* on 74 days
earned at least 200 reputation on 107 days
205 occurences of [0] on the page so I guess that 2050 rep then
@crypticツ good evening kittycat
whoa you scared my dogs with the ping =oP Forgot didn't have earphones in. I'm busy babysitting my sister's bf's chocolate lab puppy. She is such a handful =o(
The cat beat her up >.<
18:00
@ircmaxell @SandyS1 Meanwhile, WordPress powers 17% of the web. Not a coincidence.
@nacin @SandyS1 I wonder what percentage of server compromises it accounts for :-X (J/K, didn't mean to turn into a bashing)
OMG please let him stop. Or I will send an invoice to the idiot for all my wasted time fixing customers sites and servers
Actually. I should do it either way
Ow wait... gpl :(
@ircmaxell
@SandyS1 windows powers 90%+ of pcs ;) http://en.wikipedia.org/wiki/Usage_share_of_operating_systems (ok, will stop with this one). Would you use it because of that?
bah bah, cc-ed wrong user
Hey that's @Lusitanian
18:15
@ircmaxell For someone with "Software Security" in their bio, that's a mighty irresponsible statement, no matter how much you are kidding?
user895378
You lose all my respect the moment I read "WordPress Lead Developer" in your twitter profile.
user895378
WordPress does nothing but provide ammunition for people who say "PHP sucks."
user895378
What a god-awful spaghetti abomination.
@PeeHaa埽 another chat pet peeve. Mine is more serious, lives may be at stake =oP
Neh I can live with that one. Mostly because I don't think it has even happened to me :D
18:22
@PeeHaa埽 yeah, bad things only happen to me =o(
@crypticツ Never seen it happen
New users always join the first line for me
Yes. Finally! I've had it for today. youtube.com/watch?v=MTc3zcnIZOw
@Eugene oh cool.
@nacin What's irresponsible is the fact that this branch of code even exists: https://github.com/WordPress/WordPress/blob/master/wp-includes/wp-db.php#L883
user895378
Question: in an HTTP static file server should the default content type be text/plain or text/html?
@rdlowrey text/plain is safest
@nacin What's irresponsible is calling $db->escape() calls ADDSLASHES in all cases: https://github.com/WordPress/WordPress/blob/master/wp-includes/wp-db.php#L916 In 2013. That's BAD...
The browser won't interpret or parse anything in the file, just display it as it is
@rdlowrey text/plain definitely
user895378
18:34
K, thanks for the input guys.
hello :)
user895378
Does PHP set a content-type header automatically for you or does it just let the webserver handle it with its default?
pce
pce
Should i install MariaDB (drop in mysql replacement) or Oracles MySQL Server for a new symfony project? Any Recommendations?
@DaveRandom Here is another way to kill kittens, if you haven't already read it...
pce
pce
@rdlowrey the php-cgi binary set content type to text/html
18:38
@rdlowrey text/plain; charset=us-ascii
@pce install whatever you feel more confident with
@ircmaxell You don't try to argue with Nacin, don't you?
@pce postgres :P
pce
pce
@Jocelyn ok, i'll try mariadb
@pce hi @pce! You can take maria.
@pce: Or if you like the fun: cubrid
user895378
18:40
Everyone is advocating text/plain but it's very obvious that's not what happens in PHP because HTML content "just works" without explicitly sending Content-Type: text/html; charset=utf-8 ...
user895378
I'm not 100% sold that the default in a server shouldn't be text/html (with the appropriate charset, of course) ...
@rdlowrey The browser automatically assumes text/html without a header given, I believe.
@rdlowrey: I'll check some HTML/HTTP docs for you.
@hakre No, I try to show reason in false points...
user895378
@MadaraUchiha Hmm ... maybe that's where my disconnect is.
pce
pce
18:43
@rdlowrey execute php-cgi from the commandline and you see which headers it sends (true for fcgi).
Any HTTP/1.1 message containing an entity-body SHOULD include a Content-Type header field defining the media type of that body. If and only if the media type is not given by a Content-Type field, the recipient MAY attempt to guess the media type via inspection of its content and/or the name extension(s) of the URI used to identify the resource. If the media type remains unknown, the recipient SHOULD treat it as type "application/octet-stream".
@rdlowrey I mean, if the server doesn't send a header whatsoever, the decision is for the browser to make.
@ircmaxell I don't fully grasp this english sentence.
Is Content-type a header that must be sent by an HTTP server?
@MadaraUchiha No, SHOULD. If not send the recipient SHOULD treat it as type "application/octet-stream".
user895378
<?php echo "Hello world"; ?>
@ircmaxell We *do* prepare. ext/mysql or not is irrelevant here.
user895378
^ I get Content-Type:text/html; charset=UTF-8 with that.
that's just BAD
@rdlowrey are you sure that's the web server?
18:45
@ircmaxell Yeah, that is the biggest fun. Let me pick the official blog-post.
grab yourself some popcorn: make.wordpress.org/core/2012/12/12/…
user895378
Okay, let me start over. I don't care what other servers do. In my server that I have written I automatically assign a content-type to outbound responses if they don't have one assigned.
@rdlowrey to do that per the HTTP specs you must know the content-type for the response body.
user895378
@hakre Show me that quote.
user895378
Because 99.9% of php scripts aren't specifying a content-type header and yet a Content-Type: text/html is still being sent.
user895378
For static files it's determined from the extension (the same way nginx does it FWIW).
user895378
18:50
For dynamic responses if there is no content-type header assigned I'm assigning whatever value is configured as the default content type.
@rdlowrey That's the server default for .php documents, I believe.
@rdlowrey so you are concerned about PHP runtime engine or HTTPD?
user895378
Neither.
user895378
I'm asking for compelling evidence not to default to a Content-Type: text/html; charset=utf-8 for dynamic responses that don't specify a content-type.
user895378
Keep in mind that you can simply set a configuration directive to change the default content-type the server assigns if it can't otherwise determine the content-type.
18:52
@rdlowrey no that is wrong, but a good standard bet.
pce
pce
@Ocramius thanks for the reminder, i use postgresql, with postgres i can haz real joins.
@pce but you'll lose the ability to disallow truncating tables referenced by FKs :(
lol
user895378
@hakre I disagree that it's wrong. I've been up and down RFC 2616 many times and I'm unaware of anywhere it's expressly forbidden.
@rdlowrey you forget about the repcap ;)
user895378
:)
18:54
@rdlowrey okay, what I mean is: if you take that content-type it's likely a guess. As a content-type should be given that is of the response body (and not that might be of the response body), it's likely not that well to just flunge one.
user895378
Yes, but if you're dynamically generating a response and don't specify a content-type it's almost certain that what you mean is text/html. If not, you should (1) specify the header yourself, or (2) adjust the default setting from text/html to whatever you want it to be.
PHP adds text/html because (historically) it is what it servers for 99.99999% of all responses.
But you can configure that in php.ini
hey guys is there any chat room for matlab.. ?
user895378
@hakre So that was my original question ... everyone was advocating text/plain but I think text/html makes way more sense as a configurable default in the absence of a user-specified content-type.
18:57
@rdlowrey If it is a HTTP server I would say: yes. Because HTML is the Hypertext document served in HTTP responses most often.
text/plain is more for emails.
And for the charset I would take UTF-8 nowadays.

« first day (914 days earlier)      last day (4259 days later) »