« first day (2011 days earlier)      last day (2951 days later) » 

1:57 AM
anyone online?
 
yes, me, good morning
 
good morning. can you please have a look at my question? I'm really struggling
http://stackoverflow.com/questions/36683870/dynamically-search-sql-table-and-display-on-html-using-php-and-javascript
 
@YohanBlake I recommend you to use something like json to encapsulate your data in a way it will not contain exactly what is supposed to and are your file saved with UTF8 without BOM?
yes?
 
2:12 AM
@happy, the table coalition is utf8mb4_unicode_ci
 
and your code file?
 
you mean the php file on the server?
 
yes
 
um, I'm not sure what you mean by BOM
 
that would prevent non printable character to be inserted in the expected answer
378
Q: What's different between UTF-8 and UTF-8 without BOM?

simpleWhat's different between UTF-8 and UTF-8 without a BOM? Which is better?

 
2:15 AM
I'm not sure about the file system used in the server
but I haven't had any difficulties retrieving data from the sql database before
 
if you compare $_REQUEST['some_input'] to a variable with what you expect it to be, is the answer the same?
 
2:32 AM
Mrnging
 
 
2 hours later…
4:26 AM
mornin
 
as you say
I'm edgy. I have to click things.
also vampire the masquerade is fanally back on sale. I won't be missing it this time.
 
4:51 AM
bloodlines or redemption?
 
Ekn
mornin
 
5:19 AM
mornin'
 
3
Q: PHP - Create Thumbnail & maintaining aspect ratio

Gijo Varghese I have created a thumbnail creator using PHP. The thumbnails generated should be of same size. But the problem is the use uploads images having different aspect ratio like landscape or portrait the thumbnail becomes ugly. So i created the picture above for clarification. Whatever be the uploade...

 
apparently bloodlines
somebody told me some mods unlock many kinds of vampire from the original paper game. couldn't confirm yet..
 
I want just to display the thumbnail not want to store it in the database or any where.. so can i manipulate this function so that it will return a thumbnail on calling this function with the original image inside img element?
Something like timthumb.php...?
Guys any idea?
Anyone Plz am stuck here....
 
Wes
5:43 AM
mggmrnrigfgdfng
 
Wes
can't write havent had coffee yet
 
hey who can know who stared messages with realness (like, without falseness on signal. like, who actually stared. .. )
 
Hello anyone know how to manipulate a thumbnail creating function so that will display thumbnail whereever its called instead of creating a thumbnail image in some folder...?
 
Wes
i can't compute your sentence
 
5:53 AM
how anonymous are stars
 
want something like timthumb.php ....will call this function inside img tag with the original image... and it will return a thumbnail of the image passed it to...
@Wes
 
Wes
i don't think they are actually anonymous
 
Who fucking stared I have installed the wordpress?
... except me, ofc.
 
Morning
 
Wes
@FélixGagnon-Grenier i did too. it was fun :B
 
6:02 AM
I didn't, it needs to begin with "Behold! " for full effect.
 
Wes
lol
 
!!xkcd can't sleep
 
overflow ^^
 
How can i check if a particular image exist or not ?
 
6:12 AM
 
Ekn
google that question
 
:P
 
mnomning
 
mgringo
 
@SergeyTelshevsky \o
 
Ekn
6:14 AM
o/
 
!!rebecca
 
@Gordon Only 3 days, 17 hours and 45 minutes left until Rebeccaday, OMG!
 
"only"
 
that baa baa song is troubling
 
@FélixGagnon-Grenier i sometimes wake up at night and got it in my head
 
6:16 AM
@Gordon the correct response should be "It is Monday, you twat. Deal with it!"
 
should i use necessarily use allow_url_fopen() along with file_exist()?
 
Wes
thanks for sharing it with us @Gordon now i will need a bottle of vodka to forget it
GET OUT OF MY HEAAAAAAAAAAAAAAAADDDDDDDDDDDDDDDDD NOOOOOOOOOOO
 
@tereško feel free to PR :D
 
Ekn
mondays are good
 
hell no
 
Ekn
(lies that I tell myself at 3am of a monday)
 
@astrosixer allow_url_fopen is usually fine, allow_url_include isnt. then again, you can include file_get_contents which does the same and is equally harmful but there is always many ways to shoot yourself in the foot
 
then again, I might be a bit more pissed off at the world today, since I was fucking clumsy on Saturday
I managed to drop the newly bought knife of from the kitchen counter .. on my foot's little toe
 
awww... I started reading that caring for the knife...
 
the "foot fingers" are called toes
 
6:21 AM
sorry, fixed
and of course, I was unlucky enough to have it land with the edge
 
nothing serious?
 
Ekn
ouch
 
toe is still attached
though, it hurts when I walk ... right in my self-image
 
remove the mirrors from the walls #protip
 
@tereško nice day to play ping-pong with you, then :P
 
Ekn
6:26 AM
welp, for the last few hours I can't use my left hand properly.. holding a cup of coffee even hurts
Ace bit my hand unintentionally when playin
 
@Ekn carpal tunnel?
 
Ekn
most probably
but also, it's becoming a bump on top of my hand
 
oh . fuck
you sure it's not actually broken?
 
Morning!
 
unless "Ace" is your pet poisonous iguana
 
Ekn
6:29 AM
:p it's a siberian husky
not sure, gonna see
 
you probably will have to visit emergency room in the morning and get some pictures taken
xrays, I mean
@SergeyTelshevsky I would be willing to try :P
 
Ekn
yep, it's gonna be a shitty rainy monday
 
its not rainy. its sunny. but cold.
very cold.
 
@tereško I'm dead
 
MOrnin
 
6:41 AM
@Epodax \o
 
6:52 AM
what is http wrapper does not support writeable connections... ? it does not create thumbnails in specified folder...
 
@astrosixer exactly what is says. you cannot write over http, e.g. file_put_contents() or fopen/fputs doesnt work with a url.
 
morning all
 
@Naruto o/
 
@Saitama 26k yesterday man :P (slither xD)
 
6:58 AM
Great :D
I am sucking at that atm tbh
 
haha, got bored last night :P
 
@SergeyTelshevsky dunno ... you looked like still wriggling about 5 min ago
 
grumble grumble
 
what's up Joe?
 
Hello
 
7:05 AM
@tereško he's practising for the Royal Grumble
 
woke up super late, everyone is late for everything, also, monday ...
 
0
Q: Change half product on slide

HimanshuIs this type of slider possible : when click on navigation its only slide half image.

is possible to make slider like this?
 
@DamienOvereem nin'
 
@Himanshu yes
you position two layers one on top on the other and fix the background images
one to the left and other to the right
 
7:07 AM
how to slide them? @tereško
 
you use JS to change the width of the top layer
 
@tereško I'm in gym every morning before work, so physically I am
 
I probably should try something like that too
last time I was in a gym was .. dunno ... 6-7 years ago
 
@tereško But its work dynamically ?
 
I am hungry
two and a half hours til lunch
too long
 
7:13 AM
so eat, and in two and a half hours eat again
 
:D
 
@Gordon do you receive food according to some timetable?
 
hi good morning
 
@SergeyTelshevsky yes, it's called routine :P
@Saitama yummy
 
7:15 AM
ikr
 
think about food, then think about routine, then think about food :D
 
@Saitama that actually looks really bad (if you ignore the tiny monkey in the back of your mind)
 
:/
 
@Gordon what if am rewriting url then i should perhaps write the absolute address for images in that particular page. What will i do then?
 
@astrosixer I have no idea what you are asking
 
7:25 AM
How can I get those input's values and put that values into another one's name and type attributes plnkr.co/edit/6iZSIBa9S1G95pIMBRBu?p=preview
 
You told me " file_put_contents() or fopen/fputs doesnt work with a url" against my previous doubt.. you are right i was given the absolute address for the file path for creating thumbnail.....now it is solved when i removed the http in front of it.... but what about if i am rewriting url so it may be more friendly ... in that case i should have to give the absolute address for the image whose thumbnail is to be created... @Gordon
 
@Saitama god dammit, now I'm hungry aswell..
 
@Gordon I want to get those values using PHP
 
Hello..I need some help in opencart. Could anyone suggest is it right place to ask or not ?
 
7:29 AM
@kishore me too have some doubts regarding shopping cart.. but i dont know whether is this the right place or not .. have been asking since last week but nobody answers me..
 
@astrosixer, which framework are you using ?
 
our company uses a custom standard MVC..
9
 
@tereško sorry to bother you again do you an idea about How can I get those input's values and put that values into another one's name and type attributes plnkr.co/edit/…
 
oh..I got it..
 
ahha
 
Anonymous
7:34 AM
mornin
 
@Saitama :(
 
:?
 
now I want that
 
@Gordon I have big breakfasts
 
@astrosixer, I think if you ask questions or functions related to php then you may get help, but if it is related to your Custom MVC then I guess, it is a little chance of getting an answers..
 
7:36 AM
@FlorianMargaine omg. you dont wanna know what I just misread… ROFL
in case you do wanna know, remove "kfa"
 
@Gordon haha
 
moin
 
o/
 
morning
 
7:41 AM
morning @FlorianMargaine
 
Ekn
morgen
 
does it mean morning ,@Ekn?
 
yes, it's German (and probably other Germanic languages as well)
 
actually it means "tomorrow"
so, bis morgen = until tomorrow, guten morgen = good tomorrow = good morning :p
 
great
 
7:44 AM
@Leigh Not sure about that causal relationship tbh :-P
 
guten morgen morgen = good tomorrow morning or good morning tomorrow?
 
Repurposing "morning" to mean "tomorrow" seems more logical than the converse
 
Ekn
well, take spanish, mañana is used for both morning and tomorrow
 
what is a "custom standard MVC" ?
6
 
@DaveRandom I didn't repurpose it, blame ze germans
 
7:46 AM
@tereško It's starrable
 
I am referring to this one
15 mins ago, by astrosixer
our company uses a custom standard MVC..
anyway
 
school run, laterz
 
@tereško, It means the work flow of this MVC is confined to the company where it is created. I guess.
 
@KishorePatra did you really have to use buzzword generator to write an answer?
anyway, it's all boring
 
@tereško, No not at all..what happened ?
I just edited .
 
7:49 AM
I have a problem (which I was poking at on Friday, but then got distracted) regarding unittests
when testing a data mapper, should I use a mock or a real instance of the domain object, with which said mapper is expected to interact with?
 
Hi guys
 
posted on April 18, 2016

New Cyanide and Happiness Comic

 
@tereško, sorry. no idea on that :-(
 
@tereško Custom MVC is based on the logic of MVC seperating the data and view..
 
7:52 AM
I have a domain that has the https:mydomain.com being pointed to a different website
 
@PaulCrovella not exactly. "Guten Morgen" refers to "der Morgen", e.g. the time before noon. It's equivalent to "the morning" in english. Only "morgen" as an adverb means tomorrow. But then you spell it with a lower m. On a side note: "das Morgen" also exists and can either mean "the future" or a no longer used measurement unit of about 1⁄2 to 2 1⁄2 acres
 
@astrosixer that's definitely not what MVC is separating
 
I have inquired from our host godaddy why there is another website freeloading on our domain https and they dint exactly give me a solution
Any idea how to prevent this
maybe adding something to the htaccess file or something
 
@GotaloveCode I suggest you should look into the .htaccess file...There may be it is written to redirect somewhere else..
 
Thank you for contacting Hosting Support in regard to the URL https://mydomain.com not showing the correct issue. This is a known issue with cPanel hosting. You will either need to add an SSL certificate to the hosting plan to support the HTTPS connection or stop using HTTPS connections on websites that do not have an SSL certificate.

Please let us know if we can assist you in any other way.
 
7:55 AM
@Gordon how do you test the persistence logic?
 
@tereško what?
 
So how to stop HTTPS connections on a website
@KishorePatra it isnt
I just had a look
 
@GotaloveCode umm, by not using the https protocol in assets, but why dont you just add a cert from letsencrypt. its free
 
nevermind, I will just continue banging my head on the desk .. maybe I shake some idea loose
 
don't do that @tereško,,,try google it...
 
7:57 AM
@tereško use the real object, but dont use the real storage mechanism?
 
oh its free I thought there was a charge for that @Gordon thanks let me check it out ASAP
 
yes, that what I have been thinking about
 
@tereško oh any what @KishorePatra just said… you really need to improve your googling :D
 
as in right now
 
Morning
 
7:59 AM
nin'
 
now I am sure that nin' means morning.., right ?
 
I did do what he suggested @Gordon and I had tried adding this to htaccess to try direct traffic to http
RewriteEngine On
RewriteCond %{HTTPS} on
RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI}
 
@KishorePatra basically anything you might ask that about means morning here
 
@KishorePatra sure. But tell me, what should I query google with to get help regarding application architecture and design?
 
@tereško, you want to know about "persistence logic testing " , right ?
 
8:02 AM
12 mins ago, by tereško
when testing a data mapper, should I use a mock or a real instance of the domain object, with which said mapper is expected to interact with?
 
@tereško, May be like this... possible way of testing a data mapper
or testing data mapper with real instance of domain object
 
if anyone has some time, can you read over that draft rfc and tell me what else you expect to see please
 
@JoeWatkins first thing I expect to see is a link to that draft rfc
 
8:19 AM
@JoeWatkins I like
 
@JoeWatkins Type inference...
 
@MadaraUchiha explain ?
@Leigh me too :)
 
@JoeWatkins Ideally, I'd want to be able to do this:
 
do you mean infer return type of closure from interface definition ?
we can't really do that ...
 
@JoeWatkins tangent thought, could it somehow also be used with generators?
at the moment the return type of a generator has to be \Generator
 
8:22 AM
interface IntBinaryFunction {
  public function method(int $a, int $b) : int;
}

function myFunction(IntBinaryFunction $cb) : int {
  return $cb(5, 6)
}

echo myFuynction(($a, $b) ~> $a + $b);
 
no way to type the yield
 
why would you ask a yes / no question on SO?! stackoverflow.com/questions/36688724/…
 
yeah that's a limitation of generators
 
I know not all of that syntax is available yet, but bear with me
 
(or php in general)
 
8:24 AM
@MadaraUchiha you have a bear with you? That's dangerous, man!
 
@MadaraUchiha yeah it's interesting, but, we would need inference generally ... we do have some of this stuff and are using it, but only in opcache and only for optimization ...
@Gordon excellent Monday morning humour ... thank you ...
 
@JoeWatkins The guy writing the function doesn't want to deal with all your typing shenanigans, PHP should be able to infer the type from the interface, and not require the type to be repeated in more than one place.
I mean, even JAVA got that part right
 
@Gordon it's probably a russian thing
 
it would be strange if that were the only case where we inferred the type though, right ?
 
@tereško canada has lots of bears, too
 
8:25 AM
@JoeWatkins Not if you're planning on lambda expressions
 
user image
8
 
($a, $b) ~> $a + $b is fun and easy to write
 
@MadaraUchiha yeah you're right I guess ... but one battle at a time is good ...
 
(int $a, int $b) implements IntBinaryFunction : int ~> $a + $b is not
My $.02
 
@MadaraUchiha ideally they both should just work
 
8:28 AM
@tereško Yup, absolutely
If you want to be strict about it, go ahead
 
yeah you're right but, it's a problem for later ... it would create resistance if I said we're going to do this totally new thing, in order to make a thing we don't have yet much nicer, right now you are stuck having to write out a bunch of stuff anyway ...
 
And add it for documentation purposes
@JoeWatkins Fair enough
 
@MadaraUchiha Doing this would probably require generics in some way... I remember though someone proposed a nice solution to this problem, I think it was @bwoebi . The idea is - if you're passing callable of type callable($a) as an argument of a parameter of type callable(int $a): int - engine would swallow it but it would also wrap this callable in a typed one callable(int $a): int upon entering the frame of a function where you just passed this callable
So that $f = function (callable(int): int $cb) { var_dump(typeof $cb); }; $f(function () {}); would actually print callable(int): int and not just callable()
 
mornig
 
mohaa
 
8:31 AM
@nikita2206 In my view, the engine should be smart enough to detect that ($a, $b) ~> $a+$b was passed in somewhere that requires a callable(int $a, int $b) : int, and see that the types match, or else throw exception
That's exactly how it works with objects if you try to pass an object of a non-matching type, you get a compile time error (right?)
 
@MadaraUchiha what if somewhere in the function $$ is used - you can't reason about this function anymore. Or global variables...
 
Hi.. is there any way i can convert a html design to pdf using php
 
@nikita2206 Example?
 
asking me?
 
soory to bother you guys even if I shouldn't aske this question here Ill ask you I typed my full name in google and google hides some results because of DMCA complaints I dont why !!
 
8:32 AM
@MadaraUchiha sorry, gotta go, later
 
@nikita2206 sure
 
@JoeWatkins "IFoo cannot be considered a functional interface, because it contains more than one abstract method." - so? if all the methods share the same signature, why can't a closure implement them all at once?
 
@PaulCrovella Too much complexity
To little profit
 
basically that, we could also allow the other example, where Ifoo extends ibar or whatever, because there is only one abstract method there, and we could assume they are only implementing one interface, but it makes it too hard to reason about the code I think
I think it's a different kind of interface also
wait that's the same example
monday :)
if it emerges that, it would be more useful if we did make some of these assumptions, then they can be added later on ... I would rather start out making no assumptions ...
 
automagically giving a closure a method from an interface is already weird to me, but if that's what you're into then don't be half-assed about it - get your freak on
 
8:40 AM
well that's not an assumption, while a functional interface can only have one method ... you're just implementing it anonymously, which is already a thing for classes, and functions ...
also, which do you mean in that scenario, do you mean to implement IBar or Ifoo, or both ... there's no way to guess that and always be right ... it's really too ambiguous to do anything but raise an error ...
 
both, two methods is no more ambiguous than have one method appear from the ether
 
@PaulCrovella The idea is that in the past you'd implement this with an anonymous class
If you'd want to typehint a callable, that's how you'd have to do it
This is a shorter, more concise syntax for the same purpose
The next step would be, IMO, what I said above about type inference and lambda expressions
 
but only for in the case of a functional interface .. which needs to have a simple definition for people to understand/accept it ...
we super hate new stuff ...
 
@MadaraUchiha I think you're reading it the wrong way around - nothing about these interfaces guarantees getting a closure
 
yeah it doesn't, but it's definitely an advantage to be able to type hint a closure ...
 
8:47 AM
@PaulCrovella The way I see it, you don't need to.
 
ThW
Morning
 
According to my mental model, this should work:
 
o\
 
it is a shorter, more concise syntax for anonymous classes, with free lexical scope support, rebinding, and closure type hinting ... but restricted ... I'm gonna come back to anonymous classes too, but wouldn't want to miss out on this ...
(it is an anonymous class)
 
interface Fn {
  public function method() : int;
}

$fn = function() implements Fn {
  return 42;
}

echo $fn->method(); // 42
@JoeWatkins Would that work? ^
 
8:48 AM
yes
you can try on 3v4l
 
@MadaraUchiha yeah, that's the opposite of your last example
 
you have to implement the interface properly
function() implements Fn : int
 
@PaulCrovella Yeah, but the other way around works too:
 
umm, echo $fn->method(); feels weird
 
interface Fn {
  public function method() : int;
}

$fn = /* INSERT ANONYMOUS CLASS HERE */

echo user_call_func($fn); // 42
@Gordon $fn->call() or something is probably better, yeah.
@PaulCrovella I'd expect that to work under this RFC as well ^
 
8:51 AM
@MadaraUchiha I'd assume method() to be an alias of __invoke()
 
it does in that context, but if you are recv'ing Fn interface, you need to be able to call the method ...
 
If the interface is functional, anonymous classes are interchangeable with closures.
 
why should the reciever care if they are getting a closure, or an object, they have to work both ways in all cases ...
 
@Gordon method() is just how I called it in the interface.
It could be public function gordon() : int; for all I care
It's the consumer of that interface that will need to know how the method is called.
For example
(with generics because why not)
interface Predicate<T> {
  public function query(T $value) : bool;
}
 
@MadaraUchiha yes, but I find it weird if I could actually call it on the lambda then. To me, the lambda is the method implementation already.
 
8:53 AM
Here it's called "query", you can still call it with user_call_func or with ->query($value)
@Gordon That's the RFC.
 
@MadaraUchiha I'm saying this from your earlier example doesn't hold: function myFunction(IntBinaryFunction $cb) : int { return $cb(5, 6) } - as you don't know it's a closure implementing IntBinaryFunction
 
If an interface only has one method, it's considered a "functional" interface, and can be use interchangeable with a closure.
@PaulCrovella I know that IntBinaryFunction is a functional interface
So it can be used as a closure, as well as an object.
I could have done $cb->method(5, 6) too, yes.
 
that depends on the implementer
 
@MadaraUchiha and I can implement it without using a closure, so you can't assume to treat it like one
 
you don't know anything more about the interface than you did before, only now the implementer can choose to pass you a closure ... but you can't assume that because it is a functional interface, you will always get a closure ...
 
8:56 AM
@Gordon ($a, $b) -> $a + $b is short for function($a, $b) implements Whatever { return $a + $b } which is short for an anonymous class implementing the same interface.
Right, lunchtime, very interesting talk, and good looking RFC, gg @JoeWatkins
 
@Gordon it's weird to me too, but everyone else seems to instantly love it
 
@PaulCrovella Check out how Java did their Lambda expressions in Java 8
 
Mornin'!
 
no, don't ...
 
8:58 AM
I think it was very well done given how strict their limitations were
 
I guess what is confusing to me is that now the lambda syntax doubles as anon class syntax
 
And PHP can do a lot better
 
am I expected to give a fuck? I don't deal with java anymore
 
@Gordon That's exactly the power of functional interfaces
 
a closure always was an object @Gordon
 

« first day (2011 days earlier)      last day (2951 days later) »