« first day (791 days earlier)      last day (4175 days later) » 

Anonymous
4:01 PM
 
Anonymous
@NullPointer does that look like a good person to you?
 
Guten tag
 
guten abend
 
Yes? He's trying to give you dupes that might help with your question
And even four of them. That's him being really nice. Usually you only get one ;)
 
Plus, flagged 8 times — The COMPLETE PHP Newbie 10 mins ago
i wonder , for what
 
4:10 PM
@PeeHaa Morgen
 
Anonymous
@NikiC your to honest. But, I am afraid that not how the world works, atleast not today. 3 answers and more than 10 comment, no one said duplicate post once.
 
Hey hey
 
Anonymous
Anyway, he is ignored now. I love the ignore button btw
 
@PeeHaa hola
 
@PeeHaa Good Deutsch drinking session?
 
4:14 PM
@DaveRandom Affirmative. I've been away with a colleague yesterday till 6 o clock and with one bottle of tequilla
The downside was that we had to checkout of the hotel at 10:30
And that I still had to drive back :|
And I'm pretty sure I'm never going to drink gluhwein again ever
 
cheers ...
 
I wouldn't anyway, I've never liked it... :O
 
i think i need to make some food
 
Anonymous
Why is it in this PHP forum, when newbies ask questions in this room, they are not tolerated but someone talks about beer and stuff.. it is OK?
 
@DaveRandom Me neither, but when you are in Germany on some christmas market I just adopt / integrate. :)
 
user1125394
4:19 PM
@TheCOMPLETEPHPNewbie why such a retarded name?
 
lol
 
Anonymous
I am very offended @cyril
 
user1125394
sorry but the name hurt eyes
 
@TheCOMPLETEPHPNewbie Probably because @DaveRandom and @PeeHaa are long-time members of this room, so they have a bit more freedom :)
 
@PeeHaa MOAR BEER
 
4:21 PM
@TheCOMPLETEPHPNewbie Also, we don't really have anything about newbies, but some people in here (most notably @tereško) quickly get overly aggressive when newbies make too little effort on their own before asking.
 
Anonymous
@cyril It is supposed to be self-explanatory, apparently some snap during a simple quest of searching for answers
 
I don't know whether it is the case with you
 
@DaveRandom Man. Talking about beers. They had some very nice beers in the "Bierlokalen"
 
Anonymous
@NikiC It isn't
 
...
 
4:23 PM
@TheCOMPLETEPHPNewbie Though I also didn't see anyone being particular bad to you. Apart from that mass-downvoting allegation (that may or may not be true) I didn't really see anyone getting at your throat ^^
 
or yesterday , about "what is the point of array" topic
well ... who cares
should it be possible for autoloader to throw an exception, if the attempt to load a class from specific (configured) namespace failed ?
i am concerned about environment where there are multiple autoloaders
 
@tereško I'm not quite sure I understand the situation but generally throwing exceptions in autoloaders is a bad idea.
Additionally, if it doesn't load it's going to die because it can't find the class anyway.
May as well let another autoloader try, yes?
 
@tereško I'm requesting the xml, it is not pushed to me
 
think of this example (gonna write some code ... be patient) :
 
Anonymous
It is fine.
 
4:30 PM
Hello, anyone can help me? is not PHP exactly. stackoverflow.com/questions/13892713/…
 
Autoloader should never throw
 
user1125394
they just return true false
 
try {
    $klass = $request->getControllerName();
    $method = $request->getActionName();
    $controller = new $name;
    $controller = new SecureContainer( $controller, $acl );
    $controller->{$method}( $request )
}
catch( ClassNotFoundException $e )
{
      $controller = new ErrorController;
      $controller->get404();
}
catch( AccessDeniedException $e )
{
      $controller = new ErrorController;
      $controller->get403();
}
@NikiC this is the context
 
@tereško I think that's a case for class_exists, not for autoloader exceptions
 
@tereško Does that work as expected?
 
4:34 PM
@LeviMorrison yes
@NikiC hmm ... that IS an alternative , yes , but it would make to code more convoluted
 
Interesting. I'd still use class_exists.
 
user1125394
so you maybe need if's instead of try's
 
@ircmaxell By the way, LinkedStack is now a singly-linked list.
 
@PeeHaa Just been googling that, still none the wiser :S
 
Apart from the general premise that autoloaders mustn't throw, I also think that this code is bad because it tightly couples your controller instantiation to the autoloading logic
 
Anonymous
4:37 PM
Can anyone help me understand the difference between $_SERVER[''] variables and built-in functions in PHP? I mean, it seems the are both built in the system, they both hold values .... then why separate them if they pretty much do the same purpose
 
I.e. the code would break when you use a different autoloader
 
user1125394
I think try catch should be avoided, when it's not a really blocking problem like io (my noob opinion)
 
anyone can help me?
 
@NikiC now that is actually a good argument
 
@MikelGarcesEtxebarria I looked at your question but I don't know the answer. Sorry.
 
4:38 PM
@TheCOMPLETEPHPNewbie if your question is whether $_SERVER could have been a function called get_server_var('foo'), then yes, that would have been possible
 
thanks @LeviMorrison
 
Actually, now that I think about it, it would might have made more sense if PHP implemented $_SERVER/$_GET etc as a function, because it would eliminate the concept of the superglobal variable
 
@NikiC , that would just move the dirt around
you would also become unable to simulate them (for testing purposes) .. instead ending up with magical readPost() and readServer() which read from global state anyway
 
@tereško If you're a person who's into testing there should be no need to simluate them
 
Anonymous
4:41 PM
@NikiC thanks, so there is would mean that they are very similar in what they do, one is has just pre-defined value and other gathers information from server, but still it is hard to find a reason why $_SERVER's couldn't have been made functions.
 
Because your code will not directly rely on them ^^
 
true , but the argument remains ... you would just have functions, which read from hidden global state
 
@ircmaxell The I also removed contains. I'm now working on turning LinkedQueue into a singly-linked list.
 
Why are guns all over my twitter feed?
 
@NikiC mass shooting in USA kinder-garden/elementary-school, ~28 dead
 
user1125394
4:45 PM
it's a baby who did it
 
no, it's not .. you are being a jackass
 
@tereško I see. Should probably read news once in a while
 
@NikiC ...so it turns out that FF doesn't fire click for middle clicks, and you have to use mousedown, which is not really a problem for this but kind of screws with another planned feature, but it should still be doable. Also it introduces issues when you start a click on the link but release it outside - the notification will be removed but the link won't be followed. I think we'll just have to live with that for the time being though.
 
Anonymous
@NikiC when you first learned PHP, which site helped you the most?
 
@TheCOMPLETEPHPNewbie @NikiC learned PHP before the internet was invented.
 
Anonymous
4:57 PM
@DaveRandom Then I need to know where to buy, that majic spell
 
Anonymous
shame
 
1
Q: C function like in_array in PHP

bye<?php $os = array("Mac", "NT", "Irix", "Linux"); if (in_array("Irix", $os)) { echo "Got Irix"; } if (in_array("mac", $os)) { echo "Got mac"; } ?> Is there some function in C which does similar thing to in_array in PHP?

is this a appropriate solution?
@hakre is this a appropriate solution?
 
@jhonraymos Maybe?
 
what do you think about that?
 
5:06 PM
@jhonraymos I think nothing about that.
 
@NullPointer and what about you?
 
what is a good place to find simple coding challenges online?
 
@DineshVenkata be specific?
 
@jhonraymos specific in terms of language?
 
yes
 
5:09 PM
@jhonraymos i am fine ....lol..:P
 
that's really sounds good
:P
 
@DineshVenkata Have you tried Code Golf?
 
nope @MadaraUchiha
@jhonraymos I would prefer c, c++ or java
 
@TheCOMPLETEPHPNewbie I remember using this tutorial: tut.php-quake.net/en Though I'm not sure how good it is now
 
Anonymous
5:12 PM
@NikiC thanks, but did you have some programming experience before that, or were you a complete beginner?
 
@NikiC lol...:P
 
Anonymous
hey not bad. Bookmarked !
 
@TheCOMPLETEPHPNewbie Complete beginner
 
can anybody suggest me?
 
Anonymous
So freaking easy to understand and fast too
 
5:14 PM
@DaveRandom :P
 
okay @NullPointer
 
Anonymous
@NikiC Thank you so much. The site is great!!
 
5:22 PM
@hakre i think that question need delete vote
 
they automatically get added to the delv-queue , when closed
 
@tereško thank you will look at it
found codingbat looks fine
 
user1125394
good way to find if your code is badly coupled, change the project's name :D
 
5:37 PM
@NikiC Not too bad for relevance/usefulness - no PHP4 OOP, no ext/mysql, some care taken to explain many newbie security pitfalls - I guess it's been updated since it was first put online, on the whole it's one of the best complete newbie tuts I've seen.
 
> You've reached the maximum of 12 Deletion votes per day; come back in 6 hours
=/
 
sup errrbody
 
@tereško ahhh 6 ..rather after 5 delv i got message
 
@tereško You need do some rep-whoring...
 
5:38 PM
@tereško oha. only 12 del-votes?
 
@hakre because its so obvious and easy to find via google?
 
@AndyPerlitch Because OP wrote in a comment that he posted the question by mistake.
 
@hakre 10,000 rep = 5 delv vote and than on every 1000 rep = +1 delv vote till 35 thousand rep
 
gotcha
 
@DaveRandom i will try to do some
 
5:40 PM
in general, is this true: .NET is to Windows as Cocoa is to osx?
 
how can I use get_content and divs in my template file so that I can have different sections when I am using the wp wysiwyg editor? With get_content you get one div
 
@tereško Go haunt jQuery a bit, there's always free rep to be had there.
 
@DaveRandom , I will rather take a cheese grater to my ass, then start frequenting
 
5:45 PM
@tereško What you do on your own time is none of my concern... Whatever floats your boat
 
heheheh look what the one has answered in this post stackoverflow.com/questions/13894176/…
 
shameless
 
@developdaly Welcome to rooms/11/php
Is it me or have some of the styles on SO changed slightly? In particular, didn't the font-weight of post scores used to be heavier?
 
yes
@DaveRandom and someone was already itching about it in Meta : meta.stackoverflow.com/questions/158762/…
 
5:51 PM
Good, just checking I wasn't losing my mind
@tereško Now that is a guy with a low outrage threshold and too little to do.
 
hahaha
"compare the healthy... to the undernourished..."
 
also ... since you are a developer, there is no risk in loosing your mind twice
 
@LeviMorrison Awesome!
 
such a minor change -- and seemingly unnecessary. wonder why
 
user1125394
it's a major release
 
you guys know of any php-based sites that are open sourced? i don't mean an open project, but the entire site
 
@developdaly Wikipedia mediawiki.org/wiki/MediaWiki
 
@DaveRandom not sure if that qualifies. that's more like WordPress -- an open source framework to extend and build your site on top of
 
Anonymous
6:03 PM
@developdaly I know one or two, but most are e-commerce sites
 
@developdaly Well @PeeHaa's site has a GitHub repo
 
@DaveRandom that's what i'm looking for. i want to do it, but i'm worried about security. especially if the site has a large userbase
 
@developdaly What security aspect ared you worried about?
 
@developdaly Open source != insecure, just consider the very fact that openssl exists.
 
@DaveRandom don't get me wrong. i use open source stuff almost entirely and trust it. i just haven't seen it used for an entire website. maybe my concerns are just because i haven't seen it and nothing more
 
6:17 PM
Who can speak Wordpress here?
 
user895378
Can we please stop pretending that composer solves the PHP dependency problem? Because it doesn't. Just like PSR0 doesn't solve autoloading.
2
 
@TheCOMPLETEPHPNewbie
lol
This question belongs in Yahoo Answers — The COMPLETE PHP Newbie 1 min ago
 
How can I basically fetch and format info about 3 specific subpages?
Info being: title, text, picture.
 
@TheCOMPLETEPHPNewbie you are yahoo ... ajent
 
I have a question? So check this page out. So the map code is in my template file and then I use get_content and I set the position of the content to be next to the map in my style sheet but if you resize the browser window the content moves. I don't wan the content to move.
 
6:21 PM
@rdlowrey It solves it in the way that there now is some way to include dependencies ^^
 
@MadaraUchiha me
 
user895378
It answers the question. It doesn't solve the problem, though.
 
@MadaraUchiha can you answer a question I have...
 
@rdlowrey You are free to elaborate on its issues :)
 
6:22 PM
@developdaly do you know which is the most secure operating system ?
 
I don't know nothing about dependency management, so I'd love to hear
 
user895378
I took one look at the code it generated in the vendor folder and threw up a little bit in my mouth.
 
@tereško what do you mean by operation system? an operatING system? like linux or windows?
 
last answers are same .... even with same mistake and correction
 
@developdaly , it's OpenBSD
released under BSD license
 
6:25 PM
@MadaraUchiha or anyone Lets say I'm using the 960 grid and I am using wp and you put the content in through the wp wysiwyg editor using get_content how can make columns based on the 960 using get_content
 
it's what NSA uses
 
user895378
My issue is ... autoloading IS NOT A DIFFICULT PROBLEM.
 
@tereško so are you asking me if openbsd is secure?
 
user895378
Any decent third party library will either supply its own autoload/bootstrap file (which you can simply include in your own bootstrap code) or use a standardized directory/naming structure so that autoloading its code manually is trivial.
 
you were implying taht opensource is lesss secure
i asked you , "which is the most secure operating system"
 
6:27 PM
@benlevywebdesign using the standard text editor with wordpress you'd need to use shortcodes
 
@rdlowrey composer allows you to specify the bootstrap file rather than the autoloading namespace
Though the name for that option was something hard to find
 
user895378
@NikiC I get that, but why bother with that when any non-trivial application you write is going to need it's own bootstrap file. I guess what I'm saying is that when you know what you're doing, there's no need to add all the Composer cruft.
 
@developdaly what will shortcodes do for me?
 
@tereško oh, haha. i thought you were asking for advice. i was confused. my security concerns aren't so much about open source philosophy as they are directed at the website-implementation
 
user895378
Composer does nothing to make third-party libraries better.
 
6:29 PM
@rdlowrey I don't usually the composer autoload.php
 
@benlevywebdesign wordpress will discard your <div class="something"> tags, so you use shortcodes to insert that stuff istead
 
@rdlowrey I think there is little point to that. The main usefulness is specifying and managing your deps
 
user895378
@NikiC Totally agree.
 
Anonymous
@NullPointer I have had my share of experience in YA!
 
@developdaly example?
 
6:31 PM
ehh .. if you need a 3rd party tool jsut to manage the dependencies, it is quite possible that you are doing something wrong
 
@benlevywebdesign best to take the question to wordpress.stackexchange.com
 
@developdaly I know how to use shortcodes in wp for things like my sideshow plugin but I don't know how to make my own if that what you are saying I need to do
 
user895378
@tereško I agree with that too. How many dependencies are people really using?
 
user895378
If you need 10 deps for a project, what are you doing? Because you're probably just piggy-backing on other people's code.
 
user895378
Maybe I write unsophisticated apps, but it seems to me that two or three libraries is the most I would ever need. And it's not difficult to manually manage those efficiently.
 
user895378
6:34 PM
And I like language-agnostic git submodules way more than Composer.
 
user895378
git clone --recursive is really simple dependency management.
 
user895378
The submodule is linked to the specific commit of the dependency you want to use, so you don't have to worry about breakage.
 
user895378
And you update the submodule link when/if you want to update to a newer version of the dependency.
 
user895378
I don't think that anyone would argue that git is somehow less ubiquitous than Composer. And IMHO, git submodules won't be falling out of favor any time soon ... the same can't be said for a php-only project that's essentially a result of php-fig narcissism that may or may not still be around in five years time.
 
user895378
6:40 PM
Is unified dependency management a worthwhile goal? Yes. Definitely. But for my purposes, the relevant functionality is already built into my git workflow. There's no need to clutter things up with inefficient, autogenerated php autoloader code.
 
6:51 PM
Honestly, I have been a bit torn on the composer subject.
It seems to be substantially more known within the PHP group than git submodules.
If a major project goal is adoption then you need to consider these things.
This is one reason I pushed for Artax to have git submodules available but to also have composer support.
You aren't leaving anyone out in the cold.
And if one project dies (let's be honest: it will be composer) then you are already set up with the alternative.
 
@rdlowrey git submodules are less easy to use
I still have no idea just how they work
The whole updating mechanism and stuff
 
@NikiC Eh, that's partially true.
That's mainly a point of education though. I haven't really found solid documentation on submodules. My knowledge is based on what worked and what didn't.
@rdlowrey Let me know if there is anything in particular for Ardent that needs to be cleanup up before Artax launches 1.0.0.
 
user895378
@NikiC I agree. It took me a while to understand what was going on. But now that I do I don't understand why anyone would do anything else.
 
user895378
And with submodules, you aren't stuck with a particular tagged release ... you can reference any commit you want.
 
user1125394
but git submodules can be messy
 
user1125394
7:02 PM
potentially you can be lost
 
user895378
Like everything else ... you have to learn how to use it.
 
user895378
And I strongly disagree that submodules can be messy.
 
I feel like the average developer uses clone, add, commit, push, and pull and that's all git-fu they know. It's a shame, really.
 
user895378
Wanna update your submodule to a newer commit?
 
user895378
cd vendor/somelib
git pull
cd ../../
git commit -m "Bumped dependency to latest"
git push
 
7:04 PM
^ I bet the OP has no interest in that any longer.
 
@rdlowrey You missed the "run-tests" step before push.
 
user895378
@LeviMorrison lol, tests shmests!
 
:)
I've actually managed to keep Ardent at 100% test coverage through all my changes.
I'm proud of myself. I've never been that dedicated with it.
 
0
Q: I want to have more than 50 Close Votes per day!

hakreI just was seeing that I hit a close-vote limit of 50 for today. When my reputation increases, will the number of close-votes per day also increase? No it's said. But I need more close-votes. Please consider to extend the limit depending on reputation. E.g. I think a 75K user should have 75 clo...

 
user895378
@hakre lol get ready for the torrent of negativity
 
7:08 PM
@rdlowrey Yes? Why? Closeregime is not wanted?
 
For Christmas, I want 500 close votes per day ;-)
 
user895378
@hakre Not by meta, it seems. Summer of love and whatnot.
 
@Jocelyn You should get a Close All Areas Pass :)
 
user1125394
@rdlowrey vendor/somelib is tracked in . and in ../.. gits? else I withdraw my stupid opinion on it
 
:-D
 
7:09 PM
@rdlowrey Oh, all my close votes are an expression of my love that I share.
 
user895378
@hakre hehe, in that case, close away, sir. I support spreading love to all those you deem fit!
 
Well I'm off to lunch. I'm hoping to get some more work on the data-structures by the end of today.
 
Hi, I wanna get all the text from all my <td> between one <td>Kraj</td> and a </table> with Xpath.
I'm doing this $results = $xpath->query("/[td = 'Kraj']//td[preceding-sibling::table]"); is it right ?
 
@rdlowrey Love is to not make any difference. Close em all ;)
 
user895378
7:10 PM
@LeviMorrison later
 
"Thank you for reviewing 40 Close Votes today; come back in 5 hours to continue reviewing."
 
@hakre this would mean that i would have 17 close-votes per day , it also would mean that blankman would have more close-votes then i do
 
Anonymous
Does apach url-rewritting block included external files?
 
@tereško Yes I should leave a comment that I'm shy with that suggestion. If 3K is 50 votes, 6k should be 100 and so on probably.
 
Can anyone tell me why when I'm inspecting my page I am getting <body class=" customize-support"> when I didn't even set that on this site
 
7:15 PM
actually i think that the close-votes should depend on how good you are at answering questions
 
@tereško suggest that ;)
 
Anonymous
@benlevywebdesign are you inspecting with chrome?
 
@TheCOMPLETEPHPNewbie No firefox but I can check chrome
 
Anonymous
I don't see where it says <body class=" customize-support">
 
also , @hakre , IIRC, 10k user has 50 votes
 
7:20 PM
@tereško okay, I was reading a 3k user has. So I let that being corrected via comments.
 
Anonymous
@hakre I did what you asked, but no results. I am readin the manual although it is a bit hard for me to understand
 
Anonymous
can you recomment an easy tutorial to learn it from scratch?
 
@TheCOMPLETEPHPNewbie what do you mean?
@TheCOMPLETEPHPNewbie to learn what?
 
Anonymous
@hakre url-rewritting
 
Anonymous
You send me a message on my post
 
7:22 PM
Ah okay, now I see, you have a different nick here.
 
Anonymous
Now, the same nick. Just truncated
 
@TheCOMPLETEPHPNewbie apachelounge.com/download/contr/mod_rewrite.pdf - Maybe this intro is more lightweight
 
Anonymous
@hakre SUPER!!
 
Hello, can you please see why I'm not upvoted : stackoverflow.com/a/13895343/1344937 ? I know I may be annoying but the other answers are all wrongs.
 
7:38 PM
@Mageek You know there is something called IN right?
 
@PeeHaa No?
 
Why are you pinging me multiple times?
1 message moved to recycle bin
 
It was an error. But what is IN?
 
1
A: php foreach add += string in a variable return 0

mekegi $cities = array('city1','city2','city3','city4','city5'); $query = "SELECT * FROM data_entry WHERE city='" .implode("' AND city='", $cities)."'"; echo $query; but this query always return empty result, if different cities in array, maybe your need select query look like: $...

 
7:53 PM
hmm ...
I was surfing youtube today and stumbled upon something interesting, which lead to:
> When God began to create the universe, the earth was at that time in a chaotic state. Darkness on the surface of the ocean. But the breath of God moved on the waters and God said: Let there be light! and there was light.
What do you think this is ?
@Mageek eem ... what ?
why exactly you would be upvoted ?
 
@tereško because my answer is correct
 
lol
 
@tereško New lord of the rings?
 

« first day (791 days earlier)      last day (4175 days later) »