« first day (2681 days earlier)      last day (2258 days later) » 

Wes
12:21 AM
DOWNLOAD SPEED
2.32 Mbps
UPLOAD SPEED
0.20 Mbps
goddamn
 
:|
You can join Joe Watkins :P
 
@Alesana depends on what I'm assessing, and it's hard to get a read on that just from what you've posted
 
It's just assessing basic PHP knowledge. I have to reformat data, and also convert the currencies. But, perhaps also they're assessing ability follow instructions to a T?
 
they might want to see you interact with a remote api.. if so and your ECB thingy just scrapes the site, that probably won't cut it
 
It uses the ECB API
With xpath and all
Another thing is it says to keep it one script file, but I want to have the currency conversions in a separate class which implements an interface so the API services can easily be switched out. Maybe I am thinking too much into it though :P
 
Wes
12:32 AM
no phone, no water
what the fuck is going on
everything is breaking at the same time
 
That's no good
Are you sure you're not in the start of a horror movie?
 
quick, run through the forest and see if one of your high heels falls off
 
Even though you know it's a bad idea, if you leave your house to run into the forest you are most likely in a horror movie
 
Wes
12:48 AM
or high
 
por que no los dos
 
Wes
lol
if internet worked, i'd watch scary movie
i haven't watched it in ages
i stay positive
i could at least flush number 2
that's definitely something :B
 
it's the little things
 
Wes
1:04 AM
pbs.twimg.com/media/DWLUAMaXcAIoQaz.jpg that's gotta be on purpose (nsfwish)
 
Wes
1:18 AM
@LeviMorrison what i have currently, which is mostly based on my experience, is a ustring class that works on graphemes, because all i did before that was normalizing text all over the place
then the ustring class has a view to code points u("foo")->cps()
i didn't go much farther than that, except that i converted unicode character properties in php classes
both these classes implement the interface list
so you get subseq, search, replace, all the things
and they exist both as "string builder" and immutable
 
1:58 AM
morning
 
\o
 
Wes
but a fire has just started
water is back. low pressure
no jk :B could be tho
 
Well you might not be the main character then, that's good
 
Wes
lol
i need to get a better computer because running tests on this is becoming just too slow
by the way, is there a way to run tests on multiple threads?
 
2:10 AM
I wish I knew :/
 
2:21 AM
Is this class smelly code?
 
Wes
@Alesana yeah
 
Oh nice
 
Wes
shouldn't echo, but should return the result to the caller
 
I should probably throw an exception right? I don't know how to return the result to the caller while using strict types
 
Wes
and "call this method first before calling this other one" is not really oop
 
2:25 AM
That's what I was looking for ^^
I wanted the second one to call the first one, but I don't want a new API call each time...
 
Wes
right now convertCurrency requires loadConversionRate to be called first
should inject the result
function __construct($conversionRate){
$this->conversionRate = $conversionRate;
}
 
I suppose that would make sense
 
Wes
that if you really need to implement the interface
otherwise it could be a simple function
function convertCurrency($conversionRate, $amount){}
 
Hmm, well I am confused now
 
Wes
what i'd do is separate the logic from the fetch from the remote page
 
2:29 AM
If I need the $conversionRate to call $convertCurrency, it's kind of like the first example where I need to call one before the other
 
Wes
remaining code is probably fine and depends on your need
yeah sorry, scratch that
 
The whole point is to have the conversionRate backed up when I try to convert something to avoid multiple API calls
 
Wes
it's too little code to make it clever. it depends. could be fine like this or could be improved
don't get obsessed about it :D try to keep it simple, if more will be eventually needed, then you'll change it
 
I had it like this but it didn't feel right
It's not for me it's for an assessment haha, maybe I shouldn't be asking for help then
 
Wes
in that care, you should abstract away file_get_contents
 
2:33 AM
I think that's what I'm doing here
Interface Converter {

	public function getConversionRate(string $currency): string;

	public function convertToCurrency(string $amount, string $currency): float;

}

Class FixerConverter implements Converter {
[...]
}
 
Wes
paratest 1.1.0 requires ext-simplexml
why is everyone bloody obsessed with simplexml
it's rubbish
doesn't seem right @Alesana
 
I want that it can be switched out for other API's, maybe I should just scratch that goal altogether
 
Wes
class ConversionRateDB{}

function fetchConversionRateFromFixer(): ConversionRateDB{}

function convertMoney($from, $to, $amount, ConversionRateDB $conversionRateDB){}
 
So the only thing ConversionRateDB does is save the conversion rate?
 
Wes
it stores the conversion rates, yeah
like a map
 
2:40 AM
I didn't know if that would be abusing a function class or something
Then I have this.. something is way off here and I think I have just been staring at a computer for too long to see it lol
$converterDb = new FixerConverterDB('USD', 'CAD');

$processor new Processor($converterDb, 'USD', 'CAD');
I guess I could have $converterDb also store USD and CAD, and call them from it
 
Wes
the conversion rate database should likely contain more than one rate
 
Yeah, I am trying to make it so it has the ability to, even though it's not requested in the assessment
 
Wes
function convert(Rates $db, Currency $from, Currency $to, String $amount): String{}
 
That's what I have now, but I shouldn't have to give Currency $from and Currency $to to both classes
 
Wes
what class
 
2:48 AM
And I just pass the currencies as Strings
 
Wes
Rates knows all rates
it's a map, not a pair of values
 
:/ I am way overdoing this haha
 
@Wes Money should be a type that encompasses the current currency and amount
 
Wes
it's a good assessment actually
@PaulCrovella yes
 
So I should have a ratesdb class, a money class, and a converter class (which utilizes the money class) to convert money objects to other currencies?
 
Wes
2:57 AM
yes
then a function that populates the ratesdb class from fixerio
dir=$(d=${0%[/\\]*}; cd "$d"; cd "../brianium/paratest/bin" && pwd)

# See if we are running in Cygwin by checking for cygpath program
if command -v 'cygpath' >/dev/null 2>&1; then
# Cygwin paths start with /cygdrive/ which will break windows PHP,
# so we need to translate the dir path to windows format. However
# we could be using cygwin PHP which does not require this, so we
# test if the path to PHP starts with /cygdrive/ rather than /usr/bin
if [[ $(which php) == /cygdrive/* ]]; then
dir=$(cygpath -m "$dir");
any idea what this means
 
Shouldn't that function be in the public __construct () {..} of the ratesdb class?
 
Wes
no
one collects, the other hydrates it
 
quick question - do the apis they listed give you conversion rates or do they just do the conversion for you?
 
The one I am using gives the conversion rate
Which is why I use it because many conversions have to be done
It seems pretty pointless to continue to call an API
 
that's not what I asked
 
3:02 AM
I may have misunderstood
 
what do the apis that they listed provide?
 
2 of the API's they listed seem to have given me the conversion of an amount between two different currencies. One has been deprecated and the other the URL has changed.
Google's finance converter, Yahoo's, and Fixer.io
Now the Fixer.io will convert 1 unit of one currency to multiple other ones
I get to choose the base one and the ones it converts to.
 
Wes
can't run this parathing
No path or configuration provided (tests must end with Test.php)
path is correct...
 
3:30 AM
I hate when technology lies to you like that
 
Wes
it's stupidly hardcoded to a phpunit.bat file in /vendor/bin that doesn't work
In ResultPrinter.php line 197:
Log file C:\Users\Wes\AppData\Local\Temp\PT_61A9.tmp is empty. This means a PHPUnit process has crashed.
holy shit that's impressive
single process:
Time: 2.3 minutes, Memory: 14.00MB
OK (882 tests, 888839 assertions)
5 threads:
Time: 43.36 seconds, Memory: 8.00MB
OK (882 tests, 888839 assertions)
 
You got it?
5 threads is faster than 1/5th the speed of a single thread
 
Wes
3:50 AM
I got it, but had to change a file. github.com/paratestphp/paratest/issues/306
let's try with 16 threads :B
 
Good thing you caught it
 
Wes
38 seconds lol
strange it's not faster
still impressive compared to 2.3 minutes
 
That'll cut off a lot, might be faster if you meet somewhere in the middle
 
Wes
35 is the faster i got
 
That's more time than you save by standing up right when your plane lands
I think this is right, but I am not understanding the "one collects one hydrates" comment
 
Wes
3:58 AM
put it on gist. i have connection problems
can't load the page :(
 
Oh, duh, the class that loads it has to be abstract. I feel stupid now :|
 
Wes
abstract classes are likely a bad idea
unless with abstract you mean interfaces
 
That is what I mean
That way I can switch it out for other API's
It seems pretty unnecessary making all those classes but the assessment said it had to be OOP :P
 
Wes
i'm not sure tbh
rate changes over time
while the pair "currency, amount" is fixed
 
Ah so I see why you were suggesting that I should just pass RatesDB into the convert function
Seems even more unnecessary for a Currency object now
Actually this was a really good learning experience for me but I am realizing they want the whole script in an object not multiple :P
 
Wes
4:11 AM
i suppose it depends on my current cpu usage, but i got 30s
this is gold really
 
:D
 
Wes
@Alesana are you sure? itseem they want you to model the thing, rather than just write a simple script
 
I am very confused about it
> The script that processes the file must be done in an object as this will eventually be ingested into the framework and we want minimal rework later.
> One script file that can be executed from a browser to process and display the html table. The solution must be completed using OOP.
If it gets ingested into the framework, there should already be Money, Currency, Converter objects that I can access
 
is that translated from another language?
 
I have absolutely no idea
 
4:20 AM
the first sentence already has 2 red flags for me
 
What are those?
 
basically everything leading up to "as" sounds like it was written by someone who doesn't know what they're talking about, and the stuff after makes it sound like they're planning on using your assessment in production
what kinda place did you say this was?
 
It is for a place that write themes for Magento, but it is a recruiting company. Now I'm realizing the red flags
 
you mean it came to you via a recruiting company? or the place really is both a magento theme factory and recruiting company?
 
I applied to it and a recruiting company contacted me saying they are recruiting for the magento theme factory
 
4:29 AM
gotcha
 
Now I'm researching it and a lot of people have complaints about it. I guess I just got excited and threw all intuition out the window :P
 
complaints about the company or the recruiter? really either one (or both) could be to blame for botching this
 
The recruiter. I don't know what to think but I'll ask how the assessment should be done and see if I get a response.
 
I'm curious how much of that assessment was written or munged by the recruiter
it kinda sounds like they wrote it after talking with the company and there was a language barrier
 
There are other parts of it that didn't make much sense, so I don't know. I am skeptical about the whole thing
 
Wes
4:42 AM
i still have no idea if srand is cross platform
 
cross platform in what way?
 
Wes
srand(4);
$arr = [1,2,3,4,5];
shuffle($arr);
is $arr the same everywhere?
 
it might be now, but I'm pretty sure it used to not be
I don't remember what all they did with the rand shit
 
Wes
on 3v4l i get 2 different results. so it probably isn't the same everywhere
apparently also phpstorm runs tests in multiple threads
 
@Wes think that's due to wiki.php.net/rfc/rng_fixes
 
Wes
4:50 AM
oh, so now it's consistent across platforms
 
might ask Leigh if you're not sure
 
Wes
Time: 21.67 seconds, Memory: 6.00MB
it's even faster with plain php (no phpdbg)
@PaulCrovella i think i tried already :B
 
 
1 hour later…
5:58 AM
strftime prints current timezone instead of historical – #75975
 
6:10 AM
posted on February 17, 2018

New Cyanide and Happiness Comic

 
we should replace that feed
 
Wes
@Ocramius @PeeHaa in case you don't know it, you need to install this github.com/paratestphp/paratest
awesomesauce
 
But it's such quality humor
 
6:34 AM
@PeeHaa replace the explosm feed with donthitsave.com feed is at donthitsave.com/donthitsavefeed.xml
 
In regards to that latest comic, I now get my domains and plane tickets through Google
 
user9184594
Goodmorning devs!
 
user9184594
Can anyone help me to force the download of a pem file using the header content disposition? It's seems that inside the downloaded file the readfile command add some html code, i've tried using ob_clean and flush but the result is still the same!
 
user9184594
i want to use this to force the download for admin users after their have generated an x509 certificate!I'm writing a class to accomplish this, and this is the only problem I've encountred for now
 
user9184594
Thank you for help
 
7:58 AM
datetime diff has problem in a day in Asia/Tehran Timezone – #75976
objurgate to reproach or denounce vehemently; upbraid harshly; berate sharply.
 
@Allenph huh?
 
8:34 AM
I'm following this:
And I want to add two MX records. My question is, should I write "@ / Blank" literally as host name? Or just "@"?
 
no clue
 
ah ok
 
I would try searching for "how to have custom domain for gmail"
it should contain the details about setting up the MX records
 
I found the answer according to this error message:
I should use just "@"
 
Yeah you should
Sometimes if you leave it blank it defaults to @
With some domain name providers
 
8:41 AM
ah, thx
 
8:54 AM
@Alesana have you worked with zoho so far?
 
No but I might be able to help
What's going on?
 
I've created an email with my own domain name using zoho
 
Who do you have your domain through?
 
sending mail is fine, but there is a problem in receiving emails.
@Alesana it isn't famous enough. It's a Iranian company.
 
Ah okay
Did you just now change the settings?
It can take a little bit to update
 
8:58 AM
setting is done.
@Alesana ah. anyway, I cannot receive any email but I can send email as well.
 
When someone sends mail to you, it looks up your DNS and figures out where the mail has to go, or something like that
But when you send mail it doesn't have to do that
 
I see
so the problem is in my DNS server
 
Just wait a few hours :)
 
Oh yay ...!!!!!!
I received an email just now
:-)
 
There we go :P
 
9:00 AM
I feel good :P
@Alesana can I ask one thing else?
 
What's up?
 
zoho asked me to upload a HTML file on the root of my server to be sure that domain belongs to me (something like domain validating)
validation is done and that file is still there: lamtakam.com/zohoverify/verifyforzoho.html
can I remove it? or should it be there forever?
 
Uhh I don't know
 
Good afternoon!
 
Probably safe to remove it, if you have problems you can just put it back on
 
9:13 AM
ah ok, thx :-)
 
I've bought a book on web programming by Robert Nixon, "Creating Dynamic Websites using PHP, MySQL, JS, CSS, and HTML5"
However, throughout the book the author refers to PHP as just "PHP". How can I identify the exact version of PHP described in the book?
I need to check if the PHP in the book is PHP5.
 
For your information @Alesana , I've removed that file and tested the whole mailing system and apparently all fine. :-)
 
@iksemyonov Check out page 102 ;)
Good to hear
 
@Alesana What's the section name? My version of the book isn't in English.
 
Oh sorry, it is PHP Version Compatibility
> PHP is in an ongoing process of development, and there are multiple versions. If you need to check whether a particular function is available to your code, you can use the function_exists function, which checks all predefined and user-created functions. Example 5-9 checks for the function array_combine, which is specific to PHP version 5.
 
9:21 AM
@Alesana Yep, found it. It doesn't state explicitly "this is the PHP version that we're discussing in the book", so I'm going to check out examples on the companion website, too.
Hopefully there is a header in the code somewhere.
 
3 messages moved to Trash
 
10:16 AM
My head is going to explode with all these classes
 
10:44 AM
@iksemyonov do you have it as a PDF?
because it would probably take like a minute to estimate which version is used there
then again, the version would not impact much of what you learn
a lot more important would be how many bad practices does the book teach, @iksemyonov
 
3 messages moved to Trash
 
line 32 is echo fine but on 35,36 it is not echoing anything gist.github.com/anonymous/c00d1c8429114ecd49911dc81b6b855e
any help?
it was <? error,i had to replace it with <?php someone figured it out on freenode
 
11:49 AM
how to display data from database in 4x4 format?
 
@SSangeet mysql_* function are removed from php as of 7.0 version
and use full php tags
that's <?php not <?
 
12:24 PM
Guys, is my conclusion true?
> when you want to push a new version of your project to your repository on bitbacket, you should check first and see if there is new a version after the one you worked on, then you should pull first and then push.
 
Wes
DOWNLOAD SPEED
0.27 Mbps
UPLOAD SPEED
0.90 Mbps
it's getting worse
 
12:53 PM
@Wes So your download speed is about 300kb .. that's the best case for us.
 
1:43 PM
evenings room.
 
1:55 PM
Is there anybody to help me about opencart?
 
2:08 PM
@UmutGür I can only recommend against using it, at least from a security perspective.
 
2:46 PM
@tereško yup i solved all those things.
now when i echo form in this ,it is not appearing in 4x4 format.instead they appear below their previous form stackoverflow.com/questions/48841007/…
 
@kelunik thanks your suggestion
 
@Wes have you tried internet over UPS?
I know the ping might be slightly bigger, but you would definitely have a bandwidth increase
 
3:40 PM
morning
Why would we want to be able to change the "id"s of the rows in our database? Shouldn't it be Auto Incremental? I ask this b/c I saw an update function that you could target "id"s with it too.
 
4:33 PM
@Simon.B We wouldn't.
Changing IDs is a huge no-no.
 
4:59 PM
@MadaraUchiha The main reason for changing ids is merging partially diverging databases again
 
5:36 PM
@bwoebi Thank you, could you please explain a bit more?
 
@bwoebi Sure.
 
 
2 hours later…
8:16 PM
How important are spaces in SQL?
I changed this line:
$sql .= $key.', ';
to this:
$sql .= $key.','; //(one space removed after the comma)
and it fixed my problem :|
 
String concatenation of SQL strings makes me edgy.
 
Sorry I stand corrected, i've realized the reason behind it, it was not because of that space in my SQL query, rather it was because I was using an rtrim() function to remove the last comma while with that added space, it removed the last space instead.
 
8:46 PM
@Simon.B implode can be your friend when concatenating things into a list. You are using prepared statements, right? You're just building the query in chunks first?
 
9:06 PM
@Trowski This is an interesting function, makes the whole thing much easier
@Trowski Yes, that's what I was doing
 
9:28 PM
@Simon.B usually, you should avoid concatenating the SQL queries
also, you should avoid making query-builders like a fucking plague
 
I'm sure that's a good advice
I just imported a fucking database and MySQL Workbench overwrote it on my own without asking for permission! I feel miserable :/
I wish I could CTRL+Z
 
:D
there are two types of people and one of them do not make backups .. yet
 
That was just for testing purposes I'm just learning
(╯°□°)╯︵ ┻━┻
 
9:45 PM
Is it standard to allow for commands/queries inside entities?
public function review(Review $review) : void
{
$query = new ReviewerHasReviewedCompany($this, $review->getReviewer());

if(true === $query->result())
{
throw new \BadMethodCallException("Cannot review the this company twice");
}

$this->reviews[] = $review;
}
something like that
 
this looks odd
but if I understand what you were trying to ask, the answer is: no
 
I want to have a command called ReviewCompany. Should that command perform the Query instead?
 
Can we ask about Vagrantfile here too?
 
there is no "standard" for interaction between business entities and persistence, but normally people would view them as parts of different layers, that exist as the same depth
@Simon.B you should ask about it on the SuperUser site (or in their chat)
 
@tereško Thanks
 
9:59 PM
would that mean that I need to keep them out of the domain layer?
commands and queries
 
10:20 PM
@MadaraUchiha that's an interesting fetish
 
Wes
10:38 PM
internet is back?
 
Wes
[randy-marsh-internet.jpg]
you totally need to watch south park felix
DOWNLOAD SPEED
5.69 Mbps
UPLOAD SPEED
0.58 Mbps
still shit
but better
 
I just tried to open IE, but it crashed on the default msn homepage
 
Hey all, Fatal error: Allowed memory size of 134217728 bytes... is it bits or bytes?
 
Wes
10:54 PM
like, for real?
@JayIsTooCommon pretty bad. got terrible internet
@Sjon is get the only method?
 

« first day (2681 days earlier)      last day (2258 days later) »