« first day (1196 days earlier)      last day (3978 days later) » 

11:00
what does "hash -r"
^it launches command "hash" with option "-r"
;)
@Gordon I can't flag again :(
@MadaraUchiha suggest him to use border on td, you need to spoon feed those users
@Mr.Alien I don't need to do anything.
11:02
@AlmaDo Are you interested in front?
He can take my advice if he wants, or he can go to hell if he wants.
I don't endorse spoon-feeding.
I see a downvote on yours and ruddy's answer, will settle up with an upvote
I'm not doing it for the rep, I'm doing it for the one user who'd actually learn something from me.
@Mr.Alien I can't say that I like it or dislike it. There are good and boring tasks both in front-end and back-end. In the main time, I'm growing into management too (sad from developer viewpoint, but the only way for some reasons(log story) - may be I will spend only half of time for development)
@Mr.Alien Those "easy" questions are hoarded by n00bs. So when a "pro" comes and answers, it's too high-level or too abstract or too "learn it yourself" for them, so they downvote it.
It's a real problem with Stack Overflow. The vote model works great when there are a lot of pros and little noobs
11:04
@MadaraUchiha well, idiots will be idiots, some people take pain to learn themselves, some don't, they need their plate served
But it's a double edge sword when the opposite ratio is true.
@Mr.Alien They "want" their plate served. And I won't serve it.
@AlmaDo management is good, make sure you don't get your hands off completely from development
@MadaraUchiha we can split "noobs" from "pro" just if we'll ask them what means "stackoverflow"
@MadaraUchiha I generally comment my answer on such @AlmaDo that rhymes :D
@Mr.Alien I can't :( To be honest, I have no great passion (i.e. to spend all free time on that, for example) - but if I'll not do some programming for 3-4 days, I begun to feel myself uncomfortable. And my mind wants to solve some difficult task from time to time (especially it's about algorithm questions)
11:08
@AlmaDo yea than go for the job you like, even am bored with the current one, it obviously earns me good bucks, though doing on the same thing, no learning sux
haha, there will be day when I'll prove P = NP and then you all will lose your jobs :D
yea we got few einsteins here...
@Mr.Alien you may don't be worried :p Equality of P and NP is comparable with relativistic theory by complexity (or even more complex). In fact, that leads to fundamental things and solving it will change picture of Universe in some sense
ok that's weirdo theory imo which I will never understand ;)
and I doubt that P = NP anyway (and, even more, with construction proof)
11:13
hi guys
facing this problem for first time, have 5 app server behind a load balance, this Is a symfony2 app , how to maintain session consistency ?
heh.. many ways. Most easy (but bad) - NFS
not bad at all, I am considering using redis as session store, or even mysql
good way is to adjust load balancer so it will correctly balance requests. That means to use option, which will send cookie to the client and then redirect request to correct server by coming cookie
in our company we're using that
using MySQL for session storage? well.. good luck with that - but I doubt it's a good idea under high-load (and I assume it is a high-load app since there are 5 back-end servers)
11:17
I have to provide some OPTIONS now :P
if that's your choice, I recommend to use setting of server's cookie - any decent load-balancer must have such functionality
@AlmaDo sounds like a good idea
how complex is this part? @AlmaDo
@andho well, it is :p I'm using it, so I know. You'll get rid of any horrible intra-servers solutions and, of course, common session storage/handlers (like MySQL)
yup, HaProxy
@andho complex? ... huh. To edit config file?
also it's transparent from architecture viewpoint. So I'll recommend that
11:20
@AlmaDo I mean the part where your load balancer delegates request based on cookie.
and, of course, it serves scalability goal. To add new server you'll have to do.. well, nothing
@andho ? balancer does not delegate it. It's doing that itself (i.e. scheme is: "request came" -> "balancer choose back-end server -> balancer got response from back-end server -> balancer send it to client with some server id cookie ". Then if new request will came from client, it will contain that server id cookie, balancer will know which server must serve that request)
and it's standard option, as I recall
@AlmaDo hmm..
Does the w3c validator also 403 for you people? validator.w3.org/check
no
11:29
odd
Also 403's for me :(
        <h2><strong>Excessive traffic pattern blocked</strong></h2>

        <p>This on-line service is a shared resource.  It is provided at no charge
for the benefit of the community.  Due to excessive network requests we
are blocking a pattern from specific browser plugins. If you are using a
browser plugin that checks every single page you visit, please
discontinue using it and only use selectively.</p>
@PeeHaa heh.. you've been banned from there :p So you've something nasty. Let me guess: passed such a horrible document, which violated standards too much?
are you using some VPN ?
@Vamsi Nope, but I am on the company network
Probably one of my colleagues runs a validation lpugin
:(
11:31
oops
does someone have a HTTPStatus value object class lying around somewhere by chance?
@PeeHaa use a proxy?
@Mr.Alien 6 is dead if you don't serve China ;)
If you do, 6 is alive and well
@Patrick yeah proxy it is
lol
-13
Q: 2 Peebs laptop 3 times what the problem?

user248880My laptop n5050 peebs startup https://www.youtube.com/watch?v=SCe17jRYxO8

I am nearing to a burnout working on legacy code :| any suggestions
@Suhosin Never dealt with Chinese guys yet.. :)
11:42
@Vamsi Beer.
@Vamsi rewrite everything
just kidding
or am I?
haha , good one
0
Q: PHP Procedural combined with OOP

PHPeterI have been coding some OOP in PHP today and after some time, I figured that you can actually combine the two ways of writing PHP, procedural and OOP. My question is, is it considered bad practise to combine them, should I stick to one of them? Or is it even better coding if you can combine them ...

some old guy had his own implementation of DAO
What do you make of this?
11:44
cv, but I feel for that guy
I'm a real beginner with php, where should I put the value code. Thanks again. — cfocket 2 mins ago
I'm outta here
@MadaraUchiha at least protect future readers from XSS attacks
does kickstater support bitcoin ?
@PeeHaa Better? :)
11:49
It is now :D
So... how many followers did you get @PeeHaa? :P
#DramaForFollowers
:P
Let me check
Only 2. Now I will never get noticed :(
Maybe it's 2 per insult?
@Fabien :D
@MadaraUchiha And I must say awesome release :)
11:52
Indeed
E_TOO_MUCH_PINS
@PeeHaa E_TOO_SMALL_SCREEN
Nope. Nuff space left
What'd you remove?
I unpinned @JoeWatkins' gratz, but it removed it completely :P
Sorry Joe :)
12:00
Not seen him in a bit
@PeeHaa what about Phil on your twitter feed ?
@Vamsi What do you want to know ?
Does somebody know what those 2 left plugins are/
I've recognized only ABP
I used to follow that guy when I still was using CI . what has he done to upset you ?
@Vamsi Besides his "normal" day-to-day attitude there is also t.co/4Gd52j97zP
Sorry for obfuscated link, twitter copy/pasta
@AlmaDo Next to that look familiar. Some page speed thing
12:09
it's chrome? I'm not using it
You should :)
Hm.. using FF - may be it's just habit
yslow is there for ff also
I'm using ABP, NoScript and Firebug..
Ghostery
12:14
well enough for me, but it's just me
oh, sometimes ModifyHeaders too
I was using NoScrypt some time ago, too much pain on some sites
need a curated whitelist
Backbone *shakes fist*
no problems at all :p With this plugins I've discovered that youtube has ads only in this year :p
btw I know why it's mostly so quite here. Most people found their new jobs. So having no time for chat. Heh, may be I'll join then soon too
good for you
but do come and hang out in chat :)
Yeah a lot of new jobs the past few months
12:27
too many php jobs here too ( Bangalore/ India )
12:44
You should never exceed speed-limit. ^
13:06
I thinking about writing a blog post... maybe... potentially. :)
user652649
abstract factory pastebin.com/hfP6CUHS
user652649
thing is that i can't do return new ConcreteB($this->buildA()); because i need to access the A class from the outside before using it for constructing B
user652649
$factory = new MyFactory();
$a = $factory->buildA();
$a->doSomething();
$a->doSomethingElse();
$b = $factory->buildB($a);
What is the problem @Wes ?
user652649
look at line 29 of the pastebin
13:17
Even undefined behavior is more defined than this: codepad.viper-7.com/Gaq1cu/55dev
@Wes Why would it only accept a concrete class?
user652649
@PeeHaa because ConcreteB depends by class ConcreteA, not interface A
user652649
(look at its constructor)
ConcreteB requires ConcreteA, you're giving it interface A, which doesn't know anything about ConcreteA
smelly
^
It shouldn't care about the implementation of A
user652649
13:23
not understanding :\
user652649
i know i should do:

function buildB(){
return new ConcreteB($this->buildA());
}

but i want to show the A interface in the "outer scope"
Well yeah but you always inject the concrete thing, but you typehint the interface
Interfaces cannot be instatiated so you could never inject an interface
user652649
so how would you change it to have the same behavior?
@Wes Two objects implement interface A, you typehint for interface A, you can still pass in either of those two objects
13:29
You "never" typehint against an implementation
Backbone JS anyone?
i'm using tail to read the last line of a log , and output that to a server sent event . the problem is that it reads more than one line
user652649
sigh. why you guys always think i'm a retard xD i know that @PeeHaa in fact i'm asking how should i change the pattern. basically i want to get this: pastebin.com/sEEcc0z1 which is correct, but exposing the methods doSomething and doSomethingElse (which are part of the A interface) in the "outer" scope
@cocco tail --help
i read it's output is different if i use the terminal or passtrough
13:34
@Mr.Alien 10% of our customers where I work are Chinese, 60% of those use IE6. :(
@Wes change your ConcreteB to this and try
ConcreteB implements B{
        function __construct(A $A){}
}
Sooooooo outside the factory you want access to A::doShit()? @Wes
isn't that supposed to have "class" at the beginning?
user652649
$a->doShit() yes @PeeHaa
user652649
@andho if you look at the constructor, it is already as you suggested
13:36
@Wes put your example into eval.in and make your code work first
sorry my bad, look again :P
@Wes In that case I would probably do it like chat.stackoverflow.com/transcript/message/14277307#14277307
tail --help is useless.
i don't use the terminal
can i display stackoverflow search bar in my website & retrieve the questions list on any query?
in the terminal it reads one line in php the whole txt
Tip: When you have an idea do it right away or shut the fuck up!
13:38
@TheLuckyGoof Check their api
user652649
1 sec guys
@PeeHaa thanks
How do I explain, to a layman, 'unstable' as in "PHP 5.6.0alpha1 is unstable" as against "the ground is unstable during Earthquakes"
13:42
@iroegbu "It will probably set your cat on fire"
3
@iroegbu a building analogy maybe
user652649
@PeeHaa @andho eval.in/94755
building analogy?
That's because your typehinting against a concrete class instead of the interface @Wes on line 22
Line 22 should be function __construct(A $A){}
user652649
yes, exactly @PeeHaa but that's correct, ConcreteB depends upon ConcreteA, not any A
13:47
Yes but it should not
It depends on the concrete implementation of A
B should not have to care about the specific implementation
It just needs whatever the interface is providing
How ConcreteA or ConcreteA1 or whatever implements it does should not matter
user652649
that's true @PeeHaa but that's a constructor... constructors aren't part of interfaces... in fact they are meant also for this... that's why you are allowed to have an "incompatible signature constructor" when you extend a class
The ctor just sets the instance. That instance will be used in the class. That class just has to know it can call doSomething() and doSomethingElse() on the instance.
And that's it
It doesn't care whether concrete A get the number 10 by adding 5+5, doing 2*5, 1+1+1+1+1+1+1+1+1+1, or however it is implemented. The only thing it needs to know is "Hey I can call AImplementation::getTen()".
user652649
then @PeeHaa how do you create a class implementation that depends on a specific class implementation? you can't always "accept any class implementing interface" sometimes you have to ask for a specific class, and you usually do that in the constructor
@Wes The entire point of using interfaces is to not have to care about the specific implementation
15
Q: Meaning of Leaky Abstraction?

GeonneWhat does the term "Leaky Abstraction" mean? (Please explain with examples. I often have a hard time grokking a mere theory.)

user652649
yeah mate but interfaces are about regular methods not constructors
@Wes That's because ctors are also an implementation detail
user652649
idk, maybe i'm missing something, @PeeHaa :(
Let me turn it around. Why are you type hinting against a concrete implementation?
...but nobody starred my codeviper trollery :-(
@Wes can you give a concrete example of where you need to use that? In the example you gave it makes no sense to type hint against the specific implementation. So explaining what you need to do might help here.
14:03
> If you need to read or clone all of a model’s data attributes, use its toJSON() method. This method returns a copy of the attributes as an object (not a JSON string despite its name).
user895378
@Jimbo Yes! Sorry, I pinged you about it yesterday in chat when you weren't around but I think I used your github nick (@J7mbo) and not the SO one :)
Can you match variables from a csv file to table fields with LOAD DATA INFILE? or is there a workaround to rearrange it so they match?
@Fabien hehehehe fucking with yo mind yo!
user895378
@Jimbo everything is there in the repo now and working and I removed the problematic submodule.
@Wes Have you seen this youtube.com/watch?v=4F72VULWFvc ?
Or the other videos in that series. For me that really did it at the time
user652649
14:06
@PeeHaa i can't think of a specific case at the moment, my question is generic... i agree with everything you said... but i ask you.. can YOU think of a case where a class relies on a specific class implementation? there might be some :\
@Wes Nope cannot think of it. Whenever I get at a point I need I need to sit down and rethink my design whether what I am doing is sane (most likely it is not)
user652649
xD
@Wes as long as you don't have side effects I can't see why the implementation would matter
Related @Wes: Do you do unit tests?
user652649
side effects @Patrick ?
user652649
14:09
@PeeHaa no xD
@Wes if a class is doing something with globals or other classes that were not injected into it. Basically something you can not expect by looking at it from the outside
@Wes If you ever feel you want an example to make it all "click". Start unit testing. It will make these issues painfully visible.
user652649
@PeeHaa i'm going to get the "interface everything" lecture? ... wait for it xD
user652649
i know @PeeHaa i don't have enough time :(
@PeeHaa foo-rai-dei!
user895378
user652649
anyway discussion was helpful: i'm doing something wrong
user652649
thanks guys xD
user652649
@Patrick not understanding :\
@PeeHaa anything you can recommend to get into it? officially I can't do it at work but might do it anyways. Writing a lot of code from scratch right now which could use some tests but I have never actually written tests
np. But really if you ever have time watch the linked google clean code series and start unit testing. And you will be up to speed in "no time"
@Patrick It 's basically as simple as "I put X in method foo and I expect Y to come out of it"
14:13
Mornings
Yo biatch!
And that is repeated until you have covered "all" code and paths @Patrick
user895378
@DaveRandom morning
I think the world may have ended. There seems to be a number of threads on internals in which people are not trolling and being nice to each other.
@PeeHaa I know how it works in theory and watched a few talks/read a few articles about it. Just never used it. Had a go at phpunit a while ago but never got it running properly and their docs didn't really help
@rdlowrey Leave Phil alone!
@Patrick Are you running composer?
Because I tried the pear installer once and I'm still crying
user895378
14:15
@PeeHaa At a certain point when the same person is always getting into fights with people it stops being "oh the php community has so much drama" and starts being "oh, maybe this person is just an asshat" ...
For my own projects yes. But not at work
BTW, where's @Jack? Have not seen him for a while.
@rdlowrey Yeah I had that certain point a long time ago. Mr Mount Stupid
@Patrick Start with writing tests for your own projects to get the hang of it
phpunit composer install is easy
where are you supposed to put them? in a folder inside the project? same folder as the class they test?
@Patrick I often put a test directory in the root of my projects
14:23
0
Q: PHP & tail shell buffer ,server sent events.Why tail does not work?

coccoAs soon i open the connection with this script the connection keeps open and every 5 seconds it reads the last line from a log file passed with the $_GET parameter. The problem is that the tail command does not work properly. Even if it should read just one line it reads alot of lines. Why doe...

stackoverflow.com/questions/21331766/… How does he know it's a great answer, does he know any better?
Why did he ask a question he knows the answer to and not provide the answer himself?
i hve a big proble with passtrough(tail)
it reads almost all lines
\o/
hai @PeeHaa
14:36
hey dawg
Counting down yo
cool yo
yo :D
counting here, too :D
Yo Hakra
14:41
Homeoffice while doing the laundry = awesome
@rdlowrey lol, business givery.
> 4. Dare I say it, better multibyte encoding handling. (I don't want to repeat the PHP 6 experience, but I'm also not sold on mbstring-ng being the ultimate solution.)
^^ for whatever reason, I read that as "masturbating". (source)
15:01
@DanLugg I hope everybody did
It seems like that would be the ultimate solution though...
@rdlowrey Awesome man, thanks :-)
@cspray That's the weird thing, the sentence reads fine with "masturbating".
@DanLugg A lot of what @rdlowrey says is like that
;)
^^ Not enough misrepresentation.
user895378
15:03
Rookie mistake.
2 hours ago, by Dan Lugg
Even undefined behavior is more defined than this: http://codepad.viper-7.com/Gaq1cu/55dev
Better?
user895378
@Jimbo np. It's not well-documented at this point, so if you have any questions please ask.
user895378
@Jimbo yes :)
user895378
@cspray \o/
15:05
@rdlowrey Shouldn't those hands be pointed down then?
user895378
@DanLugg If I do /o\ it just looks like someone pulling a t-shirt over their head.
Well, if that's what you're into...
I don't judge.
user895378
Different strokes for different folks. Literally.
I see something different
But I digress
user895378
lol this conversation degenerated quickly
15:07
Yes it did
@MadaraUchiha That's just a tag I don't care about… the only true thing is checking out from master or PHP-newest.
this is clearly a productive programming chat.
Programming... with our penises.
15:10
@Lusitanian All we are is productive...with your mom.
*swish*
Sadly I'm not being productive at all.
Reproductive?
Because I'm in here talking with you guys about...well, what we're talking about.
@DaveRandom Not with masturbation I hope... or you're doing something wrong.
15:12
That's neither productive nor reproductive
this should really just be a giant thread of (removed) but it isn't
I'm sure we'll be able to guide this train back on course
I think I'm going to abandon PHP in favor of SWI-Prolog.
Aw, mod noob cleared my vote :'(
@MadaraUchiha E_INVALID_COMMENT
15:15
@bwoebi Meh
@Jimbo That's alright, I wasn't particularly happy with my name, yet again, next to genitalia and scatological references.
"I need if possible a urgent help. Thanks very much"
...
4 messages moved to bin
user895378
TIL you can specify constants for your test suite in phpunit.xml:
user895378
15:20
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="./tests/bootstrap.php">
  <testsuites>
    <testsuite name="Name of the test suite">
      <directory>./tests</directory>
    </testsuite>
  </testsuites>
  <php>
    <const name="WEB_SERVER_HOST" value="localhost" />
    <const name="WEB_SERVER_PORT" value="1349" />
    <const name="WEB_SERVER_DOCROOT" value="./public" />
  </php>
</phpunit>
user895378
And all this time I've been doing it in an unnecessary bootstrap file.
phpunit: The tool that just keeps giving
…head
@JoeWatkins ping
@salathe: the cartoon character that just keep giving :)
15:28
@bwoebi wazzup ?
1 message moved to bin
WTF the gif bin is gone
All my hard work :(
yesterday, by bwoebi
I now finally know how to merge changes made to sapi/phpdbg in php-src back to phpdbg repo. @JoeWatkins does this branch https://github.com/krakjoe/phpdbg/tree/test look fine now (verfiy before I push to master)
@bwoebi will look over weekend ...
@JoeWatkins fine… I'd like to push tomorrow then…
@PeeHaa Probably frozen for inactivity. ping @Gordon
15:34
Hey @JoeWatkins
You've been MIA
hello good friday to everyone, In cronjob I have to use relative or absolute path

eg:

../images/getImg.php

or

/var/www/images/getImg.php
busy busy :)
inside the file php...I mean in the reuire ''
@JoeWatkins You started pretty fast
15:35
@EmilioGort is that a question?
Then yes, you have to use relative or absolute path.
for example I have in the file require '../getImg.php' or require '/var/www/images/getImg.php'
It's usually better to do neither... and instead use __DIR__.
the problem is that I got PHP Warning: opendir(../imgListing/6/): in the cron job but when I execute the file in the command line it works fine
15:42
most likely because there is a different "current working directory" when running it yourself, versus cron running it.
sorry could you explain better...
current working directory??
Although most PHP functions will accept cross-platform delimited paths (eg: both /foo/bar and \foo\bar are valid on a Win box) paths returned, via __DIR__ and realpath(), etc., are platform dependent. What are the thoughts on normalizing this, or providing a means to do so at a global (ini) level?
but using __DIR__ will return the actual directory of the file i'm executing, and the opendir(../imgListing/6/) how to declare them?
I was thinking of something like register_path_filter(callable $c), which if registered would fire for any filesystem call, where the callable $c would accept a single argument of the filesystem path in question.
15:48
@EmilioGort where is "getImg.php" relative to the file with "require" in it?
register_path_filter(function ($path) {
    return rtrim(strtr($path, DIRECTORY_SEPARATOR, '/'), '/');
});
$x = __DIR__;             # /path/to/test.php
$y = realpath('\\foo\\'); # /foo
^^ Naive userland implementation.
tha's another error I got...actually every time I use '../' i got the error failed to open stream: No such file or directory in in the cron job
@DanLugg WWYDT?
@salathe Uniformity on path strings.
@DanLugg thanks but I think this should not be complicated...should be a way whitout the use of custom functions I think
15:51
@EmilioGort That wasn't meant for you. (sorry, unless you're just contributing to the convo; didn't want to cross wires with your question earlier)
ok...no problem
Consider a configuration entry somewhere; for sanity, you use /'d paths, { somePath: "here/we/go" }, if you're doing any string-based comparisons out of simplicity (and realistically, I think that's fair) you'd have to compensate for doing $config['somePath'] == __DIR__ always returning false on a Win box.
That means always realpath()'ing the config data, or just naively replacing the characters every time, manually. This becomes further problematic if you're comparing path strings for non-existent paths, or partial paths. You can't realpath() a fragment of the tree, you'll just get false, so you're back to naive replacements.
You can helper-function the whole thing, but then you have a silly procedural dependency throughout.
I dunno, path normalization has always been a bug-a-boo; feel free to flame the idea. </rant>
I just can't say it has ever been an issue. For the few times where someone might want something like this, they're probably already doing it with string replacement.

« first day (1196 days earlier)      last day (3978 days later) »