« first day (714 days earlier)      last day (4216 days later) » 

11:00 AM
well when do you find the time for such things? :) And I had two rainy days and also finished the book, so... :)
 
@hakra already in it
 
This really simplified it. I have pushed the other branches, too, however this is where I got stuck. There still is a context artifact but as said this lead nowhere so far. It's still in the ScalaCopy branch I should have deleted that probably.
 
@hakra where is the Habits?
 
Morning
 
If you overload at runtime, you do not need them specifically. You can just go along casting.
What ircmaxell suggested for PHP decorator might be something useful, too, but I have not followed that much.
But please feel free to check if my assumption about habits is correct.
 
11:06 AM
@hakra imo, it's not needed for Roles because they specify the Contract in the Interface and there is no need to access any of the methods of the actor. you just use the Role methods.
 
@Gordon It was just a short though I had somewhere in between. I was offline so I could not further check if that decorator approach would be of use.
One main lesson I learned is that traits in PHP is really limited.
 
@hakra yeah, mainly because you cannot mix them in at runtime
 
This guy seems to be using SO to develop his project :)
 
Do you think PC is dying?
 
@hakra You should work out a nice proposal for runtime traits :)
 
11:11 AM
Feel free to exploit that example. I'm not 100% about habits, as you know I have problems with context. The Scala example does not have context and it merely works like this PHP one, however I do not know if the Scala example is complete or not. Coplien was quite confident about it however.
@NikiC Yes, runtime traits: new Class() use Trait1, Trait2;
 
I never tried trait. I will have to play around with it soon
 
Scala has those, right?
 
and namespace :P
 
@NikiC Scala has traits as first class citizen.
 
@hakra One key difference between PHP traits and Scala ones though is that in Scala conflicting methods are simply chained. That's not the case in PHP. And the whole thing only really becomes useful with that chaining
 
11:13 AM
For PHP also new Class() use Trait1, Trait2 implements Interface; to do some strict checkings maybe.
And ruby has something like this I think: $objA = new ClassA(); $objB = new ClassB() use $objA;
 
One should probably extend the whole concept to anonymous classes in general, like Java has them.
 
1
Q: Validation Class - Feedback Welcome!

I'll-Be-BackI have written a Validation and Form class in PHP. Validation class allow you to define the rules of each field and a error message. Form class allow you to get a error message and also allow you to get a value of POST via $_SESSION. I stored in $_SESSION because if validation did not pass i...

"Consider making individual validators rather than putting all of the different validation rules in one class.
One option would be to make a Field class and have Form contain a collection of Fields (with each field having a collection of Validators)"
 
that should cover all those cases
 
What he meant by this? I don't understand
 
Though the whole thing needs a lot of thought to do right
 
11:17 AM
@I'll-Be-Back answer by Corbin is pretty good
 
Yep
I agreed
 
@NikiC Yes, also I highly suggest to look into those languages first, that have these features. Otherwise you can mess a lot and I'd say we've messed enough so far :)
 
3
A: php classes... validation

GordonYou could do it this way, but it could be improved. Having the actual validators capsule their own validation logic is good. Extending them from a base class isn't. Let's implement an interface instead. This way, any class can be a Validator. interface IValidate { public function validate($v...

 
@hakra That's why I said that you should write up a nice proposal :P
 
@I'll-Be-Back that's what's meant with Individual classes
 
11:18 AM
@Gordon interface IValidate kitten dead
 
Thanks @Gordon checking now.
 
@Gordon nice answer. you get a +1 :)
 
@NikiC yeah, should just be Validator
@NikiC thanks
 
there are also some other PHP DCI examples.
 
@Gordon He said shouldn't use $_SESSION in the class. Let say a user click on Submit button after finishing the form, it will then go to next page to do the validation check. If failed then it will redirect back to main page.. so $_POST will be empty. That is why I thought to use $_SESSION to store $_POST
 
11:21 AM
@hakra Google is incredible
They can make stuff turn up in minutes
 
@I'll-Be-Back you dont want to use any of the superglobals directly because they are globals. Your code should not depend on $_SESSION or $_POST to exist somewhere and somehow. What if your code is run from CLI? There is no $_POST then. Inject them instead.
 
@hakra I've just been looking at this one code.google.com/p/php-coredci
 
@NikiC Yeah, I sometimes really wonder how they do that. But I have the feeling they are monitoring specific sites, for example pastebin
@I'll-Be-Back: Do what Gordon writes, this will also allow you to validate other variables, not just request and session.
okay got to hurry to the market otherwise I don't get any more stuff for the weekend.
 
@Gordon Could you clarify "Inject them instead" ?
 
laters
 
11:23 AM
@hakra I will do =)
@hakra later dude
 
@hakra have fun
 
@I'll-Be-Back new Foo($_POST, $_SESSION);
 
Cool
 
public function __construct(array $requestData, array $sessionData) instead of public function __construct() {}
 
btw @Gordon, how far is your thesis?
 
11:26 AM
@NikiC heh ^^ remind me again of it and I have to leave to work on it instead of chatting with you
 
@Gordon :D
oh, and you just reminded me
need to learn a bit for linear algebra
 
@Gordon what is the purpose of second argument of session?
 
@NikiC what did you finally decide to study btw?
@I'll-Be-Back huh? you said you need session inside your class, so you inject it
class DoingItWrong
{
    public function __construct()
    {
        $this->requestData = $_POST;
        $this->sessionData = $_SESSION;
    }
}
$obj = new DoingItWrong();

class DoingItRight
{
    public function __construct(array $requestData, array $sessionData)
    {
        $this->requestData = $requestData;
        $this->sessionData = $sessionData;
    }
}
$obj = new DoingItRight($_POST, $_SESSION);
 
ohhhhh
I got you, thanks
What text editor do you use by the way?
 
@I'll-Be-Back VIM and PHPStorm with VIM Plugin
 
11:38 AM
Linux guy ha
 
@I'll-Be-Back both exist for Windows ;)
 
I use Netbean and PhpStorm
 
@I'll-Be-Back yes, do so. it's a classic. there is no PHP examples in there though, just in case you expect that.
@I'll-Be-Back most of the patterns are also listed at sourcemaking.com/design_patterns
 
hi to all?
anyone know about wordpress?
 
@Gordon Oh nice...
 
@I'll-Be-Back you might also be interested in amazon.de/Head-First-Design-Patterns-Loukides/dp/0596007124 - covers all the patterns but with easy examples.
 
hi to all
 
12:07 PM
@Gordon Easier to understand than "Design Patterns: Elements of Reusable Object-Oriented Software" book?
 
welcome
 
I'll buy it today
 
@I'll-Be-Back yes
 
great
 
anyone could you like help to me wordpress issues ?
 
12:11 PM
@Gordon By the way I personally think developer of PHP should rename all functions to be consistent and naming convention. However the old function name will still work as backward compatibility but no longer documented. What do you think?
 
@I'll-Be-Back i think that's something that has been discussed to death ;)
 
can you write some code please? — safiot 1 min ago
lol
Sometimes I wish we could downvote comments.
 
@Gordon You should do it :P Everyone will be very happy lol.
 
12:28 PM
@karthys what is your issue?
 
that's weird
 
Good Morning
 
@Gordon lol
 
@ircmaxell hello
 
@ircmaxell Morning
 
12:47 PM
good morning @ircmaxell
@Gordon I dunno if I'm immune to something, however it keeps rotating - and then?
Is this common for Zend Framework?
0
Q: Refactoring ZF Controller file?

sica07I have a controller that is (IMO) too long (over 1200 lines). What is the best way to make it "shorter"? Could I, somehow, split it in sub-classes? Or is there any recommended way to achieve this goal (reasonable size controller)? Thank you

 
1:05 PM
@hakra the faces distort, like caricatures
 
@Gordon I wonder where you find such stuff ;)
 
@hakra fb :)
 
user1125394
1:26 PM
is there a SE site on wireless networks?
 
Debugging is best done interactively on Stackoverflow :) (sorry for the irony) — hakra 28 secs ago
Please [delv-pls] stackoverflow.com/a/12652983/367456 otherwise that wanted to be helpful user gets more and more downvotes.
 
hello
everone
 
user1125394
hmm will try superuser
 
please suggest me any good book for expert level programming
in php
 
@hakra I suppose that's what happens when you steal a comment for your answer without knowing if it solves the problem or not.
 
1:31 PM
@vascowhite Well can happen, right? However, noobs deserve protection :D
 
@hekko there is none for php. php is just a tool. if you want to become an expert programmer, learn to think beyond the tool
 
@hakra Yes, I'm not saying you're wrong, just commenting.
 
if its about the data structure and database and maths i am good on it but ... i want to know prose and cones of every php function or line how do i know there things ?
 
@Gordon sorry @Gordon, but I just hate such answers.
 
user1125394
1:36 PM
 
@hekko php.net or any other mirror would be a good start.
2
Chat rooms should have up vote and down vote near every line posted.
down vote should decrease text size of the message and make text transparent as showing, that this isn't relevant/pointless.
 
@Eugene you may click the star at the end of a line to make it one of your favorites
 
I was proposing the opposite
 
PeeHaa should build something like that into the cv-pls app :)
 
@Eugene you may post your suggestion to meta.stackoverflow.com
 
1:40 PM
@Jocelyn I know. Just stated my opinion.
 
@hakra does you comment have any point stackoverflow.com/questions/12653106/… ?
 
@Eugene but it's the truth.
 
@Gordon he was asking about book. So suggest a book for god sake. Those abstract answers are very annoying. If the point is to keep this chat room on float and just make a discussion on nothing, then sure, continue.
 
@Eugene Basically saying: You can not get this little boy. I mean twitter will never offer that.
You might can get this by scraping, but I assume that twitter protects against that. So it can only be fragile.
 
1:47 PM
@hakra So basically answer you should set is "twitter will never offer that"
 
@Eugene Which we can not give because we can not speak for twitter.
 
@Eugene there is no expert level books for PHP. What should they contain anyway?
 
I'd say that user is just moaning that such a thing does not exists.
 
@hakra so we come again to the point of your comment :)
 
@Eugene Okay, touche. Which kind of answer would you suggest? :)
 
1:49 PM
@Gordon Same stuff as Java books or OOP books with examples in PHP.
 
Also there can be expert books for PHP. It's just that most expert programming books do not have PHP examples. You need to write them your own (at least you can try :))
And also there are some books with practical information about PHP.
 
@hakra none. There is no logical answer to that. You can't speak for twitter and your answer will not have any point if you don't have a solution already.
 
@hekko That is hard to grasp. Sounds a bit like code-review.
@Eugene Well, I also close-voted it. But commenting is entertaining sometimes. You think I was offending?
 
@hakra thanks
 
@Eugene if you want to learn OOP, then get a book about OOP on a language agnostic level. Same for Design Patterns.
 
1:52 PM
@hakra I would not say offending. Just pointless. You could use that time more productively. Search for a real solution yourself and propose it. Typing something that has no meaning is pointless.
 
@Eugene thank you buddy
 
@Gordon design patterns are the best solution imho.
they describe most of the real world problems and possible solutions for them
Some of them can be easilly applied to specific programming language.
 
@Eugene design patterns are blueprints for common problems. not more, not less. but it is recognizing when to use them and how to adapt them for your specific problem that makes you an expert
 
@Gordon exactly , all i know after see your conversation on that topic is ... see what is happening and try to remove the cons of that thing ... and follow the basic principal of science
 
@hakra now this answer stackoverflow.com/a/12653289/318306 has some information at least. :)
 
1:58 PM
@hekko if you want to become an expert programmer, google SOLID, buy GOF, buy POEAA, buy Clean Code, learn Refactoring, lookup GRASP, DDD, CQRS, DCI … but dont ask for PHP books. That's the most reasonable suggestion I can give you when you ask for Expert PHP books really.
7
@hekko maybe start here: ustream.tv/recorded/22783515
 
@Gordon thank you ... its very helpful
 
@Gordon oh no, let's leave it. A java programmer who loves PHP. Why should we kill it?
 
2:17 PM
@hakra because killing is fun
 
user1125394
I still don't understand how you do to break salted keywords
 
@cyril Well if there is too much salt, there are some common recipes to work against that, like adding water or other spices like pepper. :)
So which kind of keywords are you speaking? Did you mean passwords?
And what you mean by breaking them?
 
user1125394
yes keywords* sry
 
2:29 PM
morning all
Anybody in here knows stuff about the SE API? I want to know something, but I'm to fucking lazy to look it up :P
I want to get a team together to go through the cv review page of the [php] tag...
If anybody is up for it at least :)
 
Hey all, I need some PHP advice.
What's the best way to keep someone from stealing your code?
From what I've heard, obfuscation really doesn't work, and encryption is weird.
 
@SomeKittens Tell in the license it is not allowed.
 
seems that this user acquired a puppet
 
blast. Is that really the only viable option?
 
or maybe i am just being paranoid ..
 
2:43 PM
@tereško What gives it away?
@SomeKittens Yes.
Why is it a problem if I may ask? What is your audience?
 
Grrr....
We make Joomla components. We're pretty much the only people offering what we do.
 
@PeeHaa the out-of-nowhere comments in for the answer that was hit by serial downvoter
a c++ devel , who hasn't done anything for almost a year, decided to comment on php topic
 
We have a few competitors who are trying (badly) to catch up. We're pretty sure that they're trying to buy our extensions so they can pull them apart and copy us
 
@SomeKittens Imho you should just make it clear in the license that people are not allowed to distribute it to other people (other than moving it to hosting ofc). As you already noted obfuscation sucks
 
My other thought is to make the application "call home," but that's easy enough to remove
 
2:45 PM
@SomeKittens If they copy you, sue them. That simple.
 
@SomeKittens It has copyright by default
 
(The sad part is, thanks to idiot Indian devs, most of it is technically GPL)
 
@SomeKittens If they don't copy 1-on-1 they could easily just mimic it be looking at the output and no obfuscation is going to help against that
 
though .. this being a million-user portal , i would expect that to be only my paranoia
 
Some days, I feel like I'm the only sane one in my company...
 
2:46 PM
@SomeKittens most of it?
How is the rest linked?
 
@PeeHaa They did a lot of copypasta from core Joomla files, etc, so there's a comment at the top releasing it under GPL
 
@tereško You could always flag and let the mods find out
@SomeKittens That would mean everything is GPL right?
 
@I'll-Be-Back >This tool will shut down early July 2012
 
i know
 
2:47 PM
@PeeHaa sigh I don't know. I don't even want to think about it
 
@SomeKittens If you don't want people to copy you just don't release.
 
Folks, only outsource when you know what you're doing. We've got 300k (down from 3million+) lines of spaghetti code because no one bothered to check the dev's code
 
Or just make sure you always have the better product. I.e. keep inovating
 
I think I go with 980px with
width
 
@SomeKittens Well. One should never ever outsource to India. You know that now :)
I'm pretty sure SO has created half of the code
2
 
2:52 PM
@hakra Nice edit, thanks.
 
@PeeHaa That's actually something we do fairly well.
 
@vascowhite yeah, but turns out OP is looking for mysql :)
 
Now to convince the boss to have standards
 
@PeeHaa good morning :) I've seen it has been late this morning.
 
Well IANAL, but there isn't much you can do about people copy functionality (unless the copy source too) unless you are Apple. :)
 
2:55 PM
@hakra he didn't make that very clear. No problem, he either uses the answer or he doesn't :)
 
@PeeHaa Wow, and I thought I'd seen all the stupidity...
 
On SO there is always room for moar stupidity
> I am also an avid medical cannabis fan.
L0j1k, Honolulu, HI
748 12
 
heh
 
3:15 PM
@vascowhite jup, it's a nice example now anyway I'd say.
@PeeHaa Oh, reminds me that I know need to clean up the rooms so it's more welcoming for the expected visit :)
@PeeHaa jup seen that. probably a nice guy :)
 
:D
> Edit: The max. PHP version I can use is PHP 5.2.1
omg
@hakra You had a PHP EOL list. Do you still have it somewhere? Was it on your blog?
 
@hakra Thanks
 
There is no official PHP 5.2 end of life date yet.
Even asked for, the PHP devs in the mailinglist were not able to name one.
 
@hakra Thanks
 
I'm tired. I read that as PHP version 5.4 squared.
 
3:40 PM
@hakra Sounds like the list :P
 
well I should ask more than once probably.
 
3:53 PM
hello
 
@hekko Hello. How come you don't have a SO profile? stackoverflow.com/users/1703829/hekko
 
because my account got merged
 
git merge hekko
 
4:05 PM
wow. HTML5 continues to impress me
 
how to safe from ban meta.stackoverflow.com/questions/86997/… in last paragraph that says that ban is based on ip and we are using the pc on college where we share the same ip than ... what to do ?
 
It is. I think I'm going to play for it a bit. If you can also map it to an audio object there is all kinds of crazy stuff you can do with it. Probably the same for the video part. @SomeKittens
 
@hekko Well, you're fairly close to whoever got banned, so I'd punch them.
@PeeHaa Sadly, I haven't looked into HTML5 other than when you guys post cool stuff here.
Still trying to develop my PHP/Joomla skills to the point where I'm not a total noob.
 
As long as you are developing yourself in some area it is good right
 
1
A: How do I loop through MySQL results in sections, with PHP?

hakraYou first create an iterator based on your result: $rows = new ArrayIterator($row_articles); Then you want to prevent that iterator to rewind: $articles = new NoRewindIterator($rows); This helps you to create sub-iterators (e.g. for your listing) to not rewind but to continue. Then you can...

Best thing is, you can easily replace that with PDO with zero change of the code.
 
4:11 PM
@PeeHaa Yeah. I'm still worried that I'm specializing myself too much, but hey, it's what I get paid to do
 
is there anything i can do to reduce my account ban time ?
 
Anybody who use Jira here?
 
@hakra what is the advantage of this over the if -else-if -else condition
 
4:32 PM
@hekko reduce? probably not. prevent from happening again? generally you can avoid bans altogether by not being a jackass :)
although...i'm not even seeing an account?
 
what'd you do?
 
its for the voting irregularities... since in our college we share same ip and so use ip
to ban
 
@hekko and what about this account? Also you?
@hekko You're not going to be banned only because of same IP
 
@PeeHaa no its not mine ...
 
4:37 PM
AFAIK
 
@PeeHaa AFAIK ??
 
@hekko "as far as i know"
 
according to them i was created the fake account to upvote my self ....
 
and i got the 200 rep
 
4:41 PM
well, if someone else at your college went and upvoted a bunch of your answers, particularly in a row...you have to admit, that does look mighty suspicious
 
yes i admit it ... and even its second time
 
Supposedly it happens all the time
though I've heard of it happening with software teams, rather than college buddies
 
one more thing my some college mate account was deleted ...
 
hi. i have 2 arrays $firstname and $lastname each containing 1000 entries. How do I echo all double duplicates, i.e. where both firstname and last name are the same?
 
now i am thinking to request to delete my account
 
4:52 PM
14
Q: How to detect duplicate values in PHP array?

mikey_wI am working with a one dimensional array in PHP. I would like to detect the presence of duplicate values, then count the number of duplicate values and out put the results. For example, given the following array: $array = array('apple', 'orange', 'pear', 'banana', 'apple', 'pear', 'kiwi', ...

 
@PeeHaa this solution only addresses a single array. I have two.
 
@UnoMeinAme array_merge()?
 
this can be done by using the tow foreeach but it will not very good
 
The real question is: Why are you storing your data that way?
 
@PeeHaa merging first names to last names? doesn't seem like a good idea
somekitte - because it's a contact database
 
4:55 PM
@UnoMeinAme Why not?
 
i'm trying to display the duplicates so that i can clean it up
 
@UnoMeinAme So array merge and check for dupes?
 
@UnoMeinAme Then do it with SQL, not PHP
 
And ^ that
 
petefreitag.com/item/169.cfm should be a good start
 
4:57 PM
Anybody up for a stupid JS question of me?
@rlemon You around? I need your JS guru-ness. :)
 
HERE I COME TO SAVE THE DAY!
 
PeeHaa summoned rlemon!
 
@rlemon question:
 
answer: 42
 
@rlemon I doubt it in this case :)
 
4:59 PM
jquery = 42
 
Is there a way to put navigator.getUserMedia in a variable and call that?
Or am I doing it the stupid way?
@rlemon
 
this is for media streaming?
 
@rlemon Yeah. I am just starting to fiddle with accessing webcam and microphone
 
you mean this?
this.isSupported = function() {
        return !!(navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia);
    };
this.isSupported = (function() {
        return !!(navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia);
    }());
 
That only check whether it is supported at all. I want to get the one method that is supported and add that to a variable to later be able to use it.
 
5:02 PM
or you want the one userMedia to rule them all.
 
Why the a is not centered - jsfiddle.net/tV5cJ
 
@rlemon Exactly :)
I thought I was doing that by doing this (code dump alert):
 
this.getSupportedUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia;
 
    this.setUserMediaObject = function()
    {
      switch (true) {
        case (typeof navigator.getUserMedia !== 'undefined'):
          this.userMediaObject = navigator.getUserMedia;
          break;

        case (typeof navigator.webkitGetUserMedia !== 'undefined'):
          this.userMediaObject = navigator.webkitGetUserMedia;
          break;

        case (typeof navigator.mozGetUserMedia !== 'undefined'):
          this.userMediaObject = navigator.mozGetUserMedia;
          break;

        case (typeof navigator.msGetUserMedia !== 'undefined'):
@rlemon Aaaaaah ofc. tnx
 
np
 
5:03 PM
Damn my JS skills suck
 
js is a finiky turd
but so much fun
 
0
A: Custom error handler to handle errors inside and outside Object code

JocelynI finally decided for this design: my current error handler remains unchanged (function myErrorHandler). It holds the code to be executed when an error happens (anywhere in the code) in the class myObject I added another error handler (function myObject_error_handler) the constructor of myObjec...

I managed to find a solution to my own problem
 
Why the a is not centered - jsfiddle.net/tV5cJ
 
One last question though @rlemon`:)
 
=84/2
 
5:05 PM
I know get a Uncaught TypeError: Illegal invocation when trying to call it: jsfiddle.net/89qdA/1
 
The PHP chat room just turned into a Javascript chat room :-p
 
/rlemon wishes he never reacted to my summoning :)
 
well all of this this.funcName = function(){}.bind(this) can be taken care of with prototype
 
Could anyone please help with my CSS issue?!
 
@rlemon Feel free to change to fiddle with an example to improve it :-D
 
5:07 PM
I would like that the div center both vertically and hrozntally
 
    this.userMediaObject({
        video: this.video,
        audio: this.audio
    }, function(localMediaStream) {
        this.element.src = window.URL.createObjectURL(localMediaStream);

        // Note: onloadedmetadata doesn't fire in Chrome when using it with getUserMedia.
        // See crbug.com/110938.
        this.element.onloadedmetadata = function(e) {
            console.log('Something happened. Do some stuff');
        };
    }, function(e) {
        console.log(e);
    });
this is nested in here and that is now the issue.
kinda working now
errors on a new line
 
@Jocelyn Nah. We're talking about JS, so it can't be the JS room.
 
@SomeKittens Why? JS topics are actually not discussed in the JS room?
 
ANYONE?
 
5:11 PM
@rlemon Great. Looks like I have to rewrite some old code too :P
sorry mega super ultra double pingeling
 
@Jocelyn Have you ever been in the JS room? It's rarely on topic. Currently they're discussing PC specs and pizza.
 
@SomeKittens Pizza is always on topic in a developers chatroom :)
 
@SomeKittens I just joined it for the first time, and I see you are right...
 
user1125394
JunkyScript
 
@rlemon Do I have to use .call or is somebody going to shoot me?
 
5:18 PM
maybe
if you need to pass context .apply(context, [arguments])
.call(argument, argument2, argument3, etc)
but the function will be executed in it's current scope with it's current context
sorry gotta run and grab food + coffee.. i'll attempt to help when I get home.
dusts off tablet.... (no webcam on my pc)
 
@rlemon Sure. No problem. Thanks for your help so far :)
Woot android rocks
 
So how do I fix that? Please, I graduated from the George w Bush school of mathematonics, I ain't smart! — iBeDumb2.0 Dec 27 '10 at 14:57
lolz
 
@PeeHaa the accepted answer to this question is one of the less helpful as it doesn't even give the correct calculation to use.
one more question about escaping and mysql: stackoverflow.com/questions/12654709/…
 

« first day (714 days earlier)      last day (4216 days later) »