« first day (2559 days earlier)      last day (2389 days later) » 

12:00 AM
7 messages moved to Trash
 
Is there a cleaner way to write this ugly mess?

<ul>
<?php
$elementsPerColumn = ceil(count($topLinksArray) / 4);
$i = 0;
foreach ($topLinksArray as $link)
{
if ($i % $elementsPerColumn == 0 && $i > 0) { ?>
</ul><ul>
<?php } // if ?>
<li><a href="/<?= $link->url; ?>"><?= $link->name; ?></a></li>
<?php $i++;
} // foreach
?>
</ul>
The idea being to insert </ul><ul> in the middle of the list so links can be balanced evenly between four columns.
 
Can you do an up arrow + ctrl+k please <3
Also in general I prefer to format my data structures before passing it to my templates
 
hey guys, I'm pretty new to PHP, I'm just wondering, whenever I run a HTML file that has some PHP embedded, doI need to have both files in the same directory in my htdocs folder to run on XAAMP?
 
HTML doesn't embed PHP. But PHP can embed HTML.
 
you have to save it with .php extension not .html extension
yes you can write html in your php file
but not php in your .html file
 
12:15 AM
Oh, but say if I'm just making a quick form in HTML and its calling a PHP action on submit, I need to have both files in my htdocs in XAAMP right?
 
so all files need to have .php extension
not really you can submit to the same page
 
@PeeHaa aha, yeah a view helper would make a lot of sense
 
@Ultimater Always try to keep your templates as dumb as possible
 
but for better undertanding and file separation yes you need to have both files
 
Okay I'm confused now, so when I write <form action="learnphp.php" method="post">, is that not correct?
 
12:18 AM
its correct
but i mean
 
what's a good route to reset a password?
 
you can have the form and submit to the same form page like
 
/user/resetPassword
/password/reset
/user/changePassword
 
@FélixGagnon-Grenier /reset-password
 
... true dat
 
12:20 AM
Whatever you do not changePassword
 
An .html file can contain HTML which posts to any destination it wants. But it's up to the destination to decide whether to read the posted data or not. PHP can read it while .html cannot.
 
So write the form in the same php file?
 
That feels like lying to me
 
However method="get" uses the query string, so both .html and .php can read it
 
let's say your form is called ""myform.php"
<!-- you can write html -->
<form action="myform.php" method="post">
<?php
//and return form here in the same php file just use <?php ?>
?>
 
12:21 AM
@PeeHaa really?
 
but if you want to separate it also will work
 
I mean, form contains current password, and the new one repeated twice, surely that counts as changing a password?
 
Okay, so when calling that "myform.php" on a html page, what should I do? Cus I'm not going to be writing a whole website in php right?
 
@FélixGagnon-Grenier When I see change password I think about a user changing his password
 
12:22 AM
When I see reset password I think about the user having forgotten his password
 
@Chenny yes it also will work
 
@PeeHaa yeah, I wasn't clear. I'm doing the route for the former
 
So although you could use changePassword that means you cannot use that anymore for the user actually chaging his password
oh :P
 
@OtávioBarreto That's normal? For whole websites to be written in php?
 
yeah, I can't english
;)
 
12:23 AM
In that case not reset password :D
Do you have more stuff under /user/ ?
 
@OtávioBarreto *In a .php file
 
Actually doesn't really matter
Either /user/change-password or /change-password
 
@Chenny yes it's normal , because a php file can have html and javascript inside it than you just use the php when you open <?php ?> tags
 
I, strangely enough, have nothing under user, I named the routes based on their business status (producer, filmmaker, etc)
... which is not that smart when coming to user routes
 
:P
Meh it's just urls
 
12:25 AM
I think I'll refactor towards /user/ stuff
 
Unless you are one of those weird but but buuuut rest people
 
@OtávioBarreto Oh i didn't know that. So people only use .html files if its going to be a completely static website?
 
@PeeHaa surely you mean butt people ;)
 
@OtávioBarreto IE. A website with no php in it
 
yeah in this specific case they are the same :-)
 
12:26 AM
@OtávioBarreto please don't do that
please don't, ever, mingle php, html and javascript in the same file
 
@Chenny not its going to be a static page only , the pages with .php will dinamic you can have both kind of pages in your site
dinamic and static
 
s/dinamic/dynamic/
 
@FélixGagnon-Grenier What would you recommend to do then? Because right now I have a .html page that has a form and its <form action = response.php> but everything right now is in my htdocs folder in xaamp running with Apache i think. Is there anyway I can run the php files from a different directory or does it have to be in that xaamp folder?
 
@FélixGagnon-Grenier I make this with no problem use html and the php part just use inside the <?php ?> tags
@Chenny create a dir inside htdocs folder the adress in your browser it will be localhost/folder
a folder for each diferent project
I need to get the createSale() $sale values
 
@OtávioBarreto Right, that's what I was wondering, but is there any way to test projects outside of that folder? Or will I have to bring my projects into that folder whenever I use PHP?
 
12:33 AM
@Chenny yes there is a way
you would have to change your apache/xampp settrings
httpd.config file
DocumentRoot "C:/xampp/htdocs" , change to DocumentRoot "C:/foldername"
restart xampp after you make this change
httpd.config file it's inside the C:\xampp\apache\conf folder
search for the line DocumentRoot and change it as you wish
 
3 messages moved to Trash
 
hiding your traces, I see
good guy
 
:P
 
@OtávioBarreto Thank you! it worked!
 
@Chenny you are welcome
 
1:01 AM
!!uptime
@Jeeves buddy?
 
@PeeHaa lol @Jeeves is a bot?
 
yes
 
@Jeeves are you alive?
 
@PeeHaa Yeah I'm fine thanks.
 
1:03 AM
@Jeeves Buddy! \o/
 
@Jeeves are you alive?
 
@OtávioBarreto Yeah I'm fine thanks.
@PeeHaa Kill a cat!
 
@Jeeves Sure
 
@PeeHaa Come over and get him.
 
1:03 AM
@Jeeves This feels like a trap
 
@PeeHaa You are the program, I'm telling you.
 
!!reboot
 
Restarting now! o/
 
@Jeeves you are smart! :)
 
@PeeHaa PHP Warning: The process was started with the --debug flag, but the zend.assertions ini setting is set to production mode (-1) - assertions will not be checked! in /srv/www/Jeeves/bin/jeeves on line 79
 
1:05 AM
I don't even no why -d is used tbh :P
 
3 messages moved to Trash
 
!!blame bwoebi
 
Next Amp\Dns\NoRecordException: No records returned for datamarket.accesscontrol.windows.net in /srv/www/Jeeves/vendor/amphp/dns/lib/DefaultResolver.php:307
what's that thing even?
 
Yeah
translator
 
1:06 AM
ah
 
@IROEGBU warned that would happen more then a year ago
So we ignored him
 
Unhandled exception in Room11\Jeeves\Plugins\Github#enableForRoom(): LogicException: Callable passed to resolve() did not return an instance of Generator in /srv/www/Jeeves/vendor/amphp/amp/lib/functions.php:767
 
:P
@bwoebi hmmm
 
@PeeHaa but that one is definitely not normal
 
Nope it is not
I worked on it tonight
 
1:07 AM
#0 /srv/www/Jeeves/src/Plugins/Github.php(48): Amp\resolve(NULL)
 
I thought I made it better
I'm confused
Does resolve need somethign returned in it?
I thought it was smarter
 
@PeeHaa no, but you passed null to resolve()
 
        resolve(function() use ($room) {
            $this->enabledRooms[$room->getId()] = $room;

            if ($this->pollingWatcherId) {
                return;
            }

            $this->pollingWatcherId = repeat(function () {
                yield $this->checkStatusChange();
            }, 150000);
        });
Is it because there is no yield?
 
the error message is a bit confusing
@PeeHaa right
 
k
 
1:10 AM
why do you even use resolve there?!
 
does that sound like too much for one function?
 
return type
 
/*
 * routine changes the password of the user
 * it must verify that the request is authenticated
 * that the user entered the correct current password
 * that both password (new and confirmation) are the same
 * create a new hash from the new password
 * update user informations with the new password
 * redirect to user profile
 */
 
I made it more explicit (and broke it)
 
@FélixGagnon-Grenier is this the top-level controller?
 
1:11 AM
yes
 
then it's fine
 
of course, I don't intend to do all that in said controller, only call services to do these
 
I can just add a random yield even after the return right?
 
@PeeHaa right.
 
1:13 AM
Not sure why I am even asking tbh :P
Way too late for me
Also having to do amp v1 sucks
!!reboot
 
Restarting now! o/
 
Better :-)
 
\o/
tnx
Now hoping github will go down tomorrow :P
/me is out
I wish you all a good night o/
 
 
3 hours later…
4:44 AM
"Your YubiKey 4 Series Security Key is eligible for replacement!" dang x2
 
morning morning room
 
mornings Linus
lol fuck them.. replacement coupon doesnt cover package cost
oh lol it does, dont fuck them
 
5:04 AM
\o
 
Hello everyone.
good morning.
Guys could you Please help me in a www and non-www related stuff ?
I have a website in which i have set up the htaccess so that if non-www url entered it will automatically convert it into a www . It is working fine when I run the site in the browser. But it is not working when the request is fired from the POSTMAN or any mobile device.
 
5:21 AM
Guys, any idea how to solve this ?
 
Is "oh my fucking God" a curse to the God? In other word, what "fucking" refer to?
 
It kinda emphasizes the feeling that is to be conveyed by 'Oh my god'...
 
@ToukaXKaneki ah ok, thx
 
for example..."she is fucking hot".
 
5:33 AM
got it ;-)
 
6:16 AM
this will clarify all your questions about the proper usage of the f-word
 
I'm watching ... thx
 
6:53 AM
.
 
moin
 
I just got told off by the building management for playing Fleetwood Mac too loud :-/
I specifically got told off for playing Fleetwood Mac, I'm not sure what will happen if I put something else on
 
play youtube.com/watch?v=1knh-_SYrfQ at the highest volume possible :B
 
7:01 AM
no I've fallen down a Genesis rabbit hole now
 
@DaveRandom I suggest to play trollhammaren to find out
 
@Gordon wtf are they saying? youtu.be/CJhi43RntJk
 
@ToukaXKaneki something about a troll with a big hammer hunting and smashing christians
its such a cheerful song
 
indeed
 
7:06 AM
@DaveRandom "told off" means "fuck off" ?
 
it's swedish, although the band is finnish, but they chose swedish because "swedish sounds trollish"
 
is there a good way to do image attribution in markdown?
 
@Shafizadeh I actually don't know how to explain that in less complicated words, see if this helps
 
7:24 AM
@tereško how do you mean, just placing some attribution text underneath it?
 
yeah
 
If just putting it in italics underneath it didn't work i'd probably see if I could do it with html, that's very dependent on where you are trying to do it though
 
How you guys celebrating "DIWALI" this year ?
 
we dont
 
@Gordon do you celebrate any other festival like diwali ?
 
7:30 AM
@KishorePatra we don't
aside from a fact, that a large fraction of developers are atheists, it's also an Indian-specific celebration
in western cultures the various solstice festivals are more common
 
yes @tereško..I believe that all the celebrations or festivals have a common objectives. Be it an Indian or western culture.
 
... looks like you did not understand what I wrote
 
I remember a number was special for you. what what that number? @Gordon
 
@Shafizadeh 42
 
^ that's actually an internet meme
 
7:36 AM
and why? (you gave me a link already)
 
actually it's literature
The Hitchhiker's Guide to the Galaxy is a comic science fiction series created by Douglas Adams that has become popular among fans of the genre(s) and members of the scientific community. their books to illustrate facts about cosmology or philosophy. == Answer to the Ultimate Question of Life, the Universe, and Everything (42)Edit == In the radio series and the first novel, a group of hyper-intelligent pan-dimensional beings demand to learn the Answer to the Ultimate Question of Life, The Universe, and Everything from the supercomputer, Deep Thought, specially built for this purpose. It takes...
 
thank you guys
 
well, it originated in literature, but has become a meme these days
some of people, who use it, dont even know the origin
 
uhm, too early still... could anyone confirm wpasupplicant (2.4-0ubuntu6.2) has those recent patches for ubuntu? I keep seeing 2.4-0ubuntu9.1
also... morning
 
moin
 
7:41 AM
mornin
 
omornin
 
ah I think it has them indeed launchpad.net/ubuntu/+source/wpa/2.4-0ubuntu6.2 .
\o /me gets some coffee...
 
@tereško yes I got it..
 
moin
 
Anonymous
8:07 AM
o/
 
\o
 
Anonymous
!!wotd
 
Anonymous
@PeeHaa he's not working and there's a bunch of commits from you :B
 
!!blame PeeHee
 
8:19 AM
Can someone confirm my observation:
Ten years ago: "I am a PHP newbie without a clue"
Today "I am a PHP newbie without a clue *and* I use Laravel"

It's somewhat disturbing to see all these Laravel questions on SO where people are trying to solve basic problems they are clueless about with a framework they are equally clueless about . They got two problems and dont even realize it.
 
@Gordon PHP appeals to beginners, Laravel has hype, why are you acting surprised?
 
Anonymous
!!uptime
 
@Gordon Laravel is the new jQuery.
 
Laravel is great, and does all the things!
 
@MadaraUchiha because it wasn't as worse when newbies would jump to code igniter
 
8:22 AM
@Gordon PHP was never a shining example for excellent coding practice, don't delude yourself.
 
which I think is due to the fact that despite being a framework CI was still mostly vanilla php
 
because swarming to WordPress is better?
 
wp is also still mostly vanilla php
 
That's like me saying "What the hell happened to frontend? We've forgotten how to program and architecture" then remembering that there was never "program" or "architecture" in your average frontend dev's vocabulary.
 
but laravel seems to reinvent all the wheels
 
8:24 AM
@Gordon You mean like Redux is literally implementing an OO dispatch under the guise of being functional and pure?
 
so now even if you tell people the vanilla php solution, they cannot use it because they dont know how to translate this to their laravel
 
Or how about how Angular is selling you Service Locators and globals and calls them DI?
Or how about that time when people knew jQuery without knowing JS? :D
Beginners don't give a flying duck about knowing the correct or best solutions
They want one that works, works quickly, and has many job openings
 
!!uptime
 
╔══════════════════════════════════════════════╗
║ [1 minute and 9 seconds] without an accident ║
║         since [2017-10-18 08:25:06]          ║
╚══════════════════════════════════════════════╝
 
so you are basically telling me frontend devs are ruining backend now?
 
Anonymous
8:26 AM
@Ekin \o/
 
Anonymous
!!wotd
 
although now I see uv produced warnings
 
Anonymous
@Ekin /o\
 
omg wat r u ppl doin to him
 
I mean, I know the newbie PHP dev problem. But my impression when looking at SO is that it didnt use to be this bad before Laravel
 
Anonymous
8:27 AM
its Pieter I tell you
 
ask @PeeHaa
 
Anonymous
!!reboot
 
Restarting now! o/
 
@Gordon No, that's not what I'm saying
 
lol wait what does that do?
 
Anonymous
8:28 AM
calls exit;
 
oh right, yeh that works I suppose
 
Anonymous
not so much on a multi-room basis, but we're not there yet :B
 
5 messages moved to Trash
 
I'm saying that people always look for the path of least resistance, and most won't even bother trying to understand the underlying concept, they just want their problems solved
 
8:29 AM
the stack gets emptied if you kill the process
 
Anonymous
@DaveRandom I forgot that he forgets on reboot
 
Have you interviewed recently? Because I've been interviewing for the past 5 months now, and most people can't answer the most basic questions about the technology they claim to use for years now.
 
@JayIsTooCommon we could fix that with apc if we have a simple forking wrapper at the top level
 
That's true for (at least), JS, PHP and C#
 
@MadaraUchiha most interviewers, historically I have been interviewed by CTOs rather than devs
 
8:31 AM
@DaveRandom Tech interviews?
Sounds bad
 
Anonymous
very common though
 
yeh I'm not saying it's a great situation, but I do understand why it's like that. CTOs are not necessarily a good indication of how good a team is, because their day-to-day concerns are different
Management generally suck at the job the people underneath them are doing
 
Anonymous
^ this
 
They might have been probably were good once, but they don't do it any more
 
@MadaraUchiha Maybe introvert so... that would explain things :-)
 
8:35 AM
If you get a good feeling from the company, I personally think it's reasonable to ask if you can talk to a senior dev
 
@DejanMarjanovic What do you mean?
 
> a shy, reticent person.
...
So maybe cannot express with words well enough at the interview.
FU MD
 
@DaveRandom /cc @PeeHaa
 
@DejanMarjanovic I know what an introvert is
 
@MadaraUchiha yes and I won't blame anyone for taking that path. The problem is they are not looking properly. When you cannot apply a basic solution because Laravel does it different, then that's a problem. Point in case: I just answered a question where some guy told me he cannot use datetime columns because he doesnt know how to map that in Laravel and something about Blade. That's ridiculous. Instead of solving the original problem, they now have to solve two problems.
 
8:38 AM
Also, we give people code and ask them what the output would be
There's only one correct answer, and it doesn't require extended explanations
(We also ask "why" when they answer, but most don't even get the boolean part right)
@Gordon Yeah well, welcome to beginner logic
I've seen the exact same with Redux on the client-side.
 
I've also fucked up really nice on my last interview because the interview method was new to me.
 
Redux has a great sales pitch, but in reality causes way more problems than it solves
 
@MadaraUchiha apparently also true for Laravel
 
And then you get all these tutorials about "how to do things with redux", which should be titled more along the lines of "how to do things despite redux"?
 
@DejanMarjanovic fight to the death?
 
8:41 AM
@DaveRandom I said, "I'll escort myself out ba-dum-tsss" :D
 
@MadaraUchiha IKR. I am half way to assembling a conf talk "how to do X without Laravel"
 
> I've no fish to embarrass you further, I'll let myself trout
 
Haha :D
 
@kelunik @bwoebi @Ekin @PeeHaa if you DM me mailing addresses I will send you some amp stickers... Pedro was going to do it but I forgot to give them to him :-/
we did manage to distribute some around phpnw though
 
@MadaraUchiha "introvent"
 
Wes
9:07 AM
morn
 
I am tempted to create a "Google is not working" post, and then user as duplicate for closing hello-world questions
you could close it as duplicate of stackoverflow.com/questions/6266334/…
(what I can't do anymore, because I already wasted the vote)
 
@tereško that's what I was looking for, I knew there would be a dupe somewhere but it's a reasonable question that's hard to google if you don't already know the difference between expr/stmt
Oh I dupe-hammered it
 
@DejanMarjanovic it's a good job that talking to other people isn't a vital part of any job.
 
good
 
9:23 AM
@Danack Kind of is, I lack those people skills as they say :-)
The question is, do you want to work there?
 
anyone else getting a cross origin policy error in gogoanime recently?
 
Where? And probably not, I have a reasonably good job currently.
 
@Danack Where you have to talk more than you work :-) Theoretical question.
 
10:04 AM
yamete
 
Wes
10:23 AM
@JayIsTooCommon send pictures
i wrote pictures
 
Hi Wes
I am facing one issue from yesterday
if you have a look
1
Q: How to insert data which contain non english letter in php slimframwork

ziaullahziaI am working with PHP slim framework to develop API. I can GET and DELETE but with the inserting (POST) and updating (PUT), I am facing problems. class db { //Propertise private $dbhost = 'localhost'; private $dbuser = 'root'; private $dbpass = ''; pr...

 
Wes
:`ålder_år`
i doubt you can do that
 
Anonymous
@Wes what pose would you like?
 
Wes
ballerina?
 
Anonymous
either way, i'm not smiling. It's been a bad day. One moment
 
Wes
10:33 AM
i will photoshop you a smile
 
Anonymous
if anything, I was frowning
 
!!utf8
 
849
Q: UTF-8 all the way through

mercutio I'm setting up a new server, and want to support UTF-8 fully in my web application. I have tried in the past on existing servers and always seem to end up having to fall back to ISO-8859-1. Where exactly do I need to set the encoding/charsets? I'm aware that I need to configure Apache, MySQL an...

 
Wes
ahahaha
 
10:42 AM
@ziaullahzia read both of those ^^
 
while you'e at it, read kunststube.net/escapism and kunststube.net/encoding as well
 
I will try that
 
The fundamental problem that you have is that you aren't telling every single component that you want to use UTF-8 (and you do want to use UTF-8)
as soon as you do that, all encoding problems will disappear
 
wow
I will try that
 
10:44 AM
Also form-enc.daverandom.com can be used to test how browsers deal with encoding in form submissions
(tl;dr just specify everything as being UTF-8)
 
Ok I will it a try
 
Wes
you are so uninspiring @JayIsTooCommon
i can't improve the funny. it's funny already :B
he sent me a "justin bieber face" pic
 
Anonymous
no, that is just my face
 
Wes
ahahaha
 
10:54 AM
posted on October 18, 2017 by CommitStrip

 

« first day (2559 days earlier)      last day (2389 days later) »