« first day (1086 days earlier)      last day (4084 days later) » 

19:03
@Simon_eQ Yeah it's like trying to just read one Wikipedia article.
guys, there's an avatar image on my wordpress website that is taking 1.2 sec to load average
it is called by this function
Anonymous
@Starsong no back to review as promised
".get_avatar( $post -> post_author, 71)."
i'm noob at php, but I've came this far... Instead of deleting the code I would like to specify maybe an fixed image
or something
any ideas?
@Simon_eQ Send me this tomorrow at work, I'm on my tablet so review now would suck :P
I will review in my lunch break for sure
Anonymous
thanks. i'll check up on you tomorrow.
Quick preference question: Do you prefer all lower caps or First word cap for directory names and namespaces?
(does PSR ever say anything about that?)
Probably lower caps.
user924016
@MadaraUchiha i prefer uppercase first. I would match it with the dir if you are using namespace autoloading
@MadaraUchiha if your code is object oriented namespaces should start with a capital letter
@NikiC It is, how about directory names?
Save for say, webroot, which would contain no OO code.
19:12
@MadaraUchiha I don't believe the PSR says anything about the case, but both <namespace> and <package> are meant to be proper nouns, so require a capital letter in English.
Also, everyone does upper-case.
@MadaraUchiha directory names have the same case as the namespace (i.e. typically uppercase). Unless you mean stuff like src/ and test/? (in which case its lowercase)
@NikiC I'm still honestly not sure how to structure my app
I was thinking of webroot, Application and maybe tests at the top level
(Is there a standard for such things?) It's a side project I'm starting for fun and maybe future profit
user924016
Hmm question on refactor. I was refactoring and ran into this.
for($i = 1; $i <= $quantity; ++$i)
{
$Card = $this->getBottomCard();
if(is_null($Card))
break;
$cards[] = $Card;
}

Changed it to

for($i = 1; $i <= $quantity && ( $Card = $this->getBottomCard() ) !== null; ++$i)
$cards[] = $Card;

Do you think this makes it unreadable or is a shitty way of writting it?
@QuackQuacker $this should implement Iterator (or some extension of it), then you can foreach over it.
user924016
@MadaraUchiha it part of a method that pulls out a specific number of elements out of the bottom fo a stack
19:17
@QuackQuacker Your point?
I'm sure there's an iterator for it (or you could implement one yourself)
user924016
@MadaraUchiha foreach starts at the top? Here is the full method
    	/**
    	*	Returns \Cards\CardStack with quantity of cards from the bottom.
    	*
    	*	@param int $quantity
    	*	@throws \InvalidArgumentException
    	*	@return \Cards\CardStack
    	*/
    	public function getBottomStack( $quantity )
    	{

    		// throws InvalidArgumentException
    		$this->validateQuantity($quantity);

    		if($this->hasAvailableCard() === false)
    			return new CardStack;

    		$cards = [];
    		for($i = 1; $i <= $quantity; ++$i)
user924016
@MadaraUchiha thanks
@QuackQuacker CTRL+K when entering code
(first enter code, then CTRL+K)
Wow, interesting, I didn't know chat did that!
@NikiC Do you get this ping?
@MadaraUchiha yes
That's neat, didn't know pinging worked in code
No word highlighting though :P
@QuackQuacker This method is a part of... what?
(What class)
user924016
19:20
CardStack
user924016
Want the interface?
@NikiC is there a type of Iterator which allows me to iterate only a set number of times?
user924016
@MadaraUchiha it should not just interate, it most also remove the element from the current stack.
(as in, get the $n items off a stack's top/bottom/random)
@QuackQuacker A personal implementation of Iterator is probably what you want.
user924016
19:22
The getBottomCard uses a array_pop on an internal stack
That way you can set whatever functionality you need.
While still maintaining an Iterator's API.
7 mins ago, by Madara Uchiha
I was thinking of webroot, Application and maybe tests at the top level
@NikiC what do you think? ^
I added this
@QuackQuacker Not sure if relevant, but the SplStack will also remove elements when iterating ;)
<IfModule mod_headers.c>
   Header set Connection Keep-Alive
</IfModule>
to my .htaccess, but my server is still responding with a Connection: "close" header. Why?
user924016
@NikiC thanks i will check it out
19:24
@MadaraUchiha uh dunno. I wouldn't bother thinking too much about it
@ŠimeVidas What do you get when you explicitly set it with header()?
but seems reasonable
@NikiC Meh, I don't want to make a stupid mistake early on just to regret it all the way in the middle of the project :P
@MadaraUchiha I don't have PHP on my server
@ŠimeVidas What do you have then?
19:25
@MadaraUchiha Static HTML + images
I am very sorry it took this long, but here it is: New #fail compilation of aug/sep
@PeeHaa Flash #FAIL
user924016
@MadaraUchiha you are right, the iterator is perfect for the class, it actully implements exactly the functionality i need for "viewing" the stack without manipulating it. I will add it when im done with the current methods and after i wrote tests for each of iterator interface.
@QuackQuacker Sure thing, glad I could help :)
user924016
19:40
@NikiC the splStack class implements a number of things i do use. Is there a way i can extend it and hide its methods ( like... i want them to be in the private scope) so i can provide a more "CardStack than Stack" interface.
@QuackQuacker no, that's not possible
can't remove methods, that would violate LSP
user924016
@NikiC okay, i would rather like to overwrite the scope
user924016
But i know this isnt possible
user924016
Thanks for the input none the less, it is appreciated and it also made me implement Countable to the interface
user924016
Is there traits i could use instead?
user924016
19:46
no.. nvm...
user924016
lol
Anyone have any idea why my like button doesn't work on my site?http://reallydownornot.com/

Facebook gives me an error "linting" the page, and google has brought no answers.
A few people have already asked this here but there are no answers.
How would you define a "package"?
For that sense, what would you put in a @package tag in PHPDoc?
@AlexCastro What doesn't work?
Also, you know that isup.me exists, right?
Just sayin' :P
Try using my site first and you'll notice the clear difference.
19:56
Mmhm
You can claim a website, which lets you get a dofollow link from our site and add a description. Users can comment on the domain, and there is also a historical chart, which isup.me doesn't do.
@AlexCastro Where is the server located?
The server is located in Dallas
What isup.me did right though, was that if a site I want is down, I only (usually) want to check if it's down.
corrected
19:57
I (again, usually) don't care about comments or history or claiming domains of sites that exist, because I checked if they're down or not
Okay but just try clicking the like button on my site and watch it: reallydownornot.com
@AlexCastro It pops open then instantly closes?
Or is this some clever way to get free likes? :P
(kidding :D)
haha
Dying for 1 like
But really, it's just not saving my likes.
I even tried going through the plugin page on facebook's website
it simply does not record the likes
I think the best you can get is to consult Facebook support.
I don't know if we have many facebook devs around
What are private constructors used for?
20:02
@JonyKale singleton pattern
new DocumentClass();

public function __construct() { //fine
}

private function __construct() { // error
}
@PeeHaa Ill take a look thanks
@PeeHaa let's say you have baseController & indexController that extends baseController.

When you do new indexController, you pass an object inside it. Now you want to save that object in baseController as a property, and make it protected.
Now for that, you've set up a constructor at baseController.

Now, you want to create an object in indexController, like $this->object = new Object();

Will you get an error if you have 2 constructors there? at indexController & baseController?
Do I look like a codepad?
Yes
new indexController(new Object());

class indexController extends baseController{
	private $obj;

	function __construct() {
		$this->obj = new Objectnew();
	}

	protected function index(){};
}

abstract class baseController {
	protected $registery;

	public function __construct($object) {
		$this->registery = $object;
	}

	abstract protected function index();
}
That's what I mean, can I do that?
20:23
emm ... what is the point of this ?
@JonyKale private constructors are usually a red flag for bad practices
also, you might want to look into this new thing: namespaces .. it's this new feature that has been around only for 4 years or so
@JonyKale you'll have to call parent::__construct($withSomeObject) in the subtype constructor to make that work since the parent constructor will not be called automatically.
0
Q: Facebook Likes Not Saving

Alex CastroI have integrated a Facebook like button on my website, however the likes are not saved. Upon clicking the like button, you'll notice that the like disappears after a few seconds. Here's my site: http://reallydownornot.com Facebook's website itself cannot lint my site either: https://developers...

Let me know if you can help :)
why do people attempt to mimic CodeIgniter ?
Because they don't know better.
sitepoint.com/integrating-the-data-mappers Where does "UserInterface" come from? Not ModelUserInterface but UserInterface.
20:39
@Fabien because someone added "Model" later
I just assumed his \ key broke.
All his namespaces are like that. "use LibraryDatabaseDatabaseAdapterInterface;"
@Fabien naming things FooInterface or ModelSomething is pointless. If it's a Foo, name it Foo
@Fabien "PHP 5.2 type coding detected"
Would you just structure the dirs to make sense of it all then?
Model/User.php
Interface/User.php

etc..
@Fabien no. it's unimportant whether something is an interface or a model
Feels like I am trying to run a little before I can walk. I may scrap the whole MVC build on LamePHP and use a framework or something for now.
Anonymous
@Gordon something quite fishy here seems like all flags have been found helpful, but all the answers have still may name
@Simon_eQ its causing extra work for us. nothing fishy. just be patient
Anonymous
21:01
oh, sorry about that. Didn't think of it like that.
Is there any meaning to sign commits or tags when I work on a project alone, and it's intended to be closed-source?
@Simon_eQ "Have still may name"?
Anonymous
damn, too late :)
Anonymous
@MadaraUchiha I just realized I have 9.3k comments in this room, and I have been active for about a year, as much as anyone. Now, am not asking you, I'm telling you! make me a room owner );
Anonymous
and I mean that NOW!!
Anonymous
21:09
don't keep me waiting...
Heh
You dare command me mortal?!
Anonymous
My lord, it's just ... it's just you know.
He's a genin.
@Fabien He's not even that, he's in the Academy! No wait, worse than that! He's an ANBU.
Anonymous
I need to be a room owner, I have been serving you for too long, and my powers are growing ... :[p
21:13
heh
ANBU I TELL YOU!
Have you noticed the incredibly high mortality rate among the ANBU that were seen in the series? :P
Damn no shingeki no kyojin today :( Season must be over.
@Fabien Actually, the series is officially over.
Anonymous
as far as anime is on topic, I have only watched deathnote.
No one knows when it returns :(
21:14
What!?
Damn, on to the manga I guess.
I have the strong urge to go to Japan and start mass murdering people.
Yeah, NSA, I said it!
Anonymous
lol
Anonymous
The was a spree killing that occurred on 21 May 1938 in the rural village of Kaio close to Tsuyama city in Okayama, Japan. , a 21-year-old man, killed 30 people, including his grandmother, with a Browning shotgun, Japanese sword, and axe, and seriously injured three others before killing himself with the shotgun. Until the 1982 killing by Woo Bum-kon, this incident was regarded as the world's worst massacre by an individual, except for the 1927 killing of 45 by Andrew Kehoe.[http://www.foreignpolicy.com/story/cms.php?story_id=3822 ForeignPolicy.Com The List: The World’s Worst Shooting ...
Anonymous
21:16
30 people with a sword, now that's something unbelivable.
@Simon_eQ otherwise known as Itachi Uchiha
That night was fun :3
lol
Poor Itachi
@Fabien Itachi is my absolute favorite character of any anime.
And I've seen plenty. He's the most misunderstood, deep, awesome character out there. Period.
They make out like Sasuke is more powerful, but let's face it Itachi is the strongest ever.
@Fabien Itachi would own Sasuke in a fair fight
Let's move to the anime room instead of littering here? :D

 Maid Café (メイド喫茶)

Welcome back, my Master! (お帰りなさいませ、ご主人様!) Sit wherever you'd l...
21:19
@NSA: Having fun reading all these conversations?
@Fabien the naruto sucks
it's boring
@tereško I'm mostly watching for the battles and the soundtracks
The plot stopped being interesting long ago
Sometimes next to Itachi vs Sasuke it got suckish.
@tereško Yeah, but it started when I was young and now I am tied to it. It's no where near my favorite but I enjoy the manga. It's almost over I think too.
21:22
this was supposed to be a flame-bait, ya know
@tereško You didn't count on us agreeing with ya :D
But screw that, SnK is over TT^TT
The only downside to SnK manga is that it's drawn pretty crappy
But plotwise it's the most interesting series I've seen since Death Note
Maybe even more than Death Note
I think I'm going to watch SnK anime to the end when it comes out, then I die. With a smile.
Anonymous
off to getting drunk, and watch hot Brazilian chicks.
Look but don't touch.
@Simon_eQ Cheers to that
And I am off to bed :D
night folks
Anonymous
@MadaraUchiha & I expect to have been made a room owner by the time I return.
Anonymous
21:27
:p
Anonymous
later ..
@Simon_eQ not all Brazilian chicks have the ... emmm ... original parts
be vary of traps
Anonymous
@tereško disgusting :p
yeah couple of my friends had that issue in Borocay, Philippines.
Hi. :))
21:32
i'm off to bed too, night!
@Simon_eQ well .. I'm actually unsure what I think about it all. My current stance would be described as "puzzled".
BTW @tereško I assume you meant "weary" rather than "vary". Unless you were saying it in some sort of Russian accent. In which case, spot on.
i was writing in a hurry
since my english vocabulary has been populated using mostly anything but the written word, I often have to check how to spell some word or another
hell .. my understanding of spoken russian is extremely good, but I cannot write a single word in it
21:57
Russian alphabet is nuts anyway
user924016
Nn
heyo !
ermmmmmmmm
can someone help me out
please
i am trying to figure out how to translate output to multiple languages easily and i wanted to know if there is some way to do it
nvm disregard
:D
figured it out
peace!!!!!
If a an answer just links to two other answers, what do I flag it as?
wouldnt you mark the question as already asked?
that is to say if the answer is correct
@Hanut answer, not question
yeah i know but if the answer already exists then the question is a duplicate
no?
23:00
-2
Q: Is separating every query to a DB a good application design practice?

FahadI have a site that I'm working on where it will basically play videos for users based on a subscription. So users who subscribe to videos a,b,c will not be able to see or access x,y,z. In order to do that I have a db query every time a page with video content is loaded. The videos are structured...

not neccesarily in this case, as the question is crap anyways =oP
:D
ooh my scathing
@crypticツ Both "it is not an answer" or "it is very low quality" and would be fine? Also - you have become more cat like.
You seen a doctor about that?
@Danack just changed my hats =oP It's October!
Btw...can someone answer this for me... whats with dependency injection? Theres an entire group of people promoting it and then I come across folks not wanting to touch it with a barge pole
23:07
0
Q: How to automatically handle all unhandled exceptions in symfony2?

zerkmsIn in my controller action I call $i++; or \bla(); where either is not defined. And run it in the default app.php with all the default symfony v2.3.5 configs - I see Notice: Undefined variable: i in /var/www/.../UIBundle/Controller/DeployController.php on line 57 Call Stack: 0.0000 ...

guys, I really need a help now :-)
@zerkms Why not just fix the issue? "Undefined variable: i" i.e. you're trying to use a variable which is not defined.
@Danack it's just an EXAMPLE
I'm asking how to log EVERYTHING
the code should never show stack trace. Period. The question: how to demand SF2 to do that
@Danack aaannd...it was disputed =oP, figures...
Either that or hack your app.php to catch everything. However not every PHP error is catchable.
e.g. calling a function that doesn't exist - will give a fatal error rather than exception.
Well, let's change it then
@Danack changed it to $someobject->bla()
so - now it's non existent method
oops, it's not recoverable as well
23:18
trait SafeAccess {
    public function __set($name, $value) {
        throw new \Exception("Property [$name] doesn't exist for class [".get_class($this)."] so can't set it");
    }
    public function __get($name) {
        throw new \Exception("Property [$name] doesn't exist for class [".get_class($this)."] so can't get it");
    }

    public function __call($name, $arguments) {
        throw new \Exception("Method [$name] doesn't exist for class.");
    }
}
"Either that or hack your app.php to catch everything." -- that's silly. I don't believe 20mb sf2 cannot handle it out f the box
One of the few things traits can be used for - making PHP throw an exception when it should be throwing a farking exception.
@zerkms If you're seeing E_NOTICE on a production box, you can just set the error reporting level to not show that. Or set the error handling to actually throw an exception php.net/manual/en/function.set-error-handler.php that can be caught properly.
@Danack ?
I know that
The question is - how to ask sf2 to do that
I'm using a HUGE full stack framework so that it did all the routine for me
if I wanted to make it from the scratch - I would do that without its help obviously
setting the error level is in php.ini - it's outside of any framework.
23:27
handling errors + logging it + presenting nice is what FW is supposed to do out of the box
uhm, how is it related to setting error level?
I don't want to silent the error
It's not clear exactly what is happening in your question - but "Notice: Undefined variable: i" is just a E_NOTICE warning - it doesn't actually throw an exception that can be caught.
You would need to set a custom error handler, to catch E_NOTICE warnings and throw an exception.
In dev environment symfony does it for me
It sets its own custom error handler
and that's what I want to have in production as well
I have always been thinking that every FW these days just converts php errors into exceptions and handles them without special request
23:49
Think I goofed :(
@Danack seems like Debug::enable(null, false); is what I was looking for
no additional custom code to handle that
@zerkms Cool - it may still not cover the 'method not defined' problems though.
@Danack yeah, it was just a bad example. I did put it randomly for example
of course I don't expect anything like that in production ever )
But anyway
[2013-10-07 12:53:29] emergency.EMERGENCY: Call to undefined function foo() {"type":1,"file":"/var/www/.../UIBundle/Controller/DeployController.php","line":‌​57} []
this is what I have with undefined function
so - now I can at least make a custom notification
or whatever I want
@zerkms Probably something for tomorrow - but PHPstorm can do code inspection to do a static analysis of code to detect calls to undefined functions - jetbrains.com/phpstorm/webhelp/code-inspection.html
It can be in runtime
like - null instead of a object of an expected type
But it seems like there is no way to output something sensible without hacking sf2 in case of an unrecoverable fatal
it just

if (!$this->displayErrors) {
return;
}
and doesn't allow to specify a custom page in such case

« first day (1086 days earlier)      last day (4084 days later) »