« first day (1526 days earlier)      last day (3416 days later) » 
00:00 - 16:0016:00 - 00:00

12:01 AM
Pretty hard to tell what they were trying to say.
 
It sounded to me like they suggested to require upgrading in the PHP license.
 
Hmm, I guess. That wouldn't be legal though....
 
 
2 hours later…
2:03 AM
@NikiC The latter.
 
2:26 AM
...which is not to say that last paragraph is understandable.
 
2:57 AM
s/that last paragraph/the comment/ :P
i very nearly reported it as a spambot, til i noticed there was an actual message being that wall of gibberish.
 
Yeah... was really... odd
 
what was it?
 
4:00 AM
@cHao spambots are typically more intelligible
 
4:12 AM
Wondering if I should just, uh, put that Scalar Type Hints 2 RFC to internals already.
 
@AndreaFaulds I'd wait until after the holidays. There's already enough going on right now.
 
@PaulCrovella Yeah, I probably should. Plus, it has two prerequisite pull requests anyway.
 
shouldn't the static classes vote be closed?
 
Morning Folks
 
@PaulCrovella It is.
Goodnight :)
 
4:20 AM
My friend is looking to set up a company that includes web development, mobile apps, big data and related stuff
So, he really needs a suffix for the company like technologies, software, systems, webapps etc

Say, if the company name is abc. we want whether for the above said work which suffix will be more suitable
 
 
2 hours later…
6:05 AM
Good morning!
 
6:27 AM
Good mornig Ravi
Hey I am in trouble
I am new in php and I didn't export my mysqldatabase
just copied the file of mysql
now its not working when I copy that database to my mysql folder of wamp
Now what cant I do?
 
That should work, if mysql version is same.
Check permission of data directory. Hope you are just pasting data directory of mysql, where actual databases used to be stored.
 
7:19 AM
posted on December 20, 2014 by Joe Watkins

Today I'd like to share a screencast I am working on, I'm thinking about giving some talks on the UK conference circuit in 2015. This is my first go at doing a screencast, making slides, and making diagrams, so forgive any mistakes in production. Please do provide feedback, this talk needs to be developed to be about 15 minutes long to be suitable for use as a lightening talk, and may be deve

3
 
Hi everyone. I am new to PHP, and am wondering if anyone can explain the differences in foreach and while, and point out when it is better to use one instead of the other.
 
@RandyC foreach iterates over elements in an array, while iterates while the given expression evaluates to true
 
ah, sorry misunderstood.
 
7:23 AM
moin
 
mernin
 
when did copying to usb drives get to be so painfully slow ?
like 15 minutes a gigabyte ...
 
That's okay @RaviDhoriyaツ I appreciate any help
 
@JoeWatkins when the amount of data started getting into the gigabyte range
 
ah good point, should be using it for documents of a few kb I guess ...
still, very annoying, computer does everything else really fast
 
7:27 AM
@PaulCrovella Thank you. More specifically, when working with arrays, when is while better suited as a tool.
 
@JoeWatkins, for such situation I can guess two most common reason.
1. Number of files being copied are tooo many (and small files like bytes, kbs), then it will take time to copy each files.
2. USB driver had been used many times to make bootable driver and used to install OS.
 
brand new drive, literally just opened packet it came in, big files (films 1gb >)
 
in #2, i mean USB drive (not driver)
 
@RandyC Use while when you need to evaluate an expression for truthiness to determine whether or not to perform an iteration. If you simply want to iterate over all elements in the array, use foreach.
 
@JoeWatkins. Which OS, CPU GHz, and RAM ?
Just confirm any other process isn't eating CPU processing capacity.
 
7:33 AM
@JoeWatkins I think SSDs have us pretty spoiled at this point. Also try to use the latest/greatest USB version, they tend to bump up the transfer speeds quite a bit.
 
@PaulCrovella I think I understand. For populating html tables or lists where data is already known, you'd use foreach, but when needing to check array key values against database tables, while would be better suited. Right?
 
16gb ram, 8 cores at 3.5ghz, drives are all ssd, usb on usb2 port ...
extremely slow ... I think maybe fedora 21 changes buffering for usb mass storage devices ... it's waiting to finish until device is sync'd ...
 
OMG, then it must work damm faster!
 
@JoeWatkins got a usb 3 port anywhere? also depends on what the drive supports. Then again I've seen higher version drives/ports drop down to usb 1 due to fucktardery, so you may be screwed regardless.
 
usb 2 max for drive ... I do have a usb3 ports though ...
I'm just going to have to give up the many hours of life required to copy these films ... sucks though ...
 
7:42 AM
it's not like you need to sit there and turn the crank. do something else while they're copying
 
many to copy and limited time, so need to copy as fast as possible ... when I try to copy more than one film it slows down even more, so can't do that ...
disproportionately slows down I mean ...
 
what is the benefit of storing several types of fees in another table like (productid, feetypeid, feeamount) over (productid, feeXamount, feeYamount, feeZamount) ? The former would require too many joins... what would be the benefit of such structure?
 
I'm not sure how performance for JOIN degrades, I'm pretty sure "too many joins" doesn't really make sense ... you should probably test these assumptions before making decisions about architecture based upon them ...
 
8:17 AM
hello anyone has any idea for this question stackoverflow.com/questions/27578312/…
 
8:28 AM
Morning
 
i wrote it there but noone is online
 
geebus it drives me nuts how often people recommend simplexml on SO. wtf is with everyone's hardon for that god-awful extension
 
8:50 AM
"simple" XML would be it's name if not for limitations on the name of extensions ...
 
shortbusXML would work. Should I send a pr?
 
9:04 AM
I wonder how much of SO's traffic is due solely to this
 
55
A: What's the difference between PHP's DOM and SimpleXML extensions?

GordonIn a nutshell: SimpleXml is for simple XML and/or simple UseCases limited API to work with nodes (e.g. cannot program to an interface that much) all nodes are of the same kind (element node is the same as attribute node) nodes are magically accessible, e.g. $root->foo->bar['attribute'] DOM ...

@PaulCrovella fun fact: this is how I got started on SO ;)
 
9:23 AM
@Gordon That's like a polite version of my rage and disgust. I'll try to remember to refer people to it instead of stabbing them in the face.
 
9:40 AM
Morning
 
afternoon!
 
@compski UGT is observed here
 
@PaulCrovella lol that's under MIPS language not PHP =p
 
@compski "is convention initially established"
 
10:11 AM
good mornings :)
 
10:26 AM
good morning
 
10:38 AM
moinz
Been on the ferry for ten minutes sand completely bored already ...
50 minutes to to ...
 
@JoeWatkins reddit/r/funny
makes you waste ~10 minutes, 40 minutes left
otherwise... do you know pgp? have you used it?
no, not php, pgp
not a typo
 
or just breath the fresh see-air ... :)
 
hey guys, googling hasn't helped me, can anyone try helping me why my ip adress can't get pinged (Destination host unreachable) while I have perfect access to the internet and no firewalls whatsoever
 
10:56 AM
@ircmaxell I'm pretty sure these projects give wrong numbers as well. Most hosts that are in the stats with with PHP 5.2 or below as well offer 5.3, 5.4 and most often even 5.5 - users just need to set that in the admin interface.
 
 
1 hour later…
12:05 PM
mroing
 
good morning
 
12:16 PM
Apparently people are convinced that I'm wrong in stating constant arrays were not in the constant scalar expressions RFC when it went to a vote
 
since when are arrays scalars?
(not that I'm particularly well with that word...)
 
They aren't scalars. The RFC was something of a misnomer in that respect
 
12:29 PM
What are scalar data types?
*vectors
 
Morning
i placed simple query here but i used sql injection in my query... — saiherbal ingle 19 mins ago
OP uses SQL injection. It's super effective!
7
 
even sql injection but still the damn query is "not getting where condition" - it's a miracle.
 
:P
 
normally I shout at my query: "get this stupid where condition" and then it works. I call this "aggressive programming" (AP).
 
@hakre When I still was working in a team I did the very same thing when somebody did something really stupid for the 5th time on a row
 
Bas
12:43 PM
Hey guys
 
@PeeHaa I do this even I work alone. It helps me to keep my mental health as even I still do errors my own, I can ideally blame my code for it :)
The computer just can't shout back ^^
hi @Bas
 
Yeah. I recognize that. Sometimes I yell at myself too :)
 
Bas
sup?
 
meh!
 
@JoeWatkins your solved you audio issues yet?
 
12:48 PM
hello every one.
 
Bas
hi.
 
i want to know design pattern for the ajax base messaging system
like i know how to build it
but if the message length goes to for instance 2000 messages in one thread
it badly hurt the bandwidth and slow down the server
 
@FaizRasool ajaxpatterns.org
 
any good idea to implement such a system.
 
@FaizRasool Are you sure you aren't looking for WS instead?
 
12:50 PM
last month only 3-4 terabyte bandwidth goes to messages
 
I can't tell if he see you guys or not.
 
well really i can do any thing to implement it
im thinking about changing to request on ajax
rather than html from the ajax request
 
@PaulCrovella he feels a bit bot-ish, doesn't he?
 
@PeeHaa i dont think so it is about WS
 
ok
 
12:53 PM
but do you suggest any changes
 
42
 
42 ?
 
that's the answer. 42.
 
I second that
 
Bas
12:55 PM
Hey guys, i'm still making this road tax calculator. And now im busy parsing the data. The data is in an Javascript array. like this pastebin.com/dMcgKsPS (official files with the correct prices for fuel types etc). Is it good practice to load that in a MySQL database?
I want to build my app with PHP, not with JS tbh.
 
@FaizRasool You are basically asking us "I have some vehicle. How can I make it faster?"
 
@PeeHaa no, that's easy. the answer to that is always: add rockets.
 
:D
 
Bas
Owyeah, there's an array like that for each province / vehicle type
 
@Bas depends on what you want to do with the data
 
12:58 PM
@Bas I would discuss the right format to store that with the openstreetmap project and directly integrate it with them.
 
Bas
@Gordon Eventually just check if the car's weight is bigger then a row and smaller then the row after inside the datababase. If so, select that specific price which eblongs to that
'@hakre What?
 
@Bas and where do you get that data from? Why is it in a JS array to start with?
 
Bas
@Gordon From another site, that's how it's being delivered to me.
 
and you download that on demand/request or like once a day?
 
@Bas is it road charges or nationwide-taxes?
@Bas and openstrettmap is here, they collect data: openstreetmap.org
 
Bas
1:03 PM
@Gordon A year or so i guess, but they can change, and that's the formit they deliver it in.
 
@hakre [yh]agni?
 
Bas
@hakre Just making it for the netherlands atm. Its for the road taxes.
 
@Gordon What´s hangi?
 
@Bas ok, so you just download it once and you just store it as a file in your project then? so basically the JS file is the database?
@PeeHaa you/he aint gonna need it
 
ah he :)
 
Bas
1:04 PM
@Gordon Yeah, multiple JS files actually.
For each vehicle type
 
@Bas how many files are we talking about?
 
Bas
6 if i'm not mistaking.
 
for the start keep it as files then. you could parse them and keep them in memory as arrays which should be easy to search and filter.
 
Bas
So no extra mysql db?
 
hmm, imo that's small enough to keep it like that for now. Just focus on making it work for now. But abstract the access to the data so that it becomes easy to swap out the file access with db access.
 
1:07 PM
access the data with a clear interface then you can change that in the future, e.g. if you want to keep as well the historical records of the last 70 years so you can paint nice graphs or whatever.
like @Gordon wrote as well.
 
Bas
Hmm
But i have no idea how atm, how do i keep track of all those arrays? Because per file there are like 12 arrays (for each province)
And not all files have the same design
pattern*
 
@Bas catalogue the file-types.
 
Bas
What do you mean?
data_person_car.js The format's are like that
 
well if you have 6 files, write down the 6 names and then write down which formats they have.
that should give you an overview and show how you can group things to have some benefit.
you can also write down what the purpose of each file is, e.g. which data it contains and what the role of that data is or for what the data in that file is used.
 
Bas
Alright, but... in PHP or something? Or just a general overview for mysefl?
 
1:12 PM
with pen and paper if you like. you can do it with a spreadsheet application as well.
that's for your own documentation and overview.
it will help you to keep the view from above while you write the code down later.
 
Bas
alright, thank you :) one second then.
Ow wait
but, do i have to check the data with JS then? Or can i do that with PHP?
 
the data is in text form. both JS as well as PHP can deal with text data. I'd even say PHP is better with text data, but that might be my personal opinion as I do more PHP than JS.
 
Bas
Yeah, i wanted to handle the data with PHP aswell. But i have no idea how atm.
Could i just parse it in an array then?
 
I'd create an Object Model over the data
 
@Bas I don't know if you could just parse it, that's a question for which you would need to see for your self.
But I think it's feasible to do.
 
1:17 PM
nested arrays are so ugly to work with
 
Bas
Indeed, that's why i was thinking about the DB.
 
@Gordon You prefer nested StdClasses? ;-)
 
11 mins ago, by Gordon
hmm, imo that's small enough to keep it like that for now. Just focus on making it work for now. But abstract the access to the data so that it becomes easy to swap out the file access with db access.
Figure out the api you want to use to access the data and go from there. Stop worrying about actual implementation details as a starting point.
 
When would you people release a new patch version of a project? For example I have this PR. Would you release a new patch or wait a few?
 
@Gordon encapsulate what varies. done.
 
1:21 PM
@PeeHaa for this one I'd wait
it depends though... to each his own
depends on the project's usage too
if nobody uses your project, go for it
for opcachegui... I'd wait
 
@PeeHaa fix it but no ship. if it would be inside the UI, ship. if the next release takes too long, ship.
 
k tnx
 
Bas
1:35 PM
Alright
made the spreadsheet
I have 9 different vehicles, with 4 different formats
So, i guess i have to create 4 different parsers
But how do i call those parsers? because it are all different vehicles
who has no name together :P
 
interface VehicleParser
class FooParser implements VehicleParser
class BarParser implements VehicleParser
 
The parsers are file parsers for a specific format. So you could call them FileFormatNameParser.
 
Seeking thoughts. Would you inject your DIC into a Factory?
 
But you still need to decide the names for each format. But it's probably easy for you as you know the material better than I do.
 
@Fabor shouldnt your DIC manage your factories ?
 
1:50 PM
Let's say your factories create objects with varying dependencies.
 
@Fabor by definition the factory already knows how to do that. It's the job of it.
 
It's the job of the DIC too though.
 
@Fabor the job of the DIC is to be a factory?
 
I mean as in the creation of objects.
 
@Fabor Sure why not. No matter what implementation you follow, the factories have a fundamental need to know the information about how to create objects. If you're using a DIC then that information is contained within the DIC - so there isn't a problem in a factory having a dependency on the DIC.
 
1:52 PM
@Fabor and from your application, what would you say is superior: the DIC or the Factory?
 
@Danack Aye. this is the end result I came to with Daniel. Mainly because of my varying dependencies on the objects created by my factory.
 
And would you consider DIC as much a pattern as you would consider a Factory to be a pattern?
 
@hakre "by definition the factory already knows how to do that." Only if you create a new factory class for every possible version of a class that can be generated when an object is instantiated. That gets really boring when you start decoratiing classes and have an explosion of combinations.
 
I was curious how you'd alternately handle the varying combinations without injecting the DIC.
 
@Danack Explosion of combinations normally signals a design issue. Anyway, I have written that to clarify @Fabors question, so the terms used are clear for each other when talking about that.
 
1:54 PM
If someone actually creates a LoggingAlertingLazyLoadingRetryingDBConnectionFactory as well as a LoggingAlertingLazyLoadingDBConnectionFactory - well good for them....but I don't think I want to work with them.
@hakre "Explosion of combinations normally signals a design issue." No it doesn't.
Or citation needed as the kids say these days.
@Fabor I had some crazy stuff in a project that builds decorated versions of objects. What it was doing was also building a closure that would create the correct type of object. Then I would only need one factory object that also takes a closure that does the actual creation of the object.....and then I realised that was just stupid.
 
Seems like a whole lot of extra work.
 
The information about which closure to use was still being held by the DIC (effectively) so why not just pass the DIC into the factories? Yes, technically it means there's a bit more coupling between the DIC and the application code - on the other hand it avoids having to have a bazillion different closures, as well as the extra cognitive load of having to understand what some closures being passed around are being used for.
 
@hakre I'm mostly fumbling my way through trying to build a site. It's not easy or potentially possible to find good samples out there of how everything should fit together. I had previously assumed injecting a DIC made it a SL prior to last week.
 
Bas
Trying to figure out how the array must lok then
$array1 = array(
    "vehicle_type" => array(
        "provincie" => array(
            "weight from" => array(
                "benzine prijs",
                "diesel prijs",
                "LPG3/aardgas prijs",
                "LPG/OVERIGE PRIJS"
            )
        )
    ),
);
on this atm.
 
@Danack Well you put that in your previous sentence. I pick that example you give:
> Only if you create a new factory class for every possible version of a class that can be generated when an object is instantiated. That gets really boring when you start decoratiing classes [...]
 
2:01 PM
@Danack but then doesn't your DIC become a service locator?
 
What you do here is that you try to solve the "boring" problem with DIC. I'm yet not sure if the way it was asked DIC was considered a pattern as Factory is considered one.
 
@FlorianMargaine Effectively for the factories, yes. But it's a trade-off against having complicated code elsewhere......and the factories are always going to need to know how to create objects, unless you pass all possible dependent objects they require to create other objects into them.
 
@FlorianMargaine This is what Daniel and I were discussing in that room last week.
 
If not, DIC might be just a dependency of the factory and/or the access point to the application state.
 
@hakre "What you do here is that you try to solve the "boring" problem with DIC." It's not just a boring problem - it's a very annoying one when you start auto-generating code. i.e. I probably wouldn't write a LoggingAlertingLazyLoadingRetryingDBConnection class, I'd generate one from a Log, Alert, LazyLoad, Retry decorators on a DB connection.
 
2:05 PM
But I'd say that if all your factories depend on the DIC, that sounds like the DIC stands pretty much in the way for most of your code.
 
@hakre ? I don't understand what you mean by 'stands in the way for most of your code'.
 
The real dependencies should be injected when the factory is created, and it could be the work of the DIC to do that.
@Danack If you have one object like the DIC and it's a dependency of many of your (creational) classes, the cohesian goes down (or how that is called), much of your code depends on the same component and this can make it inflexible.
that's what I mean that these things start to get into your own way.
 
"much of your code depends on the same component and this can make it inflexible." No - the application code that requires a factory object, isn't aware of the DIC. They're completely decoupled. And you can add a second level of decoupling by making your application objects be dependent on an interface of a factory, not the actual class - so that you can swap in a completely different set of factories e.g. for testing, or for using with a different DIC.
 
@Danack Sure, I didn't say it's not possible (the pattern you refer to sounds like the Abstract Factory Pattern to me btw.). The question by @Fabor was about the consequences which I think is to discuss here, not what is right or wrong.
 
Aye. Was definitely just a thoughts discussion.
 
2:17 PM
does it have any benefit to yield calls to fgets instead of just returning them?
 
It makes your code more l33t.
 
uh, case?
foreach (readLine() as $line) {}

function readLine() {
    while ($line = fgets()) {
        // process stuff on $line
        yield $line;
    }
}
 
yeah, doesnt look too useful?
 
foreach (readLines() as $lineObject) {}
can let you have some processing on the line
 
It can have far lower memory usage - and if the data is not actually used, then it's quicker.
 
2:21 PM
then in the foreach you can yield again...
it's more about using memory for one line at time rather than storing everything at the same time
yeah what @Danack said
 
@Danack @FlorianMargaine assuming fgets operates on a stream I doubt it will have memory benefits
 
you'll only have one $lineObject at the same time
 
@Gordon It depends what you're doing with the data after the function call. If you're just modifying a little bit (e.g. addslashes) before echoing it to the screen, then you will only have a single line in memory at once. If you're getting the whole data stream and doing an analysis on it all, then no.
Also, if fgets is slow (e.g. reading across a network) and you only need the first few reads from it, then not loading the whole thing, and only loading the bits you need saves wasted reads.
 
hmm, I'll just stick to return. thanks.
 
On an unrelated note. Any suggestions for dealing with food poisoning :(
Undercooked a pizza apparently. Stupid oven.
 
@Fabor Weetabix and yakult. And learn to cook.
 
@Danack heh. I got some shredded wheat. May do that. I think my oven temp thing is broke. Oven is on its way out anyway. Bought an oven thermometer. Trying it out now.
Great way to wake up on a Saturday :P
Cheers @Gordon. I got some rehydration salts around.
 
I didn't know rehydration salts were a thing people kept around.
 
Sure. Always keep some in the first aid kit. Extends from our days of travelling. Plus when I am playing basketball I sometimes take some after.
Also great way to end a heavy night of drinking.
 
2:58 PM
user image
6
 
Bas
@Gordon It's to much data man, for a few arrays
It get's so confusing at all points.
Maybe i could use 9 different arrays for all vehicle types?
 
@Bas in your array suggestion you posted I though you have got one array per vehicle type.
@Bas <- didn't you?
 
Bas
@hakre Ooh.. uhm. no it was for like.. 4 different vehicles
I'll show you the spreadsheet.
The row under every vehicle are the columns.
Which it needs
'auto' is car btw. lol
 
yes, that I do understand :)
So you already did the grouping. I'd say you can give that document a little love so that the same field really have the same names. So "Diesel prijs" is always "Diesel prijs" and not "diesel" sometimes. Or that all price values end with "prijs" in their name.
But the table shows already pretty good with what kind of data you've to deal with.
I assume you not only have different data based on the car-type but also a different way to calculate those taxes.
 
Bas
Thanks :) Yeah i just rushed it abit..
Nope, those are just direct prices, no calculations
 
3:51 PM
Well then not to calculate but how to lookup those taxes.
 
Bas
What do you mean?
 
Well in a program you call a function with parameters and you get a value back.
 
Bas
Yeah yeah
 
If it's now that in the function you do some calculation or do some lookup operation for that part of the program that calls the function it does not make much of a difference.
 
Bas
Yeah, its just a lookup operation
Based on which fueltype the car is
But look at this code:
/**
 * A placeholder to know which province is part of which data array
 *
 * @type {{noord_holland: (dataNoordHolland|*)}}
 */
var provincesWithData = {
    noord_holland: dataNoordHolland
};

/**
 * Holds all the personen car data
 *
 * @type {Array}
 */
var data = [];

/**
 * Gets every row in the personen_auto.js arrays, convert it to an array and store it inside a variable
 */
function generatePersonCarData () {
    /*
     Loop through all the provinces with it's data
     */
    for (var province in provincesWithData) {
 
3:54 PM
And fields like Provincie or Gewicht vanaf are input parameters or are those output?
 
Bas
both, the province where the car owner lives
and the weight of the car
matches with the "gewicht vanaf"
sorry.
But if you look at that code, it's already compatible with "personen auto" and "kampeer auto". The only difference with the "bestel auto personen" is that this one doesnt have a "provincie" field
 
if it's both, is the input always required or sometimes?
 
Bas
Always
That data doesnt change aswell.
Or atleast, nothing gets added by users
So actually this database is read only.
 
yes, you can operate on static files then easily.
 
Bas
Do you mean without using a databasE?
 
3:59 PM
@Bas the filesystem is a database btw. What you might mean is a dedicated relational database server like Mysql.
 
Bas
Oow, yeah.
indeed
 
you don't need that for the moment, but I thought we had past that point earlier already, or is that still not so clear to you?
 
00:00 - 16:0016:00 - 00:00

« first day (1526 days earlier)      last day (3416 days later) »