« first day (1027 days earlier)      last day (3927 days later) » 

9:01 PM
@igorw I don't like it. a) () looks like a call, not a reference, and b) it would be too easy to forget to add the parens and too easy to misread.
 
@igorw In response to your request for keys() on a map: I've added a KeyIterator though I don't think I'e pushed ityet.
I know you closed it as you had a workaround.
We also have each on a collection now as well.
 
@DaveRandom any better recommendation ?
 
@Baba In the UK or in general?
 
@DaveRandom kind of reminded me of how pointer declarations in C are made to look the same as how you dereference them.
 
Not that it makes that much difference I suppose
 
9:07 PM
@DaveRandom In general .... if they can understand English
 
@igorw Yeh I don't like that either :-P
@Baba VPS or what?
 
@LeviMorrison is there a keys() method that returns one?
@DaveRandom it generally feels inconsistent to me. what I do like about it is that it would mix nicely with use statements.
 
@DaveRandom Yes
@DaveRandom Dedicated or Cloud
@DaveRandom But i prefer hybrid .. don't want Database in cloud
 
@igorw Yeh I admit I've thought that use function is a bit clunky, but at least it's nice and clear
tbh I don't like use, I'd much rather import things, but that's very much nitpicking
@Baba I've had good results from vpscorner.co.uk but tbh I'm a little out of touch with the market, I have administered physical servers myself but in terms of managed hosting platforms I don't have a huge amount of (recent) experience.
 
@DaveRandom there's a java for that
 
9:13 PM
@igorw Yeh I know. But doesn't it sound so much nicer?
 
@DaveRandom I would appreciate if you can help me do some little research on hosting platforms when you are free
 
@Baba It would be worth just asking who uses what in here (amongst the regulars) and probably go with the most frequently used that isn't 1andCrap or GoShitty
 
@DaveRandom cool
 
What's that actual use case here? What kind of spec are you looking for?
 
@DaveRandom I would ask around too
 
9:17 PM
So @DaveRandom was there anything besides the use eval here and here that would prevent you from using the library in a production environment?
To be clear, I mean more the concept. Setty is not intended to be used in a production environment
 
@DaveRandom Child Protection System , Image processing , Biometrics , Multiple Interface Mobile , web , API ... , Geospatial Calculation , Update Stream etc
 
@Baba I use digitalocean.com and so far, would recommend them
 
And even with my idea it wouldn't be the intention to use the actual library itself in the production environment
 
@cheesemacfly thanks .. would do some digging
 
@DaveRandom yeah, it's definitely nicer. and avoids stupid sentences like "how to use use"
"are you useing the class?" "yeah I'm using it"
 
9:19 PM
What I'm not particularly fond of is how the PHP docs utilize the term use and import
 
@cspray It's basically the evil() calls yes. Although if the alternative is reflection I'm not that keen on it either because it is sloooooow. Admittedly in the general case that's not a huge problem but it would be easy to get complacent and overuse it and then it will make a noticable difference
 
@DaveRandom Nope, I wouldn't use reflection either
I'm anti-reflection unless absolutely necessary and I don't think it is here
 
I am intrigued...
 
Essentially I would refactor to provide some kind of "Printer" interface that aggregates the autogenerated code into a single file or even a PSR-0 compliant directory of classes
 
@Baba I'm just looking for something posted the other day, hang on
 
9:22 PM
You would then include that code in your production environment
Either including the singular file or setting up autoloading to work with a different package system
 
@DaveRandom Ok .. thanks
 
@Baba found it - I know @Leigh and @Jimbo recommend those guys
@cspray So kind of pre-compile on deployment? I could probably live with that
 
Who can speak Farsi؟
 
@DaveRandom Yes, obviously you have some additional overhead of managing the integration of this autogenerated code
But I don't think it would be that extreme to be honest. Typesafe enums are probably gonna be something that you create one time anyway and not need to constantly recreate or add new values
At least from the use cases I've come across with them
I would probably also wind up transitioning to generating the code with NickiC's PHPParser
Then you could really do some cool stuff, generate enums with custom methods on them and really control what's going on better and be able to expose customization of the enums (namespace, names, available methods) more easily
 
9:29 PM
@cspray agreed
 
what is the fastest way to convert decimal to binary? base_convert has limitations of the input. Using bcmaths, its not that fast. Any alternative?
 
@cspray enums with methods is kind weird tbh, I think of them as basically just a finite collection of constants
 
@NokImchen Again, go read amazon.co.uk/Data-Compression-Book-Mark-Nelson/dp/1558514341 and stop being annoying.
 
@DaveRandom Nice ... let me check it out
 
@NokImchen Your only other realistic option might be gmp_strval ... And listen to @Danack.
 
9:32 PM
@DaveRandom I agree, to an extent. While I certainly can't picture many use cases where this would be necessary having worked with it a little in PHP I try to intentionally tell myself when working with Setty that enums are not just constants. They're full fledged objects
 
@DaveRandom 128 euros ... Looks good
 
@NokImchen Just how large are the numbers that you are dealing with that simple bitwise ops won't cut it?
 
@DaveRandom He's trying to write his own compression routines or something.
 
I have few cases problem،Please help?
I'm Persian language
 
@Baba I've not checked it out properly tbh, the only thing I'm running at the moment is a vpscorner VPS for £9/mo but it's basically just a playground, I have very little traffic so I'm not sure how they hold up under load. I've heard good things though
@Charles dafuq
 
9:35 PM
Man, this whole compression thing seems like a really bad case of deja vu
 
@DaveRandom thanks .. i would probably need about 10 servers but i would get some sample servers .. do some test and benchmark
 
I mean fair enough, learn how compression works, but go read materials from people who know what they are talking about instead of bouncing ideas off the collection of reprobates usually found in here @NokImchen
 
deja vu all over again
 
Groundhog Day reimagined as a horror film
 
@cspray Groundhog day is a horror film.
 
9:36 PM
No, it's compression. So more like Grndhg Dy rmgnd s hrrr flm
It's not a lossless algorithm, I'll grant you
 
@DaveRandom Ah, I see you've discovered disemvoweling.
 
@DaveRandom They set it in Wales?
 
@Baba I believe @Leigh has been using them for quite a while, and @Jimbo has had one for a few mths I think, so they can both probably give you some decent real-world feedback
 
how to add new font in tcpdf,i try but no show text in pdf file
how can fix it?
 
@DaveRandom Cool ... thanks for the help
 
9:39 PM
@Danack Not enough Ls
 
But, anywho, @DaveRandom I'm not sure I'll ever wind up implementing typesafe enums like that though. So far you're the only person that's expressed even remote interest in the concept, let alone my implementation, and I have other projects taking more precedence.
 
@Charles ts ttlly wsm
 
@S.MuhammadMahdiMirkarimi Whenever someone comes here asking about PDFs, I usually point them at wkhtmltopdf so they can just use HTML and CSS instead. This may or may not help you.
 
@:11149621 @:11149608 ok :(
how to reply to 3 post at a time? :|
 
@igorw No, but I could add one I suppose. Did you have a use case besides iteration though?
 
9:41 PM
@cspray The biggest shame about that is that if there's that little interest in it, the changes of a proper impl in the core happening are pretty much zero :-(
 
@cspray You have a typesafe enums project?
 
@NokImchen just @mention the user names instead of replying to a specific post
 
@DaveRandom Well, it isn't exactly like I've been marketing it or advertising it
I suck at selling myself
Really the project was more so I could muck around with code generation
 
@LeviMorrison I don't remember tbh. but I generally would expect such a method to be present.
 
I just happened to implement typesafe enums with it
 
9:43 PM
@cspray I hear that only too well
 
Is "application logic" and domain/business logic the same thing?
 
i wish i could point the topic cos sometimes ppl get busy with another topic and forget what they said (atleast i do cos m sooo forgetful) :(
btw, thanks for the alternative :)
 
@NokImchen You can reply to one post and @mention as many other people as people you like and everyone will get a ping
@NokImchen @PeeHaa will get a ping from this, which is fine because he needs to be annoyed more.
 
I agree. @PeeHaa is not pinged enough.
 
@Charles Thank you, one more question, my account has been blocked on this site, what should I do?
 
9:46 PM
@DaveRandom lolzzz dont do that , he'll kill u, hack ur pc and fill it annoying adwares :P
 
pfft, @PeeHaa is all bark
 
@S.MuhammadMahdiMirkarimi If the error message points you at the Help Center or at a URL, go read the article it links. If the error message does not tell you to go read something in the Help Center or does not give you a URL to visit, then you might want to go over to the Meta site and use the search there for the error message. This will give you information on why you might be blocked.
 
Hey @PeeHaa do you think you can help @S.MuhammadMahdiMirkarimi? His account is blocked on this site; what should he do?
 
That's okay @PeeHaa, I took care of it. No need for us to keep pinging him over and over and over.
@PeeHaa and over.
 
@Jeremy I'm voting to close that post as "Not Constructive". IIRC the term "business logic" originates in PoEEA, I'm not sure about "domain logic" but I think it's usually used in the same context as "business logic", and "application logic" is far too generic to say for definite that it applies to something specific.
 
9:48 PM
Please help: http://stackoverflow.com/questions/18136161/php-xpath-search-returning-0-results

It's driving me crackers x]
 
@Charles Thank you
 
where's that website where you can view/sauce/search PHP's source in C?
 
@JoelKidd You shouldn't need to registerNamespace() at all for that, but the way you have done it the XPath you would need would be //transXchange:AnotherChild/transXchange:id
 
@DaveRandom Thank you so much Dave.
@DaveRandom Would you mind posting that as an answer?
 
@JoelKidd In a few mins, I'm just about to go for a smoke :-)
 
9:52 PM
@DaveChen lxr.php.net
 
thanks. Just checking on a lower level the differences between fmod and bcmod
 
@DaveRandom Ok cheers man, enjoy your smoke :P
 
10:04 PM
I just ran a quick test, bcmod and fmod return the same results... http://3v4l.org/Wcl28

what is the difference between bcmod and fmod?
 
10:20 PM
@DaveChen for one, they're from different PHP extensions
at a glance, the major difference is that bcmod is for integers, fmod is for floats
 
can you really mod a number with decimals? :P
 
> float fmod ( float $x , float $y )
 
one sec :D
well since fmod works with floats and integers, and is faster than bcmod...why use bcmod at all?
 
10:38 PM
I'm trying to write a script that evaluates code on a site to submit with my resume. How can I eval a for loop from a string? I'm trying to keep it to one file so I can include it in an email I'm going to autosend.
$send_resume_to="@somewhere.com";for ($x=1; $x<5; $x++){ $send_resume_to = $x . $send_resume_to;}$send_resume_to = substr($send_resume_to,1);
 
If I echo something while its inside of a private function, will it still show on the screen and will the other functions still be able to get the values that are echoed out?
 
@Stephane Sounds like a bad plan tbh, do you really need to eval() ?
 
DaveRand, do you know of another way of evaluating code that's a string?
I'm just having fun
it's just for one appication
 
@BrandonGelfand echo writes stuff to the output buffer, no matter where it is called from. "Other functions" can't access that data unless you use the buffering mechanism to capture it, which 99% of the time is code smell IMO. You should probably just be returning the data.
 
@Stephane The fact that you need to do this is the code smell. Why do you need to eval a for loop again?
 
10:46 PM
@Stephane If you want to evaluate instructions like that really you need a DSL with a parser and an evaluator I would say. It is very dangerous/bad practice to evaluate arbitrary user input as PHP code
 
Its a form dave and I am setting the values so the users can't change them but the only way I can make it so the users can't see it there is by doing display:none
 
@Stephane What if i submit exec('rm -rf /');
 
You can't. I'm scraping a specific page
 
@BrandonGelfand Why do you think that the users can't change those values?
 
@cspray cause i removed all the options that used to be there :)
but the ones that i wanted them set to
 
10:48 PM
I'm not interested in security for this. I'm interested in running code that I've scraped.
I think I figured it out. A quote issue
 
"I'm not interested in security for this." <-- this makes me sad :(
 
@cspray I am not sure how I can hide the html from the page other then using display:none
 
Are you dense? I'm writing a simple one-off script for myself only.
 
bad move
 
I don't want it to be sloppy like that though, I want to make it so that way it can't be seen by anyone
 
10:49 PM
@BrandonGelfand You can just not output it in the first place
 
Gotta love chat where people can't answer questions so they troll you with unhelpful comments.
 
@DaveRandom I have to because its a form with all the data already set
They still have access to the form but they can only change a few parts and all of it needs to be there or it won't work
 
@Stephane Nobody here was trolling you. You came in and asked a vague question about eval. We typically find that evil and we expressed our concern. You obviously understand the concept of evaling a string so what were we supposed to do with no code besides suggest an alternative?
@BrandonGelfand Well, in this situation I say don't output it like @DaveRandom suggests. Even if you put display: none I open up my Chrome web dev tools change that to block and bam I see your HTML
 
I gave you code. I'm trying to eval the string I posted and it's erroring. I appreciate the concern, but not after I've explained it's a one-time use page.
 
@BrandonGelfand Then I suspect your back end needs to be redesigned in such a way that it will work if it's not all there. However, an alternative option would be to hide the options you don't want to be displayed by using <input type="hidden"> for those options
 
10:52 PM
@cspray I know that, thats why I was asking about a private function. But the code is HTML not php so how do I not display it?
Is there some sort of wrapper or something I can use @DaveRandom ?
 
@BrandonGelfand /shrug, I don't know; sounds like problems with your architecture imo. I don't have this sort of problem with personal code
 
I don't really know anything but HTML and CSS atm cause I am still learning :/
 
I just don't find situations where I need to echo HTML out of functions
 
@cspray I am not doing that now, I was thinking it would still have the values in the back if I did and when the form was submitted it would still send it all
 
Sorry, I got my back up because I've seen others and experienced myself getting the "You have an issue with Apache? Duh, use nginx responses"
 
10:54 PM
the user still wouldn't be able to see it though
 
@BrandonGelfand Nope, doesn't work like that. If you "echo" something the user gets it
 
Yeah I know
I was hoping if it was inside a private function it wouldn't though
 
Well, your hopes have been crushed like a pitiful bug. If you "echo" anywhere it goes to the user.
 
Ok :/
Time to get back to the drawing board.... be back in a bit
 
Unless you do some output buffering, capture the echo'd content and don't send it. But, that's not something I think you should be looking at at this point
 
10:56 PM
I remember when I first started in web dev I really could not get my head around the client-server separation. I have spent the last few years trying to come up with a way to sum it up in a few digestible sentences but it's really hard to explain :/
 
@DaveRandom I got into web dev purely on HTML, CSS and JS
I know HTML and CSS fairly well and the separation of client/server has just always been apparent to me. I wonder if how we got started in it has anything to do with that
 
I suck at CSS, and I'm forever being bollocked for my HTML
@cspray Quite possibly, I really started out in desktop apps (VB6 :-() where everything is a bit more self contained
 
@DaveRandom I started getting into creating static websites early on. Then I got into using VBA for a job; basically we were copy/pasta some data from an intranet webservice into a spreadsheet and creating a report on Fridays. I decided that sucked and automated it
 
Actually I suppose technically I started out in QBasic, but getting computers to print rude words when you're 7 isn't really programming.
 
And I just kinda caught the programming bug so to speak
I am still relatively newbie in the programming industry
I didn't get started seriously with computers until relatively "old"
 
11:01 PM
@cspray I am currently working with VBA quite a lot at work and I hate it, myself, and everybody else. I may start killing soon.
 
16-18
@DaveRandom Yea, I actually tell myself sometimes looking through some of the PHP code I work with "At least it isn't VBA"
 
Well as I was saying to someone earlier, it actually doesn't have to be as bad as it is on the face of it. If you decouple yourself from MSO and just use it as a DAO layer and the interface to the form layout, you can pretend it's just VB6/winforms if you squint a bit
 
@DaveRandom Well, this was my very first real programming ever; it spawned out of me discovering the VBA editor in Excel and looking at MSDN Office website. That code, if I still had it today, is probably hideous
Hideous beyond words
So I don't understand the concept of "clean" VBA
 
11:18 PM
@cspray The trick is to hide the hideous stuff in modules that you never need to touch, so your active code can be fairly clean, like gist.github.com/DaveRandom/5582494 - so I can do a single clean RegExp.Test("/foo/i", "subject with foo in it") instead of 9000 line of code
 
@DaveRandom you don't have to, you can always visit cv-pls.com and grab the compiled copy served to browser, If you access the less file with ?raw it will show raw output of the less file, I'll add raw_css as another flag so it will show uncompressed compiled CSS.
 
That code uses regex to allow you to use PCRE syntax regex. The code in itself is hateful, but the API is clean and simple
@crypticツ I've created a branch to work on, I'm planning to create a deployment-time script to do a one-time build, although the real point of the branch is to create a daemon to handle the API communication in such a way that should avoid the accidental bans
@crypticツ Can you sort @Wes out with owner rights on the HTML/CSS/DOM organisation? He wants to create a new repo
 
@DaveRandom just did
 
winner :-)
 
added all the css chat owners to it, well the ones who have github accounts
 
user652649
11:29 PM
@crypticツ kkk thank you ;)
 
@crypticツ Where is @ka these days? not seen him in here for a while
 
@DaveRandom he's probably somewhere locked away in some bunker creating regexs
 
user652649
@DaveRandom he changed his nick, now he's called @CSᵠ
 
@crypticツ lol
@Wes oh yeh I did see that actually, still not seen him for a while though :-P
 
11:35 PM
@Wes I want my free oxygen. What do I have to buy?
 
user652649
xD
 
@Ocramius need your input on this github.com/PHP-Chat/CVBacklogUI/issues/11 since you contributed the cache code.
@DaveRandom how does licensing work if we bundle 3rd party libs like PSR-0 and PSR-3?
 
Hi , if I have an array e.g $data = array('error' => 'my errormessage');
and I want to add an item later e.g ('error2' => 'my errormessage2');how can I do that ?
use array_push()?
 
@crypticツ Depends on the terms of the licenses of the 3rd party libs. I think php-fig stuff is MIT licensed (so you can pretty much do what you like as long as you include the original license for the imported codez)
@Athanatos Just do $data = array('error' => 'my errormessage'); $data['error2'] = 'my errormessage2'; <-- $data now contains both members
 
@DaveRandom thanks :)
 
11:49 PM
np
 
@DaveRandom I think it's a PHP FIG license github.com/php-fig/log/blob/master/LICENSE not sure how that would work O_0
 
@crypticツ That's MIT
 
@DaveRandom wohoo banned again for 2hrs
 
@crypticツ I'm going to do a small PR tomorrow that should hopefully patch it. What PHP version is you server running?
 
@ircmaxell hey how's it giong, long time no see. I just discovered you had a Youtube channel! good work.
Does anyone here have any experience with the Laravel Framework? laravel.com
I've seen it popping up recently and from what I have seen from it I really like it so far.
 
11:59 PM
php code2
Warning: scandir(Main Dir,Main Dir): The system cannot find the file specified. (code: 2)
 

« first day (1027 days earlier)      last day (3927 days later) »