« first day (732 days earlier)      last day (4210 days later) » 

1:01 PM
@Sem No an IP address on its own is not valid (it shouldn't be), you'd want to do @\[(?:ipv6:[\da-f:]+)|(?:(?:1?\d{1,2})|(?:2[0-4]\d)|(?:25[0-5])\.?){4}] or something equally horrible to strip out the @[ip] type addresses (not sure if that IPv4 pattern is even right, don't have time to check). So far as the setAddress() goes you've lost me a little bit there - I though you were just saying "how to keep it DRY for the various places where an email is required" - did I miss something?
 
Sem
@DaveRandom setName(value) is a nice standard, setStringType(name, value) is something different which will make things unpredictable. I don't like both of these in the same framework for setting a single value.
 
@Sem Oh I see what you mean. Well I guess you could do e.g. setProp($name, $value, $validationTypeConstant) but I don't like that. I'd probably go with setName($value) and a private validateEmail() method.
 
Sem
@DaveRandom Yes that's what I was going for, placing validation functions in a superclass. Not sure though.
 
1:09 PM
@Sem I'm sure others have an opinion and has been watching the conversation quietly seething. Naming no names. /cc @tereško
 
Without any sign / effort of reading any posts back are we talking about validating emailaddresses?
 
Sem
@PeeHaa Validating datatypes and stringtypes in any domain object for an always valid effect.
 
always valid?
public function isValid()
{
    return true;
}
? :)
 
[thedailywtf] ?
I'm sure I've seen a lot of production functions like that. Today, actually.
 
@PeeHaa No, return (bool) rand(0,1);
 
1:14 PM
@DaveRandom Your range lacks FILE_NOT_FOUND
 
hehe nice one
 
@NikiC Comment Oriented Programming. Ugh.
 
@GordonM /* No comment? */
 
@GordonM I agree. Terrible idea imo
 
Sem
@PeeHaa When setting a value there needs to be a validation before the actual setting part to make sure all the given arguments are perfectly valid, alright?
 
1:16 PM
yep
 
Comments should be exactly that. Comments should NOT affect how the program runs!
 
in a restful design, /users/1 with accept header of text/html might return a html view of a user, but what would be a good design for requesting an html view of a form for editing a user?
 
Annotations for an external tool to process? No problem with that, I use PHPDoc comments all the time. But comments that affect the code? The hell?
 
@GordonM I don't know, I'd like to be able to do /** This code will work properly */
 
@GordonM Thought that was entirely the point
 
Sem
1:17 PM
@PeeHaa Well then, how would you validate the setters in your domain objects?
 
eat($hit) && die('in a fire');
 
SO more and more turns into a duplicate search service.... that sucks.
 
welcome to Sackoverflow. Please follow the ask advice you needed to confirm before asking any question. For example go through this long list: stackoverflow.com/search?q=%5Bphp%5D%5Bmysql%5D+multilevel+menuhakre 19 mins ago
^^ Sackoverflow lol
 
I've overflown my sack and fallen into the river. Please help.
 
public function setFoo( $foo )
{
    if ( ! $this->someValidationMethod4Foo( $foo ) )
    {
        throw new Exception('Bad foo!');
    }

    $this->foo = $this->someNormalizationMethod4Foo( $foo );
}
@Sem , kinda like this
or instead of throwing an exception you can set an error state in the object
 
Sem
1:26 PM
@tereško Where would you place someValidationMethod4Foo, in a superClass? The one for an email address for example.
 
whay is this obsession with a supercalss ?
no , you place it where you will need it
it's not like you will validate emails in each domain object
 
Stack Overflow is turning into noob overflow :(
 
Eternal September (also September that never ended) is the period beginning September 1993, a date from which it is believed by some that an endless influx of new users (newbies) has degraded standards of discourse and behavior on Usenet and the wider Internet. The term eternal September is a Usenet slang expression, and was coined by Dave Fischer. The term is so well entrenched that one news server calls itself Eternal September, and gives the date as a running tally of days since September of 1993 (e.g., is "September , 1993, the September that never ends."). This server was formerly na...
 
Exactly
 
@GordonM in other news, 20% of americans thinks that sun goes around earth
 
1:29 PM
@Leigh The colored tubes look fun :)
 
Sem
@tereško So you say you place the exact same emailValidation($email) where needed without inheritance?
 
no , that is not what i am saying
@Sem first of all , there is no emailValidation($email). Only filter_var( $email, FILTER_VALIDATE_EMAIL) .. and you should one ( or maybe two if you have a contact for in page ) object which uses an email attribute
 
user50049
@tereško You think that's bad? The other 80% of us Americans think the Sun is headed for the Earth.
 
@TimPost Technically, it kind of is...
 
1:44 PM
@TimPost It kind of technically is... yeah, what @xyon said.
 
ninjaaaaaaa
 
Though the sun expanding to a red giant is going to happen long before the Earth's orbit decays.
 
Maybe then I might get a decent sun tan.
 
can any one help in oscommerce?
i want to put sitemap page, but don't know how... plz guide
 
Does it have documentation?
 
user50049
1:49 PM
@DaveRandom Good grief, look at the price tag on this
 
@TimPost Doesn't surprise me in the least. The ridiculous thing is that a lot of that data is totally different from BT's (two bodies that forked from the same parent, the GPO, some time in the late 70s), who also rely heavily on postcodes, and both parties insist it is the other that is wrong. I have spent 3 weeks trying to a get a single phone line installed because neither party will accept a postcode change on their database.
 
user50049
@DaveRandom Oh what a lovely puddle of muck you've landed in
 
The trade unions of the late 70s, 80s and to some extent the early 90s have a lot to answer for in that respect. They deliberately started creating a lot of red tape to validate their own existence as Thatcher privatised everything and a lot of it is still littering up the system.
 
> It is foolish to think that these two bits of code are behaviorally different:
>
> class Entity {
>     DateTime $last_modified;
> }

The are different because this one looks like a strongly typed variable
which brings with it a lot of connotations which aren't immediately
obvious, and in fact most of this is not needed. 99% of use of parameter
typing I've seen is done for purely documentation purposes and that code
would break hard if these types do not match but in the code they never
do since there are no other types that end up there. I think having the
^ Top portion is mine, body is from Stas.
He's a moron.
I can't get over it.
At least @NikiC ripped on him.
Maybe I'll add some more to it, not sure.
 
user895378
2:05 PM
Documentation is exactly why it's awesome IMHO.
 
user895378
The most important aspect of code, by far, is readability (assuming it functions correctly).
 
user895378
Self-documenting code means I don't have to spend lots of time documenting it manually.
 
But it isn't just documentation, it is type safety!
I need this thing to be a DateTime because I'm not going to make sure that it is a DateTime object everywhere.
I'm going to check it when it is set and never again!
 
user895378
I was just disagreeing with his argument, but yes, it's a PITA to check it everywhere.
 
Furthermore, how is the following not strongly typed if the former is?
class Entity {
    public $last_modified {
        get();
        set(DateTime $last_modified);
    }
}
 
2:11 PM
can't be bothered to read half of the threads anymore. Latest one: Should properties be in interfaces, answer: no. Simple, end of discussion.
 
@Leigh Actually, I disagree on that one.
 
@LeviMorrison Can the object members bypass the setter/getter? If so then conceivably the get() could return a non-DateTime value. It would be stupid to do so, but it would be possible.
 
@DaveRandom In my actual reply on the list, I state the assumption that get returns the same type as set accepts.
I simply failed to copy it here.
In many cases the is the desired behavior.
This is why the shorter syntax is so desirable.
 
@LeviMorrison I agree, any public property is by definition part of the API for a class so you should be able to say a class that implements an interface must have certain public props
How the getters and setters work shouldn't be defined in the interface but the fact that they exist should be specified there.
 
@GordonM Exactly.
 
2:25 PM
posted on October 17, 2012 by Henri Bergius

With Lukas Smith we gave the Monday keynote in this year's International PHP Conference, titled The Internet is your application blueprint. The video is now online: The main argument of the keynote is that even though the big promises of the Service-Oriented Architecture hype of 2000s haven't happened, by now companies are using lots of services when building their web applications. Consid

 
user895378
Is there ever a scenario in the below code where $bytesWritten will be anything other than 5 or false?
 
user895378
$test = @fopen('php://memory', 'r+');
$bytesWritten = @fwrite($test, '12345');
 
user895378
i.e. can local stream writes fail to write the full string and return, say, 3 after writing only '123'?
 
If '12345' is a multibyte-encoded string!
Which would imply that the PHP script is also encoded multibyte, I think. Not sure on that one.
Or if you're writing to a storage device with only 3 bytes available free on it... would that write the first 3 bytes and fail? Or would the entire write operation fail?
 
user895378
I don't know -- that's why I 'm asking :)
 
2:32 PM
@rdlowrey For php://memory I doubt it. It's only really socket based streams that may or may not write the full data. I think. Having said that: uk.php.net/manual/en/function.fwrite.php#106209
 
user895378
I guess I'll just bite the bullet and loop until false is encountered or the full length of the string is written. Was hoping I could get away with a simple false === $bytesWritten check.
 
If you've got a floppy drive lying around you could try writing 1.45mb of data to an empty disk and see what happens :)
What are you trying to do anyway?
 
user895378
Storing the entity body of HTTP response messages in a php://temp stream as it's received so as to avoid buffering large http messages.
 
user895378
So as I read data from the socket I'm writing it into the temp stream.
 
@rdlowrey stream_copy_to_stream() then
 
2:38 PM
Wouldn't that mean php://temp instead? Or am I missign something
 
user895378
@DaveRandom Will that work for non-blocking socket streams?
 
user895378
@GordonM php://temp transparently switches to file-system storage after X Mb of data are written (usually 2Mb, but it depends on a php.ini setting).
 
user50049
@GordonM The entire write would fail (if the OS had any kind of respectable VFS implementation)
 
@rdlowrey Don't know. Suck it and see. I don't see why not though. Or do you mean "will it block while the stream is received" - because if so I suspect yes but I don't know for sure.
 
@rdlowrey Your example code says php://memory but I wasn't sure if that was a mistake or if that was due to the current needs of the situation
 
user50049
2:40 PM
@GordonM If you can't write the requested block size, it fails. But you could attempt to write 12345 100 times and it would fail on the 99'th, with 98 successful writes.
 
user895378
@GordonM Yeah, the example was just a general "Are local stream writes atomic" question.
 
Like I said, the only thing I can really think of that might screw things up is character encodings. IF '12345' was UTF-16, for example, then you wouldn't get 5 bytes written
 
> If handle was fopen()ed in append mode, fwrite()s are atomic (unless the size of string exceeds the filesystem's block size, on some platforms, and as long as the file is on a local filesystem). That is, there is no need to flock() a resource before calling fwrite(); all of the data will be written without interruption.
@rdlowrey ^^
 
user895378
@DaveRandom Yeah I read that -- the "unles ..." part threw me. I'm just going to verify things instead of closing my eyes to the infinitesimally small possibility of failure.
 
@GordonM Yes but strlen() always returns the byte length, not the character length, so as long as you are consistent as to how you determine the size of the input string it won't matter
@rdlowrey So just read the input stream in chunks that are smaller than the filesystem block size - problem solved.
 
2:45 PM
Does php://memory even have a block size? I assume php://temp does once you hit the write-to-file boundary
 
user895378
@DaveRandom Agreed. I prominently mention in my documentation that string function overloading can't be used in conjunction with the code because strlen is relied upon to return the number of actual bytes and not characters.
 
user50049
@GordonM On Linux? I don't think so.
 
user50049
Windows I'm not sure.
 
user895378
I just need to find a CodeIgniter Streams framework ...
 
user895378
yesterday, by DjMike
i think is time for me to go to a new level and use a framework
 
user895378
2:46 PM
:)
 
Can I write this:
`if($user = get_user($user_id)) { $user_exists = true; } else if($user = get_user($old_user_id)) { $user_exists = true; }`

As this:
`if($user = get_user($user_id) || $user = get_user($old_user_id)) { $user_exists = true; }`

Is that valid?
 
Uh . . .
I think you made a mistake in your comparison.
= should be ==.
 
yesterday, by cyril
it optimizes cache etc..
 
But aside from that, yes, they should be the same.
 
@LeviMorrison I use if ($var = getFalseyValue()) {} all the time :p
 
2:48 PM
@LeviMorrison I'm not comparing anything, just trying to get the user object, but if the user object is false, then it should attempt to get it via the old ID.
 
@NightHawk They should be the same, yes.
 
@NightHawk Why not $user_exists = get_user($user_id) || get_user($old_user_id);
 
@rdlowrey are you in some situation like this php.net/manual/en/function.stream-set-blocking.php#69505
 
I don't think PHP short-circuits properly or you could do $user = get_user($user_id) || get_user($old_user_id).
 
user895378
@CMNAJS No, I'm fully aware of fwrite variations with remote streams, but thank you!
 
2:50 PM
It does short circuit
if the first one evaluates to true, it will not evaluate the second
 
user895378
@CMNAJS I was trying to determine if similar actions also needed to be taken when writing to local streams.
 
@Leigh You won't get the object in a var, you't have to do $user_exists = (bool) $user = get_user($user_id) ?: get_user($old_user_id), which is just horrible.
 
@Leigh Did you read my statement? I think the value of $user will be type bool.
 
@Leigh Because later down the in the script there are instances where I need to perform actions depending on whether the user exists or not, but other times I will actually need the user data. I find it cleaner to have two self-describing variables.
 
@LeviMorrison I read it, and you said it doesn't short circuit properly. It short circuits just fine.
 
2:52 PM
@LeviMorrison $user will either return false or an object.
 
@NightHawk Wrong: viper-7.com/WfdJqN
 
user895378
So much easier to understand:
 
user895378
$user = get_user($user_id);
if ($user) {
    ...
}
 
It does not store the object, it stores the result of the || operator.
 
@LeviMorrison but viper-7.com/ydQ57Z
 
2:53 PM
anyway, $user_exists = ($user = get_user($user_id) || $user = get_user($old_user_id)); will get your code working and looking horrible :)
 
user895378
Why people insist on obfuscating their code with multiple statements in a single line I don't understand ...
 
@DaveRandom That's a different operator :)
 
@DaveRandom Disclaimer, 5.3+ for shorthand ternary
 
@Leigh I don't want it to be not readable, but I don't want to write unnecessary lines either.
 
@Leigh Yeh, that's the problem with ;-)
Bugger readability
 
2:55 PM
@DaveRandom Not my problem, but a lot of peoples ;)
@NightHawk Well thats because you're new, once you get it into your head that maintainable code is better than "smallest code possible", you'll have a different opinion on a lot of things.
 
@NightHawk As it is you've spent 5 minutes writing one line when it doesn't matter a blind bit to the interpreter. I'll politely suggest that you may be overthinking it.
 
user50049
@Leigh I don't see what's so horrible about that. Then again I mostly work with C.
 
@rdlowrey I don't think so. I never faced this.
 
I have a question
Say if you have a list of items shown on a webpage
item 1, item 2, item 3 etc
if a user clicks on item 1, it redirects to a view page where id=1
 
Sem
@Leigh There is a big difference between readability and abstraction.
 
2:58 PM
and you can view item 1 in detail
how can this be done
 
@DaveRandom My original question really just was whether I can compact the if...else if into one if, which the answer seems to be yes.
 
and same with item 2
?
 
@NightHawk The answer is yes you can... but don't. That's my answer anyway.
 
user50049
@Nitrodbz Iterate over the items, write <li> elements containing links with the current counter and be done with it?
 
@DaveRandom What's your reasoning behind why not to do it?
 
2:59 PM
right so the view page will have to read the url
and detect the id
and extract that id to view the page
 
user50049
@Nitrodbz Huh?
 
the view page in which the user gets redirected to
view.php/id=1
i mean
 
user50049
@Nitrodbz You're talking about a lot of things nobody here has seen.
 
@NightHawk Purely readability. It's not pleasant to come back to your own code 2 years later and have to spend 15 minutes remembering how it works. Also comment everything as well.
 
Sem
@DaveRandom comment as in how this function works or what the class does? The latter is ok but if you need to comment on your function you're surely using some weird $xes or $ys
 
3:03 PM
i get the part where you create a unique url with a counter
 
user895378
@NightHawk Good code is never clever. Make it as simple and obvious as possible.
 
@DaveRandom Do you think if($user = get_user($user_id) || $user = get_user($old_user_id)) is less readable? If anything, I think it's more readable, because to me it clearly communicates what it's doing, but in one line.
 
user895378
> but in one line.
 
user895378
10 mins ago, by rdlowrey
$user = get_user($user_id);
if ($user) {
    ...
}
 
KISS is an acronym for the design principle articulated by Kelly Johnson, Keep it simple, stupid!. Variations include "keep it stupid simple", "keep it short and simple", "keep it simple sir", "keep it super simple", "keep it simple or be stupid", "keep it simple and stupid", "keep it simple and straightforward" or "keep it simple and sincere." The KISS principle states that most systems work best if they are kept simple rather than made complex, therefore simplicity should be a key goal in design and unnecessary complexity should be avoided. Origin The acronym was coined by Kelly Johnso...
 
user50049
3:03 PM
@NightHawk I tend to agree. I would not have a problem understanding that two years from now
 
user895378
IMHO it's not about whether you can understand it ... it's about needing 1 nanosecond to grok it vs. 2.
 
Anyway, thanks everyone for the input. My question has been answered.
 
user50049
@GordonM Yeah, but that's rather simple with less code. <shrugs>
 
posted on October 17, 2012 by Paul Reinheimer

Last night I started working on a script to help customers integrate the Where’s it Up API with their existing monitoring infrastructure. I started with Nagios since that’s what we’re using for WonderNetwork (I also learned we’re monitoring ~1200 services). Shortly after I started coding I talked with Will since he’s our systems administrator, and the target market for the Nagios integrat

 
@Sem In general possibly true but not a hard and fast rule. There are many data manipulation functions I've done where it is a multi-step process, and I'll tend to put a comment at each step - even if it's only a couple of lines. I helps you to go straight to the problem code (assuming you have one, which of course I never do because I am perfect). Example: stackoverflow.com/a/8561604/889949
 
3:08 PM
I still love this comment. stackoverflow.com/a/185181/477127
 
@NightHawk Well at the end of the day it is your code, so it is your definition of readability that matters - so if you think that then go ahead. But consider if at some point in the future you add a third option, and so you add another condition. Then you add a fourth, and a fifth, and... soon you've got a line that's 3 screens wide and impossible to read. But don't take any of the opinions you've got from us as The Answer, make your own opinion ;-)
 
2 upvotes for this? I'm really getting the impression that the newbies are cockpuppeting now, or at least upvoting each other. stackoverflow.com/questions/12937161/…
I tend to find writing compound statements across multiple line helps with readability.
'if (($cond1)
|| ($cond2)
|| ($cond3)) {}'
 
@DaveRandom I agree with you. If, down the line, something where to change that would require additional conditions, I would refactor the original statement and break it out or create a function. My rule of thumb for if statements is no more than two checks.
 
... wait, cockpuppeting? I meant sockpuppeting!
And now I can't edit it!
 
user895378
lol
 
user895378
3:14 PM
Time to star!
 
@GordonM Awww, I thought that was intended, you've shattered my amusement now :-(
 
I have no idea how you'd even work a marionette with your member.
 
@NightHawk :-) For the record, I don't like the whole if ($var = $assignment) thing at all, it's too easy to misread it as ==. Worse, it's too easy to mistype == and introduce new and exciting bugs.
 
@DaveRandom I've started taking to putting the constant/function return on the left hand side now for that reason.
if (function () = $value) will trigger a syntax error
 
@GordonM Yoda comparisons
 
@TimPost In this chat, my definition of horrible is considerably different to my personal standards ;)
 
@Leigh Do as I say, not as I do. I wonder if there is a man here for whom that is not the case...
@GordonM My personal favourite from that is If this happens we can't recover, and there is more than likely a rip in the space time continuum that the user is too distracted by to notice anything else.
 
Who keeps upvoting this crap? stackoverflow.com/questions/12937161/…
 
@DaveRandom You can find some of my finer accomplishments on codegolf.stackexchange ;) .. if you need examples of how not to write code.
 
user895378
@Orbling FWIW, the close vote reason fully encapsulates my logic, rendering a comment superfluous: not a real question 4 ... * It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, see the FAQ.* — rdlowrey 15 secs ago
 
3:36 PM
You know how code quality is measured in WTFs/minute ... codegolf.stackexchange.com/questions/6707/…
 
@GordonM I like this one better: stackoverflow.com/a/789811/538216
But I do agree with a comment on it: stackoverflow.com/questions/184618/…
 
@Leigh What the hell is $»»? How does that work? I though var names were limited to /[a-z_][\w]+/i?
 
@DaveRandom Its just a variable, you can call them whatever you like ;)
 
the earliest source for WTFs/m that i know is : osnews.com/story/19266/WTFs_m
 
Wondering if I could make this one shorter with a generator: codegolf.stackexchange.com/questions/4114/…
 
Is there a function to delete index key from 80 and until end?
only keep 0 to 79
Im referring to array
 
@I'll-Be-Back array_slice
 
Oh nice
Thanks
 
Providing your indices are sequential, with no gaps
 
@Leigh You can easily ensure that's the case by doing $arr = array_values ($arr);
 
3:59 PM
@GordonM Then you lose the keys
 
But we're doing indicies!
 
what if the keys are 0,1,79,80,... and he wants to delete only those first 3
 
Yep.
 
"Yep" what?
 
Yes I only want to keep first three.
I got it to work. $reportLinks = array_slice($reportLinks, 0, 83);
Example.
 
4:02 PM
Like I said, will only work for sequential in-order keys.
Wonder what the speed of array_intersect_key(range(0,79), $array) would be.
 
Oh dear sweet merciful God... if I had the misfortune to be working under this guy there probably would have been murder committed within a matter of months. stackoverflow.com/questions/218123/…
 
@MadaraUchiha Ho ho
 
4:19 PM
do you have any idea how much the memory_limit is on most shared web hosters space?
 
PLB
@user539484 exactly the same what's written in config. Contact to their support center for details.
 
@user539484 What's the default value for memory_limit? I'd wager that's the most common setting.
 
In the moment I have no host, I just would like to know about your experiences (budget: max 5$ / month)
 
hey guys , do you know of a way to prevent the uglification (new word) of the websites when printing ?
 
4:26 PM
@user539484 At $5/mo, you could get a damp cardboard box with "Servar" written on the side.
5
 
there are many providers offering such prices, the owner has just a little budget, I can't change
 
@user539484 for a bit more (less then 10$, more then 5$) you could get a VPS host
 
What would happen if many users access the site, then each script will need some memory, what if there are too many users?
do they just have to wait a bit or will it result in an error?
the thing is: I use Yii with ActiveRecord, have written big parts of code already, but forget its huge memory need
*forgot
 
my condolences
@SomeKittens tilaa.nl (6 euro, 10GB FreeBSD VPS)
 
4:43 PM
@tereško By "The websites" do you mean some website in particular, or just in general? In the latter case you'd provide a print stylesheet.
 
@GordonM , i want to print this : myrecipes.com/recipe/…
 
It's ugly enough as it is without printing, all jammed down the left hand side of the browser window. But it looks okay in the print preview (in Chrome at least).
 
@tereško You could try the Printliminator to remove uneeded stuff from the site.
 
Of course ugly is in the eye of the beholder.
 
@MadaraUchiha this seemed to work for me
 
4:56 PM
@tereško You don't always want to print the page exactly as it is shown on the browser
But whatever works for you.
 
Good afternoon
 
does mysql rebuild the index if I do sth. like this UPDATE tbl SET col1 = tbl.col1? or if I want to update, but it is the same value?
how can I test it=
?
 
evening
 
Hi @PeeHaa
 
Hiya @Robik. All well?
 
Yes, You? :)
 
Good good. Finally had a pretty productive day on my new job. I.e. threw all old code out :D
 
5:20 PM
:D
 
@NikiC Yes, definitely me.
 
5:36 PM
Anybody has some .tar (de)compress class by any chance. The only one that I got easily working was from PEAR :(
@SomeKittens No idea what OP means...
nvm
 
@PeeHaa What's wrong with PEAR version?
 
@peehaa what did o do?
Going to lose signal soon
 
@LeviMorrison Just a general pear hate :)
@ircmaxell o?
 
@PeeHaa There is always the option to farm it out to the command-line utility . . .
 
rad
Quick Question: I wanna download a file when someone clicks on a link. How do I do this?
 
5:52 PM
@rad Quick answer: search for it. Been answered a million times.
 
rad
:)
sorry, needed it real quick and I was a bit confused
here's the answer:
<a href="download/someFile.pdf" target="_blank">Download</a>
 
@rad If you need something real quick you should search for it real quick instead of coming in here and asking for it
 
@PeeHaa I like how I'm a variable.
$SomeKittens. $m=$a[1] is false, so returns 00:00:00 regardless of whether there are any hours. Same but reverse for $h=$a[0] — user1032531 20 mins ago
 
@SomeKittens :D
It would have been really screwed up if OP had done something like $SomeKittens = 'PeeHaa';
 
...that would get weird
 
6:04 PM
@tereško What I do in such cases is use my screencapturing tool and print that
Probably a bit too late and you are already enjoying your meal
Quick before all high rep users answer it
 
Hiya @hakre. It's beer time indeed
 
rad
@PeeHaa you're right
 
sigh, why do people recommend escaping quotes instead of paramterised queries? stackoverflow.com/questions/12940251/…
 
rad
I kinda paniced
 
6:12 PM
@hakre i hate you .. now i have to go shopping
 
@tereško come on, get some fresh air ;)
 
@MrCode Please change you answer to use htmlspecialchars() and mention the encoding. Ty :)
 
you know what's the saddest part : you are actually correct ... but then again this autumn the weather has been horrible
 
@PeeHaa yeah for XSS prevention alone specialchars() is enough but in most cases you need htmlentities() so that other characters unrelated to XSS are encoded such as the & sign
 
6:18 PM
not always , it actually depends on your clint-side code ,and is only loosely related to PHP
 
"but in most cases you need htmlentities()". What cases?
 
The case of printing user input on a page
 
@DaveRandom I'm thinking about setting up a gist in the future for dupes in the dupes helper
 
6:32 PM
@PeeHaa can you update me on what you are building pls?
 
@Gordon I was thinking about a moderated centralized list of duplicates. So I can easily use it to fill the dupes helper in the cv plugin and perhaps there are some other uses for it.
 
0
Q: Integrating Zend Framework and Wordpress, Delegating page loads

bigmanI'm looking to have a full integration between Zend Framework and Wordpress. For clarification, this does not mean I want to use Zend Libraries within Wordpress, but rather delegating the page loads for a single site between both systems. I've done a fair bit of research, I've come across seve...

muhahaha!
 
@PeeHaa moderated centralized list of duplicates sounds like something that could go into cvbacklog?
 
@Gordon I was hoping you would say something like that ;)
@hakre It is doable though. You can setup an error route in Zend (i.e. what happens when ZFW 404's). Although that would also mean that typos will result in a redirect to WP :)
Ow wait. OP wants to do the exact opposite
 
@PeeHaa I suggested now apache subrequests to find out if worpdress is 404 or else.
got to hurry again.
still some code needs to be written.
 
user895378
6:41 PM
@hakre lol
 
@PeeHaa I was thinking about adding redis or something to maintain a list of dupes. our chat transcript will grow and grow and we are already getting lots and lots of throttle errors with the current approach
 
Hi everyone
 
apparently being a beginner is the reason for escaping instead of parameterised queries
 
is that pasta after swim?
 
Anyone have a moment to double check me on something about the Google Drive API?
 
6:44 PM
@poolnoodl Checked, Drive API is fine!
 
Oh, I know it's up.
 
@poolnoodl Checked, you know it's up! ;)
 
lol
 
actually that was a double-check ;)
 
I was wondering if anyone has built something that doesn't use OAuth, but uses the service account idea.
 
6:45 PM
@MrCode I mostly blame the sea of terrible resources people find on the web
 
Or if that's even possible at this point.
 
@poolnoodl No I didn't, sorry.
 
afk now. pizza just arrived and I have to play with my new sphero ball :D
 
boah. hungry!
 
I'm using Joomla (), which doesn't support prepared statements (just escaping). If I want to use PDO and avoid repeating myself, where should I put the database interaction class?
 
6:46 PM
@Gordon Cool
 
@PeeHaa I agree there is a lot of rubbish
 
I've already got a "library" folder, but I think that's bad practice...
 
@SomeKittens Sorry. I know just enough about joomla to know I want to avoid it ;-)
 
It's improved a lot since 1.5. We get PDO etc in 3.0. Problem is, the people I work for still haven't moved to 2.5.....
 
@SomeKittens I think that would be a lot of work to create a PDO class for Joomla because you'd have to implement the interface which consists of lots of methods like fetchAssoc() fetchObject fetchAssocList etc etc
 
6:50 PM
Sounds like a major security issue. Or isn't it as bad as in the past nowadays? @SomeKittens
 
@PeeHaa "Major security issue" translates to "Not a problem if we haven't been hacked yet" in my boss' mind.
Speaking of that, anyone hiring?
 
^^ hehe
 
@SomeKittens Are you currently a CS student living in Provo, UT?
If so, then yes, I do.
 
@LeviMorrison CS student in Rochester, NY, sorry
 
@SomeKittens Can't help you then.
 
6:53 PM
Blast. Thanks though.
 
Third party extensions are more of a security issue than escaping in Joomla, particularly local file inclusion vulns
 
@MrCode Yup. We've got several dozen though.
yarg.
 
joomla ohgawd
 
Better question: We're building a form with lots (100+) questions that we want to store in SQL. It's broken up into different sub-sections. How should we form the SQL?
 
adding PDO to joomla 2.5 is like adding a jet engine to a pull wagon. you can do it, it won't be pretty, and someone will probably die if you pull it off
 
6:56 PM
@SomeKittens then avoid joomla
 
I don't want to create a whole PDO extension. Just enough to fulfill our needs.
 
@SomeKittens you can protect against LFI in Joomla by creating a system plugin and rejecting requests with content such as ../../../proc etc
 
@tereško I get paid to do this. You got a better offer?
 
you get paid for time spent .. right ?
 
Yup. That's the nice bit.
 
6:58 PM
then i fail to see the problem
 
@SomeKittens lol
 
Problem is I work with an API that makes WordPress look like it was coded by Knuth.
 

« first day (732 days earlier)      last day (4210 days later) »