« first day (2470 days earlier)      last day (2703 days later) » 

poop
For a while I was thinking about replacing all that crap with powershell. But... wait for it...
That's retarded too only in different ways
Anonymous
preview still broken?
I have never seen a working preview in my life
Anonymous
How do I preview?
You don't
Or checkout locally and build :)
Anonymous
14:02
Ok, all done. Perfectly, it's ready to go
@salathe just a heads-up, the docs build is about to break and it's @PeeHaa and @JayIsTooCommon's fault
Anonymous
mainly @PeeHaa's
Done
Anonymous
mental.
Anonymous
Full karma please.
14:05
Now we wait for people shouting it's all broken
Anonymous
/cc @JoeWatkins
'object' is not reserved at linting time – #74964
I will give you some more low hanging fruit when I find it @JayIsTooCommon so you can get the feels of docs. After that feel free to ask for an account
Anonymous
@JoeWatkins ignore that, full karma please.
And thanks @DaveRandom for being our windows almanac :P
14:15
exec() does'nt work anymore since PHP 7.0 was updated to version 7.0.21. – #74965
@JayIsTooCommon what @PeeHaa said
Anonymous
bore.
14:32
@JoeWatkins would you mind giving me a brief code review? gist.github.com/DaveRandom/a52c397ac8ca8c5648b1ae7109a5c258
@DaveRandom sure.
@DaveRandom it all sucks, do it all over again
any other question?
@FlorianMargaine Thanks Joerian Margatkins
I just finished @Patrick's tutorial. It was interesting. Probably going to go through it again at home to try and make sense of stuff.
I already spotted a mistake actually
14:37
the TL;DR is that Windows is retarded
I'm out the door, but at a glance, why do you need a doubly linked list at all ?
@Tiffany IMHO, it's less of a tutorial and more akin to flow of conscientiousness
also, if you are using gcc, there are builtin linked lists, there are probably some that come with vs also, but I dunno the apis
@JoeWatkins academia, I guess
oh well ... academically, you are making it more complex than it needs to be, the requirement is a single link ...
do that ... academically ... of course ...
14:39
php -v command on Windows should give: PHP 7.1.7 ( Gamer edition )
@tereško there are parts that I'm curious on, like why do it this way, or what's that for, but I'm hoping with some reading and trying it again, stuff will make more sense.
push and pop are fine
(but execute a bunch of useless instructions, because doubly linked)
not sure about unshift
@Tiffany keep in mind that, what you read there, will be his options about it all when it was written
It gives me a mental framework to work from. Gives me ideas of how I can improve my website codebase. Or if I just decide to rewrite it. Though the idea of rewriting kind of scares me because of how many database entries there are for pages.
and seriously, all of this is pointless ... single link :D
14:43
if me-2-years-ago talked to me-now about best practices, I would pick up a tire iron and beat the shit out of that ignorant prick
@Tiffany Make it incrementally better instead of starting by deleting everything
@PeeHaa I know that's what clean code says to do, and to test everything before I push stuff live. Stuff is tightly coupled though, and working towards loosely coupling stuff is what's daunting me.
Anonymous
@Tiffany loosely coupling stuff shouldn't be at the top of your priority list if the codebase is shitty
@tereško as crappy as it will be for me, I can get you a list of all the products and prices from that site that doesn't work for you. No images though. I'll have to xpath it all out in to a nice list :P
Would that list work for you?
@Fabor naah, I will play around with proxies, when I get home
hell ... if all else fails, I can just do the google-web-proxy hack
14:47
the codebase isn't complete crap, it's better than what I can write still, but there are parts of it that definitely need improving.
The top of my list of things to do is switching to mysqli functions, but I need to figure out how to inject the mysqli connection where it's needed in the code.
it might be better to made a direct leap to PDO
@tereško I tried a little here. Can't guarantee a location issue but worked on 2 different connections here.
Anonymous
^^
incrementally better
@Tiffany pdo and mysqli are actually targeting to different usecases
switching from mysqli to PDO is not an upgrade but a "side-grade"
14:50
I would have to completely rewrite sections of code that I do not feel comfortable yet rewriting. I don't feel confident that I can rewrite it in PDO and have it still work.
It is a goal, mind you, but if I can at least get it switched to mysqli, we'll at least be more secure, and I'll have a better understanding of how to make stuff work.
I don't understand the code well enough to switch it to PDO.
OMG @PeeHee what did you do to the docs build?!!
PeeHee is currently not answering. Please leave a message after the beep. BEEEEEP
4
Anonymous
@salathe you're joking right? please say you're joking
evenings o/
@PeeHaa I really want to star this.
15:03
T
Oops
T? Yes please. Milk 2 sugars.
@TristanWiley Are you lost? :P
@PeeHaa *plays Rebecca Black's Friday as the message*
@JayIsTooCommon I'm joking. :)
Anonymous
:)
(:
15:08
I keep forgetting we actually have visibility modifiers now on constants \o/
Oh boy! Merge conflicts! My favourite!
favorite*
@PeeHaa meant to post in Sandbox lol. Accidentally broke the delete button last night so I couldn't delete
Filth :P
15:12
@JoeWatkins that's not a numeric id. Try killall instead.
15:24
I have two questions with this code. One: on lines 5, 7, 9 and 14 there's a variable defined globally and receives a value from the constructor. How is the function show able to access the variable? Is it because it was defined globally? How is it able to access the value from the constructor? Is it because the constructor is ran first?
Two: how does the code know to use the FilePageReader class in the Page class? What I don't have shown is a dependency injector, so does that have something to do with it?
That code is broken
$data is not defined
L14
I chopped out portions of what I worked on in the tutorial
so it's not complete, no
k
Well
Nothing is defined globally
however, $data isn't defined elsewhere either.
would it be easier if I put this in gist?
L4
private $pageReader;
15:27
I wanted to provide a tangible example to ask these questions, and this was the best way I knew how
instances of this specific class have a member called pageReader
So anywhere inside class Page that is available
would member be a variable, or just a "member"?
I would prefer the term property
alright
But it's just a variable yeah. Bound to instances of the class
L7 actually is just an argument for the method. Whatever it is is coming from whatever creates the instance
new Page('this thing')
Lines 9 and 14 just use the property / variable of the instance
Does that make sense?
15:30
yes
so I can assume that if private $pageReader wasn't defined on line 5, lines 9 and 14 wouldn't work?
Anonymous
@Tiffany No, they would
@Tiffany Well. It shouldn't. Hooooowever php
Anonymous
You don't have to define properties before setting, but you should
15:32
PHP will automagically create the property for you if you didn't define it, but that's just php being stupid
fair enough
Anonymous
I think if you don't, you're on par with Satan. Something like that.
Just work on the basis that it doesn't work otherwise
yeah
just another one of those "lolphp" things
did you guys hear that that linkin park vocalist died yesterday..?
15:34
yes :/
Anonymous
wasn't that yesterday?
yup
Anonymous
yes, it was yesterday
20th july
I listened a lot of linkin park when I was younger
Anyone ever used Hashicorps Vault?
15:36
@Fabor sort of
wow, there are more r11 people in /r/lolphp than I expected
@PeeHaa can you comment on question two, or is there not enough information?
@Tiffany Were you under the impression that people here take PHP particularly seriously?
@Tiffany I missed that question. Let me check
> support group for those afflicted with PHP
That's a bingo! *excited in German*
15:50
The Page class asks for any PageReader. FilePageReader implements PageReader so the Page class knows what methods it has.
How the decision is made for it to be a FilePageReader is up to the end user (meaning you)
You pass it in
so there's where the dependency injector comes in
GOOD MORNING
@Tiffany Exactly
user4244405
may I ask someone to check out my answer and improve/vote on it?
You could also have passed in a class DatabasePageReader implements PageReader or some other class that implements PageReader
15:51
I should write this down because I'm probably going to forget this in a week
@PaulCrovella heya paul o/
the example uses the Auryn package for dependency injection
@argon Is it php related?
@Tiffany Yes. So normally you would do something like:
user4244405
hi PeeHa, yes
@FlorianMargaine How did you get on with it? I remember trying long ago.
15:52
$page = new Page(new FilePageReader('/path/to/files'));
With auryn you can tell it whenever it sees something is asking for a PageReader it should just build the new FilePageReader('/path/to/files') for you and inject it instead of you doing it manually
user4244405
I don't know if it's against regulations, but, just let me know .. better ask forgiveness than permission I guess.
user4244405
here's the answer I was talking about:
https://stackoverflow.com/questions/22308365/get-string-representation-of-anonymous-function/45226440#45226440
omg
I was hoping it was not that :p
When you say "short version" does that mean you actually have code like that in your projects?
I'm getting a headache reading the short version
user4244405
15:55
@PeeHaa yes, it is part of a framework I'm building from scratch
I had to beatdown a migraine yesterday. x_x
Free tip: don't write code like that ever :)
user4244405
lol Tiffany
Well maybe for codegolf
user4244405
haha I know PeeHa, some peeps like to keep it "as fast as possible" and not worry about under-the-hood as long as it works
15:57
Please no
@argon wat
fast as possible?
How is that related to writing code like that?
when you're trying to explain something, however, you WANT to know what's "under the hood"
user4244405
I'll remember to keep the code longer, thanks for the tip though
@PeeHaa as in deploy time -- never delete code, just ship shIP SHIP!!!
Anonymous
@argon no, that wasn't the advice
15:58
Also it's hard to read your long version too, but I am going to say your parser is going to fail
@Dereleased it sucks working in that kind of environment :(
Because they always do
user4244405
oh ^.^ pardon .. anyhoo, so what do ya think? .. i think maybe to use strpos & substr to make it a tad faster (micro-optimization)
It's going to be complete overkill, but github.com/nikic/PHP-Parser
That actually works
Your parser is waaay too naive
And probably breaks by looking at it
Anonymous
@argon absolute shite
15:59
@argon either use braces or don't, but don't pull this happy horseshit:
Anonymous
To put it politely
    if((substr_count($list[0],'function')>1)|| (substr_count($list[0],'{')>1) || (substr_count($list[$last],'}')>1))
    { throw new \Exception("Too complex context definition in: `$path`. Check lines: $begn & $endn."); }

« first day (2470 days earlier)      last day (2703 days later) »