« first day (2452 days earlier)      last day (2726 days later) » 

21:00
@SalOrozco PHP.
I'll show an example.....
Jan 1 '15 at 16:44, by Danack
function validateOrderAmount($value) {
	$count = preg_match("/[^0-9]*/", $value);

	if ($count) {
		throw new InvalidOrderAmount("Value must contain only digits.");
	}

	$value = intval($value);

	if ($value < 1) {
		throw new InvalidOrderAmount("Value must be one or more.");
	}

	if ($value >= MAX_ORDER_AMOUNT) {
		throw new InvalidOrderAmount("You can only order ".MAX_ORDER_AMOUNT." at a time.");
	}
    return $value;
}
i've setup my xdebug on my virtual machine running ubuntu-desktop, how would i go about make my host os listen to it or even start it?
(though actually the next time I touch code like that, I'll have it return [$validationProblems, $value]
@MikoChu If you're using PHPStorm, you should just need to click the 'telephone' receiver icon to start it listening.
@Danack i'm using Visual Studio Code as my editor
btw I recommend finding the option to stop execution on the first line of code which is in the options/preferences somewhere.
@Danack, yeah I had something like that. Thanks
21:03
@MikoChu Have fun storming the castle. aka I have no idea.
ThW
ThW
@Danack I put that into small classes :-)
@Danack do you know how to do it for sublime?
@MikoChu I know how to do it in PhpStorm.
I've tried Eclipse with a Java tutorial. Is PHPstorm similar to that but for PHP.
PHPstorm is like eclipse only good and not stupid
ThW
ThW
21:05
@SalOrozco Superior, PHPStorm is the PHP variant of IntellJ Idea
Both are IDE so yeah, similar
I loved how you make classes and it sets it up for u.
hi guys
`$start = microtime(true);
$calculated = microtime(true) - $start;
echo "time_here: " . $calculated . "\n";`
this code returns 1.9073486328125E-6
why is this so slow?
any idea?
ThW
ThW
21:07
that is not slow
that is a scientific number
a variable declarition takes 2 seconds?
ThW
ThW
it does not
php > $start = microtime(true);
php > $calculated = microtime(true) - $start;
php > echo "time_here: " . $calculated . "\n";
time_here: 0.00088381767272949
microseconds
this is from my local.
ThW
ThW
21:08
You're reading the number wrong
oh wait
@ThW then can you explain second one?
ThW
ThW
Scientific notation (also referred to as scientific form, standard form or standard index form) is a way of expressing numbers that are too big or too small to be conveniently written in decimal form. It is commonly used by scientists, mathematicians and engineers, in part because it can simplify certain arithmetic operations. On scientific calculators it is known as "SCI" display mode. In scientific notation all numbers are written in the form m × 10n (m times ten raised to the power of n), where the exponent n is an integer, and the coefficient m is any real number, called the significand or...
so you say it is not 2 seconds
right?
ThW
ThW
much smaller
21:10
then why i wait about 2 seconds to execute this code?
writing docker-compose files is exhausting, when you suck at it.
@PeeHaa why does chat not properly scroll to the bottom anymore. what did you do.
ThW
ThW
so it should be some bootstrap of you environment, not the actual execution
@PaulCrovella I have had it for days now
Sucks so bad
I am on canary chrome though
What browser are you on?
21:13
chrome 61.0.3141.8
> Version 61.0.3147.0 (Official Build) canary (64-bit)
dev channel here
Return current Unix timestamp with microseconds
@PaulCrovella Ah that must be it
it returns microseconds
21:14
It will be broken for all chrome users soon \o/
muhahahah
Typical SO devs ignoring stuff until it breaks for everyone \o/
I have to refresh for it to work again time to time on FF
Even after refresh it still doesn't work :(
@PeeHaa i don't have that flag on
Me neither
ThW
ThW
Yes, but the number returned was so small, that PHP used scientific notation to display it ("e-6").
21:17
ok
ThW
ThW
number_format() forces a specific output format
@PeeHaa also that is from 2014
i say "i wait 2 seconds" you say "it is scientific notation"
Why not both?
:D
@PaulCrovella Your face is from 2014
ThW
ThW
sigh Like I said - it is not beetween this two calls, it might be before or after that.
21:18
@AdilIlhan Probably - you're measuring how fast your code runs, but seeing how long it takes PHP to load your code, and then run it.
open a new meta post maybe? Not sure if people will complain about us not being on stable browsers @PaulCrovella?
just loading the PHP files is likely to be your problem.
ThW
ThW
or php itself
@FélixGagnon-Grenier quizzical-dog.jpg
21:19
@PaulCrovella <3
I should go ask this on SuperUser, but I was curious...does anyone know why authentication failures take longer than successes? (I can't speak for other distros, but in Debian an derivatives this is definitely the case.)
@Danack ;) had a long full day of dockerizing a python app behind a nginx proxy. fun times...
@Allenph timing attacks
@Allenph to rate limit people guessing passwords?
That totally escaped me. Duh.
21:21
so, what have I missed
lol? :P
@SalOrozco well .. apparently your personal assessment of your own skill is somewhat ..emm .. off
@Danack I iz not wrong :)
21:24
I’ve setup a virtual machine running ubuntu-desktop and made it serve php, I’ve installed and setup Xdebug and the only problem left is make Visual Studio Code debugging work on my host os and i can't find any tutorials, does anyone know how?
@tereško Other than making someone else feel bad, this is an example of having a conversation with no possible benefit.
@Danack what are you bitching about now?
@tereško You being in a bad mood and coming in here to take it out on other people, rather than just turning the computer off and having a break.
earlier in that conversation I told him, that passing PDO in a template is a bad idea, to what he responded that he has really good understanding how everything works .. and that I should basically shut up and let the grownups talk
IMHO, I was quite polite, given the context
Good understanding of Solid Principles, Implementation is a different story.
21:28
@Danack to be fair being a dick is kinda his M O, regardless of his mood
@SalOrozco it's not about SOLID but about Separation of Concerns
Exactly
... and don't claim that you understand SOLID well, because someone might ask you how is it a good idea to have multiple public methods in a class (which it actually is) in context of SRP
Do we have anyone living the US here? Some guy sent me a $10 dollar Starbucks eGift as a thank you for my help, but I can't use those here in the Netherlands. So perhaps I could make someone here happy with it?
Obviously, you have way more experience than me. I think is clear to everyone here.
Still though people in here are just trying to learn. Get to t he next level.
No need to be negative.
You are a horrible leader. Leaders lead not try to put people down.
21:35
@icecub I live in the US...but I think you can probably convert it!
I meant to ask "Is Url a word or an abbreviation? How about L.A.S.E.R.?" before the voting started.
@Allenph I don't think so. I went to a Starbucks here but they told me we don't have anything simular. It's basicly useless for me
There were some good Starbucks deals recently.
Oh. I know you can sell it online for a 15%ish fee.
21:38
you can always send it to me or Allen lol
do you really think it's worth the effort for $1.50 ?
Hand paper scissors?
Whaha nah man. It's just 10 dollar. I rather make someone happy with it then go through the efford :P
That would be a gain of $8.50, @tereško. It would buy him a cup of coffee.
If you want it @SalOrozco I'm good. Haha.
@SalOrozco do you know how to remote debug? not using phpstorm tho
21:40
@Allenph That about my hourly rate and I live in Democratic Republic of Buttcrack
i just can't find a tutorial about it, so frustrating
.. and would it all take less then an hour?
@Allenph think you have helped more people than me. You deserve it.
Uhhh...I don't help anyone. I get helped. Hahahaha.
@tereško you kidding right.
21:41
actually it's a bit more than my hourly salary
@tereško
You guys figure it out. Just pass me an email address or something to forward it to, lol
Time to move in that case.
The person who asked me about PHPstorm I just recently installed it on my machine.
Salary is mostly based on where you live right?
also what you do, I'd say
also on amount of experience
also on a company
21:47
linux is sucking my life, someone help, i can't make remote debug work
Look it up google is always a good place.
ye except i can't get any
commuting home
all the search result is about normal debugging
dig a little deeper
21:49
i've posted on facebook group and stuff, went to youtube and everywhere i go i only get normal debugging
i might actually ask in google+ if this continues
@MikoChu how about you start with the context ?
on which OS is your editor/IDE running?
windows 10 is my host os
ide is visual studio code
guess os is ubuntu-desktop
have you forwarded the port, that is used by the xdebug's remote ?
21:50
i haven't
well ..
how would i make my ide configure to listen to my fake server?
Interesting
ugh .. where to begin
you can forward ports from a VM to localhost
it means that you can make it so that http://localhost actually points to VM's apache/nginx
that should be enough for you to know in which direction to start digging
i put in my hosts the ip
ip website.com
21:53
I think it has to do with how likable you are. Of course, luck, how you communicate. Not always the most skilled developers find the best jobs.
@MikoChu just use phpstorm - it's free for 30 days, students, and open source maintainers. And is worth paying for, for everyone else.
@Danack i can't afford that and i really like free software xD
PHPStorm 30 days free
> Have fun storming the castle.
@Danack it's taking my life apart
@SalOrozco ye but what happens after it expires? will migrating be easy?
and after it expires i still can't remote debug manually
21:58
Ask someone for a student email
but thanks for the advise guys
i posted on tons of website so i hope i get a response but for the meantime i'mma configure the sh** out my ide and see where it goes
Miko There is a workaround. when it expires just simply uninstall. Install again. Try with a new email. You get another 30 days.
.. and loose all the config
HAHAHHAHA i can't do that forever
back up?
22:02
I am actually only one at work, who does not use PhpStorm, because I prefer to actually learn the codebase
what is the life cycle of xdebug in layman's term?
What do you use?
Atom, mostly ... vim on remote
Been using sublime for too long.
Want to try others.
well .. atom has that code-map thing too as an extension
problems: lack of "go to definition", advanced autocomplete and refactoring facilities
22:04
do you have any link that teaches how to remote debugging using atom listening for xdebug?
I will look into it. Is always good right. To know more than one.
@MikoChu In terms of US dollars, how much do you value one hour of your time?
for "advanced editors" there are 3 major options: sublime, atom and vs code ... and vim .. kinda
for IDEs there is one option: storm
@Danack i don't know
@Danack but i get the point
@MikoChu you can probably figure it out - if you were going out somewhere for fun, like the cinema, what rate would you expect to pay per hour to be entertained?
22:08
/me counts in beers ... or in public transport tickets
@Danack 5$
that's cheap
i hardly go out
i hardly spend guys, i can't think of any reasonable price, i like cheap stuff
You can get a chicken mc nugget combo for 5 bucks.
going to a theater to see a movie is more of a chore these days
22:10
@MikoChu can't relate. I buy expensive shit, but tend to save up
.. my last headphones set me back for something like 400$
What kind.
@tereško it's ok, most of my items are second hand or from a friend
@SalOrozco these
I've always loved the movie experience. Haven't been to a movie in years.
@PaulCrovella but a 21:9 and torrent :D
22:13
High-end headphones.
Miko, there is a saying in my culture. You not going to take all that money with you to the grave. Might as well spend it.
... which reminds me, that I should figure out, why EDR is not kicking in on linux
@SalOrozco yeah, good point
Prime day
22:35
guys what projects are you working on right now?
Simple Desserts website.
you?
@SalOrozco is that fun project? i'm kinda working on a monitoring kind of website
it monitors activity and generate information according to user's params
Ahh something different, never Designed a cake website before.
I was working on an RBAC lib (in my free time), but that hasn't been touched in about a month now
@tereško what is that?
@SalOrozco the cake framework?
22:40
Like google analytics?
@tereško lol desserts(cakes, cupcakes) company hired me to designed them a website.
Easy stuff.
@SalOrozco far from it, mine is super duper super simple
@tereško damn
.. I also yesterday patched up my authentication lib
I have also been working With the latest version of angular and ionic to create a hybrid mobile app. Haven't touched it a week.
22:43
^ that's "work"
also, NDA'ed
There is very little resources on angular. You really have to look at the documentation.
@SalOrozco haha i'm just starting to learn angular.io but stopped cuz linux is hell
@MikoChu try to learn angular using angular cli.
@SalOrozco i'm using nodejs cli, does angular have its own cli?
22:47
why not nodejs cli? is it bad?
@SalOrozco the issue with Angular is that the docs are a bit behind the current code, and it suffers from a common issue of all "opensourced internal projects" - the examples are trivial and against best practices
@tereško I have to agree.
.. then again, that has been a common issue since google published the first maps API
@tereško yeah, some docs are behind
docs are behind and examples are terrible
Das Keyboard 5Q has been pushed back (ostensibly due to FCC compliance)
22:54
what's that
the next iteration if the keyboard, that I am using
funny name, "das", reminds me of das bootmovie
@MikoChu well, this is current;y one of the best work/gaming mechanical keyboard out there
also, it's heavy enough, that you could easily kill someone with it
oh
sounds useful, if some unexpected hostility arises, really useful
What kind of switches?
23:04
mx brown (at least on mine)
I like the sound and feel of the blues.
I never tried the browns.
they are a lot quieter than blues
as I said - good for work
Provided by your employer?
nope
23:21
goodnight guys
Night.
23:50
my settings
anyway can't sleep cuz of this
        "name": "Listen for XDebug",
        "type": "php",
        "request": "launch",
        "port": 9000,
        "localSourceRoot": "http://handler.com"
php.ini on the guess pc
zend_extension = /usr/lib/php/20160303/xdebug.so
xdebug.remote_connect_back = 1
xdebug.remote_port = 9000
xdebug.remote_host=***********
xdebug.remote_enable = on
xdebug.remote_log = "var/log/xdebug/xdebug.log"
xdebug.remote_handler=dbgp
xdebug.profiler_enable=1
xdebug.remote_enable=on
i don't see why it's not capturing the debug!!!
Go to sleep man.
@SalOrozco can you please see this
i have a question then i'll sleep
this part "creating an ssh tunnel for xdebug"
is that the port forwarding i need?

« first day (2452 days earlier)      last day (2726 days later) »