« first day (2148 days earlier)      last day (2814 days later) » 

12:00 PM
It's not quite as flexible as the Visual Studio Solution/Project system in some ways, but it's really not that much of a headache when you get used to it
even in Visual Studio I have each individual project as a git root, it works in much the same way
 
Cool I never thought of doing that
 
You can also do something in git called "submodules" but I don't recommend this
 
I will stay away from that so
 
such a beautiful world (-_-). ily all
 
If you want to have a general "projects" directory, but still have a "solution"-like layout, you can just symlink the projects into your "solution" dir
 
12:02 PM
Since all projects are in one directory you can deploy standalone but what if they are being deployed to different servers and need to reference classes from another project? It is fine while in development mode and they are all on the same machine. At that stage would I need to use composer
 
@tibanez well each project should have it's own git repo and composer.json anyway (I do this in C# as well)
well, without the composer bit, obviously
 
> I don't want them all in one project so they can be deployed standalone
What exactly is the problem with having files being deployed if they are never referenced by the running code btw?
 
I understand what he's getting at I think
The problem is that it's harder to modify multiple projects in a single IDE session
 
Jay
@DaveRandom are you here mate?
 
No, I'm over there -->
:-P
what's up?
 
Jay
12:05 PM
Dave I really need help
 
he's here ^
well not here ^ ; just above
 
@Jay ...with?
 
Jay
soap
 
I have an Accounts subdomain, Market, Billing, Profile, Recruitment etc etc. Each is essentially its own application, some use Slim framework since they are tiny and serve smaller purpose, two subdomains use Symfony. Each subdomain needs to be standalone and can be deployed on its own without having to deploy every subdomain
 
Jay
I need to create a service that lets people send xml which can be <element><1><data></1><2>data</2></element>
and return a result
 
12:06 PM
This @DaveRandom is a treasure to this chat room, they should be paying him a salary.
 
@tibanez I think the symlink thing could work well for you, assuming that what I said above ^^^ is the thing you are having difficulties with
 
Jay
@DaveRandom I will commission you
 
Create a "solution" directory, symlink all the "project" directories you want to work on into it, and open an IDE session with a base of the "solution" directory
 
@tibanez So what exactly is the problem in having them all be in the same project? Just have the composer.json for each deploy in a separate directory?
@Jay You're going to make him an officer?
 
@Danack can you sanely have multiple composer.json files in a single VCS repo?
(I have never thought of working like this so I don't know)
 
Jay
12:08 PM
£50
 
What could possibly go wrong?
 
@Jay OK well to start, generally the way you'd do this is with XML that looks like this:
<elements>
  <element>data 1</element>
  <element>data 2</element>
</elements>
 
Jay
I need it to be a class file that generates the wsdl
 
@DaveRandom Yeah that would be nice. The thing then though when it is time to deploy and each subdomain goes up to a different server. I'd do a composer install but it would not fetch any dependencies from the other projects unless I versioned those projects and put them in a private repo maybe which composer can then fetch from?
 
Just have lib directory that stores all the common libraries, and then one src directory that contains the app specific bootstrap code + one composer.json for each deploy.
 
ThW
12:11 PM
@Jay this is not valid xml, tag names can not start with a digit.
 
@Danack It's when I run composer install on the server it won't fetch the dependencies on the other projects unless I version those, put them in a private repo and reference them in the composer.json unless there would be a better way?
 
Jay
I know that was a sample
of a loop
 
/data -  this is a git root
  /project1
    /src - bootstrap code for project1
    composer.json
  /project2
    /src - bootstrap code for project2
    composer.json
  /lib - all common libraries
 
@Jay I get a shiver down my spine any time I read "WSDL" :S
 
@tibanez just put the deploy specific composer.json's in separate directories?
 
ThW
12:12 PM
@Jay wsdl means soap, you don't want to treat soap as XML, use a SOAP extension/library.
SOAP uses XML as a serialization format, you don't want to work on the serialization directly.
 
Jay
<drivers>
<driver1>
<forenames></forenames>
<surname></surname>
</driver1>
<driver2>
<forenames></forenames>
<surname></surname>
</driver2>
</drivers>
Something like this
 
@Danack this, but note that in practice @tibanez I generally just use composer in development. It really is not that much of a headache to set each project up in a repo and run composer update when things change. Unless you create a new project every day, but then you probably have bigger problems...
 
@Danack So you say I deploy project1 and 2 to different servers the /lib directory goes up with both of them
 
Sure - diskspace is cheap.
 
@DaveRandom In private repositories?
 
12:14 PM
@ThW I assume there must be some tooling to generate a WSDL and entities from an XSD or something?
 
ThW
@Jay bad/ugly format from the XML view, you don't need to number tags
 
Jay
@DaveRandom I need to set drivers and then other things and then get a quote
 
@Jay so you're using SOAP or not?
 
Right, what you need to do to start is forget about the "soap" element and design an object model
 
Jay
yes soap
I have a class
 
12:15 PM
I have no class
 
Jay
this is my class
 
it is not a class
 
Jay
which is used in setClass
 
@tibanez yeh or public, some of the libs/tooling I've written for work purposes is on github
 
@Jay it is a bladly named array
 
ThW
12:17 PM
@DaveRandom google says here is google.de/search?q=php+soap+generate+wsdl :-)
 
Jay
how so?
 
ThW
never needed this however.
 
@DaveRandom The only thing I want to share between the projects is Event classes like OrderPlaced. So for the Market subdomain I would create a separate library with these events, could add them to github or whatever, reference this library in the projects which reference them
 
@tibanez yeh, you create a separate library (as a "project"), give it a composer.json, throw it in a git repo (I use bitbucket for private repos because free private repos) and point the composer.json for the application projects to that
 
If I was to do that the thing is should the composer.json use dev-master as the version...it could be quite dangerous but I won't want to have to create the full package of events and tag it just so I can reference it in a more stable way
 
12:19 PM
You can use the symlink trick if you want to be able to actively develop more than one thing at once, but I've pretty much never found this necessary
 
Okay cool. I have a clearer path now thanks
 
@ThW I have github.com/DaveRandom/WSDLDistiller, I might write the opposite of it one day when I have lost the will to live
 
Jay
@DaveRandom Do you know how to do this?
 
ThW
@DaveRandom hehe, yeah with the libraries/tools soap is not bad. But you really don't want to work with its XML serialization directly.
 
Jay
So we can't generate a wsdl file with php?
 
12:22 PM
@Jay Not really, I'm sure I could figure it out though... what I'm 100% certain of is that what you need first, before you think about SOAP/WDSL/all that bollocks is an object model
@Jay What you generate it with is irrelevant. What you are generating it for is an object model
 
Jay
object model as in what does that do?
 
ThW
@Jay I just linked a google search. The first to results are SO answers to your question.
 
@Jay As in a client is exchanging messages with a server. The message consists of data, which is expressed in objects.
14 mins ago, by DaveRandom
<elements>
  <element>data 1</element>
  <element>data 2</element>
</elements>
 
Jay
$server = new SOAPServer(
'webservice.wsdl',
array(
'uri' => 'http://example.com/soap/server.php'
)
);
 
"elements" is an object that functions as an array of "element" objects
"element" is an object that contains data
 
Jay
12:24 PM
so webservice.wsdl. this I am confused about
 
The WSDL describes the object model
 
Jay
is webservice.wsdl a file? Does it exist? Is it built on the fly
 
It's a static XML schema document, that is generated from your object model
 
Jay
so its basically non existant
 
It's usually a static file, but it cannot exist until you have an object model for it to describe
You generate the WSDL file, and the PHP code that goes with it, from an XML schema, usually
Microsoft have a shitload of tooling to abstract all this away, which is why I said you should create this thing in ASP.net
because the tooling is just not mature enough for any other arch
because every other arch realised it was a terrible idea a long time ago
 
Jay
12:28 PM
ok
All other systems apart from php will communicate with this soap service
we only have php networks
 
The theory of SOAP is that it's platform agnostic. The practice is that they way in which it is platform agnostic is that it is consistently broken on every platform
I have an idea
@Jay pretend that the task is to do that sane thing, which would be to implement this in JSON. Design that API (i.e. design the endpoint layout and the messages that would be exhanged by those endpoints). That's your object model.
From that, you will be able to design a schema, and from that, you will be able to create you WSDL.
Then you only have to write that code \o/
 
6
Q: Jquery Calendar with Time Slots selection

Punit GajjarI want to create Appointment Booking feature in PHP. I want to have a calender in which user can select date and in return calender shows the time slots to select. Time slot will be static. It might can be Dynamic in future, You can check the example on below link. https://getbooked.io/ sea...

which is the related (best) answer in given question
 
Anonymous
12:45 PM
@VishnuBhadoriya Nice trick to try and get upvotes. If you don't receive a response, best to just leave it and let the OP decide.
 
Anonymous
And if you are that eager to earn rep/bounties - give better answers. Just code answers aren't worth a bounty or upvote.
 
thank for your effort
 
hope all my American friends have big plans for this weekend :)
 
1
A: How to get count of distinct XML nodes?

SherifWhile your solution works, and pretty efficiently given that it operates in O(N) time, I figured I'd propose an alternative solution that doesn't rely on arrays or references and is more generalized to work, not just for XML, but for any DOM tree. Modeling The Problem The easiest way for me to ...

I'm actually quite happy with that answer :)
 
12:54 PM
Quick, someone buy ho.ly and just put SHIT in <h3> in the middle
 
Anonymous
@Sherif Could of put some effort into it :/
 
@JayIsTooCommon Yea, I suck.
 
@Sherif seriously... don't just post an answer and not attempt to explain it :P
 
Well, it was a good question. It's one of those problems that looks deceptively easy to solve, but is actually quite difficult to generalize.
 
@Sherif For you, maybe. :P
 
12:57 PM
I thought I'd at least document what I did if even just for me, because honestly I was confused at first.
 
well written
 
@salathe It was for me, actually :)
 
@brzuchal I guess - though it probably needs to be something most people recognise.....If they don't understand (or like) the example then it probably wouldn't be persuasive.
 
@tereško o/
 
\o
 
1:01 PM
When you have to pick a router for basic functionality but a high range, which brand would you choose?
 
A real router or an access point?
 
"Range" is a very, very complex subject in 802.11
One really important thing you need is a detachable/replaceable aerial
Since most things ship with a yagi antenna, and that's not always what you want
Also it depends heavily on the devices that you are using
I have a personal preference for Draytek for personal use, for high-end business applications HP
 
I will tell you were it's needed for: A ethernet cable appears at a 'booth' in a large exhibition hall. Someone needs 1 ethernet cable for a device ( so the router will do have a output to that device) and further I need a good Wifi signal for a free open network which is send by that router
 
I usually stick with Cisco products, personally.
 
> in a large exhibition hall
you're fucked
sorry
 
1:05 PM
> a good Wifi signal
 
Yes good WiFi Signal is important.
 
If the booth isn't that big, would something with beam-forming help mitigate the ludicrous amount of background noise?
 
@Duikboot There are about 15 channels available for wifi. How many wifi networks do you think will be operating at once in this exhibition hall.
 
^ this is the crux of the problem. You will drown in noise in an exhibition hall, because everyone will have the same idea.
@Duikboot You want something that does switching, not routing
 
so just make sure all of your devices can do IP over Bluetooth. Problem solved!
 
1:07 PM
You don't want a pointless extra layer of NAT
 
Just receveid more info :D
 
AP with built-in LAN switch and dual-LAN for isolation, if you want it broadbandbuyer.com/products/19923-draytek-ap810-k
 
There will be not that much wifi networks. ( It's more a seminaire for max 60 people divided in 3 classrooms )
 
@Jimbo It's been registered since 2006
 
> ho.ly is for sale! Current bid price: $30
 
1:10 PM
ah one of those, where there is a secret reserve :)
 
@Duikboot How physically large is the required coverage area, and how much structural interference is there? (walls/other booths/general metallic objects/people)
 
@DaveRandom > @Danack So now I know there won't be that much signals ... it would make it more easy
@DaveRandom Just asked that question :) waiting for response.
 
I'm going to guess you are looking at more than 1 AP, based on what you know so far
 
I have to come up with some things for a personal development plan, I can't think of anything I want to do to improve myself, does that mean I'm too awesome?
2
 
And probably omni antennas
 
1:11 PM
Sounds already a high-end solutions for... 60 people?
 
it's not about the number of people, it's about the space
 
Will get more info about that in a few minutes.
I asked the locatoin of seminaire with the largest location
Also if there are different floor-levels.
 
This needs a sit survey before any sane decisions could be made, I suspect
This may have come up before, but I FUCKING HATE 802.11 wireless
 
Why? do you hate that?
 
Because it consumes power like it's going out of fashion and doesn't work properly
 
1:14 PM
Is that for all 802.xx? versions?
 
Every iteration they say "look! we made it better!" and what they mean is "look! the poor design decisions we made 20 years ago are unfixable so we made it faster and we're hoping no-one will notice that it only works correctly when you have your own personal nuclear reactor and you stand in precisely the right place"
 
How do I check if the id not exist in php
Code:
`while($query->fetch()) {
if(id exist) {
echo "<script>$('#CmtPostedBy-" . str_replace(array(' ', '[', ']'), array('_', '', ''), $UserName) . "').html('<img class=\"UserPicBarSmall\" src=\"" . $UserPic . "\"></img>');</script>";
} else {

}
}`
oops
 
fucking DECT is more useful
bluetooth works better
it's madness
 
What are other options for internet?
 
The solution to every wireless problem I've ever had was to just give up and run ethernet
 
1:17 PM
@Duikboot there aren't any, that's what drives me so mad
Well, there's a load of static LOS stuff, but nothing for last-hop devices
 
Well I have just did the following: [ router (house) ] -> )) Catch good signal [ access point (garage) ] ----->ethernet cable ( 60m - 60CM under the ground ) ----> wifi broadcasting at garden
And I'm happy with it it works well.
 
That's because it's in your house, which is a relatively small and radio-quiet zone
 
nevermind, I already solved it
 
(I once spent a summer trying to put a working WiFi network in here and I barely survived the experience)
 
If you've been in a cramped (college apartment) environment where everyone brings their own AP, you'll learn about channel fighting real quick.
 
1:20 PM
Nice place wow
 
Indeed, and you'll notice that every office with >10 people in it has flakey wifi, just because there are so many bodies and devices and there's radio noise everywhere
 
Ok but let's assume the space won't be that large at all,... When I pick a router; When looking at the Ghz-band of a router... What does that mean?
 
yes, yes it does.
16 mins ago, by DaveRandom
you're fucked
16 mins ago, by DaveRandom
sorry
 
Keep in mind, 5Ghz is ideal for connecting in smaller, open spaces, a
On the other hand, if you like to work outside or live in a large house with many walls between you and your wireless router, then connecting to the 2.4Ghz band might be your best option.
I get that, easy to understand but what's the impact?
 
Anonymous
@DaveRandom fuck that must have been difficult
 
1:23 PM
You have no idea
But here's the thing: we simultaneously installed a multi-base DECT system, worked first time, forever
There are walls in that place that are (I shit you not) 5ft thick
"2.4GHz is full, let's ruin another part of the spectrum!"
 
@DaveRandom I got news: Max distance is 100 meter incl. 1 floor level, sometimes the walls will be in wood, sometimes they wel be in concrete.. But the maximum distance will be 100 meters.
 
I got rhythm
 
First sentence in book. I think I like
 
That's not less... 100 meter imo.
 
Anonymous
@DaveRandom Not a clue what any of that means but I used to do work here judithwolfe.wp.st-andrews.ac.uk/files/2015/05/… and the solution was to just dot waps everywhere.
 
1:27 PM
Hey, why the plus one in this date('z')+1 when we want to get the day of the year ? :o
 
@JayIsTooCommon That works as long as you have someone that understands boundary layouts and band spacing
(which I do not)
 
Anonymous
@DaveRandom Which wasn't me, but boss was a freak and knew that stuff :P
 
@Duikboot I would take 3 APs with me, pre-configured on 1, 6 and 11, and a set of different types of antennas, and just experiment. Although of course that relies on you being able to run ethernet to where you need it
I'm 99.999999% certain that one AP is not going to give you full coverage
The multi floor level thing is heavily dependent on what the floor is made of
If it's concrete and rebar then you're gonna have a bad time
@Joseph I assume because the system that PHP uses for z is that the 1st of Jan is considered to be day 0, whereas the system you are talking to considers the 1st of Jan to be day 1
 
@DaveRandom yes i figured
when i am doing this DateTime::createFromFormat('Y/z:G:i', $date )->format('Y-m-d H:i:s') it is adding a day :(
so if i use todays date it creates tomorrows :(
 
!!> echo DateTime::createFromFormat('Y/z:G:i', '2016/212:9:12:!1' )->modify('-1 day')->format('Y-m-d H:i:s')
oh duh
 
1:36 PM
hey Dave i am not looking to make it work i am looking to understand why is it adding a day :/
 
3 messages moved to bin
god damn it :-P
 
Anonymous
xD
 
try again
 
3 messages moved to bin
yeh so @Joseph that is why, it's because your data is coming in with a 1-based z value, but PHP has a 0-based system
so all you need to do is ->modify('-1 day') and you will get the right timestamp
although it will explode on the 31st Dec of a leap year, I guess
ugh, you'll have to preg_replace_callback() probably would be the sanest thing
 
Thanks @DaveRandom :) !
 
1:41 PM
yw, sorry I don't have better news for you :-(
 
My issue with netgear is that they are not made to last, in my experience. I've had routers and APs fail a lot of times, and I even had 2 netgear 48-port switches go when they were about a week out of warranty :-(
 
this guy's cv presents "zend certified engineer". should I pay it any mind?
 
ZCE isn't worth nothing
 
Jay
1:44 PM
how do you distinct a column and select all columns at the same time?
in sql
 
oh oh, currently running it 2 months now. ( On that NetGear stuff)
 
@Jay distinctly select all columns?
 
Jay
SELECT DISTINCT(email_address), * FROM table ?
I dont want to return duplicates
 
distincly, select, all columns
 
3AP's where you mean to grab the signal everytime at a good spot and extend it again?
 
1:45 PM
@Duikboot I haven't bought netgear for years, maybe they are better now, who knows. I buy Draytek because they provide enterprise features at SOHO prices, and they have a support department where competent people actually answer the phones and respond to emails.
 
Jay
@FélixGagnon-Grenier I dont understand?
 
distinct(field1), distinct(field2), etc.
 
What are soho prices?
 
Jay
o
I dont want to distinct other fields
just the email
but with the same query I want to be able to return every columns
 
do it in two queries
or: what does it even represent (in your own words) the query you are trying to write?
 
1:48 PM
@DaveRandom not sure i understand , what should this give ? echo DateTime::createFromFormat('Y/z:G:i', "2016/246:15:46" )->format('Y-m-d H:i:s')
it's giving tomorrow
how is that logical ?
 
protip: distinct returns a number or rows defined by (obviously) how many different values there are in a specified column. how do you link these to normal query result?
 
@DaveRandom intentional double negative?
 
@DaveRandom Seems a little more $$ then a other brand.
 
Jay
@FélixGagnon-Grenier I have a db table with results. 5 columns. One of the columns is email_address which has about 3 results per email. I want to only return one email but also return the data on the same row
 
!!> echo DateTime::createFromFormat('Y/z:G:i', "2016/246:15:46" )->modify('-1 day')->format('Y-m-d H:i:s')
 
@Joseph ^
However, I suspect...
!!> echo DateTime::createFromFormat('Y/z:G:i', "2016/366:15:46" )->modify('-1 day')->format('Y-m-d H:i:s')
 
I think your expected result there would be dec 31st?
oh wait, duh :-P
 
Right yeh, it does work fine
 
1:55 PM
@Jay "the same row" means nothing. there is no "same row". maybe what you are looking for is a way to have one row per email address, through the use of some aggregating construct like GROUP BY
 
you can just subtract 1 day from your PHP date object before you call format()
 
It's a jquery ui date picker ...
but it works just fine for me on the thirty first of december
if i do this
DateTime::createFromFormat('Y/z:G:i', "2016/366:15:54" )->modify('-1 day')->format('Y-m-d H:i:s')
i get this 2016-12-31 15:54:00
how did u get 2017 :o
@DaveRandom oh didn't read this one :D , Thank you , yes it does work fine
 
Annnd in Thailand, it's hot and dark.
 
racist
 
lol
 
2:02 PM
:P
 
good flight?
 
mrgnn
 
/me interviews a 30 years old pedantic zend engineer that values laravel to the point of making it a key feature of their cv in 5 minutes
 
Interview him. Interview him in the face.
 
2:06 PM
@FélixGagnon-Grenier that's sad
 
the saddest part is they're are the worthiest ones
/me out now
 
@bwoebi We look up closures by name? What?
 
@LeviMorrison how would you lookup them then?
 
They are defined right there - just use an address on stack or something?
 
@LeviMorrison uh… and the precompiled op_array*?
do you expect we'd recompile Closures just in time they're instantiated?
 
2:20 PM
When is 7.1 RC 1 due?
 
it's out
 
Grumble, did Scott finally execute the mcrypt RFC?
Looks like no
 
@DaveRandom Not bad. Leg room was okay but sleeping was attrocious
 
@bwoebi No, that's what I mean. When the closure op-array is compiled it is separate, but the code that declares the closure it would just put a reference to it in bytecode (not have to look up by name or something).
Meh, not sure I made enough sense there.
 
@LeviMorrison our opcode ops are 32 bit wide
 
2:23 PM
ops are not
 
I believe we could do an union {} though to merge the 2x 32 bit into a pointer
@LeviMorrison (ops = operands)
 
I was sure I'd seen 64 bit in places. Guess not.
 
How can I understand whether is my website "utf" or not? Actually I'm trying to follow this sentence:
> if your websites are utf, use htmlspecialchars(), otherwise use htmlentities().
 
@bwoebi would you give me a hand in debugging a strange php7 soap problem?
 
@staabm yes, though, soap sounds scary
 
2:25 PM
@LeviMorrison Do you mean my website ins't "utf"?
 
@staabm does it involve references?
 
@NikiC I guess not
my soap requests succeeds when send without gzip but php dies when using gzip
without a error
soapserver->handle() never returns
it produces a "bad request" xml-fault error and dies
php -v
PHP 7.0.10-2+deb.sury.org~trusty+1 (cli) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
with Zend OPcache v7.0.10-2+deb.sury.org~trusty+1, Copyright (c) 1999-2016, by Zend Technologies
 
Where the gzipping is done by PHP or by the webserver?
(because you should do the latter)
also what the hell is with this SOAP server in PHP shit today
 
we activated gzip in the soap client (php implements only the server part)
just migrating a php5 app to php7
 
Is this a PHP extension we're talking about (SOAP server)… or is the server built in PHP?
 
@staabm ah … then there's some hope it's a trivial bug
 
and it only errors for some of our services.. some work also with gzip ;)
 
Yeh, I'll have to look to see
 
@bwoebi ok, team viewer?
 
@staabm yep, just drop me a mail with credentials
 
2:33 PM
your email?
 
@staabm doesn't change :-P bobwei9@hotmail.com
 
on its way.
 
@bwoebi Does this mean we don't cache any function lookups?
 
2:49 PM
I read sessions are preferable to cookies for logging a user in. I'm using cookies at the moment. The cookie stores a token and this token is stored in the database in a hashed form (using SHA1). If the raw cookie token and the hashed token in the database don't match the user is logged out. Is this secure? Should I be using sessions instead? I can manually log people out by deleting the hashed cookie from the database, I read that is an advantage of sessions.
 
@tereško they were also an asshole.
Mr. Are Souls in the flesh
 
@Francis Sessions are usually implemented using cookies. Security-wise, what matters more is how you generated that hash
 
@FélixGagnon-Grenier you shouldn't hire someone just because it's the "least stupid person"
 
I use bin2hex(openssl_random_pseudo_bytes(64, true)) to generate the raw token, then I hash it using SHA1 before I send it to the database.
 
neither option is inherently more or less secure, it depends entirely on how your implementation works with them
 
2:56 PM
@tereško point taken.
they were also defending the architecture of laravel
 
@DaveRandom do sessions make you less at risk of CSRF compared to cookies
 
and everything but insulted me when I asked them to confirm their grasp of oop by explaining me polymorphism in their words
 
@Francis no, because they are implemented using cookies. Again, security is not an inherent property of either option, it's about how you use them ;-)
@Francis then using sessions would be no more secure. There are other reasons you might want to use sessions instead, but there are also reasons that what you are doing might be a better fit for you, it's not a trivial question
Step zero, security-wise, is to make sure that your application is HTTPS-only, and that all your cookies are flagged as such
 

« first day (2148 days earlier)      last day (2814 days later) »