« first day (1627 days earlier)      last day (3314 days later) » 

user895378
12:53 AM
@ircmaxell Sorry, was out of the office all afternoon. Your advice was correct though.
 
> We're sending a quick note to let you know the next payment date for your Flickr Pro subscription is April 20th, 2015.
In a separate email:
> Flickr Pro is no longer available for purchase, but many of the Pro-only features are now part of free Flickr accounts
 
Hi,my test environment is set up using public ip, is it okay to use public ip with multiple ports ?because i have two services to be run
 
1:13 AM
@jemz It's 'ok' but it's better to i) test with an environment very similar to your production server ii) which is likely to use domain names to route requests to the correct end-point.
 
1:33 AM
@Danack, But Is not okay too if using same port with the two services, I mean I have php socket bind with one publice ip and port(1337), and the socket.io bind to public ip and same port(1337) ?
 
2:03 AM
@LeviMorrison Very briefly, yes. I didn't get far enough to do anything particularly interesting
My advice is to copy Hack
 
2:28 AM
@Andrea I don't like their enums.
 
Why not?
 
Why are they requiring me to give a scalar value to each enum value?
In the most basic, useful case for enums that isn't helpful.
 
@LeviMorrison That bothers me as well
having algebraic data types, or at least a poor man's substitute, would be awesome
 
@Andrea So what did you do? Just get a parser that accepts it?
 
@LeviMorrison yes, and that produces a class with constants
the magic, I never got round to it
 
2:30 AM
Okay. So you were going down the route of translating an enum to special kind of class.
 
Yeah
An enum of X items was a class with X instances
I'd love tagged enums
<?php
// an optional type
enum Maybe {
    Nothing,
    Just($value)
}
Like the Haskell: data Maybe a = Nothing | Just a
That makes you an optional type
<?php
enum Boolean {
    True,
    False
}
<?php
enum Day {
    Monday,
    Tuesday,
    Wednesday,
    Thursday,
    Friday,
    Saturday,
    Sunday
}
 
2:47 AM
Is someone here familiar with smarty? How can i pass an array to a smarty function without add an dimension to it?
function smarty_function_addSettings(array $params, $smarty)
{
    // Do stuff
}
{addSettings data=$settings}
I want to access them in the function only with $setting['whatever']. Currently i have to do $params['data']['setting']
 
3:12 AM
@Andrea Not sure if I want to do that or not :)
But I liked abstract data types the one time I actually used that feature.
 
@LeviMorrison they're really great and more languages should have them
 
The other issue is how to deconstruct it without pattern matching /cc @ircmaxell
 
@LeviMorrison add pattern matching
I've wanted a match ($foo) { on <pattern> ... } statement for years
 
@Andrea But with generics this could be so much more!
enum Maybe<T> {
    Nothing,
    Something(T $value)
}
 
good moaning
 
3:22 AM
Morning, Ja͢ck.
 
Haven't seen much discussions around the Throwable / BaseException thread.
I kind of like the Throwable approach and have e.g. both Exception and AssertionException become "siblings" that both implement the interface.
 
@LeviMorrison oh sure
That'd properly match the Haskell
enum Maybe<T> { Nothing, Just(T $value) } matches data Maybe a = Nothing | Just a
anyway goodnight
 
@Ja͢ck Not sure if reasonable.
 
What do you mean by reasonable?
 
Not sure if the engine can feasibly catch/throw the interface.
(Not sure how founded this is, but is something of a concern given that right now an assumption is made that it extends Exception)
 
3:29 AM
You mean, an assumption is made that everything extends or is Exception?
 
Everything extends Exception.
 
Well, that's true ... as Nikita mentioned, it still requires a patch.
But, based purely on merit I like the aforementioned idea
Unfortunately, this month I'm entertaining my parents so I don't have any time at night to work on it =(
 
InvalidArgumentException for compile-time type mismatches might work, but I I'd prefer something else for runtime mismatches.
InvalidArgumentException is not suitable for any runtime exception.
@Ja͢ck Hopefully having your parents is nice in some other way then :)
 
Yeah, I didn't mean it's unfortunate for myself hehe
Ugh, why can't we have the RFC scroll back after voting ...
 
 
2 hours later…
5:53 AM
Hi all
Can someone please help me in my issue :
0
Q: How to change the <img> tag for displaying smiley/emoticons so that the same smiley/emoticon could be displayed on smart devices?

user2839497I'm basically a PHP developer by profession. I've no idea about iOS and Android coding at all. I've developed an API in PHP which returns some data. This data is used by website, iOS app and Android app. For example, if we take sample output of one such data element it would look as follows : ...

 
belated hbd dude @PeeHaa
 
6:23 AM
hello
 
good morning!
 
6:37 AM
can someone help me with composer local repository
i want to create local repo
then require in all other projects
 
@rdlowrey how about just injector? Did a quick search and couldn't find a package with that name and more than a few downloads
but maybe that's worse than something more brandable but with less meaning? I don't know
@BhavikPatel why not make it a private repo on bitbucket or github? It would be possible locally, but it's a bit of a hassle imo
 
6:52 AM
my company not allowing
so i have to create at local
 
@BhavikPatel can you set up your own, like gitlab for example?
 
i have created git repo on local machine
composer.json of repo is
{
"name": "bhavik/magical",
"description": "A short description of what your package does",
"require": {
"php": ">=5.3.0"
}
}
and in my project
{
"name": "Bhavik",
"require": {
"bhavik/magical":"*"
},
"repositories": [
{
"type": "git",
"url": "d:/Repository/Code"
}
]
}
 
@reikyoushin ty :)
 
@Patrick am i doing it correct way?
 
Are you sure d:/Repository/Code is a repo?
 
7:03 AM
yes
 
You should really call your bare repos foo.git imo
 
can you guide me with this repo on github github.com/bhavitk/PDOMySQL
 
oh look another pdo wrapper
number #523 this week
 
:D
i have created composer.json into it
and update project repositories url to github.com/bhavitk/PDOMySQL.git
 
That is not a repo url
 
7:09 AM
then?
 
oh wauit. nvm I see it is it just redirects on web
 
i am totally confused
what should i do
 
Do yo get an error?
 
yes
The requested package bhavik/magical could not be found in any version
 
good meurning!
 
7:23 AM
@PeeHaa have you figured what's the issue
or you can help me with another repo
 
7:44 AM
@BhavikPatel Can you try requiring dev-master?
 
is it considered wrong if I pass multiple injected arguments in one object?
for example I see that I instantiate symfony's request & response in the beginning, use them all over the app. Currently I pass them as 2 arguments, but if I'll create a container object and use it like

public function __construct(Httpf $httpf) {
$this->request = $httpf->request;
$this->response = $httpf->response;
}

is it ok?
 
Is there anyone know a free data modeler for MySQL similar to Toad?
 
@PeeHaa let me try
 
@SergeyTelshevsky Isn't that just one injected argument?
 
@Ja͢ck exactly, currently it's __construct(path\to\Request $request, path\to\Response $response)
so is it ok to create containers for such cases?
 
7:50 AM
@PeeHaa done
thanks
 
most probably I'll never have to separate them or have only one of them
 
In this particular case, I would argue that having two arguments there is clearer
 
I agree
 
@BhavikPatel Did it work?
 
moin
 
7:51 AM
Hello, I got this $delimiter = '/(?:\:' . $lineNo . '.{0,1}\:).*/';
$line = preg_match( $delimiter, $input, $matches);
 
mogguh @JoeWatkins
 
but it returns :25:473196131
and I don't want the :25:
 
@Ja͢ck also, your opinion, doesn't httpf start to smell like a SL?
 
it seems to ignore my none caption group
 
@ircmaxell figured you would get a ping from sammy
 
7:52 AM
@SergeyTelshevsky Tbh, I don't even know what Httpf stands for :)
 
Http Fing ... obvious ...
 
@PeeHaa yes
 
@sanders Make it a look-behind assertion.
 
yo Jack
 
'sup!
 
7:57 AM
I got a dog, he has your name ...
 
Morning
 
@JoeWatkins With the arrow? That's awesome!
 
without the arrow ...
moin fab
 
@SergeyTelshevsky I would say no it's not ok.
Also, do you really need the whole request object? It does a lot of things...
 
@Jack this doesn't work
(?!\:25{0,1}\:).*
 
8:03 AM
That's a negative look-ahead
 
Is here anyone know a free data modeler for MySQL similar to Toad?
 
@sanders Negative look-ahead is not the same as look-behind :P
 
Morning :)
 
@SergeyTelshevsky That is the worst piece of shit ever...
 
8:08 AM
@Patrick if it's passed by reference why not?
 
@SergeyTelshevsky if it's passed by reference why not inject a service locator?
 
Has anybody played with noSQL before? I am looking into it to see if it will be good enough for a project
 
If your class doesn't need it, it should not be a dependency
 
@JustSteveKing Depends on what you are doing whether it is useful
It's not some magic sauce you can sprinkle on top of your project to make it more webscale
 
@JustSteveKing A spoon is pretty useful, but I wouldn’t eat a steak with it.
3
 
8:11 AM
@Patrick that's what I'm asking, does it make this container a service locator? Is it a bad practice to store them in some object if I always inject them together (if I pass a request and it's used, the response should be passed and will be used too)
 
@PeeHaa It is something that will eventually be useful. I will eventually be holding 100,000's record sets which obviously need storing. However they are all going to follow a set pattern like so : { person: { name : "Some Dude", age: 73, sex: "male", media: { photos: {[ 0: { location: "path/to/file.jpg", name: "Image title" } ]}}}
A quick example
 
@SergeyTelshevsky yes it is bad. that new thing you are creating is not what your class actually needs. It needs a request and response (or not even that). So you are passing in things that are not dependencies
 
@Patrick Depending if the spoon has a sharp edge .....
 
@JustSteveKing a fork and a knife are still better.
what time is it in the UK right now?
 
@JustSteveKing huh? Looks like a normal relational database to me?
 
8:16 AM
@FlorianMargaine This is true, however in my case noSQL will be easier to work with
 
100000 recordsets is nothing
 
@PeeHaa It will be pretty relational, however when speaking to DaveRandom yesterday he suggested looking into noSQL.
I will have multiple fields that will have multiple return results. So instead of using expensive joins I can grab one document
 
aha you need to do actual specific searches?
 
Yes I will do, I will eventually have to search all fields within a persons data which could be spread across 3-4 tables
 
@JustSteveKing please explain expensive joins...
 
8:19 AM
Well while researching I kept reading that using table joins was an expensive way to collect data ...
Not just table joins, but joins used more resources so in effect more expensive
This is what I got from Dave yesterday : chat.stackoverflow.com/transcript/message/22385848#22385848
 
@JustSteveKing expensive compared to what? did you do any testing with your data?
 
> it may or may not be better to look at using a storage engine that can handle multi-dimensional data (i.e. nosql), but often simply "multiple queries" is the right answer
 
I haven't tested no, but the way I read it was that it was a rule of thumb scenario
 
I NEED A NO SLQ SOLUTION!!!!!!1111111
...
 
Well the multi-dimentional part is of high importance, so i take that as I need nosql
 
8:22 AM
Have you freaking tried it or are you just guessing here?
insert mongodb meme
 
I have not used nosql before, hense why I am asking the php community
 
@JustSteveKing you need nosql when you need dynamic schemas
 
I am not looking for questions on why, I believe it is something I will need, I am just asking if anybody has actually used it
 
can we take a moment and celebrate codeigniter 3?
Finally, we don't have to use all that new stuff like namespaces, composer, etc anymore and can go back to 5.2 \o/
 
Yes some of us have used it and with the provided into we don't know whether you need it, but my guess is no you don't need it
> There is a new Encryption library
oh god
 
8:26 AM
@PeeHaa how did you best implement it? Can I do the same as I would with a standard MySQL? Or is there things I have to take into account
 
It's completely different
 
9:00 AM
Oooooooh god. I have to make some change in a zencart project :(
 
yay
my DasKeyboard has arrived
first impression: it's quite good
but I might end up flopping the space bar other way around
 
9:27 AM
How's gaming life treating you?
 
moin
 
@Fabor harsh
 
How come?
 
Morning
 
Morndom
 
9:32 AM
I installed Skyrim
 
@Feeds hehehehe
@PeeHaa my condolences :)
 
have slept 6 hours in this week
 
heh. Watcha playing?
 
I already said: skyrim
also completed Hard Reset on the weekend .. was nice, but lacked enemy variety and was way too short
 
1 message moved to bin
 
9:40 AM
 
@SergeyTelshevsky That is such a horrible device. I'd rather write that with gotos...
 
@SergeyTelshevsky hehehe
 
@DaveRandom I don't actually know C, I just found this on the web and it blew my mind
@tereško will ask for a review in a month or so :)
 
@tereško pro streamer?
 
In computer science, Duff's device is an optimized implementation of a serial copy that uses a technique widely applied in assembly language for loop unwinding. Its discovery is credited to Tom Duff in November 1983, who at the time was working for Lucasfilm. It is perhaps the most dramatic use of case label fall-through in the C programming language to date. Duff does not claim credit for discovering the concept of loop unrolling, just this particular expression of it in C. When used in combination with various optimizations performed by modern compilers, in some cases using the Duff's device...
3
That's the same, but even more insane
 
9:46 AM
@DaveRandom gosh...
 
@DaveRandom oh my god
 
It's essentially a way to reduce the number of branches, which is not something that gains you much, if anything, with modern branch prediction mechanisms... or in other words, don't do that (as if that needed saying :-P)
 
ok people. I have ran a chown -R foo:bar / on a dev machine. What now?
 
delete machine
 
@PeeHaa log in as foo and delete root #ShitsAndGiggles
 
9:58 AM
@Amelia changed to "no". I think resource should just die
 
@tereško I once wrote such code… Nikita wasn't pleased :-D
 
@tereško Skyrim aye, first playthrough?
 
10:14 AM
@DaveRandom I don't wanna reinstall everything :(
 
@Ocramius <3
 
@PeeHaa tbh you're probably screwed, unless you have a backup. You don't necessarily need to restore the backup as long as you can boot/read it - you could write a script to walk the file system and get the perm details from the FS and apply them to the same paths in the current, and build a path list of the differences. You would obviously need a back for that though (or a system with similar data/applications installed)
 
@PeeHaa: you're not using some kind of deployment for your dev machines that provisions them? (ansible, chef, puppet, bash scripts, etc?)
Being able to bring up clean dev machines at will is nice
 
hey guys.
so I have a problem I'm struggling with. I have a page that makes some api calls and the contents I put into a variable. I now want to put said content of the variable into a PHP variable.
any ideas? ;x
(using laravel)
 
10:31 AM
@Amelia no. It's just a dev machine with installed software
 
HeY
Who's up?
 
how do i put environment variables in Linux where we can access them from shell as well as from php ?
 
No idea lol
 
10:47 AM
@PeeHaa I just provision everything so I can table-flip at will
 
11:00 AM
@SergeyTelshevsky what kind of review ?
@Fabor yes, yes it is
 
@tereško When you get a little bored of it try some of the common mods like alternative start
 
@tereško about the keyboard, I'm thinking about buying either WASD keyboard either Das keyboard
 
You could already add graphical mods though.
 
@SergeyTelshevsky well, first impression is very good, only I am not entirely sure about the shape of space bar
 
what about it?
 
11:02 AM
well , I am not completely sure yet
either the keyboard is meant to be used with palm rest
or this desk is too short (at work)
@Fabor I still haven't tried adding the HQ texture mods
I am not entirely sure that I should
 
Why not? With the nexus mod manager they're incredibly simple to turn on and off.
 
/me might get Dominos for lunch
 
@Fabor will try
 
Your metabolism supports it @DaveRandom
@tereško The mod manager has limit on the speed of downloading mods. So if there's any way to start the downloads now I would advise it.
 
I am at work
and I have not set up remote access yet
 
11:07 AM
Fair enough, well it's not a silly limit. So it's not bad either way. There's also an amazing mod called "Perkus Maximus" which basically adds tons of depths to your skill trees. Well worth it when you are doing a second playthrough.
 
@Fabor youtube.com/watch?v=HXmwfQw9DwU <-- I have no idea why, but for some reason that makes me think of this
 
I always seem to do Archer characters. But I have seen some cool ones such as people do mage but use their followers to do all the damage. (They install a mod for multiple followers too). They focus on healing and commanding.
Cassetteboy has been around for so long. Definitely an internet gem.
You've made me want dominos now.
 
@Fabor Two for Tuesday. Do it.
 
@Amelia Sounds like a proper pita to deploy everytime
 
Negative. I've started my proper diet/exercise regime now.
 
11:22 AM
If said regime does incorporate Dominos, then "proper" is not an accurate description.
 
@PeeHaa i have a config i can use for everything. If needed I can vagrant up, otherwise i run my own digitalocean deployer and deploy:dev php
Speaking of, I need to work on open-sourcing that
 
@DaveRandom heh.
 
11:51 AM
@DaveRandom Agreed. Roger.
 
Anonymous
12:05 PM
@Fabor do u build php from src ?
 
Nah. I have done in the past with help from scripts of these guys.
 
Anonymous
I am starting to feel like, I'm the only one who builds everything from src :/
 
lol
It's PHP - 90% of people using the language don't even know it has a source
You're in the 10% hardcore :P
 
I use homebrew, we build literally everything from source
 
Anonymous
:)
 
12:09 PM
Yeah I got brew too, so useful
 
Anonymous
mariadb, nginx, php and varnish all built from src
 
Anonymous
It's a new kind of insanity
 
it's nice having php54, php55 and php56 all in the same env. though all of my projects use latest-stable anyway
 
Anonymous
@Amelia sadly that and updating without having to rebuild again which takes 25-30 minus is what I am missing desperately, otherwise I like it.
 
@Amelia I only had to get 56 because the default php doesn't have GD support, so I had to install home-brew and 56 to get it!
The only problem is, if I ever wipe my mac, it'll take bloody ages to do it all again as most of it was googling along the way
 
12:13 PM
@Jimbo document all the things!
 
Anonymous
@Jimbo keep a note, like a simple file to write the commands
 
Anonymous
It helps a lot
 
Yeah I probably should do. Put it in a gist or something for others too.. problem is, it's too late now :P
 
Anonymous
I could actually share my snippets in github, for building everything from src
 
12:15 PM
Hmm, so '<!--' is a bad character ...
 
That entire class is a bad time waiting to happen imo
 
with something like xss_clean() ... yeah
 
Anonymous
Isn't it already enough to blacklist <, > ? considering js needs those to run any of the other commands mentioned?
 
user895378
morning
 
The moment I see XSS mitigation together with regular expressions, I start running.
 
12:27 PM
@Ja͢ck run away from drupal
 
noted :)
 
user895378
Do we know the relative performance characteristics of new class { public $var1; public $var2; } vs. declaring the class ahead of time?
 
and SilverStripe lol
 
morning
 
morniing @Worf
 
12:28 PM
ola
 
user895378
@Worf morning
 
@rdlowrey Ask on main :P
 
you should never really do class { public $var1; public $var2; }
 
user895378
Thanks for the advice Bonner ;)
 
:O
 
12:28 PM
@Bonner why not?
 
it isn't just for performance, it is to ensure you are being passed the correct classes and data you expect
 
user895378
I'm too lazy to build the anon class branch to benchmark it myself.
 
user895378
I can haz anon class master merge soon @JoeWatkins? :)
 
@FlorianMargaine Holy fuck that is almost as bad as ci's one
 
12:30 PM
plus if you have a decent code analyser it can't hint at any problems you may face
!! google why is an anonymous class bad in php
 
folks, i want to split a big class into some traits just for the sake of readability: i'm worried about the performances but correct me if i'm wrong, if i'm using opcache i don't have to care about that, right?
 
wrong
opcache will only cache what it considers needs caching
 
user895378
@Bonner Why would you expect this to turn up usable search results?
 
it was just a guess, just trying to be helpful
 
cc @PeeHaa ^
 
user895378
12:33 PM
@Bonner Well FYI anonymous classes aren't yet a thing in PHP. The relevant RFC was only approved for PHP7 last week and they won't actually appear in the language for a few months.
 
PHP 7 meh
 
Anonymous
@Bonner i thought it cached the entire opcode
 
no, it only caches what it can, and what it thinks is best to cache
you can configure the opcache to cache more, but there is no certainty of how much it will or won't cache
 
Anonymous
You make opcache sound like my mother :)
 
@Worf you worry about performance when you start having performance problems, unless it's terribad like queries in a loop. But not this kind of thing...
 
12:36 PM
PHP in general is poor for performance because scripts are processed and executed per request, if you want better performance, try Phalcon, or switch to something like C#
give and take opcode caches and what not
 
Anonymous
You mean by configuring if it should cache comments or not? I would hardly call that a configuration
 
there are more options than just that one configuration
 
Anonymous
Maybe you are right, I haven't seen any dramatic improvements in speed between the earlier versions of php and 5.5 I will tinker around with it now.
 
@rdlowrey today or tomorrow
 
user895378
@JoeWatkins It's not a real rush, of course. I appreciate your work :)
 
12:47 PM
@Bonner opcode caches is the proof that scripts are not processed at every request
 
you can always call opcache_is_script_cached
make it easy for yourself lol
as long as you don't use PHP 5.5.5
 
@Worf ?
 
user4180960
Hi. I have one question, I want to make a chat website. What is the best way to do it? I want to write it manualy in php, but my friend said taht this is not good idea and told me to use a framework. What do you think, is it better to use a framework or a clean php?
 
this guy spammed the c# chatroom for about 2 hours last night
 
@Mathematician171 no
 
Anonymous
12:50 PM
@Mathematician171 clean shaven php
 
@Mathematician171 did you ever write that kernal and did you look into grub?
 
@PeeHaa gotta love your answers
 
:-)
 
lol
 
user4180960
@Bonner Why you think I spammed chat?
 
you were in the wrong chatroom for 1, and 2 you were asking really pointless questions, if you were asking them in the forums you would be banned from asking questions
 
@Worf 1) don't use traits 2)? 3)? 4) profit!
 
user4180960
@Bonner How many times I must say that I am a begginer? I want to learn something about a filesystems and similar, I read many books and tutorials, but most of it is still unclear for me
 
If your class is doing too much fix that
 
@PeeHaa say it's not traits but extend
 
12:53 PM
1) Don't extend 2) ? 3) ? 4) profit!
 
no opcode ok #sad
 
703
Q: Prefer composition over inheritance?

ReadonlyWhy prefer composition over inheritance? What trade-offs are there for each approach? When should you choose inheritance over composition?

 
Anonymous
@Mathematician171 one more thing you must learn is to not exhaust people with repeated do-it-for-me type of question. If you do that, you will have a nice people to help you here.
 
@Mathematician171 The magnet's connected to the read arm. The read arm's connected to the drive housing. The drive housing's connected to the platter drive. Now heed the words of Seagate
 
user4180960
@sam_io I am just searching for some advices about programming, why you think it is a do-it-for-me questions?
 
Anonymous
12:59 PM
When with a little more effort you can find out the answer by yourself
 

« first day (1627 days earlier)      last day (3314 days later) »