« first day (2590 days earlier)      last day (2349 days later) » 
00:00 - 21:0021:00 - 23:00

12:20 AM
Hah, @Wes, I'm sure you'll hate this but take a look: github.com/morrisonlevi/Ardent/tree/Traits
 
Requirements: > Patience
;)
 
@LeviMorrison Mind an email thread? AllenPHundley@Gmail.com.
 
@Fabor cool. btw I'm going to be running a workshop for my local user group on how to use Auryn in general and with Slim in February. Would you be interested in doing a dry run of it?
In probably January
 
Wes
1:00 AM
> trait based
scares me :B
it's not much different from what i'm doing though
programming sux
oop (and other paradigms as well) are definitely incomplete / old
 
1:24 AM
you are old.
 
Wes
yes otherwise i wouldn't be complaining about everything
 
... but yeah, more seriously, I said it before, and it's probably not the last time I say it, but I don't understand how it is that I am so not close to understanding the struggles you seem to have @Wes ;)
 
Wes
burned up the wicks again
 
is it only because everything I have ever been paid to do is like, simpler? are you doing rocket science?
 
Wes
oop (at least its most popular interpretation) was invented around inheritance and polymorphism, aka god-like classes
so if you try to do stuff like value oriented composition you face problems that you can only workaround... cheaply
 
1:28 AM
lolwat
what you are saying is like, "computers were invented with bits containing 0 and 1 so nothing should ever change from that"
 
Wes
eh?
how did i say that
 
I am trying to understand what you mean by "cheap workarounds" :)
 
Wes
for example you can't really abstract away the api from the storage. you cannot have any internal state of a cluster of objects with any api
the way how you store the internal state in part affects how you design the api
and forces you to write really crap code
basically the code consists mostly in added levels of indirection, with wrappers, adapters, etc.
 
Mornings o/
 
Wes
basically it's the same problems you face when creating adapters. imagine you have a multidimensional array and you want to create objects representing each value in said array. you cannot do that easily unless you move the data into the classes. i mean, the objects cannot "just peek" at the array (not easily), they need the data completely reorganized, in properties of said classes
so there is no distinct separation between api abstraction and storage
and that's one of the major problems imho that leads to wrong abstractions
however for the most part i wouldn't know how to solve this kind of problems
 
2:36 AM
@Wes ok sorry, hockey game just finished. when you say API, you really mean REST api, or?
 
Wes
no, oop api
 
> you cannot have any internal state of a cluster of objects with any api
ok, maybe I'm dense, but of course, to access a cluster of objects, you need a way to access them
"without any api" would mean, telepathically telling the computer "show this collection of entities when I think about it"
or you mean like, data structures?
like what @Levi has shared a bit sooner?
 
Wes
i mean, modeling is based on records, you cannot easily model an arbitrary abstraction regardless of the data storage. the very data storage influences how you model the abstractions... and not telepathically :B but should be simpler
@FélixGagnon-Grenier imagine what would involve modeling a remote storage like a database gateway
without downloading the data locally. i mean, the data must remain in the actual remote database
you'd have classes like Table, Column, Row, Field, right?
now imagine how these classes would work.... all their methods would need to be redirected to the same pdo object for to use ->query(), ->execute() etc.
you'd have something huge for something that really should be trivial
 
3:15 AM
@Wes You should build your system without concentrating on how you are going to store them
You should read @Patrick's book
 
Wes
@IROEGBU ... is what i am saying
 
morning
 
3:37 AM
@PeeHaa is there a particular reason you didn't give any implementation of Storage on github.com/CodeCollab/CsrfToken ?
 
4:19 AM
Morning
o/
 
おはよう
 
4:50 AM
Cron Job should run in any system . If we set the time once, it have to run if System shut down also it means if system is switch off. Kindly help me
 
5:10 AM
\o
 
5:57 AM
it is possible to send email without internet in PHP?
 
thanks SaitamaSama :-)
Hi, anybody worked with cron job or anacron?
 
Anonymous
6:29 AM
!!wotd
 
nonbook a book without artistic or literary merit or substance, especially one that has been developed primarily to exploit a fad or make a profit quickly.
 
any laravel guys? need help
 
Anonymous
No
 
Anonymous
@Patrick I'm interested
 
i have a url in my controller like maps.googleapis.com/maps/api/distancematrix/…;.$From.&destinations=.$To.&key...
when i dd() the output of that, im supposed to get a json
but i get an error with the incorrect url
file_get_contents(maps.googleapis.com/maps/api/distancematrix/…, United States.&destinations=.California, United States.&key...
the problem is that here is a 'amp;' added next to every &
how do i get rid of it?
 
6:46 AM
Morning all!
 
@prakash Your best bet is probably use the http_build_query function to build a properly encoded url query string
@mega6382 morning
 
7:04 AM
Which one is the same as "dear"?
- babe
- baby
 
niether
 
@mega6382 But I heard something like that lots of times in movies
 
Anonymous
Both are correct for your girlfriend
 
Anonymous
You can use baby for ... well baby but not babe
 
Ah I see
thx
 
7:06 AM
@Orangepill Thanks a lot!! it helpes
helped*
btw what does .= mean in PHP
 
It mean concatenate into existing value
Like

$a = "abc";
$a .= ""def;
echo $a;// output = abcdef
 
@mega6382 Ohh.. now i get it..
thanks a bunch :)
 
Wes
7:30 AM
@Shafizadeh HEY BABAY
 
@Wes :D
Honestly still I don't know "baby" is the "a little kid" or "babe"
 
hi what is the difference between "if{} if{} if{} else {}" and "if{} elseif{} elseif{} else {}" ?
 
@user3750938 In if{} if{} if{} else {} all statements that are true will execute. But in if{} elseif{} elseif{} else {} if one of the statement is true all after it will be skipped.
 
@mega6382, thanks for explanation. If you don't mind can you give some example?
 
ping @LeviMorrison
 
7:44 AM
@user3750938 your best bet is to play around with it yourself and read up on the documentation for control structures
 
$i = 1;

if($i == 1)
{
echo "first";
}
if($i == 1)
{
echo "second";
}
if($i == 1)
{
echo "third";
} else
{
echo "fourth";
}

Output firstsecondthird

if($i == 1)
{
echo "first";
}
elseif($i == 1)
{
echo "second";
}
elseif($i == 1)
{
echo "third";
} else
{
echo "fourth";
}

Output first
@user3750938 Check the above example, hope it will help.
 
@mega6382, thanks a lot :-)
 
@LeviMorrison ping really quite loudly ...
 
People say that ZF/Symfony are enterprise level frameworks.

Then what will be the examples of where you should use ZF/Symfony, and where you should use Laravel.
 
how the hell is it that on my dual boot machine I can run multiple docker services a kubernetes cluster, a lxc service running, watch watch shit on netflix and have have multiple browsers open each with several tabs at the same time on linux but when I boot into windows I can barely open InDesign
 
7:57 AM
<?php
trait Template<T> {
	public function method() : T {
		return new T();
	}
}

class Implementation {
	use Template<stdClass>;
}

$impl = new Implementation();

var_dump($impl->method());
?>
krakjoe@fiji:/usr/src/php-src$ sapi/cli/php -n trait.php
object(stdClass)#2 (0) {
}
[Sat Nov 18 07:57:51 2017]  Script:  '/usr/src/php-src/trait.php'
/usr/src/php-src/Zend/zend_string.h(136) :  Freeing 0x00007fdaef202b40 (32 bytes), script=/usr/src/php-src/trait.php
Last leak repeated 1 time
[Sat Nov 18 07:57:51 2017]  Script:  '/usr/src/php-src/trait.php'
/usr/src/php-src/Zend/zend_string.h(136) :  Freeing 0x00007fdaef202cc0 (32 bytes), script=/usr/src/php-src/trait.php
[Sat Nov 18 07:57:51 2017]  Script:  '/usr/src/php-src/trait.php'
 
because Windows is crap at anything other than the purpose of running games? :P
 
@JoeWatkins are you and Levi working on generics? I wouldn't have thought to use them on a trait but that makes a lot of sense.
 
levi is, I'm just playing with the patch to see how difficult the poc is ... it's all levi really, I'm just making it leak ...
a kind of templates, I love the idea ...
 
it's going to be awesome for typed collections..
does the poc cover typehinting ... like public function addDiscounts( Collection<Discount> $discounts);
 
not yet
 
8:21 AM
I'm out for today @LeviMorrison I hope to find some more time this weekend to work on it :)
@Orangepill not sure it will be actually, we don't allow hinting against traits currently ...
 
8:43 AM
posted on November 18, 2017

New Cyanide and Happiness Comic

 
People say that ZF/Symfony are enterprise level frameworks.

Then what will be the examples of where you should use ZF/Symfony, and where you should use Laravel.
 
Does "as of x" mean "from x version and later" ?
 
yeah
 
Ah, and my main question is, the x version itself is counted?
 
yes
 
8:57 AM
thx
 
Anonymous
@mega6382 At this point all three are mature enough to be used as enterprise-level frameworks. However, from what I hear Laravel's facade is unpopular with the senior PHP community. So, ZF/Symfony are fine.
 
Anonymous
I personally avoid Symfony like a plague
 
Anonymous
Tools like that is how you get a brain aneurysm
 
@samayo I really like ZF2/3 I use these often in small level projects. Never really bothered me performance or otherwise. But still people don't prefer to use it in small level projects, why is that?
 
Anonymous
Because they are over-engineered and thus are very slow and the learning-curve is steep.
 
9:05 AM
But if you remove all the components, that you don't need then it is not that slow. And provide a very maintainable code. Don't you think?
I have seen with laravel and CI etc, the code is not that maintainable.
 
@mega6382 It's a lot easier to just pick the components you want and sew them together yourself.
It's not like you need many for a web app.
Plus it allows you to build in a way that if any drop support it's easy to switch it out.
 
Anonymous
Yeah what fabor says. That's what laravel does.
 
Decide your own architecture.
Quite frankly a lot of people are shooting themselves in the foot because they are "laravel developers" and not "PHP developers"
 
Anonymous
@mega6382 what this: youtube.com/watch?v=DuB6UjEsY_Y
 
umm... does the discord windows app use electron? they do...
 
9:09 AM
Basically you don't need a general framework because your problems are likely not general. They're specific to every app you build.
 
Still it is better to have some idea, of what framework will better in which circumstances.
@Fabor @samayo Laravel just seems like a lot of trouble, people say that the learning curve is less than ZF, but I am not sure. ZF2 always seemed easier to me.
 
Between frameworks dunno. But I always refer to my old quote
Oct 27 at 21:56, by Fabor
The takeaway is Laravel has a place in web development as much as McDonalds does in the food industry.
 
@mega6382 the only time you should use laravel is, if you have no idea what application architecture is and you need to make something quickly, that you will never need to modify
 
@Danack Yeah, definitely please. I doubt we can do much over the Christmas season with our app anyway. :)
 
also, stop thinking in "which framework should I choose", @mega6382
 
9:18 AM
@FélixGagnon-Grenier I work US hours (match my company) :)
 
@tereško Why is that?
 
Anonymous
@mega6382 That's upto you to decided. Try both of them first. I have tried Laravel and Symfony. One is a framework for rapid prototyping the other is a disease.
 
@mega6382 why is what?
 
@tereško Why stop thinking that way, I mean.
 
@mega6382 instead you should think about, what functionality do I need. And based on that you should pick specific packages from composer, that solve specific problems.
 
9:21 AM
@mega6382 Here
 
@Fabor I am good at making an application without using any framework, but still using a framework gives you a structure and help you develop more rapidly, you know.
 
lol
so, you suck at architecture
and instead of getting better, you decided to instead box yourself in the cookie-cutter versions that are provided by various frameworks
 
@mega6382 Well do as you like, you have people in here with mountains of knowledge advising you on the best course for PHP. We can lead you to water but we can't make you drink. There's always jobs for framework devs, we just prefer other jobs.
 
@tereško No, I mean when you are not the only one working on a project it is better to use a framework because, others can easily join in.
 
Easiest !== best
 
9:25 AM
bullshit
 
If you choose easy over better than that's on you.
Or maybe client restrictions, etc. It's more if you have the choice then don't
 
@mega6382 would you drive over a bridge, that was built with the same .. emm ... mindset?
 
@tereško Very good point.
I am gonna heed your advices guys. And gonna start thinking about this more deeply.
 
unless you are working only on "business card" sites (fire and forger type), the project will tend to contain a lot of "business domain knowledge" and that should reflect in your architecture.
 
@tereško with the same of what?
 
9:28 AM
Noun: mindset (plural mindsets)
  1. A way of thinking; an attitude or opinion, especially a habitual one.
  2. Earth Day is a way of propagating and celebrating the environmentalist mindset.
 
@DaveRandom morning
 
of course it was deemed "offensive"
at least nobody has called it "violent speech" yet
 
Wes
@DaveRandom ahahaha
 
10:06 AM
morning
 
\o
 
10:32 AM
o/
 
10:45 AM
\o
 
@mega6382, can you give some tips to troubleshoot php like echo , print, die, print_r, exit . other that that anything which you know? Thanks in advance :-)
 
11:06 AM
@user3750938 Use a debugger, save yourself a world of hurt.
 
> We call letters "uppercase" and "lowercase" because the original printing presses kept letter blocks in literal cases; since small letters were used more often, they kept them in the bottom case for easy access; thus, lowercase (and uppercase) were born.
 
Hi guys, anyone can help me with this problem stackoverflow.com/questions/47355528/…
 
11:23 AM
I think someone replied to this in here yesterday?
Was the answers not sufficent?
 
@RonniSkansing Where is the answer?
 
@alvarofvr I use MariaDB, and would like the same thing. My current solution is heuristics: store the amount of time a query needs to run, and use that data to 'predict' how long it will run now. But you can tell EXACTLY on beforehand as the server is shared with other users and processes.
 
Check the answers you got when you asked yesterday, somewhere up in the chat log
 
@RonniSkansing Ok, tahnkyou...
@Code4R7 It is the same solution I have adopted but it can have problems
 
1) Any prediction of how long something will take is unlikely to be even remotely accurate (have you never used Windows?)
2) Measuring how long something is going to take ahead of time make the operation itself take longer, at least for arbitrarily sized data sets
3) from the PoV of PHP, executing a SQL query is an atomic operation. It cannot peek inside the the query and measure how much progress has been made unless you break it up into smaller parts and let PHP execute them one by one
In the case of a SELECT which produces a large result set, it also depends on the server's configuration around how it is optimised to send results immediately as they are available vs. buffering them to reduce network load
 
11:34 AM
@DaveRandom 3) is partially true. With an AJAX-app you can start a second PHP process through an XHR request, which could use a second database connection to query the database status.
 
@DaveRandom For a few days I'm using an extension named "php-trace" that allows you to follow the execution of the script. I was hoping there was something similar even at DB level
 
So the question is, is there something like SHOW PROCESSLIST that shows an indication of the progress of a query?
and I do see some neat column Progress
 
Oh maria
TBH queries shouldn't be more than a second anyway
 
It's good!
But when I use this command the PROGRESS column not refresh automatically
And if I want to build an Ajax client side that read on this result I have to continue to run the command SHOW PROCESS
 
11:44 AM
@alvarofvr In addition to SHOW PROCESSLIST's Progress there are also STAGE and MAX_STAGE in INFORMATION_SCHEMA.PROCESSLIST. With that you could interpolate the progress bar animation, for example by means of CSS and XHR each few seconds or so?
default update time is every 5 seconds
Well, at least I know I'm going to implement this with XHR :) It's cool.
 
@Code4R7 Very cool! =) I look for something like that in PostgresSQL
 
@alvarofvr I don't use PostgreSQL (yet), but since this type of thing is called "Progress reporting", google sends me to postgresql.org/docs/9.6/static/progress-reporting.html. Looks useful at first sight?
Bummer... Currently, the only command which supports progress reporting is VACUUM
 
@Code4R7 if you want to answer the open question stackoverflow.com/questions/47355528/…
 
sure, I'll type in something for you :)
 
@Code4R7 Thank you man! Good work!
 
12:49 PM
hey hello ! here the correct site from stack for i ask about google api ?
 
 
1 hour later…
2:10 PM
@IROEGBU I kept it storage agnostic because it's easy to implement for end users and there are several ways to store data so I just provide an interface.
related / unrelated also check out packagist.org/packages/paragonie/anti-csrf
@Wes hooooow?
 
that's what I was wondering as well
 
Wes
funny af
 
I saw another video last week of some asian dude tripping and also getting stuck list that
 
if you manage to insert something, there's gotta be a way to un-insert that (pun not intended)
 
Wes
2:14 PM
wtf lol
 
btw... anyone up for some Overwatch? :3 [in a few hours or so]
It's up for free trial this weekend iirc
 
2:32 PM
I still need to finish my xcom run
 
Wes
RIP Malcolm Young
:(
 
I read somewhere he died of dementia??
How can one die of dementia?
 
Wes
i have no idea
 
Unless you forgot trains hurt on impact for example
 
Wes
2:51 PM
@PeeHaa do you use the debugger in phpstorm?
 
Nope
Well
Sometimes
I don't very often use an actual debugger. Only for complex things
 
Wes
i abuse it for everything now :B
 
I always struggle setting it up correctly when I finally actually need it for some reason
 
I probably need to rebuild my PHP to a proper version to set up xdebug...
too much effort :B
 
Wes
@PeeHaa it is a bit annoying for new projects, but it takes 5 minutes every time... probably less
 
3:02 PM
@Wes yeah it's mostly me not doing it a lot and forgetting the steps
And just me being an idiot in general
 
Hi all!
 
Wes
:B i think you just need to set the php.exe path now
 
eh
 
Wes
oh
 
Wes
3:09 PM
just finished watching the 5th episode of 12 monkeys's 3rd season. damn, it's a good series :B
 
@Wes Don't you need to connect xdebug with the ide?
 
well, in that case, I started learning differentiation... so far have been learning some basic properties and their application for the past hour or so :B
 
Wes
i always used the defaults... port 9000 etc
 
Don't you just love it when you think the code is going to work but it doesn't? I am having an issue with fputcsv...
 
Wes
3:25 PM
youtube.com/watch?v=PN8m9KAQJ0c what a time to be alive
 
@SaitamaSama wat. what kind of differentiation are you talking here?
 
@NikiC Maths ones. A question I was solving just previously might give you the idea... f(x) = log(sin(x) + cos(x)); Find f'(x)
 
3:40 PM
@SaitamaSama Wait, what was your educational situation again?
I had you pegged as studying chemistry, but I guess I misremembered?
 
umm... high school?
 
@SaitamaSama How old are you?
 
15 :B
 
huh
okay
total categorization failure
 
lol
 
4:00 PM
Couldn't find anywhere to put it though
 
Fapore! wanna play OW?
 
Negative
 
:'(
 
I think I should boot into windows and see what new have I bought on steam this month (after an hour updating everything)
 
mr5
but hey
I've got questions for you ;)
 
4:06 PM
42
 
mr5
in PHP or in MySQL, how do you set a timezone before querying datetime fields?
 
you dont
 
!!? in PHP or in MySQL, how do you set a timezone before querying datetime fields?
 
Search for "in PHP or in MySQL, how do you set a timezone before querying datetime fields? -site:w3schools.com" (https://www.google.com/search?q=in+PHP+or+in+MySQL%2C+how+do+you+set+a+timezone+before+querying+datetime+fields%3F+-site%3Aw3schools.com&lr=lang_en)
• How to store a datetime in MySQL with timezone in… - 7 nov. 2013 - All you need to do is to use a DATETIME type in MySQL instead of a … a DATETIME type,… (https://stackoverflow.com/questions/19843203/how-to-store-a-datetime-in-mysql-with-timezone-info)
 
all datetime fields should be stored as integer timestamps
 
mr5
4:06 PM
so, how are you suppose to query, say for example, an expired entry in your database?
@tereško I just convert it to unix timestamp in SQL but it is stored as DateTime. Is that bad?
 
it's the source of your current timezone problem
 
mr5
I would GET nothing if the timezone is set in +0000
I know some work around but I don't like haxx
 
Not even 1337 ones?
 
mr5
f44m
 
use proper words, you bloody degenerates
 
4:11 PM
bloody
 
mr5
I no stahp til me get an sirs
 
@mr5 HAMMERTIME!
 
mr5
This is the haxx I'm talking about
(UNIX_TIMESTAMP(expirationDate) * 1000) AS expirationDate,
and this
expirationDate <= DATE_ADD(NOW(), INTERVAL 8 HOUR) -- TODO: get client timezone from header
and my solution was to get the timezone from header. see? haxx!
I don't want to store my datetime as timestamp because I'm using PhpMyAdmin and its much easier to read a 2017-11-18 00:00:00 than 1510963200
 
4:26 PM
!!urban f44m
 
whatchoo talkin bout willis
 
5:01 PM
@Fabor pong
 
@JoeWatkins oh so it only covers traits... not what I was hoping for but I can see it still being useful
 
mr5
@Patrick hey. it's still useful for thesis projects ^^
 
@mr5 then stop whining about timezones
 
@Patrick What's you book about?
 
5:15 PM
furies
 
@mr5 ... you realize php my admin shows timestamps column as dates?
 
@FélixGagnon-Grenier really? Are you not confusing with how mysql actually stores TIMESTAMP type as DATETIME
 
lol, that could be
.... but really, mysql does that?
 
yeah
 
[the sound of facepalms across the globe]
 
mr5
5:22 PM
heyy. guess I'm wrong
timestamps are readable in phpmyadmin
but would I benefit from it?
 
5:36 PM
@Fabor @Wes how far into the book are you? I just fixed a couple of things that IROEGBU noticed. If you want i can send you the updated version so that you don't find the same errors again.
 
night, all o/
 
@Patrick Not too far, send away
im slow on reading :P
Blame The Punisher
 
sent
 
5:54 PM
nigh, all o/
 
Night guys
 
Got it thanks
 
ignore the page break issues btw, will fix that at the end
 
kk
 
6:12 PM
You use CentOS usually, right? @tereško
 
6:27 PM
rom rom rom
 
6:39 PM
@PeeHaa Okay. Was asking because you already have a lib for session... Thought it'll be easy to just add SessionStorage and leave as is... So, default is session and user doesn't have to write any code to use it, at least, for basic use-case
 
7:27 PM
@Shafizadeh no
I use FreeBSD and Arch
 
<?php
trait Collection<K, V> {

	public function add(K $k, V $v) {
		$this->collection[$k] = $v;
	}

	public function get(K $k) : V {
		return $this->collection[$k];
	}

	public function delete(K $k) : void {
		unset($this->collection[$k]);
	}

	private $collection;
}

class Things {
	use Collection<string, object>;
}

$things = new Things();

$things->add("php73", $things);

var_dump($things->get("php73"));

$things->delete("php73");
?>
@LeviMorrison ^ I'm about that far ...
 
@tereško did you achieve a conclusion about buying endless space 2 vs hoping for it to be in sale?
 
<?php
trait Factory<I> {

	public function create() {
		return new I;
	}
}

class Implementation {}

class ImplementationFactory {
	use Factory<Implementation>;
}

$factory = new ImplementationFactory();

var_dump($factory->create());
?>
that also works ...
 
7:43 PM
@FélixGagnon-Grenier I decided that I do not need it so urgently .. and installed Deadpool game
 
Anonymous
8:14 PM
@Shafizadeh I use CentOs .. what's your question
 
00:00 - 21:0021:00 - 23:00

« first day (2590 days earlier)      last day (2349 days later) »