« first day (2659 days earlier)      last day (2286 days later) » 

Wes
1:02 AM
fml
 
no, f m l
 
Wes
ok, f y l
 
Wes
watchadoing
 
in all seriousness, I'm actually really pleased with the progress I am making with libdns
I have basically completely anihilated it and started again, it's sort of in pieces all over the floor right now but it's going to be soooooooo much nicer when I have finished putting it back together
 
Wes
1:05 AM
i have no idea what that is :P
 
I still can't work out the same problem I always have with these things though, which is whether or not entities should be able to encode/decode themselves
 
Wes
example use?
/me knows nothing
but ive found my nails clipper.
 
gratz
@Wes it's literally just an object model of the DNS protocol
but it's what amp uses for amp/dns, so basically I wrote a thing that accidentally ended up with people actually using it
 
Wes
in what consists the dns protocol? :B really i know nothing. i only know that dns are strings that replace ips. the end.
 
and it's been a bit of an albatross around my next because I fucking hated the codebase
@Wes basically, I took this document and turned it into code
there are other frilly bits from later RFCs, but fundamentally that ^ is it
 
Wes
1:08 AM
i admire your insanity
 
> it's been a bit of an albatross
 
yeh
just a wing
maybe a beak
 
insert poor quality joke about coming down to bristol to get away from it here
 
Wes
Updated by: 1101, 1183, 1348, 1876, 1982, 1995, INTERNET STANDARD
1996, 2065, 2136, 2181, 2137, 2308,
2535, 2673, 2845, 3425, 3658, 4033,
4034, 4035, 4343, 5936, 5966, 6604,
7766
 
either I'm missing a reference or you are implying that drug use is advisable. I'm basically fine either way.
 
Wes
1:10 AM
it's even more insane than i thought
 
yeh but most of those are subsequently deprecated, or informational, or just defining new record types
there aren't really any substantive changes
 
Wes
that reminds me when i tried to read the url rfc because i wanted to roll my own url builder library
 
    } else if ($type instanceof Char) {
        $result = $this->decodeChar($decodingContext, $type);
    } else if ($type instanceof CharacterString) {
        $result = $this->decodeCharacterString($decodingContext, $type);
 
Wes
didn't end well
 
this sort of shit is why I hate that codebase
 
Wes
1:12 AM
but i'm actually going to finish it someday
 
it reads like it was written by several-years-ago-me (which it was)
class Anything extends BaseType
but it doesn't matter, it will all be much better soon
 
Wes
that looks like code i'd write in 20 years :B
 
tbf that is strictly following a naming convention from an RFC
but it's still dumb
ridiculous amounts of superfluous docblocks as well, that ^ class decl starts on line 24 of the file, and there are no imports
@Wes oh yeh that's a fun one as well
 
I was looking at some code that a friend helped me with (i.e. basically wrote for me cause I was stuck), and when he gave it to me, I thought it was great. I was looking at it today and thought "...this is pretty bad..."
 
I've started on that a few times and got pissed off with it half way through
 
Wes
1:16 AM
there are many unclear bits iirc
 
Using a host that you cant change domain root folder.
 
@Tiffany "Did I write this more than two weeks ago?" if "yes" then it sucks :-P
 
lol
 
that will be true forever, I suspect
 
yarp
 
Wes
1:17 AM
:D
 
Need a htaccess to point to the public folder.
 
Wes
my code gets old as i write it
 
FUCK I HAVE THE HICCUPS AGAIN
I had them when I got home from work, then they went away ... around the time one of my cats laid on my face and was purring
 
Wes
@DaveRandom
if($node instanceof Class_){
$this->collectSymbolsFromClassDeclaration($node, $symbols, $duplicatedSymbols, $file);
}elseif($node instanceof Interface_){
$this->collectSymbolsFromInterfaceDeclaration($node, $symbols, $duplicatedSymbols, $file);
}elseif($node instanceof Trait_){
$this->collectSymbolsFromTraitDeclaration($node, $symbols, $duplicatedSymbols, $file);
}elseif($node instanceof Function_){
$this->collectSymbolsFromFunctionDeclaration($node, $symbols, $duplicatedSymbols, $file);
personal interpretation of dynamic dispatch
:B
 
Anyone point me in the right direction.
 
Wes
1:19 AM
to be fair i still have no idea what i am doing so it's fine that way for now
 
@Wes yup sometimes this stuff is unavoidable, I have taken to putting method names in a private constant array keyed by Function_::class etc and using get_class()
 
Wes
also to be fair, every time i tried to be clever with that kind of stuff, it didn't end well
 
@SalOrozco you mean you want http://domain.com/ to behave like http://domain.com/public/ ?
 
Wes
i prefer switches and dumb code like that, i think, most of times
 
yeah when hit the domain to look into the public folder
Im using a shared hosting for this client. Who is to cheap lol
Cant change the root folder.
 
1:26 AM
RewriteRule .* public/$0 [END] should be sufficient probably
tbh I've forgotten how mod_rewrite works, and I always had issues with .htaccess
thankfully those days are but a distant memory
 
lol
 
I learned today that 1. Plymouth—the software for showing graphical loading animations while a Linux system boots—has its own custom scripting language, and 2. that scripting language has some ideas that are… uh, well…
 
Hmm, so variables are context-dependent unions
I'm glad I don't work with any languages like that
wait...
 
Puts an "Eight" | 7 into their code somewhere...
 
Wes
@Danack this is awful lol
 
1:46 AM
Out of curiosity, anyone have to deal with the BS of retina displays not showing images perfectly round and centered inside a border with a border radius of 50-100%?
On my wimpy 1080p display shows fine, on a retina display, it's like you see a slight white pixel on the side of the image inside the border..
 
omg I have an actual use case for the object typehint
 
lies
 
...and my min version 7.0 so I can't use it
@pmmaga no genuinely, the resource data for a DNS record is always an object but has no common interface
 
Wes
bs. not even a marker interface? :D
 
it would be empty and pointless
 
Wes
1:53 AM
it would be a perfectly legit marker interface.
:B
 
I will think about it but it seems pointless
 
Wes
i like how easily object was reserved
i've seen class Object all over the place (including in my code)
 
I feel like that's your own fault, tbh :-P
 
Wes
Object is not like Integer eh
 
2:47 AM
> Showing 56 changed files with 834 additions and 3,816 deletions
and with that, I'm off to bed :-P
 
Wes
\o/ lol
that's a big commit
gn :P
@LeviMorrison merging constants classes and functions is going to be much simpler than joining methods and properties
unfortunately that's not as useful as merging method and properties is
 
3:02 AM
Fun, just checked Stripe's transaction history, vs income recorded on platform , vs bank statements.. stripe is totally off... and platform matches bank statements..
Stripe is under-reporting like 2k USD a month in transactions which is bizarre (when looking at history of transactions).
It's like they lost data or something
but fulfilled the transfers and sales when it happened
 
 
1 hour later…
4:27 AM
morning all
 
user5304349
4:42 AM
hello .. i have to

STEP-1 ) convert voice to text to email and send it through gmail api and facebook comments/posts as well through facebook login and then facebook graphi api + sdk ..

and

STEP-2) also convert sender email back to voice and play it through speaker ..

i will be using java.. it will be a desktop app .. connected to the internet .. or a web app[not sure right now] .. i need recommendation for
1) Backend server side scripting language [PHP or Node.js which will be easier/maintanable in the long run]
 
4:58 AM
morning ppl
 
Wes
5:37 AM
lower case, upper case, title case = case, casing... casenness? :P
what's the right word? case or casing?
 
MornIngS
 
Wes
\o
 
@Wes the latter afaik
 
 
1 hour later…
7:08 AM
i'm trying to get into unit testing, however i'm having trouble finding applications for it in my symfony application.
i'm unsure where to ask so i'm planning to ask here...
am i supposed to be writing tests for my controllers?
i.e. testing if it returns a 200 status code, etc. as is, i do not write any tests at my current job.
 
@RobertCalove testing controllers is usually done via integration tests
 
so atm, i work for a company that doesn't really care about unit testing. and i do not have anyone senior to me for mentorship of best practices.
i'm familiar with TDD, unit tests, integration tests, etc.
however i don't know how to apply it
is there anywhere i can go to get help with my code?
 
Controllers are just glue code… there is little value to test them via unit-tests because they dont do any real work. They just delegate to other objects. If you want to unit-test them, you mock all their collaborators and verify they get called with the right input.
I dont know what your code looks like but if you want to unit-test something start with your business model objects
 
am i able to post code on here?
```
test
```
test
hm, code formatting isn't that good on here
 
use a gist or a pastebin for longer snippets
 
7:20 AM
so i'm assuming this is also a higher-level function
since it's using a bunch of different, dependency-injected classes
so this is something that also isn't worth unit testing, correct?
 
it does real work
you are creating the User, a password and persist to the database in there
so that is certainly worth testing
 
test new User() ?
how can i test a random password generator?
how do i test the database? it seems like none of those things can be tested.
 
I'd move the entire generation of the User, including password generating and persistance to a service class. then the controller becomes glue code again. right now, the controller contains business logic.
 
i forgot to mention that this is in a service class already
 
ah, so then this is not a controller
 
7:29 AM
no, this all lives inside of a service
however this service has a ton of dependencies.
5 to be exact:

EntityManagerInterface $em,
UserPasswordEncoderInterface $encoder,
ValidatorInterface $validator,
UserRequestHydratorInterface $hydrator,
UserPasswordGeneratorInterface $pwGenerator
 
sounds like it might be doing too much and you could split it into multiple services
 
well the work has to be done somewhere
 
5 is not a ton :)
you can test the pw generator in isolation
 
i'm delegating password encoding to a password encoder
i'm delegating user parameter hydration to a hydrator
etc...
yes, so how do i test expected output if the password generation is completely random?
 
if there are no such things as "returns 10 chars", "includes numbers", etc you just test that it returns a string
 
7:33 AM
ok. so i guess i can test the following things:

hydrator (maps request to an array)
passwordGenerator (generates random password)
 
did you write the pw encoder yourself or is the sf encoder?
 
sf encoder
the 3 i didn't code were the entityManager, passwordEncoder and the validator
it doesn't seem like this registerUser() function is unit-testable though because it changes the database
 
you dont need to test 3rd party code.
 
yeah so outside of testing those two things i mentioned (hydrator and pwGenerator)
 
you can unit test it. you mock the EM and just verify that persist was called with the user having the input from request and that flush was called
 
7:39 AM
ok so the testing would entail testing if things were called...not so much the output
 
you can also test the output. depends on what you want to verify.
if you do blackbox testing you just test the public api and it's expected output
so that would mean you call registerUser with a request object and verify it returns that array
 
ok so i would be unit testing
to test that things are called
not necessarily a return value
i thought with unit testing we want to be testing stuff that returns values, etc.
that have output we expect
not so much $em->expects($this->once()); etc.
so because i'm mocking a bunch of stuff and utilizing a bunch of different clients, this would be considered an integration test, right?
 
it depends. blackbox test versus whitebox test
White-box testing (also known as clear box testing, glass box testing, transparent box testing, and structural testing) is a method of testing software that tests internal structures or workings of an application, as opposed to its functionality (i.e. black-box testing). In white-box testing an internal perspective of the system, as well as programming skills, are used to design test cases. The tester chooses inputs to exercise paths through the code and determine the expected outputs. This is analogous to testing nodes in a circuit, e.g. in-circuit testing (ICT). White-box testing can be applied...
Black-box testing is a method of software testing that examines the functionality of an application without peering into its internal structures or workings. This method of test can be applied virtually to every level of software testing: unit, integration, system and acceptance. It is sometimes referred to as specification-based testing. == Test procedures == Specific knowledge of the application's code/internal structure and programming knowledge in general is not required. The tester is aware of what the software is supposed to do but is not aware of how it does it. For instance, the tester...
 
morn v2 o/
 
i understand the distinction, but what should i be doing with my codebase?
both?
 
7:58 AM
happy freydai
 
Sisyphean endless and unavailing, as labor or a task.
 
@RobertCalove yes. you do a mix until you have a devent coverage of the important parts of your app
 
ok so if i wanted to adhere to best practices, i would write tests for the following things:

- hydrator
- password generator (if it returns a string)
- registerUser (does it call all the contents)
so essentially the purpose of testing if all the methods inside the method body are called is to see if an error pops up, essentially
or an error is thrown rather
 
no, don't test 3rd party code. the sf pw generator already has tests
only write tests for your own code
 
the random password generator i wrote
the password ENCODER is the sf component
 
8:03 AM
ok, then you test it
the purpose of testing to me is not that though. to me, testing is giving me the confidence that code I wrote works as I intended it to work and still works as intended after I made changes.
whether that requires a blackbox or whitebox test or a unit test or integration or whatnot isnt important to me. I test what I need to test to get that confidence.
 
Wes
hodor
 
i mean the only reason why $em->flush() wouldn't be called is if there was an exception thrown prior, interrupting the flow
seems a bit odd to test if it's being called
because if there's an error prior, your other tests will fail anyway
unless ofc that one test is the only one you've written for that function
which then i guess makes sense, because then we're just making sure the function actually runs completely without exceptions.
 
so write two tests: one testing the returned array for the given output and one testing an exception being thrown on invalid input
 
gotcha thank you very much
 
8:17 AM
mornin
 
morr
 
Wes
for this to work, what's in the parentheses must return a class name string?
( Foo::$bar )::$foo
( Foo::bar() )::$foo
or are there other cases?
 
Just made a question that got down-voted to hell over a few minutes. Can anyone help me get my head around what does and doesn't get downvoted?
 
Wes
can only be that. brainfart, sorry
 
I think I've read everything there is to read on what makes a good question good, but clearly I'm not getting it
 
8:32 AM
@JonathonPhilipChambers you'd need to show the question
 
can I c/p it here?
down vote
favorite
I already know that some customers/clients/employers have NDAs so tight that even telling someone I once worked for them is in breach, so in a situation like that, writing my name in the code would definitely cost me my career.

However, could anything bad happen on the other end? Suppose I am applying for a front end html/css job, and all of the websites I have built have html files that begin with "<!-- Created by Jon Chambers -->" (because I already asked for permission from each client to do this), is there any reason this could be frowned upon?
 
just paste the link
 
Anonymous
404
 
Got downvoted to -5 in like a minute
Yeah, I deleted it before it cost me my chat privileges.
 
8:35 AM
@samayo you still got not 10k?
 
Anonymous
@Gordon Nah, sadly ...
 
Anonymous
I tried but kept loosing interest to answer
 
@JonathonPhilipChambers it's not a programming question. that's why they downvoted it. it's related to programming but it's not asking to solve a particular coding issue.
 
I got 20 now. I had 30 before I asked that question
Is there a stackoverflow that would answer that question?
 
@JonathonPhilipChambers the close votes on it are for it being opinion based. Which it is
 
8:36 AM
(I've made that mistake before, and was directed to a place for security questions)
 
Anonymous
@JonathonPhilipChambers Why would you want to leave your name as a comment inside html?
 
Just to prove I actually wrote it
 
And in my opinion. If you're freelancing, and your clients are fine with it, there's no problem with stamping your name on a site. If you were working in permanent employment for a larger company, then not so cool
 
Anonymous
@JonathonPhilipChambers Why don't you add it in your site as a portfolio then?
 
Of course I'd do that too.
I don't expect the benefit to be big, but so long as it outweighs the cost, it's worth doing
I spent some time thinking hard on it, and couldn't come up with a reason why it would be bad. But I've learned lots of things are bad the hard way. I didn't want to learn the hard way with this too.
 
Anonymous
8:40 AM
It's amateurish approach
 
Samayo, tell me more
 
Anonymous
To me, it would send a message that you've probably creating 2 html sites in your entire career
 
that's 4 times the number of site's I actually have created in html
so far
 
Anonymous
So, you made half a site?
 
Anonymous
fantastic
 
mornin
 
Yeah handcraftedgifts.net.au I made this for my wife. Still a work in progress.
(I've made websites with web builders, but that doesn't count IMO)
 
Anonymous
Why .net.au?
 
Anyway, is there a forum somewhere where that question wouldn't be downvoted
the .com.au was taken
and .au's are regulated, so they're more trustworthy.
You must have a registered business to own a .au
 
Anonymous
As long as you buy your domain from accredited registrar, it will be trustworthy
 
8:45 AM
The domain is trustworthy, but I might not be
If I've got a .au, that means I have registered a business inside Australia, and it hasn't done anything illegal yet
 
where as any criminal can purchase a .com
even if they don't own a business
 
We don't get many aussies here. anything.au is strange to us :P
 
anyway, baby needs a bath. Gotta go.
 
Although I'd probably trust a co.nz more ;P
 
Wes
8:56 AM
isn't .au austria? #shotsfired
 
Wes
9:11 AM
how do you say correctly
"lowercase and uppercase are different case"
"lowercase and uppercase are different cases"
"lowercase and uppercase are different casings"
 
lowercase != uppercase
you can replace != with ain't
 
Lowercase is the opposite of uppercase
 
@tereško I just checked DDD by Evans and the repository in there is exactly what modern DDD describes? He also mentions that it's basically a factory for already "existing" objects
So everyone is on the same page, except you :)
 
Wes
how do you name them all? cases? casings?
@Jimbo no way. dude.
 
> referring originally to the lower of two cases of type positioned on an angled stand for use by a compositor
Looks like "cases of type"
 
Wes
9:20 AM
i know the story, so it's cases?
 
mornin o/
 
Wes
my guess would be "casing" singular
cases sounds strange
 
Upper cases says:
> referring originally to two type cases
 
Wes
hey maga
yes but in that case, they are actual cases i.e. boxes :P
anyway ok, i'll use case :P
has anyone ever committed / PR to wordpress?
 
Hello fellows. Anyone like internals of PHP? I am trying to figure out the behaviour of: stackoverflow.com/questions/48379842/…
 
9:33 AM
moin
 
@Wes that's somewhat similar to asking whether any one us ever sold their body, right? I mean, we might have done that, but it's nothing we'd readily admit
 
Wes
no need to be ashamed of that. we all know what wordpress is. just wanted to know if someone can guide me through the process or PR themselves some stuff :P
 
@EnchanterIO here is the source for array union
 
Wes
hey daveo
 
been to sleep @Wes?
 
Wes
9:37 AM
nop
will do all day awake
 
"I'll sleep when I'm dead, which will be in about 3 weeks"
 
Wes
lol
i slept a lot yesterday, hopefully i'll make it through today :B
 
@EnchanterIO my naive assumption would be that it's because + is implemented via opcodes directly
 
I mean fcall overhead will certainly play a part, but presumably not that much
at the end of the day merge and union are quite different operations, merge implicitly has a lot more memory copying
 
as far as I can tell + uses zend_hash_merge but array_merge doesnt
 
9:56 AM
@Danack I believe you mean I've managed to post an old screenshot of some actual search suggestions.
 
@Wes I think @ircmaxell did for that huge security issue they disclosed a couple months ago.
 
o/
 
@Patrick you were telling me that repository is basically a mapper
that is not the same thing
 
Wes
@StefanoTorresi don't want to bother ircmaxell for that. it's almost cosmetic changes (for now)
 
@Patrick which is why I specifically pointed you to Evans' book, which illustrated that mappers where are dependency for a repository
 
Wes
10:07 AM
repository wraps around a mapper. same (similar...) api, different purpose
 
I was specifically aiming for the last diagram in that chapter about repositories
 
featuring engineers who worked on the satellite in the comments ^
 
how do I make a trap execute the action immediately when it received a signal? I have bash script with a trap but it only executes the trap action after the script exited
 
@Gordon until the script exited, or until the command within the script that was executing at the time the signal was received exited? It should be the latter
A signal trap essentially just sets a flag that says "this signal was received" somewhere in the process memory, the process has to check the flag in order to handle the signal
 
it's the same in that case. all the script does is sleep for 10 seconds
 
10:21 AM
Right, that's expected behaviour then. You need to use wait
!!man wait
 
[ builtin, ] echo builtin command, specifying ``/bin/echo'' or ``./echo'' does not. While some builtin commands may exist in more than one shell, their oper- ation may be different under each shell which supports them. Below is a table which lists shell builtin commands, the standard shells that sup- port them and whether they exist as standalone utilities. Only builtin commands for the
 
useless bot
 
hmm not sure I understand.
I start the script. then i send it a signal. when it receives that signal, it should do what I defined in trap immediately.
 
All the trap does is register a callback to be executed when the check for received signals is run
Do you know what declare(ticks=n) does in PHP?
 
yes
 
10:26 AM
OK, well in bash a "tick" happens between commands
and it's implicitly ticks=1
 
when I replace sleep(10) with wait the script immediately ends when I invoke it
 
Yes, wait returns as soon as a signal is recieved
 
you need to start a subcommand for wait to do anything
 
You do, roughly:
 
@DaveRandom but I didnt send it a signal yet
 
10:28 AM
wait waits for all the children to finish
 
the script doesnt have children.
 
pid = create process
while pid is running
  wait pid
end
 
@DaveRandom gordon just has a script that does:

setup trap
sleep 10
and expect the trap to be executed when he sends a signal
 
can you do wait sleep?
I never tried it
 
I don't know, but it's just fundamentally not what bash is for
 
10:30 AM
indeed :-P
it is doable though
I imagine the sleep is just emulating "long running process"
 
correct
 
you would probably be better just writing a PHP scrip tbh
you get much more control and can write much clearer code with a proper programming language
 
so are you recommending php or not
 
i.e. what I just said
 
is there any other way in bash to handle a signal than trap?
 
10:34 AM
What are you trying to do, create a service wrapper?
 
I am writing a test for some java code that sends a signal to a service
to simulate the service, I just start a bash script waiting for the signal to be received
it's really just a trap 'touch got_it.txt' HUP and then a sleep(10)
so in my test I start the script, send it the signal and test that the file was created
I can obviously make the test sleep for 10s, too
ah!
 
Wes
bubbbbbububbbbcccccccc
 
I need to wrap the sleep in a while
cool.
now it works
thanks
 
#!/bin/bash

trap "echo Got SIGINT" SIGINT

php -r 'sleep(60);' >/dev/null 2>&1 &
pid=$!

echo "Parent PID is $$"
echo "Child PID is $pid"

while kill -0 $pid >/dev/null 2>&1
do
  wait $pid
done
@Gordon ^
 
thanks. I just did a while : do sleep 1 done. works fine.
no need for the wait
 
10:47 AM
well sure, but that essentially just polling every second
The "correct" way to do it is to use wait, because it's not dependent on how long the child takes to execute
 
10:58 AM
Someone tried to push a commit which creates a temp table on the fly instead of adding an index "to improve performance" :/
I think I'm going crazy.
 

« first day (2659 days earlier)      last day (2286 days later) »