« first day (450 days earlier)      last day (4480 days later) » 

1:14 AM
Anybody else do codesprint?
 
Not I @Anfurny
Anyone else using NetBeans 7.1 yet?
Perhaps you @Anfurny?
 
No, is that for windows?
 
@Bracketworks I've been using NetBeans 7.1 since beta.
 
And how does it compare to zs?
 
Is out out of beta now?
 
1:20 AM
@LeviMorrison Yea; @Anfurny And Linux, but I'm on Win
@LeviMorrison Question for you then, have you noticed that [Alt] + [Insert] doesn't have the code generation feature for implementing/extending classes anymore?
All I'm getting is database connection, or constructor.. Implementing classes can't generate the method sigs for their interfaces anymore (or so it seems, I hope I've failed to set some config, otherwise I'm going back to 7.0.1)
 
@Bracketworks I assume you are coding PHP?
 
@LeviMorrison Yea
 
@Bracketworks Let me try it really quick.
 
@LeviMorrison Sure, thanks; it worked like a charm (mostly) in 7.0.1, but it's disappeared altogether now. I checked the bug reports, couldn't find anything on it yet. Might have to file one.
@LeviMorrison Actually, wait.. They've gone and changed it
Now it appears to be [Alt] + [Enter] on the class name in the definition (it kicks down a box with "Implement All Abstract Methods") which works, but is quite shitty compared to the previous generator
Previously, you could pick and choose which methods to implement, and it provided a nice dialogue with the list of interfaces/classes you were implementing/extending from
 
1:41 AM
You seeing what I'm seeing @LeviMorrison ?
 
2:35 AM
posted on January 09, 2012 by till

First off — I don't have too much experience with disqus on Wordpress but when I looked at the code(-quality), disqus is one of the best plugins for Wordpress to date. I looked only very briefly, but I found it to be very clean, well documented and well architected. Good job, disqus! In case you happen to dive into Wordpress plugins in 2012, you will see that this is unfortunately not a given

 
 
1 hour later…
3:56 AM
why people are so lazy to think?!
0
Q: How to avoid multiple query submit in php?

Jilson ThomasI have got a problem with the following code. This is a code for a quizzing site. The user will enter answer in a text box based on the question and the answers are stored in the database. The comparison is done by taking values from the database table. If it's correct, then his/her point is incr...

 
4:49 AM
You know
 
I don't
 
when people ask questions like that I just assume they are lonely... because even typing that question out takes more effort that figuring it out...
 
otherwise I wouldn't ask :-)
 
That was more of a "Ya know, "
 
:-S
 
4:51 AM
Hey @zerkms :)
 
@BoltClock: oh... Haven't you seen here ever!
 
I know. Just started coming here like a few days ago
 
when I'm boring I enter here to catch some lulz :-)
@BoltClock: have you seen I've finally moved to NZ!!
 
Yooo!
 
@zerkms I saw it :)
 
4:53 AM
wassup ?
 
yep. Now I'm one of you ))
 
@zerkms One of us...?
 
one of people living in a "civilization"
:-)
 
lol
 
yeah, sad but true
it is so cool living here in comparison to my former place
 
4:55 AM
@zerkms How are you ?
 
@OmeidHerat: went from work 1 hour earlier because of stomachache
so feeling a little ill
though I expected some issues earlier, because of different cousines/meals here and there, but my food adopting just passed fine
:-)
 
Cool then.
its always hard to get use to food.
at least for me.
 
yup. me and wife tried that white boxes with china food
you know - everyone eats them in films
well, it was sooooo terrible
 
hahaha, I don know there, but only chinese food that I eat here is a mix of rice and stuff called wokinbox.
Other then that, I wouldn't be able to work the next day.
 
this is what I was talking about
generally we like chinese food, but that ones were just terrible
 
5:04 AM
Here is mine
almost same stuff. but this oen has noodles instead of rice.
 
oh, one more funny fact about "civilization": white sugar here is like a powder
with very tiny corpuscules/particles
 
and the salt is the other way right ?
 
The salt is a little bigger
the salt particles size is in the middle of "russian white sugar" and "local white sugar"
 
So how is russian table salt ?
is smooth like powder or has bigger grains ?
 
bigger
 
5:08 AM
oh, it's smooth in my country.
when I first moved here, I got salt and sugar wrong a few times.
That was how I managed to have my first Salty coffee :P
 
hehe. we've bought boxes of different shape to solve that )
first? not the only incident happened? :))
 
lolz, no the other time it was midnight and I decided to make coffee with moon light.
and I got salt and sugar wrong.
:P
 
that's why it is bad to eat in the night
 
There is even more things that can go wrong with midnight food.
Fire alarm.
 
6:06 AM
Where would you put the PHP's run time setting for Session, in the initialization of Bootstrap or Session initialization ?
 
Hello all
 
Hoolla
 
6:26 AM
Been fooling with logos for my framework; I think I've settled
 
user47322
7:20 AM
hello #php
 
8:00 AM
Morning
 
Morning
 
8:31 AM
I am still thinking about this one:
2 hours ago, by Omeid Herat
Where would you put the PHP's run time setting for Session, in the initialization of Bootstrap or Session initialization ?
and I got one more.
 
@OmeidHerat What do you mean by "run time setting for Session"?
 
PHP setting through ini_set()
 
What session settings are you referring to?
Storage option maybe. And i guess as you are creating your Session instance (if you wrapped it) or start your session relatively close to the bootstrap it doesn't matter all that much where you put the settings as it's only one place that starts a session anyways.
If we, for example, talk storage option (memcaced vs disk) then having the settings in the code that actually starts the session seems to make more sense
in/closeTo
 
8:49 AM
posted on January 09, 2012 by Fabien Potencier

Before we start with today's topic, let's refactor our current framework just a little to make templates even more readable: <?php   // example.com/web/front.php   require_once __DIR__.'/../src/autoload.php';   use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response;   $request = Request::createFromGlobals();   $map = array( '/hello' => 'hello',

 
@edorian I see.
here is my session setting
		//Prevent Fixation.
		ini_set('session.use_only_cookies', 1);

		//Five min is a long time.
		ini_set('session.cache_expire', 5);

		//Five min still.
		ini_set('session.cookie_lifetime', 5 * 60);

		//Prevent ugly XSS.
		//Must be zero to use cookies in JavaScript, but you don't, SERIOUSLY! use XHR instead.
		ini_set('session.cookie_httponly', 1);
and I do use a wrapper, I wrap the $_SESSION to be able to encrypt it and also avoid using a global variable.
 
@edorian Currently I have put the setting in the Session initialization. but was wondering if it would make more sense to have all the setting in a config file.
and here is my second question.
Currently I use $_SESSION inside my Session, would it make sense to pass $_SESSION with reference to a private parameter and use that inside the other methods of Session instead of using the $_SESSION itself ?
That way in future can pass some other ArrayObject that can save the data in DB or somewhere else.
 
I'd just use $_SESSION inside the class. If you at one point need something else you need to ether change the class or create a new one anyways. Seems not worth it to 'guess ahead' there.
Those default settings can go into the normal bootstrap for all I care for
"Should be in the php.ini" stuff can go into a bootstrap :)
Well it depends on what you are creating... if its part of a framework that allows users to use their own session handling than settings that stuff always might not be nice.
 
Thanks heaps.
 
9:18 AM
Would you extend the PDO or warp it ?
and why ?
0
Q: PHP: Would you wrap PDO or Extended it?

Omeid HeratMy question is fairly clear. and I really would like to hear some reasons for the answer. Additional information: I don't use any kind of FW. Of course PHP > 5.3.

 
Not the downvoter, but I don't think your question is clear.
It is borderline subjective, and really really broad, being nothing more than the title.
 
@OmeidHerat if you wrap it, you do not have public API
so the question is whether you want to use your own API or that of PDO. If you want to use that of PDO, you can extend it.
in general, favor composition over inheritance
Composition over inheritance in object-oriented programming is a technique by which classes may achieve polymorphic behavior and code reuse by containing other classes which implement the desired functionality instead of through inheritance. This technique is also referred to as "Composite Reuse Principle". Basics An implementation of composition over inheritance typically begins with the creation of various interfaces representing the behaviors which the system must exhibit. The use of interfaces allows this technique to support the polymorphic behavior that is so valuable in object-ori...
on a sidenote, starting questions with "My question is fairly clear" is always a wrong assumption ;)
 
10:03 AM
Happy New Day!!!!
@Gordon: Maybe you can give this Zend Framework user a hint how to invoke it via Unit-Tests:
1
Q: Zend_Controller_Router_Exception: Route default is not defined

RafaelI'm trying to test a controller. Zend Tool has generated the following code: class Default_CarrinhoControllerTest extends Zend_Test_PHPUnit_ControllerTestCase { public function setUp() { $this->bootstrap = new Zend_Application(APPLICATION_ENV, APPLICATION_PATH . '/configs/application.ini...

 
@hakre zf cannot be tested :)
 
Ah okay, I thought it could be gg
 
i gave up testing components of it
especially if they involve any of the MVC components
 
I'm not that good with ZF but wanted to take care of some PHPUnit related questions as Edorian was on the road.
 
and good morning to you
 
10:06 AM
Yeah. Thx. It was a little later yesterday finally for me.
 
:)
 
I never answer anything on that is about Zend Framework
Most of the questions involve Zend_Controller_TestCase and I'm not going there
(or how to turn of the CSRF protection in Zend Form)
 
Oh well.
You know that reminds me on CodeIgniter
It's sometimes funny to see how the same problems lead to similar behaviour even those two frameworks are quite different.
It's this static state that turns things down. You can't de-compose things flexible any longer. It's becoming all-or-nothing in the end.
 
Zend MVC is just broken for testing. You need the entire request lifecycle to make it work. And there is very little you can stub/mock. And those parts you can mock/stub will give you instapain due to the magic methods. you never know if you need to mock __call or a real method. it's just painful.
 
10:40 AM
How to deal with such questions? stackoverflow.com/questions/8787094/…
I voted to close because well, not a real question or off-topic.
 
to localized?
 
or not constructive
hi @edorian! :)
 
hiho :)
 
@hakre all questions asking for something with GoDaddy should be closed for supporting SOPA
 
Closed as: Bad for society?
 
10:48 AM
@hakre If you want a serious answer: off-topic. It's simply not programming related at all.
 
@BoltClock thx, did that in the first place, voted to close because of off-topic.
 
11:07 AM
Does deal with non- questions? :)
 
Javascript, mysql, html/css count too :P
 
@BoltClock yeah, we close everything we can reasonably close
 
Ah
 
and we dream of a php tag that by default has all questions closed as duplicate and which have to be reopened first
 
lol
It took me ridiculously long to find a duplicate for this
I'll let you guys close it :P
1
Q: when to use `>` sign in css?

monkI came across many many websites and I saw many of them use this type of notation in their css file for creating navigation bar like : #navigation ul li > ul { /* some code in between */ } but when i omit the > sign as #navigation ul li ul { /* some code in between */ } this sti...

 
11:16 AM
@BoltClock likely because you cannot search for symbols like that. its somewhat easier with google
 
I was hoping to find something that compared both selectors, but too late I guess.
 
i used google a lot to compile stackoverflow.com/questions/3737139/…
 
Sid
Hi guys, I have a search by location functionality in my cakephp app. It allows the user to enter a postcode and then all records from the table are meant to be retrieved as well as having their distance calculated from the user's postcode. It works to a certain extent, however the query doesn't seem to retrieve records that are less than one mile to the user's postcode - how can i debug this issue?
 
Morning!
 
11:32 AM
is a valid tag?
 
@Gordon Wasn't that burninated a short while ago?
 
@BoltClock damn :)
 
Would it be correct to say, that SPL is sort of analogue of Java? The collection of classes, that use simple php functions to achieve given functionality? Classes, that Java allows to use by default, use simple Java constructions too if I'm right.
 
@Eugene SPL was inspired by C++'s STL iirc
 
@Gordon I see, but still.
@Gordon I didn't mean, who is egg and who is chicken. More about, that the concept is similar.
 
11:43 AM
@Eugene not sure what to answer to that :)
 
@Gordon Okey. Well, I'll leave, that question open.
 
Jon
11:57 AM
@Sid ask the question on stackoverflow.com and provide as much info as possible
 
Hi there. I'm quite new to php and here is my problem: I have a sql table called 'payments' that stores the shop payments. I have a sql query that group the sum of the payments by date so I have the total amount for each days. Those data are then displayed as a bar chart using google charts API. My problem is, dates with no transactions are not displayed because they don't exit in the array. Is there a way to "fill the holes" with a 0 for the dates with no transactions ? Thanks :)
 
@JulienHenry you could use a DateRange, iterate that and look up whether there is a corresponding date in your query results. if not, print 0.
 
Jon
@JulienHenry I'd probably check your query results for missing dates before sending them off to the Charts API
 
@Gordon : I have the "full" date range from another sql query, I cound use that maybe. I'm a bit unsure how to loop and add 0 to the missing dates
 
@JulienHenry Probably you can also tell the google chart API to use 0 for every missing data point in the axis.
 
12:09 PM
@JulienHenry in that case you could also just iterate over the full range and merge the values from the summed range
 
@gordon check the dates from my payments array against the one from my other array with the "full dates" ?
 
@JulienHenry yes, that's one option. other way round though.
 
@hakre : goolge api doesn't treat it as date, but as strings. I don't think I can do much on the api side
 
@JulienHenry okay, here is a trick for arrays, use the union operator: db-array (keyed by date) + zero-array (keyed by date, all dates).
then ksort($union);
 
uhum.. I guess I have some reading to do on php.net :)
 
Jon
12:16 PM
@JulienHenry for this kind of specific question, you can ask it on the main stackoverflow.com site if you need more pointers
 
@jon : I might do that. I'll give it a go with what you suggested first.
Thank you guys.
I'll be idling here if someone has another idea
 
 
2 hours later…
2:09 PM
huh no activity here tofay?
 
@NikiC Sup?
 
@edorian hoi
@edorian sup? back :)
 
Currently documenting the PEAR phpcs sniff package. I found the phpcs unit tests.. that helps with samples sometimes :)
 
who maintains it?
 
Reading up on how PEAR files/classes/functions should be commented sent me on a small journey from anger to pity
The sniffs? They are part of the normal phpcs sniffs so the project maintainers
 
2:15 PM
yeah I mean who is that?
 
The phpcs maintainer? Greg Sherwood ( github.com/gsherwood ) from Squiz Labs
But it is not his or php code sniffers fault that PEAR rules are what they are :P
 
PEAR sucks :)
21
 
Today I noticed that phpstorm has "column selection mode". That editor is sort of creepy. It can do everything I want it to do
 
@NikiC That is why the only thing I use it as pear package is, PHPUnit.
btw, Hello Again
 
@edorian Yeah it also has stuff like editing at multiple places at the same time and other creepy vimy stuff ^^
@OmeidHerat same with me
 
2:25 PM
Once phpunit is on packagist.org and/or a .phar I hope to ditch pear all together
(no there is no plan to add composer.jsons to phpunit but maybe someone will. I've seen some people playing with it)
 
Mostly the composer people add the composer.jsons themselves. So just wait for a PR :P
 
But thats just troubles I've got with the installer. There is some useful code in pear
 
Zend VM handlers don't like me :(
 
:) I don't think It's you in particular
 
oh, stupid mistake, I just wrote if () { ... } { ... } forgot the else
Still doesn't work though ^^
@edorian Probably :)
Well at least it's segfaulting now, that's a good start ^^
 
2:31 PM
Should factories go into their own namespace or the namespace of the objects they are producing?
 
That depends on the scope of the factory I guess
A UserFactory can go besides the User class for all I care for
While an ApplicationFactory might not be in the same namespace with all the main application objects
 
Good morning
 
morning @ircmaxell
 
How's it going?
 
@edorian So let's say a LoggerFactory goes in Logger. Where to put the Factory interface? Its own namespace? Seems like a waste to create a new namespace for one interface.
 
2:36 PM
@ircmaxell good, only fighting with php again
 
:-(
 
My interface would be in \project\Logging\Logger while the loggers would be in \project\Logging\FileLogger I guess.. Not sure :)
 
@CharlesSprayberry I put the factory in the same namespace as the interface for which it constructs...
 
\project\framework\Logging\ maybe it is application in-depended
 
Can anyone help me?? I getting confused @_@
 
2:38 PM
@edorian Do you normally split up your interfaces and implementations into different namespaces like this?
I saw somebody else doing it in a code review
 
@CharlesSprayberry I do...
 
Like this? This is the same name space :)
 
But in general having the interfaces sperated from the implementations seems like a good idea
 
Adding new products with specific quantity how about the new product that you need you order???
 
2:40 PM
As they should be separate "modules"
 
the interface for Cipher is in \CryptLib\Cipher\Block, but implementations are in \CryptLib\Cipher\Block\Cipher
 
@Carisle Hi :) What are you talking about?
 
@edorian @ircmaxell Ok, this is making a little more sense now. Thanks.
 
@endoriani am creating an inventory system yet im confused on which what should be first adding product whicj has not been ordered to the supplier i wonder which comes first ??? create new order or add product first??
 
@CharlesSprayberry That's just my take on it. I wouldn't say another is better or worse, just that's what I've found works well for me...
 
2:44 PM
@endorian i am creating an inventory system yet im confused on which what should be first adding product whicj has not been ordered to the supplier i wonder which comes first ??? create new order or add product first??
 
@ircmaxell Well, it makes sense. An interface should be stored in one centralized location and each package utilizing that interface is its own little space. No need for the interface to really know about all of the implementations.
 
And no need for implementations to know about other implementations (which means that putting them all in one namespace is a convention, not a requirement)
 
@Carisle It should not matter which comes first.
 
Hey @edorian, did Gordon talk to you yet?
 
We did talk a lot recently but i assume you are referring to dpc?
 
2:51 PM
yes
 
@harke I getting confused when you add product which you havent ordered to the supplier the on the purchase order you add again product??? isn't it right??
 
@Gordon Thanks, I put bit more in my question now.
 
@ircmaxell I agreed to do it with any 2 persons. whoever is getting into dpc :)
 
@ircmaxell its not fully clear yet, but after checking the dates i found that the chances that i will make it to dpc are slim.
 
4
Q: PHP: Would you wrap PDO or extend it?

Omeid HeratMy question is fairly clear, and I really would like to hear some reasons for the answer. Additional information: I don't use any kind of FW. Of course PHP > 5.3. Update: Right now I don't have much of restrictions around my project, it's a one man project yet and I have worked hard to make...

 
2:59 PM
Ah ok
 
@Carisle That depends on your business logic. Specify first what needs to be done and how things interact.
@OmeidHerat "One man project trying to be Modular as possible" return your data as arrays from PDO. Models? Who needs those? Value Arrays FTW!
 
@hakre How ? Using the PDOStatement->fetchAll or MyDB->Query('SELECT *....')->fetchAll ?
 
@OmeidHerat Use PDO::FETCH_ASSOC to get the arrays properly keyed (instead of default PDO::FETCH_BOTH).
 
@hakre That makes sense, but I am not quit happy with using PDO directly inside my classes but rather a PDO wrapper or extension, and I can't quit decide which one to go with, composition or inheritance ?
 
3:22 PM
 
@OmeidHerat It is simple if you want to follow the rules. Use Composition. Your class is not a PDO, but rather uses PDO. Correct?
 
@OmeidHerat IIRC gordon already dropped the Wikipedia link earlier today. If you want to be modular, you normally choose composition.
Your data is not same type as the database.
 
@LeviMorrison No, he's talking about using PDO directly, or creating a wrapper to use pdo
 
@ircmaxell Why wrap PDO?
 
Well, one example is if you don't like the API and what to change it...
 
3:26 PM
@ircmaxell I suppose. I think it's a terrible idea, but if he really wants to. . .
 
why?
 
Well before jumping to conclusions here, probably leave @OmeidHerat some room to elaborate.
 
back.
 
for example, when I use MySQLi, I typically use a wrapper so that I can do Prepared Statements with a sane API (not requiring references)...
 
@ircmaxell Hold up, I didn't say anything about MySQLi. . .
 
3:28 PM
I think the same thing applies to PDO...
I think in general it's not a bad idea...
 
PDO itself is a wrapper. It offers a wide range of flexibility to a programmer. Wrapping a wrapper, unless done extremely well, would likely inhibit the programmer and require a greater learning curve for additional programmers.
It's not like cURL where you have to set a million flags when usually you only care about 1 or two.
 
there's a fair bit of setup required with PDO as well...
 
@ircmaxell I usually have to use no more than 5 lines of code and I have my data in an object, ready to work with.
 
Eih, I just really don't care for PDO to begin with. So I haven't used it much...
 
It's basically:
write statement
prepare statement
set fetch mode (sometimes)
execute statement
If you want to set a bunch of properties over and over again, then a factory might be in order, but it isn't a wrapper.
 
3:32 PM
Yes, it's a database client, and yes it does SQL queries ;) But I think that part is not what @OmeidHerat is concerned about.
@OmeidHerat: What part are you most concerned about?
 
First I don't like the PDO API, and secondly, I want a fair simple API for using prepared statements, I just want to pass the Prepared statement and values array at one go.
3 mins ago, by Levi Morrison
It's basically:
write statement
prepare statement
set fetch mode (sometimes)
execute statement
instead of doing all these steps:
why just not, DB->Query('SELECT .. WHERE name = :name')->fetchAll(array('name' => 'someone');
or something along those lines ?
 
uh. . . you don't have any less code than what I provided. . . .
Perhaps I should have written the first as write query
your query statement is prepare
Okay, you skip execute
1 less line of code
then fetch
I'm going to say that it is NOT worth it.
 
eih
it's not always about loc
 
@OmeidHerat: You probably just want to use an existing component here: notorm.com
It's based on PDO and as the code is available, you can take a look how things are done in there.
I have no idea of the code quality but it seems that it does something similar to what you're looking for.
 
sql builder shrug
 
3:41 PM
The only ratio that counts is processing instructions per byte of source file.
 
@hakre Looks good, but it's not really a notORM.
 
I really don't care for query builders
 
@OmeidHerat As you can see with that example, it's using composition:
 
@ircmaxell I agree.
 
$pdo = new PDO("mysql:dbname=software");
$db = new NotORM($pdo);
 
3:43 PM
I was wondering if anyone could shed some light on my PHP/MySql issue?
0
Q: Virtuemart: Reroute Links in Browse Page (PHP, MySql??)

Samuel R. BarreraI am trying to extract the 'category_id' information from each product. Here's my line of thought: What I'm trying to do... I sell music products. An Album contains 10 Tracks. Instead of making each Track a child of the Album (I've done this for a reason, please don't suggest this as a solution...

 
> I don't know enough PHP or MySql to successfully pull this off.
 
That is, I need to hire a developer. :)
Ok I made up my mind, there is nothing bad against composition and I get really get anything much with inheritances.
 
@OmeidHerat If only it were that simple
 
@SamuelRBarrera Why not ?
 
@OmeidHerat We've tried. It takes too long and we rarely get anyone who can actually do the job. Which is why I'm trying to do it myself. But I don't know enough about PHP and MySql. I was hoping I'd get lucky on here
 
3:55 PM
@SamuelRBarrera Sounds like you have a problem in your interviewing and hiring process.
 
devhell.info <-- odd podcasts. each is over an hour long...
 
Being able to memorize my Amazon Password is unhealthy for my purse
Hello @Donut
 

« first day (450 days earlier)      last day (4480 days later) »