« first day (2706 days earlier)      last day (2256 days later) » 

4:12 PM
When executing an exe from php code is it possible to obtain the result back in php?
e.g. call a C lapack function to compute a system of linear equations using exec() and then be able to take the results and use in the php code down the line
 
@Danack no, but I did find this wonderful article
 
I'm not sure if I explained well what I'm trying to do
 
note the guy's name
@R1ddler it is not possible to directly invoke a raw C function from PHP dynamically, no, at least not in the general case
 
@R1ddler Pretty sure exec has an argument to read stdout.
 
i mean a compiled exe
 
4:15 PM
you can invoke an external program via exec and get it's output and exit code
 
http://php.net/manual/en/function.exec.php

> If the output argument is present, then the specified array will be filled with every line of output from the command. Trailing whitespace, such as \n, is not included in this array. Note that if the array already contains some elements, exec() will append to the end of the array. If you do not want the function to append elements, call unset() on the array before passing it to exec().
 
you can also just use shell_exec() if you don't care about the exit code
 
So I can use the return_var to fetch the solution that I can use later on in the php code
 
@DaveRandom I hope all canadians are ashamed for this.
 
exec("ping 8.8.8.8", $output, $exitCode);
echo "Output: "; var_dump($output);
echo "Exit Code: "; var_dump($exitCode);
 
4:18 PM
also, Star Trek is obviously racists
 
@DaveRandom Thanks @DaveRandom
 
I'm surprised that any journalists anywhere are prepared to print something mentioning the name "Nick Troller"
 
@DaveRandom What a bunch of ass holes. Let the nerd have his license plate.
He obviously didn't mean anything by it.
 
either that article is true and Canada is really stupid, or it is not true and the journalist is really stupid
I suspect the latter
 
@DaveRandom or the word assimilate has a really strong history in Canada - newyorker.com/culture/photo-booth/…
 
4:25 PM
Yeh but... Nick Troller
 
I enjoyed the curtsy
 
There is indeed, quite a big struggle in current years about native americans, how they were treated, and how they are treated, but that license thing is a bit over the top, if real
I would bet the complaint did not come from actual native americans feeling bad, but from some loser activists that try to be offended by everything
 
4:39 PM
@tereško Do you use that event dispatcher yourself or do you just know of it?
 
I am using it, but only through a manager, that is built on top of it
 
Trying to figure out whether you're supposed inject the dispatcher into the objects which trigger the events and the listener object, or just register them on the outside.
If that makes sense.
 
Hey guys, Mornin' 0/
 
\o
 
I am looking for opinion on opinions regarding API Docs frameworks. I have been using Swagger for a while, but I don't like the UI of the newest version. I was wondering do you use any other alternative?
I know there are some web based API Framworks based on Swagger, like Apiary
 
4:53 PM
I think postman has a method for documenting APIs, you can look into that.
 
@tereško The way I'm imagining using it is something like this. Do you inject it like that?
 
evening
 
'nin
 
o/ yay wildcard certs
 
free wildcard certs
 
5:08 PM
\o/
 
5:26 PM
@mega6382 oh yeah, I know about it, doesn't seem that intuitive though
 
@ziGi What free wildcard certs?
 
5:48 PM
hi, I am stuck and cant learn, is this normal?
I started around 8 months ago, did 3 rounds of learning (around 20 full days of learning each and smaller breaks in between)
now I am resting for the fourth round, but its been 55 full days off, it was 42 the time before
I did some php.net, phpStorm docs, regex, Murach's MySQL (half of the book), w3resource.com php exercises, things like this
this is normal, I guess, I cant be expecting the edu to be a couple of months or so
maybe like 3 years, an university degree takes like 5 years, lets say, and for a reason
so I wont learn the php programming "overnight"
but like I said, its been 55 days off, and I still cant learn
I am still not "empty" for the new knowledge, "the RAM is still full"
passive learning process probably
active - passive (break, they get longer) - active - passive and so on
I am on the 55th day of the passive after 3 rounds, waiting for the 4th round
I was thinking about going to a php convention to a different city two days from now, but I am not sure, I don't have the $$$ anyway
JUST WAIT, I GUESS?
 
That sound weird
 
^
 
me? why?
thanks for reading, what would be your thoughts?
 
Taking long pauses between learning periods seems rather unusual to me
 
this feedback is a needed thing, it seems like contact with people is something that would help
"RAM is still full", still not ready to learn
 
5:55 PM
How do you determine that?
 
like you can stare at the screen for an hour and you wont read a paragraph of text
just no potential for new knowledge, but yet, it will come
 
Sounds like you have no interest to me.
 
I do have an interest, but no "fuel" to learn, like a tank with 1/3 of gas and 2/3 of water mixed in
 
Yeah
 
but it will get to 100% of gas, over time
 
5:57 PM
Can all of the terrible analogies.
 
I do advanced things, like all php.net, for example, Murach's MySQL and Murach's PHP and MySQL books, regular-expressions.info, phpStorm docs (which is not the easiest read, things like this); no shortcuts, and understanding things fully before moving on
 
I don't know what exactly it is you're learning, but as far as programming in abstract is concerned I'd still say that practice is best. You have to find some project that actually motivates you and work on that.
2
 
yes, for this reason I am doing the two Murach's books
or will be doing, I only did a half of the MySQL one
 
@people-using-phpea-with-phpstorm I am confused about one of the checks over strlen usage
 
it just takes time I guess, but like I said, 100% proper learning here, advanced
 
6:00 PM
it warns about the \strlen enabling some opcache optimization, but also about using \strlen($value) === $value being preferred.
I don't get it, at all
 
@FélixGagnon-Grenier What's the current code it warns on?
 
if you would have 3 calendar years of learning php, what percent of time would you imagine you could learn, 20%?
 
if (\strlen($value) === 0) {
 
and the rest breaks? I mean, this is not the best question, I WILL JUST WAIT I GUESS
 
specifically \strlen($value) === 0
short message is "'=== $value' can be used instead"
 
6:01 PM
ah
So ugh I'd say that's a question of style
 
how many hours per week are you able to work?
code, 40, more?
 
I wouldn't necessarily consider '' === $value to be better than \strlen($value) === 0
 
2 days off (sat and sun, lets say, in a row)
 
... but how is 0 === '' ?
 
yes, like I said, not the best questions, thanks for the info!!!
some kind of feedback is good
 
6:03 PM
@FélixGagnon-Grenier It isn't. In one case you are comparing the string itself, in the other case you're comparing its length
 
or maybe, if I could ask, how long did it take you to really get into this, like 3 years?
 
@NikiC aaaaaaaahhh I assumed '' was representing whatever was there before
ta, I figured I was getting nuts or something
... yeah I'm not sure I prefer '' === $value either.
 
ok, thanks!!!
 
I hate when I let me work for long periods of time without commiting when reaching a somewhat functionnal step
this commit rn affects 25 files, absolutely not for the same reasons, changing css, adding tests, changing behaviors, refactoring some shits, resolving ea hints, adding types. like, all that I shouldn't do at the same time
 
@FélixGagnon-Grenier git add -p is my best friend
 
6:14 PM
yes, I love it too :)
... but I should fix the behaviour
btw @Wes, do you enjoy writing tests?
 
@FélixGagnon-Grenier I'll stage related files, commit those, stage more related files, commit those
so on until they're all committed
 
but, at this point, aren't the other changed files dependant of the staged files?
 
Depends
but if they are, then that's "related" :P
so they'd get staged in the same commit
 
hello guys i have an problem in php .. that i am sending email and password to mysql database but it didn't receiving the data !
 
I can see where it would be a problem if there are like 20 files that are related and reliant on changes of each other
@Piyush you mean password hash right?
 
6:28 PM
nope i mean the whole table !
complete table is empty !
 
not the point... nevermind
also look into PDO
 
should i provide you my code here ?
 
@Piyush You are probably getting an error message that you don't see. Make sure that you have display_errors=1 and error_reporting=E_ALL.
 
basically i am beginner in php so ,
 
Also if you are using mysql_ functions you have to manually check for errors
 
6:30 PM
please can you guide me
 
@Tiffany ok. yes, indeed, I am able to do so, but when working, I get sidetracked, and decide to fix that markup generation, and this database scheme irregularity, and this, and that, and it becomes bs rapidly, and I end up with a 25 files commit that touches pretty much every part of the application
 
@NikiC s/manually check for errors/stop right there/ :P
 
as i told i am beignner
If that's the case then it is likely that mysql_query is returning false because of a syntax error. You need to output the error to see it. Please follow the manual - php.net/manual/en/function.mysql-error.phpwaterloomatt 48 mins ago
check my question .. i provided my code there !
 
What version of PHP are you using?
 
sorry , but i don't know acctually
 
6:33 PM
@Piyush mysql_query... plain text passwords...
Feels like I'm back in 2003
 
make a page and type <?php phpinfo();
then load it
that will tell you the PHP version...somewhere...I don't remember exactly...
 
yo phomies ...
 
@FélixGagnon-Grenier I can see what you mean. The changes I make usually only affect like two or three files at a time... but that's also because a lot of the classes act almost like god objects (I think?)
point being, they have several more lines of code than they should
 
@FélixGagnon-Grenier Happens to me all the time
Only I had the habit of working for hours at a time without a commit in between
 
^ or days for me
my work days seem to meld sometimes
 
6:37 PM
@Tiffany nothing happens
 
@Tiffany Don't you work with the FTP&Pray method?
 
@Piyush do you have a web server installed?
such as Apache, nginx, etc
 
yes
wamp
 
so file is in htdocs, and you're accessing the page from your web browser?
 
@MadaraUchiha ftp&pray? who dis?
 
6:38 PM
i am using winspc
sorry winscp
 
!!? winscp
 
Search for "winscp -site:w3schools.com" (https://www.google.com/search?q=winscp+-site%3Aw3schools.com&lr=lang_en)
• WinSCP :: Official Site :: Download - WinSCP 5.13 Download. Advertisement. Advertisement. WinSCP 5.13 is a major application update. New… (https://winscp.net/eng/download.php)
• WinSCP :: Official Site :: Free SFTP and FTP clie… - Open source freeware SFTP, SCP and FTP client for Windows. (https://winscp.net/)
• WinSCP download | SourceForge.net - 19 feb. 2018 - WinSCP is a free SFTP and FTP client for Windows, and a multi-functional tool that i… (https://sourceforge.net/proje
 
> Download - WinSCP 5.13 Download. Advertisement. Advertisement.
Solid
Nothing like a software site with ads on it
That makes you confident in downloading.
 
@Piyush that doesn't answer my question though, do you have the php file with <?php phpinfo(); in your htdocs folder, and are you loading the page from a web browser? and make sure Apache is turned on.
 
oh .. wait
 
6:41 PM
I'm procrastinating working on an iOS app...
 
in apache i am using PHP 5.6.25
 
alright, so mysql_ still exists
 
yup
 
it's removed in PHP 7 because it's a security hazard
 
oh i don't know about that
btw when my website goes online than also .. data failed to store
 
6:46 PM
I'm out of suggestions at this point. do what Niki suggested chat.stackoverflow.com/transcript/message/41631060#41631060
 
@MadaraUchiha use choco
 
@tereško lol no
use linux
 
well, that's not always an option
 
I get the privilege to always make it an option, or make options elsewhere :D
 
hey @NikiC can you help me please
 
6:51 PM
@Piyush Are you writing this for an actual paying customer?
Or just for yourself?
 
no
yourself
*myself
 
then use PDO
 
what is pdo
?
 
6:56 PM
ok, nite, bye bye and thanks everybody
 
nn
 
public function __construct(
    Storage $container,
    UserMapper $userMapper,
    DirectorMapper $directorMapper
) {
    $this->storage = $container;
    $this->userMapper = $userMapper;
    $this->directorMapper = $directorMapper;
    if (
        $this->variableExists(SessionValue::CODE_USAGER)
        && $codeUSR = $this->getSessionVariable(SessionValue::CODE_USAGER)
    ) {
        $usager = (new UserEntity)
            ->setCodeUSR($codeUSR);
        if ($this->userMapper->fetch($usager)) {
sometimes, I wonder what the fuck it is I was doing.
 
7:02 PM
> $usager
 
don't do work in constructor soon to be a tatoo on my forearm
 
@Allenph lol
 
@Allenph oh that's the least of my problems rn
that's like, a one second refactor
 
public function testEventDispatchAnonymousCallback() {
		$dispatcher = new EventDispatcher;
		$dispatcher->addListener('someEvent', function(Event $event) use($this) {
			$this->assertEqual("someEventContent", $event->getContent());
		});
		$event = $this->getEventMock();
		$dispatcher->dispatch($event);
	}
 
@FélixGagnon-Grenier that wording though
 
7:03 PM
The anonymous function used as an argument to addListener gets called in the class being tested.
Can't use $this as a lexical variable.
Anyway to make this assertion?
 
use($this) wa5t
 
somethign with bind on a callable, I'd think
 
What version are you on?
 
because as PeeHaa rightfully remarks, use($this) is gonna throw ball ;)
 
@PeeHaa 7
Yeah, I mean I kind of expected that to fail. Thought it was worth a shot though.
 
7:05 PM
@Allenph So why are you binding this manually?
 
public function testEventDispatchAnonymousCallback() {
		$dispatcher = new EventDispatcher;
		$test = $this;
		$dispatcher->addListener('someEvent', function(Event $event) use($test) {
			$test->assertSame("someEventContent", $event->getContent());
		});
		$event = $this->getEventMock();
		$dispatcher->dispatch($event);
	}
That works.
 
Fine. Don't answer
 
@PeeHaa Because I didn't know there was a way to do such a thing.
That looks like a much better way.
 
Wat looks like a better way?
 
7:08 PM
Using Closure::bind.
 
Wat
Why?
 
Because my way seems hacky. Is it not?
 
It is
Hence
Why are you manually binding it?
 
I do think $this would be undefined in the callable, wouldn't it?
 
It's automatically done since at least 7.0.
Probably way before that even
@FélixGagnon-Grenier Nope
 
7:10 PM
I know too little to get what you're asking.
Because the EventDispatcher executes that closure. I never get a result from it?
 
oh, you mean that @Allenph could just remove use($this) altogether?
 
@FélixGagnon-Grenier Yes
 
hmmmmmmm
interesting, I did not know that scoping in callable had changed. I guess I don't play with this that much
 
Huh. Yeah, you're right @PeeHaa.
 
I'm surprised this landed at all. There must have been a shitstorm of "but meh scripts" all around
 
7:12 PM
That seems weird. What happens if you WANT the closure to be called in the scope of where it's being called?
 
@PeeHaa What about passing it to a different context?
 
> 5.4.0 Anonymous functions may use $this, as well as be declared statically.
 
Remains bound to where it was defined in?
 
That's like yeeears
 
7:14 PM
@MadaraUchiha yes, it always inherits $this from the declaring scope at instantiation time, unless it is declared static
 
@MadaraUchiha This is a better way of asking what I just asked.
 
@MadaraUchiha yes
 
@DaveRandom What if you don't want it to do that?
 
you can rebind it
 
@PeeHaa Neat, so like fat arrow functions in... everywhere
 
7:14 PM
you're a fat arrow function
dodges the ban
 
Your mom's a fat arrow function.
 
@Allenph do which part of it?
 
indeed, she inherits all contexts
 
@DaveRandom Call it with a different $this
 
!!docs closure.call
 
7:15 PM
[ Closure ] Class used to represent anonymous functions.
[ Closure::call ] Binds and calls the closure
 
@DaveRandom Say I WANTED the closure to use the $this in the context in which it's called instead of the context in which it's defined.
 
also bindTo()
 
Honestly, in that case @FélixGagnon-Grenier just add a normal parameter and pass the $this you want into it.
 
@Allenph $f->call($this)
 
Sure, but how do you bind a closure to something you're not sure what is yet.
 
7:16 PM
Dynamically bound context is bad.
 
@MadaraUchiha are you.... still talking about my mother?
 
@MadaraUchiha Not exactly. Just the instance
 
I'm not planning on doing it, just curious.
 
@Allenph You'll have to know at some point
Most often, at the moment of the call
You don't have to bind it
 
ftr I don't think anyone should do any of this really ever
 
7:17 PM
$foo = function ($self) {
  $self->magic();
}

$magic = new Magic();
$foo($magic);
Much more explicit, much more readable.
 
Ahh. You just pass it as an argument.
 
JavaScript dealt with the consequences of arbitrarily bound this for decades
 
@FélixGagnon-Grenier in my head, I imagined @MadaraUchiha shooting a giant red arrow at you, and you dodging it cartoonishly, with your hips moving like a foot to the side.
 
Don't repeat those mistakes
 
@MadaraUchiha The "problem" is that magic() must be public. imo this is not actually a problem.
 
7:18 PM
hahahaha
 
@DaveRandom Sounds like a solution to me, not a problem :D
 
There are probably sane-ish use cases in testing
other than that... nah
 
If you need to call a private from the outside, the closure logically has to be defined (and pre-bound) in a place that has access to it
@DaveRandom Reflection
That's literally its one job
Don't put your privates out in public!
 
@MadaraUchiha Search our transcript
SADLY WAAAY PAST THAT POINT
 
7:21 PM
Do I want to?
 
:P
 
private long long parts;
public double penetration;
etc etc
 
Jesus Christ Dave. Rofl.
 
Best I know is const up = new Error(); throw up;
Still cracks me up
Also works for const tantrum
 
7:22 PM
 
don't star that :-P
 
lol don't star those :D
 
hahahaha
 
Damnit :P
 
@PeeHaa :D
That's pretty good :D
 
7:23 PM
@PeeHaa whose comment?
 
Actually that seems to be a revert
meh. too much work :P
 
actually, I wonder how many PRs there are of people trying to remove it because they're sticks in the mud and have no sense of humor
 
Who is actually responsible for listening for the even and the read model refresh is CQRS? The repository?
 
wow that is ooooooold
 
7:26 PM
> zsuraski committed on Feb 3, 2004
 
Hory shit
I was 20
19 even
 
2004 :o
 
I was 8.
 
It's cool how much info has been retained across the vcs migration (2 migrations?)
 
I was...17
 
7:27 PM
@Allenph wut, actually?
 
Yeah. Actually.
 
13 :D
 
ffs I am old
 
@DaveRandom I feel this way with last.fm, since I've been using it over ten years. "What was I listening to ten years ago on [this day]?"
 
Actually that's before my birthday. Much before. I was 7.
 
7:28 PM
@DaveRandom There there grandpa, here, take my hand, I'll walk you across the street.
 
sudo systemctl stop aging
 
> I'm sorry Dave, I'm afraid I can't do that
 
Lol.
 
$ cd /; touch this
Cannot touch 'this'. Permission denied.
 
he actually got the order right, at least
 
7:29 PM
you guys are too funny sometimes, I'm going to get in trouble
 
@Ekin :P
@MadaraUchiha Aaawesome
 
@DaveRandom sudo systemctl stop yawning
 
7:44 PM
Found me a new "you didn't see anything" gif
 
Rofl.
 
7:59 PM
foreach does not work with pharfileinfo – #76097
 
I hate when I have a headache and I can't tell if it's a migraine starting, or a dwindling caffeine headache from taking over-the-counter migraine medication that has caffeine in it
 
Rofl. Socialist bastard is trying to screw a bunch of people with crypto. How ironic.
 
8:20 PM
@tereško it reminds me of an article I read a while back where a social worker said the SJW movement was actually hurting what she was trying to do
 
I have hear the same from people, who work as community organizers (as in, low-level worker union peon)
 
tried searching for the article, found a different one that I skimmed, and found a good point: "There are indeed embarrassing aspects of SJW or PC Culture; those who care about the right things, but in the wrong way and to a fever pitch bordering on ridicule."
 
8:34 PM
including the password in the key here seems... at least mildly not good
also that named persistence pool thing that it seems to allow is undocumented
 
9:03 PM
god dammit
 
 
2 hours later…
10:45 PM
yo phpeepz
 
10:57 PM
@FélixGagnon-Grenier i.imgur.com/7dq7zBl.jpg .
 
oh you ;) yeah, we have those
/me away
 
11:13 PM
@bwoebi ping
 
11:31 PM
@JoeWatkins pong
 
is there something up with ZEND_PARSE_PARAMS_THROW and fzpp < 7.2 ?
it emits warnings on string conversions ...
 
The moment when you realize you have that chat the whole time open on your other monitor but just didn't look on it :-D
@JoeWatkins it just throws if the args cannot be casted to the value
in this case the cast is successful hence it only warns
 
any way to force strictness ?
 
and continues execution
yes, but I wouldn't
 
this sucks
I'm going to need my own param parser ... with blackjack, and hookers ...
oh no I can just do Z_PARAM_STRICT_STR
 
11:39 PM
Am I misunderstanding what exactly you are passing in and what you are expecting as type?
 
11:55 PM
I'm testing an extension, passing in unexpected args ... arrays for ints and strings ...
 

« first day (2706 days earlier)      last day (2256 days later) »