« first day (713 days earlier)      last day (4235 days later) » 

9:00 PM
@DaveRandom Well that is true and my ISP is not cheap and i been with them for many years! Great support and network.. its just time for me to upgrade but looking for reliable network and good support.
 
(Also PHPStorm never was unresponsive for me at any point every (+4MLoc project) where Netbeans and eclipse spend 6hours per day "indexing" on an ssd :)
 
edorian hmmmm
 
@I'll-Be-Back not really , the autocomplete works only in the scope of file
 
@I'll-Be-Back Well make sure you are 100% certain you can get FTTC before moving on if that's what you want, samknows and the BT checker will often give false positives, you need to get an ISP to check properly against the live data
 
Yea deffo!
 
9:02 PM
@ircmaxell And how are you? All settled for the flight? Any other news? :)
 
Doing good
taking final preps for the trip
got all of the hotels and travel sorted out.
Now, just need to pack and go
 
Who paying for trip?
 
Well, the flight over, the conf and the first 4 days of hotel are my company
I'm paying for the other 2 weeks of vacation
 
cool stuff
@ircmaxell Do you ever felt PHP should be rewritten in C++?
 
No, ask @NikiC about that
 
9:07 PM
On that note a great read comes to mind: Why should I have written ZeroMQ in C, not C++
 
@edorian Sorry, but that one is full of shit.
 
Quick sanity check: this.innerText should be identical to $(this).text() in the context of an anchor who's only child is a text node, right?
 
Hello, I have a question please! anyone?
 
@NikiC I've talked about that (and part2) with a couple of C and C++ folks and they pretty much all agreed that he makes valid points
@NikiC Care to elaborate?
 
If I download and install wikia from dev.wikia.com/wiki/Wikia_Developers_Wiki will that include the theme or do I need to make one?
 
9:15 PM
nvm I've spotted the stupid mistake
 
Does anyone know?
 
@I'll-Be-Back php should be rewritten in perl
as every decent language is
 
pce
i thought php should be written in php.
 
@tereško PHP should be rewritten in brainfuck.
 
9:21 PM
Well... some might say PHP should be written in C
 
@pce , i think that's covered under "cruel and unusual punishment" clause
 
PHP should rewritten in C ;) I hate PHP naming conventions
 
Well... some might say PHP should be written in C
 
The arguments to built-in functions are inconsistent also the names of built-in functions are inconsistent
 
Yeh, that's just what we need, another "PHP sucks" debate. If you hate it, quit using it. You're all getting on my tits.
5
:-P
 
9:24 PM
@edorian I take that back. I thought it was the second article, not the first. I do agree that exceptions are not always the best way to handle errors. In situations where you really need to handle every single possible error very carefully and you have very good code review, then yes, using error codes might be better.
 
well I still like coding in php =)
 
Though in the vast majority of cases exceptions are preferable by a long shot ;)
 
@DaveRandom php developers are only community where you can say that their language sucks , and the statement will cause discussion about "what else to use"
try that in ruby channel on freenode
 
@edorian Pff. We should rather write C in PHP :P
 
oh yeah...that'd work out well.
lol
 
9:30 PM
In my opinion PHP should rename all the functions to camelCase but old name will still work but no longer documented.
 
that's something one could do for php6
the tagline for PHP6 should be "F*ck backwards compatibility" ... we have suffered long enough
 
heh
i don't care whether the names are camel cased or underscored...but goddammit, be consistent!
 
@tereško That I could get behind. It'll never happen though and would stall the uptake to a crawl. Plus I don't really want to have to re-train my brain.
 
pce
yeah, i wish they were case sensitive. That is PHP3 Manual compatibility.
There was RFC for casesensetivity, recently
 
9:35 PM
eh...i dunno how i feel about case sensitivity. on the one hand it forces stuff that refers to the same thing to have the same caps, which.. ++$consistency ...but also leads to "clever" shit like having a dozen variables with the same name except for case
 
@ircmaxell I propose that you propose a "contribute to PHP" thing for the hackaton. Else it would be the first conf for me this year that doesn't feature something like that and your core :P
 
i semi want to have it like c# does. case sensitive, but also doesn't let you have other names that only differ by case
you want a $username? then no $userName for you!
etc.
 
pce
@cHao true. good point. when i see strPos() or someone who writes ECHO like in the PHP3 Manual (which i discovered these days) and it dont behaves like echo, no step forward.
but that smells like the same overhead.
(for the intepreter).
 
@cHao Var names are already case sensitive (he said, pedantically)
 
@DaveRandom i'm using var names as an example. and whether they are or not doesn't matter much, considering i'm arguing for a third option :)
i don't guess a "nazi mode" in php would ever gain much traction, would it.
 
9:44 PM
@cHao The thing is, if you are not allowed to create another identifier with the same name but different case, you might as well just stick with case-insensitive IMO.
 
lol
 
@NikiC Well the difference between PHP 4 and C with autopointers (poco or something) is not that big anyways. At least i feel that i already wrote C code using PHP :P
 
<?php
$numberofpages = '20';
$i = 1;
	while ($i <= ($numberofpages - 1)) {
	$html = file_get_html("http://www.gametracker.com/search/garrysmod/?searchipp=50&searchpge=$i#search");
		foreach($html->find('tr') as $gameserver) {
			$item['ip'] = $gameserver->find('span.ip', 0)->plaintext;
			$item['port'] = $gameserver-find('span.port', 0)->plaintext;
			$gameservers[] = $item;
		}
		print_r($gameservers);
		$i = $i + 1;
	}
?>
Any idea why I get a non-object error on this line?
		foreach($html->find('tr') as $gameserver) {
 
Evening everyone!
 
@Eugene Hi.
 
9:46 PM
because you're using simple_html_dom
which is objectively a piece of shit
2
 
> while ($i <= ($numberofpages - 1)) {
 
@cHao :)
 
^^ eeeewwww
 
@DaveRandom Why so ew? It works.
 
user1125394
@Alec you should be using jQuery
 
9:47 PM
@cHao What should I use for scraping a page then?
 
DOMDocument
 
This is a one time thing I need to do, nothing that will be deployed to people.
 
Guys, now I know how much you like to talk about frameworks evil laugh
 
It's simply too much work to copy & paste 1,231 servers into a text document.
 
it's built into php, uses like 1/5 of the ram and cpu time, and doesn't freaking make php segfault
plus, you get xpath.
 
9:49 PM
@Alec while ($i < $numberofpages) { is the same thing, does not perform the same arithmetic operation on every iteration and is generally more readable
 
So here's my question on that topic.
 
which alone makes it worth it in my book.
 
@cyril , when regulars in this channel say it , it is considered to be a joke
 
megalolz
 
@cHao I'm not seeing any information on how to scrape a webpage by using DomDocument.
@DaveRandom Thanks, I'll use that instead.
 
9:50 PM
works much the same as simple_html_dom actually
 
@cHao Yeh I've never even looked at simple_html_dom, always assumed it would be completely pointless for pretty much the reasons you just outlined.
 
If I have a config file with settings like def_env for application build on this framework and other settings like rules to be parsed (to get info what env this might be), then should the file be handled on framework side Application.php -> class Application or on the app side Application.php -> class Application extends \Framework\Application ?
 
you really should not have such a class
 
simple_html_dom is the w3schools of XML
 
Plus simple and DOM don't really belong together.
 
9:53 PM
What does DOM stand for?
 
@tereško where you talkning to me?
 
simple_html_dom is ugly but its handle very well on messy/broken HTML
 
@Alec , document object model
 
@DaveRandom As another example: SimpleXml. Also creepy
 
@Eugene yes
 
9:54 PM
@tereško then I would like to ask why? Why shouldn't I have such a class?
 
it kinda depends on implementation , but usually Application ends up a class with single (usually static) method. It's just a bootstrap script wrapped in a class .. because ... i have no idea why people think that it is a good thing
 
@edorian Someone (can't remember who) has got that very true statement on their profile along the lines of "If you're trying to simplify XML you're doing it wrong"
 
sorry for multi-ping ... i have this obsession with spelling
 
What is this called? I forgot. "@$doc->performfunction();" The @$doc part.
 
the @ is the error suppression operator
 
9:59 PM
@Alec Terrible, that's what it's called
 
keeps php from spitting out notices, errors, etc
 
@ is evil. If you find yourself using it, you probably did something wrong.
 
it's only for if you already know exactly why the error happened, which is usually not the case
 
 
That is actually a rare example of an acceptable use case, if what you are scraping is 3rd party HTML
 
10:01 PM
I am.
 
Yell.co.uk is quite clever. Every single numbers is ajax
They have done it for a reason.
To make it harder to scrap
 
@I'll-Be-Back Inspect the requests, make the requests, ?, profit
 
@I'll-Be-Back no, it doesn't. it tries, and in most minor cases it does well, but it's horrible with html of any real size. and it doesn't play very well with gc at all...making it unstable as hell if you use it for much more than scraping a google results page or something
 
@PeeHaa , i dunno where you host your images , but non of them are found
ever
 
? hmmmm. hot link preventing I guess
 
10:09 PM
@PeeHaa 403 Forbidden nginx
 
First things first. Moar beer
 
i had to rewrite half the stuff here that scrapes web sites to use DOMDocument instead of simple_html_dom, because the latter was taking too long, eating too much ram, and crashing far too often. even the unit tests weren't passing anymore; they'd just die in the middle with no error or anything
 
It's the referer that does it. If I press enter on the address bar again it loads
 
@cHao What you are saying is true. Most people use simple_html_dom because it is easier to understand and document is great.. less learning curve.. hence is why simple_html_dom is so popular.
 
afk heading home
 
10:15 PM
@tereško I actually have class Bootstrap separately from class Application. Should bootstrap handle the settings?
 
why do you want to put everything in a class ?
 
> /* Be a real daemon: fork myself and kill my parent */
 
@tereško what do you mean by everything?
 
> Also I have some experience in software development with such languages like Java
 
Everything (or every thing), is all that exists; the opposite of nothing, or its complement. The totality of things relevant to some subject matter. Without expressed or implied limits, it may refer to anything. The Universe is often defined as everything that exists. It may refer to an anthropocentric worldview, or the sum of human experience, history, and the human condition in general. Theory of everything In theoretical physics, a theory of everything (TOE) is a theory that would explain and unify all known fundamental interactions of nature in a single model. Originally, the term wa...
 
10:18 PM
@tereško ^ That's why
 
@DaveRandom :)
@tereško well probably because I wan't it to be OOP and not part functions, part html, part sql and part OOP
 
@Eugene PHP is not an object oriented language. The sooner you get that through your skull, the sooner we can all go back to drinking ourselves to an early grave.
 
@DaveRandom neither is java
 
lol
 
@DaveRandom trolling is forbidden. Have a glance at 403. :)
 
10:21 PM
@Eugene , just because you wrap you code in a class does not make it OOP
you can write object oriented code in assembler
 
@tereško so you wan't to say, that half or all the people who worked on Zend Framework are idiots and must hang themselves.
 
yes
 
Awesome. What about I talking with you yet.
Beats me.
 
What is the responsibility of your Application class ?
does it contain any state or has some form of behavior ?
 
Currently it just gets path to settings file through __construct and passes them to parent Application class on framework site and later on it sets up main components Router, Request, Response. Next method after __construct, that is called for Application class is run.
I'm talking about application class on the app side
 
10:26 PM
so it is there only because you want to execute $app->run()
 
@PeeHaa I really wish there was an option to leave a comment when you cast a close vote. "This is a terrible question with an even worse accepted answer"
 
@tereško of course not.
the application class on framework side after parsing settings file, stores some of the settings inside of it. For example. Does this application need logging, what is the current env, sets default php settings.
 
go back to java
 
later on I can check weater this is env or setting I need. For example during the execution of some controller action
@tereško usually people who know very less tend to such answers
 
10:32 PM
you have created a GodObject global ValueObject , and you are trying to defend it
 
If you don't see point in this object, just say so. I do. I explained my point of view for such object. If you have a better idea, then you probably should say so. Saying GodObject or ..., is like saying I have an opinion about everything, no matter right or wrong.
 
@edorian no, IDE means Auto Completion. It stands for Intelligunt Duuuuu'h Expansion
 
class God {
  // does nothing useful, basically just here to confuse people
}
class Science extends God {
  // all real app logic goes here
}
4
 
@DaveRandom and again. Any certain suggestion on what should be used instead of Application class or there shouldn't be any at all. Should I tend to use Application class only on app side and not to have a parent Application class on framework side?
 
@Eugene , dont you get it !? In PHP you do not need to wrap everything in a class. And if you wrap it , it becomes pointless.
there should not be such a thing as Application class , because "application" is all of you code base
 
10:39 PM
@tereško unless its ground meat and you are planning a burrito
 
"in a class" != "object oriented"
jmnsho
 
and there should not be a Bootstrap class, because bootstraping is a step-by-step process , where you wire up your code
 
Classes make your code classy
 
@Eugene That was more a general philosophical comment, not targeted at you. But seriously, what @tereško is saying is true. Think about it this way: no matter what you do, you will always have to have at least one line of non-OO code, because PHP simply will not find an "entry point" if you don't. So you might as well write your main() method, as it were, in "procedural" code.
 
in java that magical "entry point" is a class, that's why in java you wrap it all in a class
 
10:41 PM
Any ideas on how to change this so it's legal?
$server = $doc->getElementsByTagName("span.ip").$doc->getElementsByTagName("span.port");
Catchable fatal error: Object of class DOMNodeList could not be converted to string in /home2/pinkfluf/public_html/scrape.php on line 5
 
@Alec the error message already tells you whats wrong. so what's the issue?
 
@Alec , because DomDocument is not extension of jQuery
 
@Alec Well, for a start, you stop trying to concatenate a collection of objects as if they were strings. What exactly are you expecting that code to do?
 
@tereško, @DaveRandom, @Gordon
 
@Alec getElementsByTagName returns a node list. to get the contents of a single element, you could say ...getElementsByTagName(...)->item(0)->nodeValue
 
10:43 PM
@Alec , in HTML we have <span class="ip"></span> and NOT <span.ip></span.ip>
 
try
{
	$Bootstrap = new \Framework\Bootstrap( DIR_APPLICATION . '/config/settings.yml' );
	$Bootstrap->setApplicationNs( 'Application', __DIR__ . '/../' );

	/** @var $Application \Application\Application */
	$Application = $Bootstrap->getApplication( 'Application\Application' );
	$Application->run();
}
catch ( Exception $e )
{
	fwExceptionHandler::getInstance()->handleException( $e );
}
 
Oooooh I see a singleton
 
At least this is how I see the start of app
 
what is your Bootstrap class, but a config?
 
@Eugene, please go back to Java , you do not understand PHP
 
10:44 PM
@DaveRandom not necessarily but it sure does smell like one
 
with maybe a smattering of DI?
 
@tereško where is my ignore list?
 
@cHao Thank you. @tereško Why so rude and discriminate?
 
@Gordon it is a temp. solution.
 
@Gordon Still a static factory if not a singleton, although I suppose if it were only used in the bootstrap that would be alright, but would also be completely pointless
 
10:46 PM
I question if the only reason you are here, teresko, is to insult people & put them down.
 
@Alec , which part was "rude and discriminate" ?
 
@Alec he's a bit annoyed at overengineering and doing it wrong
 
@tereško take it easy.
 
@tereško "please go back to Java, you do not understand PHP"
 
yesterday, by tereško
@AndyPerlitch there also isn't a room for posting nude pictures of people over 80 ... that does not mean that PHP chat room would be the appropriate place for it
we could create one
 
10:48 PM
@Alec , yes , and i said it because the person, at which this was aimed, is pretending that PHP is "Java with funny syntax"
in php the entry point is NOT a class
 
@tereško
 
@Eugene , are you saying that it is not how you approach php ?
 
@tereško PHP is essentially Java, syntax wise.
 
@Eugene: the point of bootstrapping is to get to the point where you can load stuff easily. That stuff you're doing, instantiating a Bootstrap and setting everything up? That is bootstrapping. Your class isn't even capable of doing its own job. Making it useless.
 
10:49 PM
@tereško I remember, that you told, that you were having a situation, where junior dev. explained something to a senior and he didn't understand him. Now I see why.
@tereško feel free to leave at any time )
 
@Eugene You're missing PHP's point.
 
@Alec PHP isn't Java. PHP borrows from Perl, C, Java and a number of other languages. But it sure aint Java. Rather, PHP is like the Borg. We assimilated a lot from others. But we are not like them.
 
@Gordon I never said it was, I don't see why you made that assumption. I simply said the syntax is the almost the exact same.
 
@tereško really. Wow. You opened my eyes. Awesome. You are like mega brain.
 
php actually borrows hugely from c, with a little from java here and there
 
10:51 PM
@Alec what makes you think that? . vs ->. $ vs nada?
 
@Eugene then why are you trying so hard to make the entry point to be a class ?
how exactly bootstrap stage of application is like an object ?
 
@tereško I completely lost your trail of thought.
 
@Gordon Yes, there are differences. I never stated that they are exactly the same. I only said they were very similar.
@Eugene Same.
 
@Alec well, they are not. at least not much more like any other language. I mean C# looks more than Java than PHP. Even JavaScript looks somewhat similar.
 
It seems like in this room everyone has an opinion regarding something, but not about what they were asked.
 
10:54 PM
@Gordon , that's not true anymore , with the latest itterations of c#
 
@tereško as true as PHP looks like Java ;)
 
@Gordon I never stated that Java was the most similar language to PHP, I merely said it was similar.
 
@Alec which it isnt :)
 
to be fair, c# started out with a huge case of java envy...the syntax was nearly identical. not any more, though
 
well .. for first few years i pretended that php was c++ with strange syntax .. then i started to actually learn php. This is what we call "being a noob"
( and no , my "native language" is pascal )
 
10:56 PM
@Eugene if you ask the wrong question, you'll hear about it. what can i say, i hate solving the wrong problem, and i assume others do too.
 
Ignore option is awesome here.
 
user1125394
@Eugene yep seems php classes are above all useful for Models, but not config, what is wrong with that?
 
Chat got much cleaner :)
 
42 mins ago, by Eugene
@tereško I actually have class Bootstrap separately from class Application. Should bootstrap handle the settings?
 
heh...so you want to hang out in the php room, but ignore half the people in it?
 
10:58 PM
I hope he added everyone who disagreed with him to the ignore list
 
@cHao Seemingly, he did...
 
@cHao nothing wrong with that. I do that all the time :D
 
eh...i never bothered to learn how to ignore here.
 
@cHao you can do that mentally. you dont need fancy chat features for that
 
Hello? Can anyone hear me? NOOooo.....
 
10:59 PM
you click on the tiny picture besides the name ... an look at the bottom
 
the few people i genuinely want to ignore, end up flagged into a chat ban anyway :)
 
I will ignore all of you now by heading to bed. night folks. cya. byebye
 
later :)
so, who here isn't ignored? lol
 
@cHao very sad if you take the half of this room :)
 
:)
i basically have a policy against ignoring. it's somewhat based in paranoia, i guess...you never know what those people you ignored are saying about you :)
 
11:03 PM
you can still see all of the content in the transcript
 
@cHao don't care.
 
k :)
 
pce
@Eugene whats wrong with handling settings during bootstrapping?
 
Slightly related poll: would people like the cv-helper to work in transcript or not?
 
/me does not use cv-helper
 
11:06 PM
@DaveRandom i semi want to say not. consider that the question may well have been fixed in the possibly-quite-a-while between when the cv-request was posted
and when you look at the transcript
 
@cHao That will be accounted for in the next version ;-)
 
i don't use it either
just having an opinion
lol
 
Well, sod the lot of you :-P
 
lol
 
posted on September 28, 2012 by Christian Weiske

I've just released phorkie 0.3.1, which brings you OpenID login and federated paste forking. phorkie is a self-hosted pastebin application written in PHP. Its pastes are editable, may have multiple files and are stored in git repositories. OpenID login Thanks to the help of Justin J. Novack, you may login with your OpenID to get pastes ass

 
11:19 PM
@Feeds All that trouble for gists?
 
@Gordon Sorry had to get some food.
<?php
$int_number = 0;
while($int_number < 100) {
	printf("Num: " . $int_number . "<br>");
	printf("Current number is not yet 100, adding 1." . "<br>");
	$int_number = $int_number + 1;
}
?>
public class Jexample {
	int int_number = 0;
	public static void main(String[] args) {
		while(int_number != 100) {
			printf("Num: " + int_number);
			printf("Current number is not yet 100, adding 1.");
			int_number = int_number + 1;
		}
	}
}
 
@PeeHaa He never responds to criticism, that Feeds guy. Anyone would think he wasn't listening.
 
@DaveRandom //sometimes, I feel like the compiler ignores my comments...
 
@Alec All you have demonstrated there is a relatively similar syntax. These days the two languages don't have much more than that in common, along with about 7000 other languages. Also what is the point in making int_number a class member and not a local variable, it doesn't pertain to anything outside the context of the main loop. Also, people who use printf() when echo (or println()) will do must die.
1 hour ago, by DaveRandom
> /* Be a real daemon: fork myself and kill my parent */
I'd forgotten just how good some of those comments are
> /* This is O(scary), but seems quick enough in practice. */
 
@DaveRandom Yeah. He always has to be like that
 
11:36 PM
I am totally stumped by the edits dropping notifys, I've been through every line a thousand times and I just can't find the problem, it's really pissing me off now. I've come to the conclusion that the whole tracking system needs to be completely redesigned, that stack approach is a bit too dumb, it needs something map driven I think, but ordered maps are a PITA to implement in JS and it would involve a mahoosive refactoring so I'm ignoring the problem for now.
Will fix before pull though
 
what was the correct pronouncation of "Samhain" ?
 
Is there a PDO global constant for SQL's DATETIME data type?
 
no
 
no, but it's just a string anyway
I think that's true of libmysql as well (?)
 
Hmmm I think I have to repopulate $_POST into session? Let say user fill the form and click on Submit - it will then go to next page to validate.. If there is an error then go to back to main form... In order to repopulate use SESSION?
 
11:40 PM
so using PDO::PARAM_STR is okay to use if i'm binding parameters in an SQL statement that uses a DATETIME?
 
@I'll-Be-Back Easiest way, but not very at all RESTful (if you care about that)
 
user1125394
validate with jQuery
 
@cyril no.
 
user1125394
lol another JS hater
 
@I'll-Be-Back No?! jQuery is the answer for all!
 
11:42 PM
@cyril JS != jQuery
 
not sure why would you actually use DATETIME instead of TIMESTAMP
 
Are you talking about Ajax?
 
validate via AJAX
 
the specifics of the database aren't under my control, i'm just wondering if binding the parameter as a PARAM_STR is okay.
 
11:43 PM
@I'll-Be-Back You'd still want server side validation, ajax validation can be easily circumvented by a malicious user
 
Yea I am not going to do ajax validation
 
Although to be fair you'd probably be less bothered about re-populating the form for a malicious user
 
That will be Secondary validation
 
user1125394
@DaveRandom or prototype.js .... ok I know the submit event is native, but that's easier to use with this %!* of jQuery
 
@cyril , you really should spend some time learning proper JS. I would recommend a mix of eloquentjavascript.net and yuiblog.com/crockford
 
11:44 PM
@cyril Read that link I gave you very carefully.
I really like that site, it took even me (and I am obviously perfect) quite a while to get it
@I'll-Be-Back Do you care about REST? If not then store $_POST in $_SESSION. If so you'll have to be more selective and probably just pass the values you actually need back via $_GET
 
user1125394
^^ok I , and I'llbeback yep I'v been using jQuery(sorry)mobile and all actions are ajax, it would work in your case
 
DaveRandom I have never done REST
 
@I'll-Be-Back Yeh I'm not as much of a REST fanboy as some. I agree with some of it, but quite often the whole "stateless" thing is counter-productive. IMHO.
 
I'll stick with SESSION for now :)
@DaveRandom How would you use REST for my situation? I will learn it later.
 
user1125394
he means session is not restful
 
11:55 PM
@I'll-Be-Back From the fact that your are even asking about needing to store stuff in session, I presume you are implementing this as PRG?
 
Oh
I'll post the code in Stack Review so you can see what I have done.
 

« first day (713 days earlier)      last day (4235 days later) »