« first day (2748 days earlier)      last day (2199 days later) » 

7:02 PM
@Wes -_- Don't ask questions you don't want the answers to
@mega6382 Regex for preg_split new line that is not in double-quotes.
 
Wes
lol
 
@Fabor what happens if their is a missed quote?
Also, just ascii or utf directioned quotes.
 
their what? ;)
 
@Allenph sounds awkward the sorting should be done in the SQL
also, that's why I have multiple mappers for same entities
 
@Danack it's a csv so missed quote cocks it up anyway
ascii only should be fine
 
7:15 PM
@tereško Ryzen 2nd gen review & benchmarks, if you care youtube.com/watch?v=petB-pNCudc
 
Wes
i'm not sure how escaping works in csv
 
@tereško WTF?
Mind Explosion
 
well, it's a bit easier more natural with my approach to mapper, than it might be with yours :)
also, you're welcome
 
I just know my mapper is getting long.
Like 200 lines.
And my test file is even longer.
 
that's not really "long"
 
7:27 PM
Feels long.
 
if it's all in one function that takes 12 parameters, there is probably a need to refactor
 
I'm not THAT dumb.
It's a single argument...and array with 12 keys! (Joking)
 
11
A: PHP Function Arguments - Use an array or not?

Félix Gagnon-GrenierDon't do that! Passing all in an array is a bad idea most of the time. It prevents people from using your function without knowing what it needs to operate. It lets you create functions needing lots of parameters when probably you should create a function with more precise argument needs and a...

 
@Allenph sounds like something i would do.
 
@FélixGagnon-Grenier Some methods have a lot of parameters. DTO constructors for instance.
 
7:30 PM
200 -_- psht /me opens 1600 line file
 
maybe he writes all his SQL queries in a single line
 
Barfs That's on freaking MSN.
 
lol
what's "msn"?
 
MSNBC?
 
7:34 PM
is that a some microsoft forum?
 
@tereško This is witless slander.
No it's a giant American new corporation.
 
fuk em
 
Wes
@Fabor btw i forgot you can use php.net/manual/en/function.str-getcsv.php
 
@Wes Won't for our case. I say that rather than giving out details :P
 
@FélixGagnon-Grenier I think your word choice should be rethinked. Also...happy birthday.
 
Wes
7:41 PM
are you sure lol
 
@Allenph what do you mean? :)
 
I was telling you that "rethinked" is not a word as Teresko-ish as possible.
 
Rofl. I love it when sites blur their content because I'm using an ad blocker and I just change the CSS.
 
Thinking back on [the multiple parameters in an array], I think if left with no choice I'd still prefer creating a type that would be some kind of configuration object with sane defaults, possibly coupled with builder objects
having to read a function to know how to name the keys of an associative array I need to pass is... I don't know what, but I don't want to do it
 
7:57 PM
That's what I'm planning on doing with search objects.
 
Wes
if a function needs 12 collaborators there is not much you can do to reduce the number
you can move them in a tuple/DTO
but they are still there...
 
9 mins ago, by Félix Gagnon-Grenier
Thinking back on [the multiple parameters in an array], I think if left with no choice I'd still prefer creating a type that would be some kind of configuration object with sane defaults, possibly coupled with builder objects
 
Wes
builder sux horse butt
 
if you say so
 
Wes
tell don't ask
@FélixGagnon-Grenier example code?
 
8:06 PM
of builder objects?
 
Literally just saw a job post with this in it:
> We are seeking a Python Developer with solid experience working with Object Oriented PHP 5
4
 
Wes
yes, how do you use them?
 
anyone can give me some help with
An Exception occurred: cURL error 58: unable to set private key file: '/mypath/whatever.pem' type PEM
before i kill myself... file exists, i set it to 777 just in case, and i am trying guzzlehttp to create a post request to a web address and i need to send a certificate
 
Have you checked the format of the key file?
 
well it has some stuff than -=--- begin --- fhjasdjfasd --end ----
or you need more than that
$ cat client_ssl.pem
Bag Attributes
localKeyID: 01 00 00 00
friendlyName: te-e9f1c6f9-1695-4200-895a-63ffd528b1a1
Microsoft CSP Name: Microsoft Strong Cryptographic Provider
Key Attributes
X509v3 Key Usage: 10
Bag Attributes
localKeyID: 01 00 00 00
subject=/title=Description: INFOBANK/CN=Dimitar Penchev Dimitrov/OU=CCA Certificate/OU=BULSTAT:203372748/O=Di El Sarviz OOD/ST=Sofia/L=Sofia/C=BG
issuer=/C=BG/2.5.4.97=NTRBG-201230426/O=BORICA AD/OU=B-Trust/CN=B-Trust Operational Advanced CA
-----BEGIN CERTIFICATE-----
 
8:09 PM
So slightly weird one then.
 
Did you seriously just post your key? Oh. It's half empty.
 
thats not the whole key :D
 
echo str_replace(explode(",", '\n, foo')[0], "", "hello \n world");
Doesn't work naturally. Assume i have no control over $str. How can I get it to work like it would if I used double-quotes.
 
Wes
@Fabor pastebin some example csv
 
i got in a PR_orientiran.pfx format than i used openssl pkcs12 -in cert.pfx -out cert.pem -clcerts
to try to generate that pem file
 
8:12 PM
Gah. This API has an object where two of the columns are the ID.
 
@wes, Going a slightly different route now anyway. We don't need the newlines in that field, so we're just going to strip them out using a filter function we provide clients. Hence the no control over $str. They can add \n= <-- Space there. And it's saying any new lines replace with space.
So how do I get PHP to switch $foo = 'hello'; to $foo = "hello" without being able to actually change the initial $foo. (confusing as I write it)
 
Wes
wat
 
@Fabor ...by reference or something?
 
Discord @Wes
 
Wes
wot
 
8:20 PM
Go on Discord :P I see your name in the offline list
 
@Wes I never really did a production implementation, mostly scratches that I quickly drop. I read about the theory of both context objects and builder objects, so my thinking about this is that, if I was really presented with a situation in which I can't refactor the functions with less paramenters (on which I call bullshit btw) I would go the way of context objects possibly coupled with builder objects
 
hash_hmac improper handling invalid parameter types – #76272
 
Wes
for some reason @FélixGagnon-Grenier is angry with me lately
it's probably my fault though
 
?
hmm, sorry if my tone was off eh?
 
Wes
don't know... did i sound patronizing or something?
 
8:24 PM
not really, did my answer sound angry or something?
maybe because it's long?
oh, you mean me calling bullshit on you? :)
 
Wes
yeah
 
that's canadian for "we're good friends"
2
 
Wes
builders are "magic" around much simpler data structures, tuples and/or structs
the "advantages" of builder are not worth the effort given the overhead (temporal and mental for the programmer)
 
How does PHP know if a string is in a single or double quote? And can it be changed without altering the original variable?
 
Wes
@Fabor once evaluated you can't tell
"a\\nb" === 'a\nb'
passing around simple maps should be good enough... if it's not, then something's wrong
that being said, builder is quite a broad term
i have seen Builder::setA(), Builder::setB(), Builder::make()
but also $factory->make($builder)
which one are you referring to?
 
8:30 PM
Can I change it somehow?
 
Wes
no
 
Dangit
 
assuredly not the factory->make(builder) one
 
Wes
that's kinda a dto, even if people call it builder
 
to contextualize, it stems from a discussion about dependency injections, containers and alternatives a few weeks ago
in the absence of reflection based injection, I came to understand that builder object was a way to set up a type. it could be used in place of a delegate in auryn context
 
8:34 PM
@Fabor What are you trying to do?
 
in the case of a context object, that needs to be able to contain our numerous parameters (still discussing the multiple parameters function) a builder object, to which we set a few parameters, could be use to construct the context object, if that is a win in term of clarity
 
Wes
ok so we are agreeing @FélixGagnon-Grenier :B i was saying that injecting builders is shit
 
Wes
context object = tuple/struct
builder = builder for that tuple/struct/context object
where did you read context object?
 
in our current conversation, or ?
 
Wes
8:38 PM
the source :P
i call them DTOs also
 
@Allenph Something smelly. Basically "\n= " is like our own code for "replace new lines with space". we split that by "=" to get our $fine and $replace. Currently it's not working, and I am guessing because it thinks it '\n' rather than "\n".
 
Uhhh...wut?
 
I think Dan shared a paper on context objects a few months ago, before that I had read about it without really understanding the use. While rethinking on the multiple parameters half an hour ago, my new impression was that using a context object to encapsulate these multiple parameters in types would be the compromise I would be willing to make. It's the link my mind made, I don't know if it's a valid one.
 
@Fabor You can't get it to reevaluate directly but you can do this...
str_replace('\n', "\n", $string);
 
hmm ... I should try writing an answer this month
 
Wes
8:42 PM
@Fabor so you have literal '\n' in the csv?
 
@wes Not literal no. Some dude hit return a few times in the CSV.
CSV is also delimited by newline
 
Wes
you are fucked dude :B
 
heh
 
Wes
that sounds like a mess
 
Oh. Yeah. If it's the other way around you have ambiguity.
There's no way you could fix that.
 
Wes
8:43 PM
reminds me when back in the day i used to store php strings (var_export) in mysql
....... :B
 
$value = eval('return ' . $columnValue . ';'); Ship it.
 
@Trowski are you in my code base?
 
xD
@Wes even I have never done that. :P
 
Seriously though, why did someone think it was okay to treat a CSV this way? Sure. It is called comma separated but feck it, let's use tabs.
 
@Fabor And thus Python was born.
 
8:50 PM
heh
 
@Fabor give the user an error and tell them to get their shit together
 
@Tiffany Yep, had to figure out how CVS worked first.
 
Pretty much doing this now.
 
Wes
has dwayne johnson (the rock) ever been in a movie that is not absolute rubbish
 
What is best place to buy a domain? just domain, no hosting. And should have excellent support if ever needed.
 
8:55 PM
Highest paid actor
 
@Fabor Switch 'hello' to "hello", wait what? What are you actually doing?
@mega6382 I personally like name.com or namecheap.com
 
thanks
 
Wes
he's like adam sandler but way way trashier
 
He had a cameo in The Mummy.
 
@Trowski moved on now but essentially... It's a bit tough to explain. We were using a variable containing '\n' on str_replace(). It's a variable because it's from an exploded line that is pulled from the DB. The replace wasn't working presumably because of it maybe being ' instead of ".
 
Wes
8:58 PM
@Allenph a cgi cameo
 
Rofl. That wasn't him on the torso at all?
 
@Fabor So the database row contains \n, not a newline character.
 
Yes
 
Then the str_replace I gave you should work @Fabor?
 
It's in a JSON too.
 
8:59 PM
You have CSV in JSON?
 
@Fabor Then you need to do str_replace('\n', "\n", $value) first.
 
No the replacement \n is in a json {"replace_value": "\\n"}
 
@Trowski I told him this already.
 
Wes
all cgi, and pretty bad too
 
9:00 PM
@Allenph It didn't but I only tried like the once before we moved on to just asking the customer remove the newline from the csv :P
 
@Fabor The difference between ' and " in PHP is only at compile time. After that strings are just byte-arrays.
 
@Fabor \n in json is a newline
Ow wait
wat
 
@Fabor Then you should be getting a newline character…
 
@Wes Wow. Remember how you didn't used to notice bad CGI?
 
@Allenph no, that was terrible when it came out.
 
9:01 PM
Maybe it was because I was 5.
 
Wes
i did remember
 
Isn't \\n still a newline in json? @Fabor
 
Shrug, either way this doesn't work.
 
@PeeHaa That will result in \n, since the backslash is escaped.
 
Whose idea was it to use that as a delimiter?
 
9:03 PM
@Trowski 3v4l.org/Y4v03 ?
Is php being stupid or am I missing a flag?
 
@Allenph Customers :P
 
Ah probably some flag
 
@PeeHaa Not enough backslashes 3v4l.org/OvjV1
 
@Fabor Do you have some sample data or a string you can write that exemplifies the problem?
 
@Trowski ugh
:P
Double quotes are hard
 
9:04 PM
There are two reasons I can think of that people create their own frameworks: 1)Learning more 2)Being tailored to their own needs. While I understand #1, isn't #2 contradictory to what a Framework is by definition at all? (A code that is not project specifi
 
:P
 
@Allenph I'm testing just using


Hello World,
How are you?

I'm fine
 
@Simon.B Don't do that.
 
@PeeHaa Backslashes are like rabbits… put two together and soon you'll have many.
 
@Allenph Don't do which?
 
9:05 PM
@Fabor And what is the expected result?
 
:D
At least it's not in a regex pattern :P
 
@Simon.B Don't write your own framework. The guys in this room are smarter than both of us...notice they don't have their own frameworks.
Go framework agnostic.
 
@Allenph Hello World, How are you? I'm fine
 
@Simon.B have I got the video for you:
 
@Allenph I know the meaning of the word "agnostic" but I think your last sentence doesn't match your explanation...? :thinking:
 
Bit haggard but here for any of you that are curious to try.
 
@Danack Wow thank you. \0/
 
Wes
@PeeHaa remember that phpdocumentor thingy
 
yeah
Given up?
 
Wes
every single component in it has become a big project on its own :B
 
9:10 PM
:D
Are parts also useful for other things / people?
 
Wes
kelunik probably wants to roll his own too, so i might make packages out of them
but ultimately no :B
 
@Fabor The split character is stored in json?
 
Yeah -_-
 
implode('', preg_split('/\r\n|\r|\n/', $string);

@Fabor
 
Wes
oh btw, i'm watching the new mummy movie now
 
9:14 PM
I'm sure it's terrible @Wes.
 
Wes
unlike dwayne johnson tom cruise is a crazy fuck but he knows how to make good movies
i cannot explain that
 
Mission Impossible is the cheesiest crap ever.
 
Wes
what
it's epic
 
@Allenph What's the $string there?
@Wes Got Netflix?
 
Wes
yes
 
9:15 PM
Did you like Altered Carbon?
 
Wes
didn't watch it
 
Well stop watching meh films and check out a trailer.
 
Wes
all the things on netflix are crap, except a few :B i wait for people to test them :B
 
The Last Kingdom is the shit.
Almost as good as GOT.
 
9:17 PM
@Allenph Not so sure it's an option for us. Did you see this example of the issue?
 
Wes
@Fabor how many fight scenes does it have?
how many explosions
they are fillers for the poor plot
 
Fight scenes a few but justified. Explosions not many
 
Wes
will try it
 
@Fabor If you change your print_r to a var_dump you can see that it's interpreted as a new line. Can't you just hard code a special case?
if ($find === "\n")
 
@Wes go check it now
I fucking mean it.
 
9:24 PM
@Fabor This seems to work fine.
 
actually, that stands for literally anyone reading this. if you haven't yet, go watch altered carbon's first episode.
best universe since... I can't really think of a contender
 
I've looked at it a bunch of times. Doesn't seem like an attractive show.
 
blocks someone
 
I didn't watch it because the description makes it sounds like something that should have been a movie, not a series.
 
kidding, but I really don't understand how someone with even a slight interest in highly technological universes can not like it
 
9:26 PM
@Trowski Why is \n treated differently to a literal use of the return key?
 
the plot is incredible, the technology is amazing, the interactions between the characters feature some unique twists that are virtually unique
 
@Fabor something something carriage return?
they're treated differently in C, right?
 
@FélixGagnon-Grenier Someone's got a show boner.
 
@Fabor It isn't, I blame that website: 3v4l.org/bTvI9
 
9:27 PM
it's easily taken over GoT and The Expanse
 
@Trowski -_- dang
 
@FélixGagnon-Grenier Blocks Someone
 
like, I would gladly never see GoT's next season in exchange for more Altered Carbon
@Allenph ;)
 
@Fabor Windows inserts \r\n for the return key.
 
I would trade it all away for more Rick and Morty and a bowl.
 
9:29 PM
sci-fi lately is too serious... I want more light-hearted sci-fi like Stargate :S
 
indoor sci-fi is the future
 
wat
define "indoor sci-fi" plox
 
I think he means sci-fi that isn't shot in forests near Vancouver
 
note ppl
 
9:44 PM
Hmm only oddity now is var_dump($find). string(6) "\\r\\n" for my machine but the string(2) for 3v4l
Oh wait maybe the str_replace isn't working properly locally
 
9:59 PM
Well turns out there was a simpler way
Rather than asking them to use \n= as a filter we just use "NEWLINE" and write a conditional to look for it.
 
Wes
"\\r\\n" is length 4
"\r\n" is length 2
'\r\n' is length 4
 
Wes
y u dont know how escape sequences work in php
 
I did, I'm just copy pasting what my var_dump() had :P For some reason the escaped string was not quite being seen as escaped
 
Wes
well i doubt it's str_replace not working properly :B
 
10:13 PM
Speaking of escape. Bed time!
Et moi, probably just something stupid on my part.
Oh "Hannibal" is on Netflix too. maybe watch that if you like nitty-gritty crime.
 
Wes
hannibal sux
it happens that they don't renew shows when nothing happens for 3 consecutive seasons :B
 
Hi guys, what type of model is this? 1 application (me) control multiple organizations and each organization have their users too and their own logins.
 
Wes
10:52 PM
well that is a strange crossover
dr jekyll and mr hyde in the mummy movie
 

« first day (2748 days earlier)      last day (2199 days later) »