« first day (2108 days earlier)      last day (2855 days later) » 

12:00 AM
but for fucks sake… why use something with a base size larger than one AND duplicable (for astral planes…).
 
I understand that first part \o/
:P
 
@PeeHaa You are not supposed to know what a fuck is!!!
 
pffff I cannot read anymore. I can't even find the record by eye
oh forgot quotes
lol it just skipped it now apparently
I'm going to leave it for now. I have a better looksy tomorrow when I'm somewhat fresh.
tnx all for now :)
 
:-D
 
Such an annoying night. Two things I don't understand at all and hate: character / encoding stuff and datetime
throws money at screen
 
Wes
12:14 AM
how many movies are they making crossovering stuff like divergent, hunger games and maze runner? lol
 
As many as that will bring in money I guess :)
 
Wes
i can't watch anything. they are making too many movies and the actually good ones are hidden behind poor advertising or the shadow of crappy movies for teenagers. i don't even trust the usual review sites anymore after they made mad max movie of the year 2015
so i just watch documentaries now.
 
@Wes I have the problem that once I started a movie no matter how crap I'm invested to watch it to the end
 
Wes
@PeeHaa we wasted like an hour because amnesia. i forgot that utf-8 is compatible with eascii. i'll be drinking a lot tonight
*ascii
 
You know what's fun? debugging a binary with source code and no debug symbols…
 
Wes
12:25 AM
Jul 14 at 17:35, by Wes
i love your definition of "fun", Bob :B
 
:p
 
hehe
 
Wes
i just started another movie and instaquit it
the fifth wave...
 
Hahahaha i've done some stuff for that movie :p
Sorry "movie"
I knew enough when I saw the trailer
 
Wes
any suggestion among these?
what about tomorrowland?
 
12:37 AM
Ex machina was okish if you are into that kind of thing
 
Wes
watched that one
 
Dunno tomorrowland
 
Wes
that was good :P
 
1:22 AM
@Wes Tomorrowland was better than I expected, but really lacked a good villan (Hugh Laurie did well despite crap material at the end)
It also reaffirms that George Clooney is a superb slapstick actor. He needs to avoid the political crap he gets into
 
@AnmolRaghuvanshiVersion2.0 Yo
 
Yes,yo!
:p
You didn't sleep?
 
1:38 AM
no :-(
 
@Machavity He didn't want an unicorn? o_O
 
2:01 AM
@Shafizadeh why?
 
@bwoebi IKR
 
Wes
2:21 AM
4.8/10 zoolander 2 on imdb is undeserved
 
Anonymous
As in its worse or better ?
 
Wes
better
i mean, it starts with justin bieber dying
 
Howdy all
 
I know this isn't quite a PHP question, but I'm writing a backend that uses a public API, and I'm struggling to get it to work the way I want.
 
2:28 AM
That wasn't a question at all.
 
Haha!
https://www.govtrack.us/developers/api

So my goal here is to filter results by the vote category. Here's how I thought it would work:

https://www.govtrack.us/api/v2/vote_voter/?person=412246&limit=10&order_by=-created&vote__category=passage,passage_part
Oh...it got cut off
Any way I can make it not shorten that URL?
 
Anonymous
@Wes ... You don't like my man Bieber?
 
Wes
everything makes sense now
 
Anonymous
:D
 
3:03 AM
Those are a lot of words to say "compiler assisted copy and paste"
We don't have enough contrived examples already in the manual? We gotta see them on SO too.
 
Wes
it's about courtesy. proper design would be not having optional parameters at all, and:
$map = new Map();
$map->setCapacity(10);
$map->addAll($data);
but that sucks even more
 
Just once I'd like to see someone not use an animal or a square or a circle or a mammal to come up with a contrived and utterly useless OO example :/
 
I like to use cars.
 
Wes
or cars, there's always a class Car
 
Yes, because everyday I write code that programs cars.
Especially using a Class that has members turnLeft and turnRight
Very pragmatic, right? We can't even get contrived examples to demonstrate real world principles!
We went from crappy documentation on php.net to equally crappy documentation on SO. No improvement whatsoever. This makes me so sad :(
 
3:12 AM
Good. now use a real world example, like an event loop … the event loop has loop bound storage (fetchState/storeState) and a bunch of abstract methods for actions on it. … with different backends.
But now that is faaaaar too complicated … because … uh … it's real world? :-D
@Sherif and well… that's the problem… either you have an abstract example unrelated to real world or it's touching some unrelated domains...
because real world examples are real world as they touch some real world domain
 
@bwoebi That's not true at all. I can give pragmatic examples without crossing a domain boundary just fine.
And I have.
 
for example? @Sherif
 
I'm not saying it's easy. I'm just saying what improvement did we really offer up when we just repeat the same mistakes elsewhere?
@bwoebi Just look at any of the examples on my blog or any of the dozens of examples I've contributed to the manual.
 
@Sherif The people don't know better. Show them.
 
@bwoebi Who says I'm not? I've been showing people for years :)
 
3:19 AM
@Sherif there's no code in your blog? (except that one about zmq/memcached…)
 
The truth is though you take an example like Human extends Mammal and the person reading it still learns nothing about inheritance, or overriding methods, or any of the actual OO principles you might have been trying to get across with that example, because they won't find it relatable to anything they will most likely end up doing in code.
@bwoebi phpden.info wrong blog
 
@Sherif I agree… but I have a very hard time finding actual good examples for that … [I only know what's worse … square extends rectangle…]
 
@bwoebi I look for the reasons why I would use the thing I'm trying to give an example of in the first place, and formulate my example based on the real use case rather than make shit up. For example, how often do you find yourself extending a class? What was the use case?
I posit that you rarely do so and when you do the primary use case is to either override some behavior of the parent class or typehint for your custom code.
 
@Sherif hacking around (i.e. class without interface) is the most used case for me, yes
And sometimes when large parts of behavior are similar
 
Which probably explains why 99% of examples that demonstrate extending a class suck, because it's not something we actually do much in practice anyway.
@bwoebi Riiiiight! exactly
Take Exception as the most common example in PHP.
Most PHP composer packages, you will find, tend to extend Exception for throwing custom Exceptions from their own classes.
99% of the time, the only reason they extend is to have a custom typehint for the client code to catch.
 
3:31 AM
@Sherif Exception is really just aliasing basically. We rarely override anything in exception
 
@bwoebi Yes, that's what I was just typing.
There are two primary use cases for extending in practice (that I find very few people ever venture outside of in the real world). Either you are trying to override one specific method, because the guy that wrote the class didn't use an interface and allow you to extend it better, or you just want a custom typehint that better fits your calling code.
 
@Sherif I sometimes use extending for null-objects
 
So why do we never give any real examples that demonstrate that?
No, instead, we tell people "there will be a time in your life when you will want to extend a car!"
WAT?!
 
@Sherif And sometimes you use extension to creep the hell out of the user … Most notably deep extension hierarchies in Java…
 
heh, those are just bad Java programmers. We have those in PHP too.
Like the ones that seem to think there is a need to extend PDO.
 
3:37 AM
@Sherif I've done that… to log the executed queries in a script and measure execution time.
 
PDO is basically just an interface. If you stop trying it like a base class by which to wrap your application Model business logic you will not have such a bad time.
@bwoebi Because your DBMS doesn't have a logging facility?
:p
 
@Sherif it does… but not program specific.
I want to log what individual executions do.
 
I get that, but still... we have better solutions for that. Like newrelic.
At least newrelic hooks into mysqlnd so you don't have to use slow ass PHP.
 
sup suckas
 
At least your is not the worst use case in the world though.
 
3:41 AM
@Sherif good… assume now it's amphp/mysql and the code is directly connecting to the server without C bindings being hookable here :-P
 
@bwoebi You said you extended PDO. Why would I assume that you were doing it via a C extension?
 
@Sherif you mentioned newrelic I meant…
 
I'm lost :/
 
forget it, not relevant
 
One of these days I will learn to understand you ^_^
 
3:45 AM
@Sherif After mastery of spacetime curbing and quantum transfiguration, maybe… :-P
 
I hear they have night classes for that.
Maybe I should sign up?
 
lol
 
that's kinda a high bar
maybe just drink, code, and be merry
 
I feel like Dinesh trying to look past his monitors, right now.
 
six monitors is just cheating
 
3:50 AM
b2t… You mention exception hierarchy… but … how often do we actually ever really use the hierarchy?
it very often could be just a trait loaded into the exception classes (instead of exception/error being extendible)
 
hold up.. someone here suggesting using a trait? I must be drunk
 
We typically either catch something specific or just anything Throwable.
@PaulCrovella what's wrong with composition?
 
I said nothing about composition
 
@PaulCrovella well… traits is how you do composition…
 
it's not the only way. composition was done well before traits
feel free to ignore me though, I actually am drunk
 
4:00 AM
@Sherif already away?
 
Sorta. I'm between my debugger and my browser at the moment.
 
@Sherif What fun are you having right now?
 
Trying to figure out a more efficient implementation for my operational transformation algorithm.
 
@Sherif I love the ways how one can say things without actually telling things. (What operational transformation alogrithm? What is it about?)
 
@bwoebi For phplab.io. It's the thing that makes it possible for two people to edit the same document at the same time.
 
4:07 AM
@Sherif thanks
 
Operational transformation (OT) is a technology for supporting a range of collaboration functionalities in advanced collaborative software systems. OT was originally invented for consistency maintenance and concurrency control in collaborative editing of plain text documents. Two decades of research has extended its capabilities and expanded its applications to include group undo, locking, conflict resolution, operation notification and compression, group-awareness, HTML/XML and tree-structured document editing, collaborative office productivity tools, application-sharing, and collaborative computer...
 
i.e. concurrent text transformation with as less conflicts as possible
 
That's the gist of OT, sure.
 
doesn't sound too uncomplicated
 
You would think.
It's uncomplicatedly uncomplicating.
 
4:11 AM
@Sherif some brainbreaker just tripped [can you reword that in understandable terms?]
 
@bwoebi I'm afraid I can't
I don't even understand what I said :p
 
lol
 
Gon
o/
 
Wes
4:33 AM
\o
Tonight we've observed a rare #supernova reaching its #magnum peak right behind a Tyson Eclipse @neiltyson #science https://t.co/IV1gAQx4L2
 
 
1 hour later…
6:02 AM
good morning peeps
 
hi guys
I'm uploading a screenshot to the server, php failed to do so: imgur.com/a/SnJWQ
path of the folder is correct
 
@JohnyNassar The name of the upload file is "Tripnologies.php" right?
 
this is the name of the php script
 
@JohnyNassar yes, take that out of the path and it should be good to go
 
didn't understand bro
 
6:13 AM
at the moment your sending the image into Tripnologies.php which isn't a folder so the image can't go there. correct the path to point at a folder and it should work.
 
name of the image uploaded is "image" btw
 
no, icon.png :)
 
yes yes but I mean the input field
 
mate, pastebin your code, can't see from this.
 
jsfiddle?
 
6:15 AM
I use pastebin.com for php.
 
or a screenshot
 
@JohnyNassar whichever, just need more info to be able to help.
 
@JohnyNassar is images a sub-folder in the directory?
 
My Tripnologies.php file is in www/Tripnologies. Images is in www folder
 
6:25 AM
ah, ok, then the path should be www/images/
 
www does not need to be written in the path
right?
 
Always try to use full paths
 
Must I change it in appvars.php only?
 
yep
the other file is fine
 
www/images/
 
6:28 AM
but the issue is with the path.
 
it doesn't work
 
what file tree structure you got? can you screen shot it?
 
www folder you mean?
 
6:33 AM
That's strange
 
icon.png is already there in images folder. I used it in a previous example
 
so it worked before?
 
yes
because of this strange problem I'm here
 
ok, first test if the upload is working. just put / for the path and that should upload this file to the root directory.
 
okay
 
6:38 AM
if that doesn't work then it's probably a syntax issue.
 
It seems that the select element isn't working correctly
cause it isn't writing the name of the screenshot when I choose the screenshot
I mean the file upload field**
sorry
 
hmmmm, i'm assuming your sending the other form data to a database, right?
 
Is this the problem?
what you think?
I'm confused because this upload file field is well written
other?
yes yes sure
 
$prefix="";
$lname="";
$info="";
$fname="";
$suffix="";
$mname="";
$email="";
 
all of the form
and what>
?*
 
6:48 AM
Ok, have you tried debugging it?
 
don't know how
 
if not, put this " error_reporting(E_ALL); " on line 25
 
after the insert?
 
no
after $target = GW_UPLOADPATH . $image;
wait
sorry, your right
just after if(move_uploaded_file($_FILES['image']['tmp_name'], $target)) {
 
okay
nothing changed
same errors
sorry
wait a moment
same errors
yes
 
6:58 AM
ok, move it to just before the last }
 
after this: else {
echo '<p class="error">Please enter all of the information to add your high score.</p>';
}
 
but the script is stopping before this part
 
i know, but we need to find where it is stopping.
 
it's stopping on the upload process
okay
I'll try
same errors
:(
 
7:03 AM
ok, put it just before the end of the process
 
what process?
 
the upload process
 
I just do that
 
if no error was shown then the issue is definitely with the path, so try sending it to a different folder.
 
Gon
Morgen v1.1 alpha1
 
7:05 AM
after if(move_uploaded_file($_FILES['image']['tmp_name'], $target)) {
right?
 
yeah, we just did that didn't we?
 
yes
I will change the uploaded folder "images"
 
try sending it to tripnologies/
 
same problem
I'm loosing my mind
:(
I will restart the server
 
7:12 AM
$queryString = "DECLARE @inventory varbinary(2732);\n\n";
$queryString .= "SELECT @inventory = Inventory FROM Character WHERE Name = 'Frondor';\n";
$queryString .= "PRINT @inventory;";
Is there some better method to get that varbinary field from a mssql db without making use of PRINT and sqlsrv_errors()? It doesn't feel like a good practice
SELECT returns nothing
 
nothing changed
pffff
mustn't this file upload element change or write the name of the screenshot when choose it?
 
posted on July 24, 2016

New Cyanide and Happiness Comic

 
@JohnyNassar yeah should do
 
7:27 AM
it's not doing that
 
Wes
mornings
 
@JohnyNassar hey try using this pastebin.com/2JsJcPD6 just to see if you can upload at all.
 
Gon
:O moins!
 
another file?
another form
 
it's a complete upload script.
 
7:33 AM
okay
 
just remove the header on line 42
oh and add the usual <html> tags
it's just to check if you can upload, coz i know this one works
 
there's some undefined variables and constant
but it's writing the name of the screenshot
image**
 
yeah , there are, but they are marked as comments.
 
wait a moment
I have to change the path
 
i already did, to images/
 
oh yeah sorry, it's limited to pdf file extensions.
but it's easy to change that
 
I'm trying with a pdf
 
ok
fingers crossed :)
 
didn't work but it's telling me that "Your CV has been successfully uploaded!"
 
ok, its the path. what path are you using?
 
7:47 AM
which path?
images/
you did it
 
and you have that folder in the directory right?
 
in the www directory
but the upload.php is in www/Tripnologies
 
yeah
oh ok then try /Tripnologies
is it with a cap?
 
they are not in the same directoory
yeah
try /Tripnologies instead of /images
?
changed upload directory to Tripnologies/ but nothing changed
 
oh fuck. sorry Tripnologies/
back slash at the end
 
7:56 AM
yes Tripnologies/
 
da fuq . . . there is an issue with the upload path but i don't know what
 
I really feel that once I started using folders in the www directory the problems begin to appear
 
yes, its a pain in the ass
 
What I'm suppose to do now?!!
Is there someone who can help ?
 
ThW
What do you think $extension = pathinfo($_FILES['file'] ['name']); does?
@JohnyNassar Have you checked the permissions? And are you sure that you want to upload inside the document root?
 
8:12 AM
how to check it? but @ThW Ialready done it before on the same machine and server
I want to upload to www/images/
 
ThW
@JohnyNassar I don't know you environment.
Have you debugged your script on a local webserver?
 
I'm on a local one already
My problem is with the upload path
 
ThW
So what is the error message? Is move_uploaded_file() called with the expected arguments?
 
now php isn't sending me any error message
 
ThW
You have set the error reporting to -1 ?
 
8:20 AM
but the upload process failed and the data isn't stored in the database
if ($_FILES['image']['error'] == 0) {
this?
 
ThW
Doesn't work is not an error description. Debug you script if you have a local server it is easy to use xdebug.
or phpdbg
 
where to put these debug commands?
where to put error_reporting(-1); in my script?
 
8:53 AM
same problems with error_reporting(-1);
 

« first day (2108 days earlier)      last day (2855 days later) »