« first day (1667 days earlier)      last day (3296 days later) » 
00:00 - 16:0016:00 - 00:00

4:00 PM
@samaYo Yup, can you please be more breif.
 
in general it is considered a bad practice to mix logic with html
but if you are using simple php templates there isn't really much of a logic there
 
Anonymous
@CoDINGinDARK interactions b/n php and js should be mediated through json. but listen to what @tereško said.
 
@samaYo, I think you misread the question
 
sure thank you @samaYo
 
@CoDINGinDARK as a side note: the best practices in JS is to add JS scripts at the bottom of the html document (before closing </body>), because then the scripts are executed when DOM is ready and you do not need add additional event listener to check for "onDomReady" pseudo-event.
 
4:05 PM
@tereško I knew that is their any, event-listener in PHP for clicks ?? I want to update a value as the user clicks, like a like button.
 
no
 
how is that done ?
 
php stops it's work when the HTML is completed
@CoDINGinDARK do you want to create a php-based validation ?
 
Nope a like button, where it counts number of likes as the user clicks the like button.
 
... @samaYo , I am starting to get the feeling that my reading way further away than yours
@CoDINGinDARK that is usually done using XHR (known as "AJAX" but the uneducated masses)
 
4:09 PM
Hey I got a answer to this question from the question section that I never understood, here it goes "You still need javascript for the events. Then you use AJAX to send data to the server, process with PHP and store with MySQL. Then you can reload your like count with php on page load and do it all over again. At least that's one very common way of managing this" @tereško
 
you send an HTTP request back to the server using javascript and on the server the PHP script increments some value in the database
 
Anonymous
@tereško I am within the same range as @CoDINGinDARK so, I can sniff more into his/her question
 
@CoDINGinDARK do you know how to do XHR call to server (either natively or with jquery)?
 
Anonymous
s/{his/her}/his
 
@samaYo I am pretty sure it's guy .. age: 16 or less
=P
 
4:13 PM
nope I am still very new, I just read PHP for 7 days :( I wanna develop wordpress themes, I am boy I create a girly image so people ll help me much more. @tereško
 
Anonymous
lol
 
I am 18 male India @tereško @samaYo
 
XHR was very little to do PHP
it's mostly a javascript thing
 
Nope I just an average person in Javascript I am very new to web development studd like 2-3 months, I am studying Js and PHP alternatively. Like oneday of JS and PHP for other I am a college dropout cos of ADD :9
 
Anonymous
@CoDINGinDARK it'll come to you. Just keep learning.
 
4:17 PM
it will explain how to make a basic XHR call to the server
that's the first step you have to learn for this
 
So that lack of notice on attempted array access to a non-array thing bugged me enough that I actually submitted a PR: github.com/php/php-src/pull/1269 (as a bonus I found it was already reported, and nikic had called it a bug, so it might be able to be merged for 7.0 \o/ )
 
@tereško thank you man, It was I was looking for :) Do you know how many days so that I can develop blog or forums ?? for my living ?? I practice 8 hours a day.
I real love this chat room, I hate the srackoverflow C++ forums they kicked me out and people are very rude, the treat me like shit. @tereško
 
I tend to be a rude person :P
ask anyone
 
Anonymous
@CoDINGinDARK "out of the frying pan and into the fire."
 
@samaYo so is that a warning ??
 
Anonymous
4:22 PM
@CoDINGinDARK to paraphrase, in that case you will have it worse here .. shortly, though not hopefuly.
 
ok ... so the estimate: to make a blog (first iteration of it) it probably would take you like a week, but it probably will be complete piece of crap (badly coded, full of security holes, half-functional)
 
Nope I actually @tereško sound like a good guy, so cool. I was so hurt when they kicked me, almost everyone were harrasing me.
 
to learn enough for making a "good enough" blog, it will probably take 4-6 weeks + 2 weeks of development
 
Anonymous
very optimistic imho.
 
"blog" in general is a simple construct
 
4:24 PM
@tereško I know,security issues was what that is pissing me of :( Do you some basic PHP functions that would convert webpage to PDF do you know how thats done ? I really wonder how such complicated things work ..
 
@AllenJB People writing angry emails to internals in 3....2.....1.....
 
Anonymous
It took me more to accomplish that. though I admit I'm a slow learner.
 
@Danack That'll be nice - it's been a bit of as boring read this week =P
 
That is a bug, but it's one of those things that's going to subtly break currently 'working' code.....which seems to be the thing that makes the most drama.
 
@CoDINGinDARK "converting" is a complicated task, but for generating PDF documents (like receipts) people usually use libraries. One of the most popular ones is FPDF, but it is ancient and there could be something better out there
 
4:27 PM
All it does is add a notice - unless people are doing weird things with error_get_last(), it shouldn't cause any BC breaks
 
@CoDINGinDARK if you intend to work as a developer, you will probably need to learn at least for 6 month .. probably closer to a year.
depends on your dedication .. I, for example, suck at dedication
 
@tereško yup one day I might develop it, hey can you recommend me some books that ll help me with code efficency since I am very new to Programming or any mathmatical chapters I need to learn ?? or algorithms..?
 
@AllenJB .....no. A lot* of people run PHP with any notice or warning being turned into an exception, turning on all error reporting, and then making sure their code doesn't generate warnings or exceptions, as that is the way to avoid silently ignoring errors. For those people, they will need to go throw and change some code.
(*number pulled out of thin air)
 
@tereško I to suck, I have ADD i have to take tablets to get going :)
 
Well if it gets into 7.0, it's likely they're going to have to update their code anyway (or at least check it)
 
4:33 PM
ThisISANOUTRAGE.JPG
 
Turning notices into exceptions seems weird to me. A custom error handler can easily notify developers of notices on live without causing code-stopping in that manner
 
@tereško bye then, thank you for helping me out..god bless you.
 
@CoDINGinDARK you do not need to learn specific subjects in math for programming because algorithms will usually require simple operations, which cause some behavior, but you need to be "good at math". As for programming books: if your are going in the direction of PHP, wou couls start with: wrox.com/WileyCDA/WroxTitle/…
(it should be on torrents)
 
@AllenJB The point is, you don't want developers to have to look at log files....it's a waste of time. Either the warning/error is an exceptional error that needs to be handled by code, or it's something that can be ignored and so can be avoided by either changing the code, or just suppressing the error e.g. @mkdir($path, true);
Also, trying to chain error handlers from separate modules together sucks......if the error can't be handled locally, then exceptions are far easier to think about.
 
@tereško i'm bad at math. like really bad. yet, i program :)
 
4:44 PM
@Gordon depends on what type of math we are talking about
 
@tereško any math :)
 
well .. you can work around that with unit tests =P
 
@AllenJB IMO, NULL should be accessible as array… well, at least I have some code relying on it… but for other non-string scalars, it makes no sense, I agree.
 
> NULL should be accessible as array
 
@bwoebi Why would you (want to) do that?!?! Anyway, unless you're doing something weird, you can either @-stomp it or do a quick is null check. But the notice hilights (potential) bugs in code.
 
4:51 PM
@AllenJB Why? Using isset is annoying ^^ … I'm sometimes when returning an array of arrays containing objects just returning NULL instead of leaving the key out because of this behaviour.
 
@Gordon if you program; I'm quite sure you good in some math that's a given
 
Anonymous
5:24 PM
@Gordon same here, no jokes. Aside from from the add/subt/multi/division, I know nothing about maths.
 
Anonymous
the whole relation b/n being a programmer and good at maths is a myth
 
A programmer needs to be good at logic.
But maths sometimes really can help depending on what you do
 
oh noes! Teh builds failed! I forgot to retest with a fully-enabled build =(
 
Anonymous
never had any use for maths while programming, Maybe, it's for different type of programming like matlab, or language design
 
6:46 PM
Hiii
I m new in sugarcrm ..how to learn sugarcrm.
 
By burning everything related to or has been in contact with the codebase
 
^ hehe
 
@PeeHaa how to learn sugarcrm
 
I just told you
Alternatively you could try to stab you own eyes with a blunt object which is basically the same
 
@santosh He just told you that sugarcrm isn't worth learning.
 
6:51 PM
K
 
@santosh You should probably try to find some SugarCRM specific forums / chat rooms. You're not likely to get much help on it here - this is a channel about programming in PHP
 
Thanks
 
Hmmm… I'm really missing short closures… Having about 20 funcs looking like
	public function listFields($table, $like = "%") {
		return $this->startCommand(function() use ($table, $like) {
			// the code
		});
	}
Always needing to use (...) all the params :x
 
7:39 PM
I wonder…
$this->startCommand({
    // my code
});
as a shorthand for closures
without params
@rdlowrey @NikiC @ircmaxell @Sara what do you think?
 
@bwoebi No, thanks.
 
Why?
 
user895378
makes me think of an inline object like javascript
 
Yeah, looks more like an object.
 
@rdlowrey just that there are statements in it
 
7:42 PM
It's nothing you can recognize as function.
 
user895378
I dunno ... I'm going to be a hard sell because I generally prefer readability to brevity.
 
I prefer both.
 
@LeviMorrison What both?
 
Readable and short.
 
yeah
I believe this one will be readable
 
7:44 PM
I prefer short, but readable.
 
Actual example:
	public function refresh($subcommand) {
		return $this->startCommand(function() use ($subcommand) {
			$this->sendPacket("\x07" . chr($subcommand));
		});
	}
vs.
	public function refresh($subcommand) {
		return $this->startCommand({
			$this->sendPacket("\x07" . chr($subcommand));
		});
	}
 
vs.
	public function refresh($subcommand) {
		return $this->startCommand(() ~> {
			$this->sendPacket("\x07" . chr($subcommand));
		});
	}
 
yes, was about to type that
 
vs.
	public function refresh($subcommand) {
		return $this->startCommand(() ~> $this->sendPacket("\x07" . chr($subcommand)));
	}
 
vs. Mr Rogers in a blood-stained sweater.
 
7:46 PM
@kelunik that's horrible as one-liner ^^
 
@kelunik since ~ is already keyword (binary negation) I doubt that's possible. Not sure about php7 though
morning room
 
@Leri that's a non-issue. That's solved in lexer
 
@Leri It's the same with yield and yield from.
 
yep
 
I see. I like the syntax then.
 
7:48 PM
@bwoebi -1 on that. Having the () ==> prefix makes this clearer
 
@NikiC I wonder whether it really makes it clearer. It's more verbose… but does it really bring a value to readability?
 
@bwoebi Yes - it's a piece of syntax that is unambiguous, and doesn't require context to understand.
i.e. if you were just extracting the closure to explain in a tutorial, you can say that:
() ~> {
    $this->sendPacket("\x07" . chr($subcommand));
}
Is a closure - and it's always a closure.
{
    $this->sendPacket("\x07" . chr($subcommand));
}
Is only a closure, when it's being used as a closure.
And also, tabs suck.
 
Well, by that argumentation one could say, let's extract just the part without the () ~> prefix… It's then also just a Closure if used with Closure preamble…
 
Yes, if you take off the part that makes it be a closure, then it's ambiguous as to what it is.
 
@Danack so, it's always dependent on context…
 
7:56 PM
No, it's dependent on the bit of syntax that makes it clear what it means.
 
@Danack yeah… just like my version would be always Closure, except when not used as expression
 
7 mins ago, by Danack
@bwoebi Yes - it's a piece of syntax that is unambiguous, and doesn't require context to understand.
 
I don't think this one is particularly ambiguous…
 
btw you still need to come up with a better reason for ~> if you still want that. People have made valid points against it; namely that ~ is a dead key, or just doesn't exist on some keyboards, and that ==> is already in use for Hack. Just saying that it's your personal preference isn't going to persuade many people.
 
Just for reference saying Hack has ==> is not necessarily a valid reason.
The points about ~ being a dead key or simply not existing are valid.
Saying some other language that intentionally didn't work with PHP has ==> is definitely not a valid reason by itself.
 
8:04 PM
Can -> be reused here?
 
@kelunik no. As much as I'd like to.
 
@kelunik Nope.
Nor can =>
To be honest I think we shouldn't allow parenthesized expressions on the lhs of => in array declarations.
Can anyone find examples of it being done in the wild?
 
How about -->?
 
@kelunik that's post decrement followed by comparison
not an option
@LeviMorrison => is a good idea, but it needs extra rules
like [$var => $var] << must not be Closure. [($var) => $var] << should be Closure
 
Except the latter is allowed currently, correct?
 
8:09 PM
yes
 
I'm not sure why it should be, though…
 
but why should anybody put a $var in parens?
 
That's my point. I'm not sure why it's allowed at all.
 
@bwoebi Same as with ($var) -> $var.
 
true
 
8:11 PM
If only PHP had the foresight in the early days to somehow to use : for hash literals.
 
@LeviMorrison hmm
we could use $var: $var for Closures^^
 
Needs moar colons ()::{} or even better as a prefix ::() {}
 
@Danack two colons is ambiguous again^^
 
As a prefix it wouldn't be though, right?
 
no
But I really dislike that prefix notation…
Can't say why… but I dislike it…
 
8:14 PM
I don't like it - but I think it is clearer to read...
 
ugliness usually isn't a solution either
 
8:29 PM
map($array, $v ---\
                  |
                  \---> $v + 1);
argh, I got it aligned on first try but typo'd everything else...
 
@NikiC … loooooooooool
 
The slide operator :)
 
RFC it! now!
 
With implementation please!
Supporting tabs!
:-D
 
lol
 
8:34 PM
With parse errors for non-aligned code.
 
exactly
 
@bwoebi So how wide should your tabs be? ;-)
 
As always… tabs aren't for fine-grained indent.
\t \t map($array, $v ---\
\t \t                   |
\t \t                   \---> $v + 1);
^ that should work… but not tabs after the actual ident
 
 
2 hours later…
user1648409
10:35 PM
Hi, anybody knows a way to detect a closing xml tag with php simplexml?
 
ThW
10:58 PM
@Shiuyin Here is no closing tag in SimpleXML, only a tree of elements. Why do think you you need that?
 
user895378
11:13 PM
magical assert() disabling via php.ini is really problematic if you actually want to ... you know ... unit test your code.
 
user895378
It basically means that phpunit can't use assert()
 
user895378
magical non-code inputs affecting code execution :(
 
@rdlowrey can't you pass it as command line argument to phpunit?
-dzend_assert=1
 
user895378
@bwoebi you could but then you're changing the way phpunit executes in addition to how your code executes.
 
not sure on how it changes how phpunit executes
?
 
user895378
11:21 PM
I guess it doesn't really. The bigger problem is this:
 
user895378
Basically if you use assert you have to run your test suite twice ... once with zend_assert=1 and once with zend_assert=0 and have checks in your tests to skip this test or that test based on ini_get("zend_assert")
 
user895378
In summary:
 
user895378
5 mins ago, by rdlowrey
magical non-code inputs affecting code execution :(
 
why twice? an assert shouldn't affect code execution?
 
user895378
You know what ... I'm not making sense.
 
11:23 PM
:-D
 
user895378
I needed someone to talk me through that :)
 
I wonder whether we even need unit tests at all when we can just assert in our code? :-)
 
user895378
Bob, you're nuts.
 
user895378
No serious enterprise-grade program can be a thing without tests.
 
user895378
I certainly wouldn't use it.
 
11:25 PM
@rdlowrey that just was a hypothetical question
 
user895378
:)
 
I mean… assert()s in code are just like tests… but tests happening in code itself
 
user895378
Yeah but if you treat them that way you'll just end up with runtime errors in production that should've instead been caught during development.
 
@rdlowrey oh, because code actually isn't run… true.
 
user895378
Yeah I find that just executing as many lines as possible is the most helpful part for me -- because I know what's supposed to happen ... I just need verification that I didn't derp and do something stupid
 
11:26 PM
You're obviously right :-)
@rdlowrey do you have any idea how I would meaningfully have unit tests in amp/mysql without implementing writing myself a server implementation?
 
user895378
@bwoebi Yes!
 
I don't really want to write binary responses directly in code
 
user895378
Don't write a server. Just require the presence of a mysql server on the system to run the test suite.
 
@rdlowrey yeah, good luck testing COM_SHUTDOWN
 
user895378
Do something like what @kelunik does in the redis lib: github.com/amphp/redis/blob/master/test/AuthTest.php
 
user895378
11:29 PM
Where you fire up a server instance as needed.
 
Problem is that mysql always reads it's /etc/my.cnf
 
user895378
Really? There's no way to specify a custom config file?
 
You can't have multiple mysql daemons on one same server I believe
at least not with a standard mysql build
 
user895378
4
A: Give .my.cnf to mysql command line

Brian ShowalterThe --defaults-file option lets you specify which options file you want to use. It would be a good idea to give it the full path to your options file. mysql --defaults-file=/home/user/.my.cnf database

 
user895378
11:32 PM
> However, if you need to run multiple servers on a more permanent basis, it is more convenient to use option files to specify for each server those option values that must be unique to it. The --defaults-file option is useful for this purpose.
 
yep
 
user895378
@bwoebi don't feel bad. I'm wrong all the time.
 
well then…
@rdlowrey me too :-)
 
user895378
My life is mostly just what happens in-between being wrong about things.
 
@rdlowrey so, 99.9999% of the time is all that in-between? :-P
 
user895378
11:34 PM
Floating point math has a difficult time accurately describing the full-breadth of my wrong-ness.
 
We need unbounded floats :-)
 
> visited 1823 days, 1820 consecutive
 
@ircmaxell I'm waiting for the day you have no internet the whole day… ^^
 
The first step is to admit you have a problem.
 
@rdlowrey I just noticed that I actually don't have mysql installed locally :-D
 
user895378
11:44 PM
@bwoebi Phone internet > ISP outage
 
@rdlowrey yeah, I said no internet, not only cable internet^^
 
user895378
That would likely require a cataclysmic event meaning Anthony would have bigger concerns :)
 
hehe
 
@ircmaxell genius
 
00:00 - 16:0016:00 - 00:00

« first day (1667 days earlier)      last day (3296 days later) »