« first day (622 days earlier)      last day (4552 days later) » 

10:00
morning
wtf there is another PHP room: chat.stackoverflow.com/rooms/12382/php
@NikiC morning
@Leigh omfg
@ircmaxell You should register a NEWS merge handler (you find instructions in the gitfaq)
That way you avoid problems with it :)
@Leigh lol
@ircmaxell Something about that code is wrong. Here: github.com/php/php-src/blob/… It allocs needed * sizeof(char ). Why char? Isn't that like 8 times what is needed (or 4 times on 32 bit)? Shouldn't it be sizeof(char)?
@ircmaxell Also, now that you changed the code above shouldn't this github.com/php/php-src/blob/… use needed? Otherwise it won't null out the whole salt, right?
10:31
@ircmaxell The whole code there seems a bit f*d up. I'll try to fix it up
@NikiC It's sizeof(char *), isn't that the pointer size? sizeof(char) I could see the point of, but not char *
@Leigh Exactly ;)
THe * got lost in the chat ^^
@NikiC ok, the *s got removed in your message, yea
And there is a lot more wrong there
10:47
@AnPel Any help plz?
1 message moved to bin
@ChrisP when you paste code, hit the Fixed Font button that will appear next to the message box. everything is causing eye cancer. Also, please dont ping individual users for help unless you know they are willing to help
I can see only 2 buttons send and upload
@ChrisP first paste the code
structure of array:

							$polylines[$row['polyline_name']][$row['line_seq_number']]["from_point"]["long"]=$row["longitude"];


i want to copy some colums something like:

foreach ($polylines as $v1) {
						foreach ($v1 as $v2) {
							if($v2["from_point"]["long"]==$tetmimenh && $v2["from_point"]["lat"]==$tetagmenh || ($v2["to_point"]["long"]==$tetmimenh && $v2["to_point"]["lat"]==$tetagmenh))
							{
								$counter2++;
								foreach ($v1 as $vv2)
								{
									if($v1[]
									$json[$counter2]=$vv2;
now?
edit the post, select everything and hit the fixed font button
Hmmmm. You got what you wanted @Gordon :P
10:52
hey guys i want to use mysqli class to make a class that have functions like insert ,update,delete quires and all the functionality in mysqli should i extend the mysqli class or this is a bad idea ??
@PeeHaa better. though you should work on the tabspaces in your code
@ChrisP strange indenation rules you have there ;)
@ChrisP after pasting your code, you 'll see the fixed font button next to upload. hit it, then send.
@user1464822 create new mysqli instance and inject it to the class instead of extending it from mysqli
the same..
10:54
you mean a singleton or injecting it from the contructor like dependcy injection
@ChrisP what are you trying to do?
i have an array with 4 dimensions
i want to copy this array to another array but not all the records
I want to have an if condition
@user1464822 dependency injection. you dont need singletons. ever.
ok but this class is a part from a db wrapper so it's a good idea to injected not from the contructor but from another method
??
@ChrisP you can use pastebin.com for your code, too
10:57
cause i want to make the contructor to get the connection information like the base class
@user1464822 can the db wrapper do something without the mysqli instance? if no, then inject in the constructor
@ircmaxell Could you please review gist.github.com/3017323? The changes seem right to me, but I really don't want to break crypt() ^^
and make a method called connect to connect me with that database ??
cause am using PDO too in the db wrapper
@user1464822 why would you use pdo and mysqli in it? Oo
11:00
cause if i want to change to mysqli i don't want to change a lot of code in my project
cause it's an mvc
@user1464822 imo, connect should not be a public method in your wrapper. check whether you are connected when calling any of the crud methods and connect on demand then.
you mean i should make it protected ??
and use it from db wrapper
@user1464822 non-public. whether private or protected is up to you
Sem
Sem
@user1464822 He means an if and else statement weither you have set your mysqli object or not.
@Sem no, just whether its connected, not whether its set
11:02
thank you i did understood
i see
Sem
Sem
@Gordon opening connection with mysqli == initialising myqli object?
@Sem oh well, in case of mysqli you are right
Sem
Sem
@Gordon What type of db connection do you prefer?
@Sem have none
Sem
Sem
@Gordon You store data in files? If not, then how do you store your data? :)
11:08
@Sem i store data where appropriate :)
Sem
Sem
@Gordon Fair enough.
@Sem Gordon stores all his data in the foetus cloud. A hive mind of unborn babies bursting with stem-cells.
Sem
Sem
@Leigh ah, mysql_* functions?
@Sem no, literally
@Sem wat?
Sem
Sem
11:11
@Gordon Show me the code! >:(
@Leigh using mysql_* functions feels like storing data in a foetus cloud sometimes :)
@ChrisP Learn to format.
is Apache Cassandra a alternative for Mysql
@Somebodyisintrouble is a helicopter an alternative for a car?
@Somebodyisintrouble isnt Cassandra a NoSQL DB?
@Gordon And how much non-relational data is forced into RDBMS on a daily basis.
11:15
@Leigh im using the helis in GTA all the time instead of the cars, so yes, it is
@Somebodyisintrouble My point is, sure, it's an alternative, depending on what you want to use it for
@Leigh so the answer to "is Cassandra an alternative to MySql": depends on what data you want to store
i want to store image in db so which is best for me
@Somebodyisintrouble is the db going to be clustered/sharded?
@Somebodyisintrouble thats a shame, I heard that a filesystem makes an awesome db for storing files. You could also just have a fileserver or two and reverse proxy to them
Regex for HTML
@Leigh wait
16
A: Files - in the database or not?

Tangurena Store in the database with a blob A disadvantage is that it makes your database files quite large and possibly too large to back up with your existing set up. An advantage is integrity and atomicity. Store on the filesystem with a link in the database I've come across such horrible...

@Somebodyisintrouble It's all opinion. If you DON'T fall into the pitfalls mentioned, then you don't need to worry about them
I don't know about Cassandra, I know MongoDB has GridFS
I wouldn't use MySQL for files
May 11 at 16:20, by Mike S.
<- still waiting for the Singularity.
in Lounge<C++>, 40 secs ago, by sehe
The PHP Singularity - fresh by Jeff Atwood
Sem
Sem
11:23
@Leigh Isn't that be the most obvious decision? If you use MySQL for files why not store all images, css, js and html files in there as well? Make it all one big detour.
@NikiC yeah...
@ircmaxell What I did in the end: git.php.net/…
looks good
@sehe ehrm
nice to see you here @sehe :)
@Sem I store all css and js pre-gzipped and let nginx sort it out
11:28
Everyone with a HN account, please down-flag: news.ycombinator.com/item?id=4176075
I find this annoying
@NikiC Of all the articles I've read shunning PHP, the only thing I've ever really agreed with, is that some of the function naming could have been done better.
no type hinting in function use clause?
@NikiC I haven't actually read the article. Just searched you chat history and saw that it hadn't been linked to yet. Information sharing :)
@Leigh I don't have a problem with articles pointing out problems in PHP per se. But I do have a problem when those articles are malinformed (and they usually are)
What strikes me in particular is this sentence:
> What's depressing is not that PHP is horribly designed. Does anyone even dispute that PHP is the worst designed mainstream "language" to blight our craft in decades? What's truly depressing is that so little has changed.
Yea he's not really been watching internals :)
11:33
now that I'm thinking about it, we're way over allocating that salt value. Because the two sizeof calls are included in MAX_SALT_LEN...
This makes clear that Jeff has actually no idea what he is talking about
@NikiC Have you read it already? That's fast. Well, I'm probably slow because I'm at work, but an initial scan told me I should reserve 10-15 minutes to read the article...
@ircmaxell Yes, that's what I thought too
Well, the point to make is clearly saying "PHP is evil" which is a true saying.
@sehe 5 tops
11:34
But I didn't want to drop the two sizeof calls
but it's better to overallocate than under, so whatever
I mean, I really don't want to be the person to break the crypt() function ^^
@sehe I skimmed it :)
Just to double check, the proposed simple hashing scheme is identical to the one you've already implemented natively?
If that's the case, since I have a feeling your proposal will get through eventually, I might as well start using the native version now for new projects
11:38
I wasn't, but that seems to satisfy my question too :)
well, don't use it yet. It's unstable. Wait for the propsal and when it actually gets in...
@ircmaxell Is the format of the generated hash liable to change?
Not of the generated hash, but the API will change (most likely)
shower time. Later...
i have one problem, when i submit a form , in textarea values added backslashes , i dont know how to solve this problem?
anyone help me?
11:52
are you using mysql_* function
@karthys get_magic_quotes_gpc() && die('Disable Magic Quotes.');
@Somebodyisintrouble What do you mean? Today or some years ago?
thanks @hakre
@Somebodyisintrouble I used it last week and the week before, because I was editing an application that dates back ca. 10 years ago.
12:02
Hi anyone know about PowerMTA
I am using PowermTA to send email, working correctly, but I need some solution on content type.
> I thing most projects to defeat PHP are doomed because programmers got it wrong. PHP is not in the same league of Python, C#, Ruby, Java or whatever. PHP is more like Excel, a not-so-beautiful tool for helping laymen to solve problems with a computer. And you know what? I like spreadsheets, although they are extremely shitty from a programmers perspective (PROCV() anyone)?
Sem
Sem
@ircmaxell Haters goanna hate.
Actually, I'd say in the early years of PHP there has not been so much thoughts about language design, which brings with it, that there must have been not so much progressive discussion which naturally has a specific outcome.
Is it worth to complain about? Depends.
Is it worth to know about? Sure.
12:18
mysql_* functions, who wants to do the honours? stackoverflow.com/questions/11261641/…
People with Jeff's influence shouldnt write posts like this imo. It's not constructive.
What a shit post of Jeff
Ow wait you were talking about that
@Gordon One benefit of PHP is that we don't need to do marketing. So I'm not really sure if Jeff's influence is a problem here.
@ircmaxell what was this a reply to?
@hakre its like @ircmaxell said. hes spreading FUD. and i expected more of Jeff.
12:27
@Gordon Come on, leave the church in the village. He is giving opinions and he clearly writes so. I don't have a problem if folks express their thoughts in written language. I'm also not d'accord with the conclusion he gives, but he must not care that much as we PHP coders need to do.
Also there is not much substance he give. He works up to the meta-level, but there, it somehow stops following a line of thought and starting with guessing. We still yet do not know how this experiment turns out.
@hakre i find stuff like "That's exactly the reaction most sane programmers have to their first encounter with the web programming language PHP." or "And you knock on the front door and it just collapses inwards and they all yell at you for breaking their door" offensive.
mornings
Sem
Sem
@tereško good day sir :)
hello sir @tereško
@Gordon The first is your imagination viewing the hammer photo. You find that offensive? Huh? The second is from a quote Jeff didn't even wrote it himself. Probably sentence picking? Give a read, say you find it weak, point made. But offensive? One might consider the language design of PHP offensive as well. Let's call it Overly Offensive Programming - OOP.
12:39
@hakre the hammer is offensive. starting the post with it is pure flamebait
Whats wrong with a double clawed hammer? I think it's an awesome idea (although I'm only thinking about hitting people with it)
and talking about "sane programmers" is pretty much like telling us what "real programmers" do
@Gordon I see it this way: The man building the hammer had some fun and needed to show the world. Probably he wouldn't have done without doing the photo showing the world, but that's speculation. About the post: I'd say it's an attribution to the other post he linked on top. Like the hammer photo which is an attribution, too. And that post is epic, even if evil.
im just sick of people complaining about php and ignoring the millions in business value people created with it.
millions is a bit low...
oh hai facebook
12:42
Well, when it comes to criticism, you can not in the same line also say, what's all good.
also, like if people wouldnt create crap software with "well designed" languages.
It's a very positive article in my eyes; a call to arms to other language ecosystems to make something that can compete with PHP; because nothing really does at the moment, even given all of PHP's "bad" points.
@tereško morning
@salathe And while they catch up, PHP will get better :)
@Leigh sure, slowly but surely.
12:43
@salathe i think the conclusion is wrong. why come up with a "new ecosystem" instead of improving php instead? its NIH syndrome.
@salathe Jeff even named PHP singularity in the title, yes.
@salathe :D
@Gordon why make PHP something it isn't?
@ircmaxell I asked for a review on internals as Pierre suggested: news.php.net/php.internals/61037 Just to be sure :)
@salathe thats not a legitimate question. PHP is what the community make it and if enough ppl think it needs fixing in some regard, it will be fixed.
12:47
@Gordon Also you can not stand NIH against life-cycle: birth, reproduction, death.
@Gordon It absolutely is a legitimate question, even if you're happy enough with the community moulding it however they see fit.
@Gordon and anyway, I expected the answer to be "to make it better" :)
@salathe fair enough
what exactly is the current topic ?
i am still somewhat confused
@tereško Some people are disappointed with PHP but on the other hand can't get over it.
That results in a love-hate relationship.
Which spreads like a virus through hypertext.
on other news, some scientists have proposed that earth might not be flat
12:52
@tereško If earth would not be flat, why then wouldn't my office chair don't roll away?
@tereško heresy!
btw, does anyone understand why it's called "The PHP Singularity"? I didn't quite get it
oh .. that's the cause
@NikiC replied
12:58
@ircmaxell good
thought about that as well
but I wasn't exactly sure whether the max salt len is really what I think it is ^^
has any one tried to write coffee script like thing for php ??
@Krish , why ? Especially since every serious javascript developers knows how terrible coffeescript is
Sem
Sem
@tereško Law of Demeter doesn't apply on data structures, what's your opinion on that?
@NikiC I like how Mr. Atwood completely fails to acknowledge that you could, you know, contribute to PHP . . .
@Sem , seems legit
13:04
@LeviMorrison my thoughts exactly. he has a very close-source mindedness about him and his approaches to problem solving.
Has anyone ever notice how pathetic the PHP Manual entry on SQL Injection is?
I mean, sprintf? mysql_*? really?
I think this is a good comment: news.ycombinator.com/item?id=4176321
Jun 24 at 20:09, by PeeHaa
@php docs people. uhhhhmmm shouldn't we change this piece of shit? http://www.php.net/manual/en/security.database.sql-injection.php
@PeeHaa That's so very sad
13:10
> How do you intend to get the "critical mass" of popularity to get it rolling?
Most of the security section is awful.
One of the terrible portions of it.
get it rolling by trolling apparently
sorry, was still distracted by the Jeff
day 3 of foreign support :'[
maybe someone should write a troll on ASP.NET frameworks
to fight idiocy with idiocy does not seem to be the solution
13:17
wait .. you're saying that this "have a good day" was not a single exception , but your daily routine now ?
it seems it might go on for ever @tereško
@CarrieKendall What kind of support is that?
I.e. what is it for?
my condolences .. been there , done that , burned the t-shirt
13:19
Love this comment on Jeff's post:
> I am a Java programmer at work (could be no more corporate-y) and a Python developer in my projects (could be no more hipster) but I admire PHP and its ability of solving problems. It grows because, some times, some poor soul wants to create an online encyclopaedia, or some teacher needs an online teaching platform, or someone wants to write a blog. Those people do not want to learn to program, they want to solve problems.
we should rename PHP to Problemsolving Hypertext Processor
PHP is not a programming language but a problemsolving DSL :)
@CarrieKendall Are you still on support? :P
Isn't the great thing about an vps that yu don't need support?
Fix typos yourself
when my system is acting irregularly unfortunately, I am
@CarrieKendall Take your business elsewhere? :)
its not my business is the problem :[
i am the whipping boy (girl doesnt sound right :P) unfortunately
13:26
@CarrieKendall How can we lighten your day?
@hakre simply understanding the context of my messages will be enough :P
hehe
@NikiC 132 is the max size of the generated string it will return...
$ php -r 'var_dump(crypt("foo", "$6\$rounds=100000000\$saltsaltsaltsaltsaltsalt"
> ));'
string(123) "$6$rounds=100000000$saltsaltsaltsalt$H.xPnRWs3LRo8xenCuxbVuZvWjb.Olb6Njtfclqq416GN3Tmv/nmtAqZcAmLW9ZkAkhLuSymMgGaoUZ27hptu1"
W3C Selectors API Level 1 new recommendation yesterday. If anybody want to help porting an "AddOn" for PHP's DOMDocument, I started a lightweight and PHP 5.2 compatible selectors parser here: github.com/hakre/XDOM
@CarrieKendall lol
@hakre You mean they finally realized CSS selectors should basically be used in the DOM? shocking
14:14
@hakre why 5.2?
@LeviMorrison Huh? Isn't that common since CSS? The only thing which is done here is to state, that like with xpath, there is another way to query DOM elements and one in a well known fashion of the CSS selectors.
@ircmaxell That's the technical description of the PHP version compatibility, which is 5.2 IIRC.
I know, but my question is why 5.2? why not 5.3?
@ircmaxell Compatibility and prototyping reasons
compatibility with a dead version...
@ircmaxell No that's just because of the fact that PHP 5.3 is backwards compatible here. I guess there's a reason why PHP is backwards compat, so I'm, too.
14:21
@LeviMorrison I blame webdesigners for not learning xpath and not realising that XHTML is better than HTML
@hakre I was basically saying that CSS selectors are much more natural that the DOM API for most developers and I'm glad they are implementing it.
Sem
Sem
What's it with big companys still saving passwords directly in their databases in the year 2012.
@Sem which is the reason we're building wiki.php.net/rfc/password_hash
@Sem I think that's called "conflict of interest".
@Gordon I also find it hard they basically dropped XHTML.
Oh, we allow for XHTML-serialization, but we won't write a grammar or schema for you . . .
Gee, thanks.
Sem
Sem
14:28
@ircmaxell If they don't accept the API we're goanna do some DDoS on php.net!
@LeviMorrison i pretend to myself they will learn eventually and are just taking a detour
<?php

$start = microtime();

//Some code here...

$end = microtime();

echo "Time:" . $end . "-" . $start . "= " . $end - $start;
Any reason why The only thing I get is -0.222499?
@Gordon Yeah, was about time. It's written in the news they're pushing for this.
14:37
Shouldn't it be more like Time:<SOMENUMBER>-<SOMENUMBER>= -0.222499?
@Truth That output might be unrelated to your echo. Convert the echo into printf and try again.
printf("Time: %f-%f = %f", $end, $start, $end - $start);
@Truth because microtime generate number like .microsecond Second
You will need to convert them in correct syntax
microtime(1); for float
like seconds.microsecond
Thanks
Also, is there any way I can prevent PHP from formatting my floats for me?
I don't want it displayed as 1E-5 I want it as 0.00001
14:46
@Truth You should be able to use number_format()
With the extra args
fyi, 1E-5 is in scientific notation jetlogs.org/2008/02/05/…
Oh @NikiC: I figured out why I need the efree
09:47Mark T.: I'm not really familiar. i'll be creating a ticket about this and forward this to a specialist
-.-
the return of php_crypt() in my refactor always over-allocates the buffer returned. So to return it to PHP, we need to re-allocate the buffer to the correct size.
I'll add some comments to that effect...
@MikeB I know what it is, I want it to display nicely. And thanks :)
Another (hopefully last) one:
$pattern = <<<REGEXP
/
(https?:\/\/)?   #May contain http:// or https://
(www\.)?         #May contain www.
youtube\.com     #Must contain youtube.com
/xis";
When used, gives the following error:
Warning: preg_match() [function.preg-match]: Unknown modifier '/' in D:\Websites\htdocs\tests\index.php on line 37
I thought it was supposed to ignore anything after #
@Truth When adding comments with the /x modifier, don't use the pattern delimiter in the comments. It may not be ignored in the comments area. php.net/manual/en/reference.pcre.pattern.modifiers.php#72997
So try using ~ or some other delimiter instead of /
15:07
@CarrieKendall , this is just sad
scary thing is : India is the largest english-speaking country
@tereško in my experience, speaking english means nothing if you don't understand the context. broken english is actually worse than them speaking their native language. At least I can leave the context up to a translator.
sometimes i get a feeling that so do they
hi all. i have a link which calls another page from my controller. however, the include statement appends to the existing content rather than replacing it. how do i get the link to replace the content? i've tried html target= but none of those worked. pastebin.com/Shr4kpKs
@Truth printf, you can specify the number of digts as well.
@MikeB After switching delimiter to ~ I get the exact same error, only the unknown modifier is &quot;
@hakre Thanks
15:22
@Truth Did you mean to have "; at the end of your pattern?
Can you close heredocs that way?
@MikeB X_X
I just love HEREDOC
@MikeB I think HEREDOCS need to be closed with a new lined, unindented REGEXP; in this case.
I converted from a "string"; syntax to heredoc, that's where the problem was
hi all. i have a link which calls another page from my controller. however, the include statement appends to the existing content rather than replacing it. how do i get the link to replace the content? i've tried html target= but none of those worked. pastebin.com/Shr4kpKs
@MikeS post it a couple more times i'm sure someone will help then.
</sarcasm>
15:32
o well. thought i'd try.
Some view engines support sections, where a nested view can specify a "section" to be written to another view in the rendering hierarchy (common uses: CSS, Javascript). I'm trying to wrap my head around implementing this, and the only way I can come up with (and have seen) is a 2-pass system; one to render the hierarchy and cache sections, another to inject sections... I assume that's the only/best solution?
Okay, I need to set up an include_path setting that's based on the current directory. Is there a variable available in .htaccess that would let me set the include path based on the .htaccess location (ie, not based on script location)?
user895378
Complaining about PHP is like saying "all clothes made with cotton are terrible because they aren't made of silk." When, if you know what you're doing, cotton clothes can be just as elegant and functional as any others. Often moreso. A bad craftsman always blames his tools.
user895378
The only thing preventing elegant application code in PHP is the developer.
15:38
@rdlowrey Not exactly
Please read the whole post.
user895378
@Truth I've read it. All of it.
user895378
Every language has good and bad parts. You work with the good parts and avoid the bad parts.
Wooho! 22,222 rep
user895378
I'm aware of PHP's shortcomings -- they're many. Doesn't change the fact that PHP code only sucks if the developer sucks.
@Truth The analogy made me giggle.
15:40
@Bracketworks The hammer? :P
Just all of it.. I think pentagonal rooms and upside-down roofs got me ;)
wow, 600 posts from the comment I left on Jeffs site
@ircmaxell Link?
Since you mentioned the fractal post, you should at least read my reply to it.

blog.ircmaxell.com/2012/04/php-sucks-but-i-like-it.html

I think you miss a very key point, that sucking matters for shit when you're able to get stuff done with it.

Additionally, saying nothing has changed is a bit of a ruse. Follow the internals lists, and watch what's been happening in newer releases, and you'll see that lots has been changing.

Overall, just another FUD article. Sigh...
user895378
15:46
@Truth And if you've read the entire "fractal of bad design" post, you'll also know that while there are lots of valid points, there are also many places where the author is patently wrong, demonstrating a seriously incomplete knowledge of the language. "I don't know how to do something in PHP, therefore PHP sucks" is just plain lazy.
> Wordpress is the Nickelback of programming, and PHP is the electric guitar.
user895378
@tereško That was my favorite line in the article :)
anyway , i think we should lay that post down and back to something more productive
user895378
There's no gatekeeper at the door to PHP hell stopping developers and saying, "Abandon all S.O.L.I.D., ye who enter here."
user895378
And now that I've completed my rant circle with a reference to Dante's Inferno, it's time to move on :)
15:49
@rdlowrey Agreed.
> There are only two kinds of programming languages: those people always bitch about and those nobody uses. -- Bjarne Stroustrup
stackoverflow.com/questions/11264679/… Anyone else consider this repwhoring? I know SO encourages self-answers but why wouldn't I publish every function I ever authored in the form of a question?
user895378
@MikeB eh, it seems more like the OP was legitimately proud of his basic solution for what was a dumb question in the first place than purposeful rep-whoring :)
yeah, that one's not new or novel
@MikeB Practically same timestamp . . . it MUST be copy-paste.
15:56
i consider it to be a topic with no question
NOOOOOOOOOOOOOOOO MY 22,222!!!!
:`(
please don't use sizeof(). It's an alais and does nothing but make it harder to read. Use the proper function count()... — ircmaxell 6 secs ago
@rdlowrey Sure, but I'm proud of my work too
@Truth Shortlived.
user895378
@MikeB Well, it is annoying, but I don't know if I can personally justify downvoting it ...
user895378
15:58
He's only got 448 rep ... if he's a serial rep-whore he's not very good at it anyway :)
@MikeB flagged
Aye

« first day (622 days earlier)      last day (4552 days later) »