« first day (1814 days earlier)      last day (3127 days later) » 

12:04 AM
@Ghedipunk I'd use help.github.com/articles/about-webhooks rather than a cron job.
 
@PaulCrovella Thanks. That's much closer to my original idea of using git hooks. :D
 
Im still unable to get the anwser
if a make a simple query and there is a row like "cars" if I make a while loop and fetch the results
they gonna be like
porche
toyota
GM
Ok, But Im still unable to count that results inside the while loop
example:
6
and 6
and 2
 
if strlen isn't what you're after then I've no idea what you're asking
 
I make my google search but there a lot of mentions to count and srtlen funtions and that functions appear not towrking on that case
 
maybe mb_strlen() in case you're using a multibyte character set...
 
12:17 AM
a mcve and a clear problem description would go a long way
 
For instance,
`strlen('💩')` == 4
`mb_strlen('💩')` == 1
 
:26084219 I validate form using javascript client side. but then when the form is submitted, how to re-validate it on the server side and reject the submission if it doesn't match. The following is my edited code.

my index.php file
<head>
<script type="text/javascript">
function blankornot()
{
	var name = f1.name.value;
	if(name=="")
	{
		document.f1.name.focus();
		document.getElementById("err_name").innerHTML = "<font color='red'>Fill firstname</font>";
		return false;
	}
	if(firstname!="")
	{
 
@user3216114 please use something like pastie or gist rather than pasting everything in here
 
@user3216114 Submit the form to index.php, and in index.php if it's valid, accept the values, then do a 302 Found redirect to qa.php.
 
means form action=index.php
I don't know about a 302 found redirect.
 
12:32 AM
@bwoebi not screenshots! I used the save as gif option
 
@NikiC actually I want to revive it myself ^^
PowerPoint has let you export images for as long as I can remember
 
can me someone help with stackoverflow.com/questions/32925549/… ?
 
@Andrea given any thought to bigints coming back around?
 
the answers from the others questions with this error don't helped me.
 
12:43 AM
Read my comment, read your script.
instead of Copy Pasting, atleast understand the basics of PHP -.-
 
sorry this was a comment in the script
 
I am being so nice today, helping with a basic understanding of PHP question... feeling so angelish XD
 
the ways to fix "unfefined variable" and "undefined index" errors is either to define the values or to check if the value exists before using it
 
I tried both
 
how?
your question did not reflect any "trying"
 
12:49 AM
Read my full comment instead of heading up to the source...
          `We don't have any background information and we can't suck that out of our thumbs .... -.-`
 
do you even know how to check if value is not defined in PHP?
 
@tereško I think you don't need to ask that ^^
 
I will add my changings and the result to the question.
 
Great let's start thumbsucking again :-P
 
@PaulCrovella I have. I'm wondering if it might be possible to do in a 7.x, but probably not
I know there's some things I'd do differently next time
it's 2am and I wanna go to a breakfast thing at 7am
goodnight :)
 
12:53 AM
@bwoebi could you explain what BC break you have introduced, exactly?
 
and now I am hungry
I hate you, @Andrea
 
> This additionally removes support for binding to an unknown (not in parent hierarchy) scope.
this is broken as heck, no?
 
@tereško :)
sorry :p
actually closes Firefox. night.
 
@MikeM. I have add the information, what I get, if I declare the variable like you said.
 
And I already commented to it, that's how nice I am...
 
1:00 AM
@Grischa so, you actually expect us to somehow pull it out of our asses, that YOU ARE RUNNING THAT FUCKING CODE IN A LOOP?
 
I don't wanted to add the astrixes, I wanted to strong the missing part.
 
-.-
Read my comment again
@tereško Take a chill pill buddy xD You really need some food don't ya?
this is just hopeless -.-
and I feel like I am getting trolled by one known guy in here but he made a fake account to troll someone...
 
Do I use var_dump wrong?
 
appearantly, ` $moreurl .= $teilurl[$navigationspfad_zaehler] . '/';` turns into: www.example.com/page/ when the content of your teilurl = string(6) "physik" string(17) "festkoerperphysik"
Hooray for sience.... and magic.
 
Yes, but it worked, when I delete the new line: $moreurl = '';
 
1:10 AM
Use the correct chat, thank you. Didn't join it for nuthin.
@tereško by chance german?
 
That's an old damn song.
 
yeah but i came across this song today ^^
 
Pffff getting an headache of Grischa's german code -.-
 
1:20 AM
@AnmolRaghuvanshi Not funny, look: pastebin.com/5CVZRM2X
 
@Sara I bow to your bikeshedding deflecting bikeshedding technique. Really incredible to watch.
 
@MikeM. :) you know german
 
@AnmolRaghuvanshi Just a tiny bit.
 
it all doesn't make sense to me.
 
1:24 AM
ya know, reading internals might not be good for ones mental stability
 
how can i be updated with latest english songs hip-hop and rap
 
@AnmolRaghuvanshi Google "Latest english hip-hop and rap songs"
 
Hello in the following code my variable $name in qa.php is not printing.
i want to print textbox value from qa.php with the validation of index.php
http://pastie.org/10459343
 
@AnmolRaghuvanshi try this in return: youtube.com/watch?v=nXY6B78EKdg
 
music is very good
@tereško once you posted a video song not getting the name...
 
1:35 AM
what do you mean?
 
Hello in the following code my variable $name in qa.php is not printing.
i want to print textbox value from qa.php with the validation of index.php
http://pastie.org/10459343
 
a video link of song there is one girl in a song and guitarist
 
ahh yes
thnks.
 
in my experience metal-oriented bands make very beautiful ballads
 
1:38 AM
yeah
 
Please help
@AnmolRaghuvanshi Please help me
 
@user3216114 if i could help i definetly would help....
 
Thank you.
my question is Hello in the following code my variable $name in qa.php is not printing.
i want to print textbox value from qa.php with the validation of index.php
 
1:56 AM
Whoohoo changed 171 lines into 30 lines... :P
But I bet it still could've been less xD
I am actually quite sure it could be.. xD
all Grischa needed was something like this: 3v4l.org/D0bPG -.-
I totally just did all his work he needed PFF :P
Atleast he has the respect to say Thank You. Rarely seen now-a-days on the web.
 
@user3216114 sorry
 
...?
 
he need help ^
 
@AnmolRaghuvanshi Ye but I refuse to help, simply because I started reading off that it contains JavaScript ^^
 
mee too and it's 8 am in morning i need some nap
 
2:06 AM
it's 4AM here I need to get some rest aswell
 
i didn't sleep from one day
 
Meh I stopped doing that stuff.
I get grumpy for doing that...
 
functioning on 1 hr 2 hr nap only
 
I used to stay awake for avg 2-3 days
 
i feel so bad if can't help a person codeing
 
2:09 AM
But after that I was a zombeh
 
@MikeM. that's normal
:) 2-3 days
 
Yup like production went from 75% to 60% after the first day then it went to 35% and when it came to the third day it went to -10% which I actually fucked up a class I build a week earlier :P
 
And then knowing you just overwritten your backup.
didn't make my evening great.
 
:)
once while working i slept over my laptop result in cracked screen
 
2:15 AM
^^ That's bad :-P
 
;p it happens twice ^^
 
That;s not good ^^
 
:)
/me going to take some nap
 
@AnmolRaghuvanshi I am going to try to produce a bit more.
Wow that can be taken soooo freaking wrong in sooooo many ways...
 
@MikeM. good luck ;p
 
2:19 AM
@AnmolRaghuvanshi Ye thanks I need it as I am becoming a damn zombie again
 
@AnmolRaghuvanshi btw, you might like this cover song:
 
3:05 AM
@tereško not bad
 
can't sleep, so working on the script ;-)
 
3:48 AM
morning
 
Joe, why are you up by this time?
 
Morningg
 
morning
it's 4:56am here, I should go to sleep
 
4:05 AM
Morning
 
@tereško that's awsme lovely cover
and Morning
 
4:17 AM
@iroegbu not sure
first commit was just past four o'clock ... didn't look at time when I woke up ...
 
 
2 hours later…
6:09 AM
Loving this split view feature.
On El Capitan
 
First actual unit test written and passed on my server... about 4 years later than I should have written it. Do I write more tests, or do I pick a factory pattern to make fetching mockup objects easier?
 
writing more tests will let you know what you need to change to make writing tests easier
 
Much appreciated, Paul.
 
nothing brings clarity to the question "what's gonna hurt?" as much as "ouch, this hurts" does
 
Very true. :D I'm not getting paid for this code, and I can't make it any more of a naive mess if I wanted to, so this is the perfect candidate project for learning the hard lessons.
 
 
1 hour later…
7:26 AM
@Andrea In the current form, i.e. using void?
 
7:41 AM
SELECT payper
AVG(payper) + '%';
FROM rep_commission
gives me
AVG(payper) + '%'
53.87096774193548
I want to name the column "Average Pay"
instead of "AVG(payper) + '%'
and I want to add the '%' to the 53.87...., and condense the 53.87096... to 53.87%
er $ to the beginning
 
@NikiC yes. I'm unlikely to change it to null, though it might end up happening
 
0
Q: PHP / MySQL Query Rename Column / Fix output

levizoeschWhat I have SELECT payper AVG(payper) + '$'; FROM rep_commission Results given, AVG(payper) + '$' // Column Name 53.87096774193548 // AVG per item I want to name the column 'Average Pay' instead of "AVG(payper) + '$' I also would like to condense the value to 53.87 instead of 53.87096...

 
8:01 AM
@Andrea Wait ... does that mean you're keeping an open mind about a proposal?!?! I don't think that's allowed...
6
 
ThW
Morning
 
GOOD MORNING MY NEIGHBOR!!
IF my query is
$SQLQuery = "SELECT
				CONCAT('$',TRUNCATE(AVG(`payper`),2)) AS `Average Pay`
				FROM `rep_commission`
				";
what would be my
foreach ($DataBaseHandle->query($SQLQuery) as $row)
    {
    echo $row["columnhere"] ." - ". $row["columnhere"] ."<br/>";
    }
 
do a var_dump($row) in the foreach, it might help
 
how do I do that?
try {
    	// Make our connection
		$DataBaseHandle = new PDO($Host,$Username,$Password,$Table);
			$DataBaseHandle->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
    			echo 'Connected!<br/>';


	$SQLQuery = "SELECT
				CONCAT('$',TRUNCATE(AVG(`payper`),2)) AS `Average Pay`
				FROM `rep_commission`
				";

foreach ($DataBaseHandle->query($SQLQuery) as $row)
    {
    echo $row["columnhere"] ." - ". $row["columnhere"] ."<br/>";
    }

    $DataBaseHandle = null;
    }
catch(PDOException $e)
 
you add the line var_dump($row)
 
8:13 AM
instead of $row["columnhere."-".$row["columnhere."br/>";?
@FlorianMargaine
 
@NikiC hah
 
8:54 AM
Some people are struggling to make it to Sundays talks it seems. I am all alone... :p
 
@Fabor do you mind looking at my question i posted earlier.
about 10-12 lines up
udner good morning my neighbor :P
 
I'm at a conference about to watch a talk ATM so its unlikely.
 
should be quick :)
 
ThW
@levizoesch php.net/var_dump
 
9:12 AM
@Ocramius it is… hence I actively prevent it now.
@Andrea even better :-D
 
9:28 AM
@bwoebi But why is it okay if it's in the same hierarchy?
 
@HassanAlthaf let's continue here instead of in the comments section.
 
Alright.
 
I have no clue what you meant with changing the toHtml method.
 
So,
You were saying,
If we had to adjust something of a particular FormElement,
You can do it only by adjusting the toHtml() method in every FormElement class.
 
no, that's not what I meant. my main point is that it's bad if my code has to new all these different form elements. I cannot test those easily when they are hardcoded like this.
that's why I am suggesting to encapsulate the creation inside the form builder instead.
this way, my code doesnt need to know which form element class I need to instantiate in particular
this hides implementation details of your package from my code
thats a good thing
 
9:39 AM
In my opinion it makes sense. What my idea is, that all the elements are FormElements, and for example, HtmlTextField is a TextField and instantiating it means creating a new TextField, like, this gives some sort of meaning.
I understand, that it promotes abstraction.
 
I am not talking about abstraction
I am talking about coupling
 
Abstraction => hides implementation
Correct me if I'm wrong.
 
Consider $textarea = new Foo\Html\Textarea versus $textarea = $builder->createTextarea() or $textarea = $builder->create(FormElement::TEXTAREA)
the first one requires my code to know which particular class your textare element is
 
Hmm, thats definitely a good idea.
 
the other two dont, because that detail is hidden in the creation method
 
9:43 AM
But, the user needs to know the constants in order to do it, but, it really does hide a lot of implementation. Thanks!
@Gordon Do you mind editing your review post and adding this point?
 
@HassanAlthaf can do later. kis just woke up
 
@Gordon Alright, thanks.
 
yw
 
What's your opinion about frameworks?
I recently wrote an article, and I'm really awaiting responses.
 
Well.. using dependency managers has nothing to do with it.. frameworks also use di ioc
when you stack a couple libs together, you basicly get a framework
 
9:49 AM
By frameworks, I meant those like Laravel, etc.
 
but I generally like it (the blog post you made)
 
Oh, thanks! :)
 
yw =]
 
Oh wow, pat is writing a book, nice!
 
@NikiC I decided to review that today… … Well, what's the point of the scope parameter exactly? the static? (for Closures from a method I mean)
 
10:02 AM
@bwoebi I don't think closures from methods should be rebindable at all
Changing the scope to anything other than it is would break self:: constants, right?
 
actually, we can change the called scope?
 
@bwoebi The called scope is set to the scope iirc
or to the $this ce maybe
I'd have to check ^^
 
@NikiC to $this, when $this exists
else to scope
so, we can change called_scope, but not ce on these.
 
Anonymous
@HassanAlthaf pat?
 
@samayo Patrick Louys.
 
10:17 AM
my last two internals emails were a little angry
 
@Andrea I'd like to see the results about the algebraic types proposal first, which most likely will then also allow type | null … where we'll get precedent for using null as type...
 
@salathe If the error behaviour of \u bothers you, why didn't you vote against it? It was in the RFC.
 
@bwoebi You do not want to create a dependency between void return (simple proposal) and algebraic types (f*ing complicated proposal)
 
@bwoebi I'd prefer nullables really, they're simple, no-nonsense
@NikiC oh god have union types now become algebraic types?!
 
@Andrea the problem with nullables is that it's going to look weird with algebraic types type | ?type2 << euh, yea? type | type2 | null is going to look much better.
 
10:20 AM
@Andrea I'm just quoting ^^
I'd say algebraic types and union types are pretty unrelated...
 
@bwoebi well it can deal with that when it gets to it
@NikiC algebraic types are a way to do unions, but not quite in the way PHP has
 
@NikiC maybe I'm just messing up the words...
 
since all variables in PHP are a union
 
Anonymous
 
Anonymous
I think that's a big mistake
 
Anonymous
10:22 AM
get/post requests should not be merge together.
 
@samayo I'm not the author. @Patrick is.
 
Point is just, we shall see whether we'll introduce null as a type or not… else we'll end up being able to use null and void interchangeably, which may be suboptimal...
 
Anonymous
@HassanAlthaf Ok, do you still understand that code though?
 
Yes.
He merges $_GET and $_POST.
So that the $_GET and $_POST array keys can be accessible through a common method getParameter($key) I believe.
Don't remember the method correctly. Haven't used PHP since a while. Been doing Java.
 
@bwoebi If we should ever run into that problem (which is not at all clear) we can simply forbid isolated null types
E.g. function foo(null $bar) does not make terribly much sense
Similary foo($bar) : null will be forbidden and void has to be used instead
 
Anonymous
10:25 AM
So, a user submits a form with 'name'=>'samayo' the url has also an get param as ?'name'='samayo' what will happen now? @HassanAlthaf
 
$_GET will be assigned a key value pair 'name' => 'samayo'
 
Anonymous
They will be merged, and you will lose data of $_POST['name']
 
I read the $_GET part only and yes.
$_GET['name'] wil merge with $_POST['name'] into $array['name']
But which one will be given greater preference?
Is it the $_POST that will be overwritten or $_Get/
 
but if data is delivered in a post request.. when would you ever also set data in $_GET?? (Actually I do not really see the reason to use $_GET at all)
 
Anonymous
10:31 AM
Are you saying, you can not submit data on foo?bar=tar
 
@samayo He is saying, knowing that you are gonna submit data with a POST request, why would you do it with GET too at the same time.
 
Anonymous
Yes, it is rare I admit. But it has it's uses-cases. Mainly, for CSRF-related purposes.
 
but I also think you are right samayo, the lack of being able to access the data without falling back to global is not ideal
if anyone for some reason needs to pass the name param to both get and post.. they would be unable to
do a pr =]
 
Anonymous
Yeah, also one is a query and the other is a form type. imho they are not supposed to be merged.
 
Maybe do a pull request for him? @samayo :P
 
ThW
10:38 AM
@samayo Not true, forms can use get and some like search forms should.
 
Anonymous
@HassanAlthaf you do it. I'm way too busy trying to program skynet in PHP :D
 
skynet?
I'm busy programming this stock control system in java lol
loving java <3
 
I really think how the producer passes data is irrelevant to the consumer of it
so imo it is just POST data
 
Anonymous
Eh, I wanna try Java so bad. I need to build just one android app @HassanAlthaf
 
@samayo It's not that hard. If you can invest $10, there is an amazing tutorial I can recommend you. It's worth it for $10.
I just don't have enough time to learn Android. Lol
I have two android apps on play store @samayo but they are too basic.
 
Anonymous
10:42 AM
@HassanAlthaf Mine is going to be basic also. It's just a book actually.
 
Wow, I got 10 to 50 installs. LMFAOOO
I feel amazing.
Aight i gotta pray fast and have a shower. Seeya guys.
 
Anonymous
Looks nice. ^ laters
 
@samayo will you open a issue on http issue?
 
Anonymous
No, I can't right now. Also, I think @Patrick may have done it intentionally, thus .. he may not merge it.
 
@bwoebi no, it isn't. Why would it be a broken use-case if I fetch a public property from one class via $this and call a private method on a given $object?
 
10:53 AM
@Ocramius this is about rebinding of non-closure closures only
I.e. if you fetch a "closure" of a method using reflection
 
Oooooh, alrighty then
I don't use that stuff anyway, it's broken as heck
 
It is? ^^
 
kinda, yes
I generally prefer to have my own userland impl of getClosure($reflectionMethod)
much simpler to control too
 
@Ocramius ah, how is that possible to implement in userland? Apart from just calling the internal method again ^^
 
function getClosure(\ReflectionMethod $m, $object) {
    $mn = $method->getName();
    return Closure::bind(
        function (...$params) use ($m, $mn) {
            return $this->{$mn}(...$params);
        },
        $object,
        $m->getDeclaringClass()->getName()
    );
}
something like this
can also make one for static methods, eventually.
It is broken as heck because of silly rules like the ones just introduced by @bwoebi
 
11:01 AM
@Ocramius Ah, I see
(...$params) ==> $this->$mn(...$params) :P
 
yeap, in 7.1 :-P
but yeah, in general "assumption" and "reflection" is a recipe for problems, because when people go the reflection way they already went for fucked up stuff
 
11:22 AM
mornin'
 
Anonymous
morning
 
mornin @teresko
 
morning's
 
Anonymous
is there a benchmark between making a database query based on id/int vs a string/slug
 
Anonymous
for ~100k records
 
11:35 AM
@samayo programmers.stackexchange.com/questions/189026/… might help you. My common sense says int lookup may be faster.
 
Anonymous
Yeah. I wish we had a benchmark to know just how much faster it is though.
 
Jun 20 '13 at 19:02, by tereško
never trust benchmarks which you did not forge yourself
2
 
Quoting from '13 like a boss. @Fabor
 
@NikiC hehe, special rules… I'm not particularly liking that ;-)
 
@bwoebi Not so special. I would expect us to do it anyway
Because of the parameter usage
 
Anonymous
11:42 AM
@HassanAlthaf good job github.com/PatrickLouys/http/issues/8 :)
 
@samayo np. ;)
 
Well, I see no reason to disallow a standalone null though. Also, might make sense when having covariant return types...
parent returns Foo | null and child only null … would be weird to have the child return void there…
@NikiC Also, while not having a concrete example why it'd be useful as standalone parameter, I don't know… but at least, as said, for return types explicit null makes sense.
 

« first day (1814 days earlier)      last day (3127 days later) »