« first day (1546 days earlier)      last day (3627 days later) » 

12:00
Yeah, it's because of the stateful nature of forms
Yes I did $result = json_decode(getInstagram($q),true);
@Ocramius Thank you, this $form->isValid() line makes sense to me now. My question at the SO received so little attention so I remembered the chat.
Thanks again!
am I only one who thinks that his is a stupid article ?
New blog: 'Interface' considered harmful. Please RT. http://blog.cleancoder.com/uncle-bob/2015/01/08/InterfaceConsideredHarmful.html
@tereško no.
12:03
Fibre please! Save me!
Need some dirt to blackmail whoever makes the decisions where fibre goes.
@Ocramius Sorry, one more Q. On page load my form now initially displays the errors. Have any quick ideas what I might be doing wrong?
@webarto looks like I'll come to PHP-Serbia <_<
And you need @webarto protection?
@developer10 you need to be patient, heh
@Fabor probably <_<
OK, take your time, I hope you're going to reply though
12:07
@Patrick weird that when I var_dump it shows up correctly. but when I pass to my variable $video->data = stripslashes($data['videos']['standard_resolution']['url']) the backslashes are still ther
user924016
@tereško but I love interface =[
@developer10 you should display errors only if the request is a POST request, IMO
@tereško that looks more like an use case for trait… not why interface is harmful…
@tereško I think so as well.
@jeraldo then you must be doing something wrong ;)
12:08
@tereško he makes a point about using multiple inheritance for code reuse: yay for hidden dependencies everywhere!
I get a feeling that the title should have been "I have no idea what the difference between abstract class and interface is, but here is my opinion"
@Ocramius OK, I'll try putting the validation run inside isPost if statement - that probably should do the trick. Thx
it could be that uncleBob is going senile at his age (63)
already? :|
a bit early for that...
@Patrick definitely. im pulling out my hair. how could something so simple cause me trouble :(
@Patrick thanks for the help :)
12:21
@Ocramius Awesome mate, when and stuff?
@Ocramius A conference with guns and hookers? Where do I sign up???
@webarto not sure yet :)
@PeeHaa No, Serbia is softcore, Bosnia is where the party is at.
Yeah, do the illegal stuff in a different country.
Don't shit where you eat :-P
12:25
heh
given the comparison I'm running with the idea that serbia is filled with strippers playing laser tag
@PaulCrovella nightlife.24sata.rs whatever turns you on
is this about some kind of clinic?
click and send your pictures from teh party
haha, yeah, NEON MOTHERFUCKER
12:29
hi guys
@Ocramius anyways, update me accordingly please :-)
Good morning
Good morning minion of zee Germans
I've registered for the language courses and soon will tease you, bastard (:
class Example_Db_Class
{
static function connect($dbName)
{
if ($this->db == null)
{
$this->db = new $this->mysql_connect($dbname);
}
}

}
12:31
Ich zähle alles!
what is the problem with this code ?
@FaizRasool please don't do that
singletons are bad
and mysql_* functions are deprecated
Where. Is. Rebecca?
can't believe room 11 finally grew up :p
@AlmaDo ...keep looking
^ where should I look?
12:35
--->
F*ck :(
:p
@webarto well, I only will go there
@webarto yeah, as soon as I know :-)
@AlmaDo Guten den, mena zovut Alma Do, ich eta php entwickler.
Wish this was possible: 3v4l.org/1spVn
hi all! :) I basically despise seeing E_NOTICE messages, so I try to always just code "the right way" and check my indexes and whatnot, but my boss doesn't really care because he disabled those notices, is there any real benefit in doing something like if (!defined("something")) define("something", true); vs define("something", true);
12:44
> Returns TRUE on success or FALSE on failure.
@Purefan Your boss is an idiot as with most bosses / managers
@Ocramius try it like that 3v4l.org/OaMR4
The code would not work as expected... error is error, notice is just a level.
@Pee
@PeeHaa He's usually a nice guy, but I want to give him some convincing arguments to change the way he works
@Patrick THAT IS THE 4TH TIME TODAY!!!
>.<
12:45
@Patrick // I'm so sorry ... nice
eh..
Just carefully watch your status bar on hovering links when in room 11 at Friday :p
@Purefan There are nice idiots out there
user924016
lol
user924016
@Patrick thanks
When phpmd is running more that 10 minutes for the project, it's already .. frightening
12:50
@PeeHaa Yeah :) So far I haven't been able to find anything security related (we use PHP 5.5) so I guess I'll just keep looking or ignoring those nasty E_NOTICEs
I feel like this sums up laravel quite well
@Purefan if you cannot trust your code to work correctly, building extra checks like " if (!defined('something')) " will not help you trusting your code. allowing every notice to display does
@Purefan Don't ignore them
Treat them just like any other error
user924016
@PaulCrovella lol =]
16.000+ tables?? Something is really, really, really wrong. For each table after.. well, 20-th in your database - there is a kitten dying somewhere — Alma Do 22 secs ago
12:54
@AlmaDo 20 is not really that much
@AlmaDo say 100-th and we're good. 30-60 tables is quite normal…
@PeeHaa it's not. Just an.. average measurement. To give some idea about - it may be tens of tables. But not hundreds.
user924016
+10.000 is alot
user924016
wow =]
and definitely not tens of thousands
user924016
12:56
dynamically stupid
I've seen code in which for each user a new table is created………
@PeeHaa I meant ignore his Notices ^^ Thanks for the feedback guys :)
@bwoebi did it also write out a new username.php file to disk for their profile pages?
@PaulCrovella no ^^
How can I annotate with phpdocs my function so that it states that it returns one item of the same type passed in as array, similar to C#'s T Shazaam(T[] enumerable)?
13:00
@Purefan ah :)
The method check() has an NPath complexity of 27216. The configured NPath complexity threshold is 200. sigh
I feel like there should be a pac-man style high score list
@AlmaDo, <module name="NPathComplexity">
<property name="max" value="32768"/>
</module>
Problem solved!
And I forgot what chat room I was in. Anyhow, you can probably change the limit in phpmd too.
Or just replace the phpmd binary with a noop-operation.
@SimonSvensson no ..
The method updateArticle() has an NPath complexity of 5017600. The configured NPath complexity threshold is 200.
@AlmaDo, I have a solution for that one too. ;)
13:08
five. fucking. millions.
^ lol (L
@AlmaDo not bad. Did you test all paths?
ThW
ThW
@SimonSvensson @param SomeClass[] $paramName
hello folks!
user924016
Hello @animaacija; Welcome [= please read room-11.github.io
If i use file_get_html('ulr') to parse some website. Does this site knows, the php robot does that?
13:18
@Ocramius :D
Just testing eval.in/240826
Well i was thinking something like, to simulate user agent as firefox, so the server collecting responce would know i'm a human. not php server. hmm
php has no such function as get_file_html()
well true, i use custom class this time. Sorry.
hmm ... this seems to be getting really good reviews: fractal-design.com/home/product/water-cooling/s24
though, I still might go with CM's Nepton 280L
13:24
@ThW, I dont know what type I'll accept, it can be arrays of any time, I just want to state that I'll return that type in my @return shazaam
@animaacija However file_get_contents() has an optional third $context parameter. You could create a stream context and pass in your desired headers
Aha.. it has something like $use_include_path and $offset //ill look these up too
they're irrelevant for your particular problem
I have a debian machine here on which I try to log in. However when I try to do shift+3 it looks like it does a backspace instead of a #. What is the magic fix for this?
I have physical access to the thing
And shift+2 deletes everything (the whole line) it seems
@PeeHaa check which keyboard layout you are using
13:34
How can I do that when I cannot log in?
hmm ... ssh in the box
I need to login to bind an address first :P
Damn this :)
oh , joy
fresh install ? laptop ?
uggh server
fresh install ?
or was the box installed some time ago ?
13:37
The thing is I need to grab files from this thing first
That should be possible I think. Need to check disks setup
@Fabor broadbandbuyer.co.uk/products/15285-draytek-v2860 every time (wireless options are available but I'd by a separate AP)
@PeeHaa have you tried alt+3 ? And might there be possible to get an on screen keyboard ?
It is expensive though, relatively
@DaveRandom Aye. Waifu didn't approve the budget so I chose a fairly well rated amazon one. This
@PeeHaa have you tried a bunch of shift/alt combinations? not just limited to the key 3 but the keys around the Enter key as well
13:40
Also: I have just found an actual use case for <script language=php>
@Fabor No opinions as have never seen one
Worth a go.
if you unset a variable, does it release it from memory or just decrease the refcount?
@PeeHaa it might be a better idea to get a liveCD working an use that to copy the stuff
I am getting the impression that someone has fucked up the keyboard layout on that box
@hohner It depends what was in the variable
you COULD try plugging in a different keyboard, but I suspect that it won't have any affect
13:43
@DaveRandom My internet keeps cutting out randomly. Enough times a day that's it's a pain. I spoke to Aquiss and they said
> I have carried out full line tests, both broadband and phone, but I'm unable to determine a problem as a result of any problems within our network or BTs. Your line tests are fine. However, as your line is used heavily for downloading, then slow speeds could be accounted for either background network activity or router a struggling to handle all the data being pushed down it. When we make assessments, we use both the live current session data and the past 14 days, both get studied.

Whilst I can see a few PPP session drops, these are not that frequent for a line of your length, put the te
He sent me their line test results too.
If it's not an object it decreases the refcount and when it reaches zero it releases the memory, if it's an object then GC is more complex @hohner (circular refs won't be free'd until later, possibly the end of the script)
@Ocramius For some reason it takes like 2-3 seconds to get through my doctrine-bootstrap. It's a MySQL db on an AWS instance. I'm connecting from a VM on my local machine. Typical?
@animaacija on screen keyboard on cli? :)
@DaveRandom thanks - somebody is trying to unset a bunch of objects and doing a memory_get_usage afterwards, which is still showing allocated memory. Is there any way to trigger the GC to release it?
@Fabor Sounds legit, would be interested to know what your SNR margin is reported as (would need to look at the modem status data in the router)
13:46
@tereško uggggh yeah I think that is the snaest solution
@DaveRandom Router is wanky and old. Doubt I could even find that info.
@hohner gc_collect_cycles(), but actual valid uses for this are few and far between
@tereško Tried that same result
@Fabor depends on lag and what you are doing. Profile it
@PeeHaa did you try alt+35?
13:48
Down - SNR margin 7.5 dB .
Up - SNR margin 7.8 dB .
From the line results they sent me ^
Also @hohner it's just possible that there is some other reference to the instance somewhere... if gc_collect_cycles() doesn't free them then they're still being referenced somewhere else (e.g. a closure created within the instance will reference the instance in its $this ptr). Also note that a "free" in zend mm doesn't necessarily mean the memory will be released back the OS
Although memory_get_usage() should always reflect the release
@PeeHaa what about Recovery mode?
might let you change the keyboard layout
or at least scp your files to another machine
@Fabor ugh :-(
@DaveRandom?
It's workable, but only just
13:51
What would improve it?
brb
@Fabor Well, maybe a bit of internal rewiring/better microfilters, maybe nothing you can do about it, depends where the noise is coming from
really brb
@PaulCrovella Works for login name not for password :|
@DaveRandom so if you do have stragglers still referencing these instances, there's no real way to remove them until the request/script execution ends?
well that just makes no sense at all
@Purefan Could try that
13:54
Well, if only data is importaint, i ussually intall some OS aside to access , save , and cleaninstall.
@hohner If you destroy the things that reference it before calling gc_collect_cycles() then they will be collected.
Or you can save everything from live usb to some external. But if data is encrypted there, then give a call to Linus.
What is the Linux Distro btw?
@PeeHaa if you have mouse available there, you could copy the symbol from username
(select to copy, middle-click to paste)
also, you have really shitty usernames & password
@tereško Nah. His box is now unhackable, even by himself ;)
14:00
@tereško cli
@tereško It's the passowrd ;)
@DaveRandom hmm. The trick is to find where refs are still active for the unset instances. Do you have any advice or tooling recommendations for tracking these types of memory leaks? I guess the obvious choice is xdebug
I usually enable mouse even in CLI setups just fo that copy-paste functionality
linux cli {command line interface} ?
@tereško hindsight... 20/20... :-D
14:03
yay
did the single-user-mode work ?
can you log in with some other account ? like root
So if yr not logged in, you have no way to run any command. If so. There is only external solution, like add some os aside and access this one from outside and ..
user924016
lol =] there a more solutions... or wait single-user-mode already suggested..
accept the transient nature of all things and let those bits go
@PaulCrovella you obviously have no talent for being sysadmin
pff.. it's also an effective way to reduce backup tape expenses
speaking of which, if anything on the box was important it'd be backed up somewhere else already
14:15
Ok, I sure will
What's your preferred web service protocol?
SOAP, obviously
heh. Don't do that, people may read that from google.
fuck 'em
14:28
lol

tereško likes soap

5 mins ago, 1 minute total – 2 messages, 2 users, 0 stars

Bookmarked 14 secs ago by salathe

0
Q: How to select an image from set of images appearing on a form, validate the form and highlight/change the shade of selected image?

PHPLoverI've a form that contains three images. <form id="msform" action="sample.php" method="post"> <fieldset> <h2 class="fs-title">Personal Details</h2> <h3 class="fs-subtitle">We will never sell it</h3> <table style="width:100%"> <tr> <td><span style=...

This question has a very broad scope. You're not likely to get an answer without some code to demonstrate what you've tried and some specific questions about what is giving you trouble. It's not likely anyone here will take on the task of programming your page for you. — user3479671 12 mins ago
Dec 10 '14 at 16:57, by tereško
@PHPLover , please STOP dumping question links in the chat
now..
I'm done with this mess
14:38
@PHPLover chat.stackoverflow.com/… , please fucking stop
\o/
The method X() has an NPath complexity of 3091652746875000000. The configured NPath complexity threshold is 200.
In GRUB added init=/bin/bash for signel user mode
@AlmaDo not bad at all
After that mount -o remount,rw /
Victory is mine!
Thanks all
14:39
@ircmaxell orly? :)
now .. I don't know how even to pronounce that
@DaveRandom Ordered 3 of those splitters your recommended. ATM I have nothing in the sockets. Worth having I guess.
@AlmaDo 3 septillion
@ircmaxell fine. But .. how much times it exceeds configured "normal" level .. to know size of that mess-up
I mean - it's obvious how many times. But I'm not the one who may say "not bad" on that :p
@ircmaxell it's only quintillion :P
it exceeds "normal" levels by 10^21
@salathe did I add in an extra 000?
14:44
@ircmaxell you added six zeros
I just wanted to introduce phpmd to our team and involve that to release cycle. Now I doubt it would ever happen
ah, I started at the long scale, then read the short scale name
1333
A: Why does Windows think that my wireless keyboard is a toaster?

Kenneth LReason 1 Because Microsoft made a toaster driver sample. In the sample there is the line <DeviceIconFile>Toaster.ico</DeviceIconFile> and there is a chance that your keyboard manufacturer took that sample. Reason 2 Look at the back of the keyboard for some place to insert a slice of bread…

I thought about .. may be thousands. Tens of thousands. But not .. this
^ hilarious
14:46
:-)
show them my presentation on the subject
Actually I borrowed some ideas from there (but not just copy-pasted) - so .. But I was ready for resistance level inside code for 1000, may be 10000 complexity. But not .. uh. 3 septillions ..
that's what happens if application is ..well, hundreds of thousands line with couple of years history
new bungles were developed with DDD approach. And neither cyclomatic (threshold 6) nor NPath (threshold 200) was violated. But legacy code .. sigh
yup, that always happens
and don't try to fix it
instead, make a rule
which one?
14:52
if you need to modify a legacy function, refactor so its cyclomatic-complexity and npath are below thresholds, and add unit tests
so no need to go back and try to fix everything today, but as risk goes up (changing a complex function) you mitigate it by reducing complexity and adding tests
yes. But who want to refactor a function, which for me looks like it should be separated - and not into couple of functions. Not even to couple of classes. But to couple of bundles may be
it should be separate package..
this is also known as the "never touch a legacy function again" rule
@AlmaDo yup, but do that when you need to change it, not arbitrarally
well, at least everyone in he team knew that legacy is a mess. I just showed some numbers
time for a vacation to cuba
14:56
hell yeah. I deserved :p
@CarrieKendall Hey! long time no see! How's everything?
good, good. how are you? tiff got the flu over christmas break so we haven't done any travel in a while :(
yeah, we were going to hit chicago and mt rushmore over the break. stupid flu
I'm doing ok. Was sick for quite a while (thanksgiving through this week) but slowly getting better. Now parent's are both sick so dealing with that (Dad is in ICU, mom is home on antibiotics). So things are... yeah...
15:00
oh, that's horrible. what does he have?
flu combined with congestive heart failure combined with some sort of infection
:-/
i'm really sorry to hear that..
posted on January 09, 2015 by kbironneau

/* by Arekibian */

15:18
@RonniSkansing Well done sir, well done.
15:34
Hello folks. In ZF2 what is the recommended way of clearing all form input fields after successful submission? Thx
user924016
=] Happy friday @DanLugg
@DanLugg Yea, the bastard got me too
I didn't have my headphones in at the time so I had Rebecca Black blaring across the office
Hahahaha
@RonniSkansing Happy Rebecca day to you too, you sneaky bastard.
user924016
Thanks [=
@developer10 you can achieve this in php or js/jquery
15:39
@DanLugg your doppelganger is my brother-in-law O.O
that's kind of a derpy picture of him, but still
@developer10 PRG
Some kind of bush-fire in the background there.
Too bad ZF2 didn't come up with such a function as everything is so extensible and configurable anyway
@JoeWatkins I thought all PHP functions have a default return value of null if they are returned without a value? Is that me misunderstanding something, or a change in 7?
@Danack that's true
15:47
@developer10 ZF2 has functions for this. you are just mixing up front- and backend code
@CarrieKendall lol, interesting
@ircmaxell The context is: lxr.php.net/xref/PHP_TRUNK/ext/libxml/libxml.c#607 - the call to Z_ISUNDEF appears to me to be redundant.
@ErikBaan I'm implementing a standalone ZF2 form. What would you recommend for me to call inside a file where I'm rendering the form?
Every picture of me is kinda derpy anyway
@Danack well it's more correct that all undefined variables have a value of null, but it doesn't cause a segfault to reference an undefined variable in PHP but obviously does in C ...
15:49
@Danack does Z_ISUNDEF mean that perhaps the function wasn't actually called successfully?
@developer10 I already told you yesterday, taht you need to use post-redirect-get
a function call can succeed without setting return value
@developer10 well.. as far as i know ZF2 won't apply any posted (?) data to the form values by itself. So there is probably some code you wrote that does this.
fci.retval_ptr_ptr = &container;
...
if (zend_call_function(fci, fcc) == SUCCESS) {
    /* you don't know that the function actually set containner */
}
if you reference container here, pre 7, you might get a fault ...
@JoeWatkins By 'reference an undefined variable' do you mean try to use it, and pre-7 it's going to be a null pointer, and 7+ is will be Z_ISUNDEF ?
15:53
yeah, but not a zend null, C null, so if you call Z_STRVAL(container) (for example) you will fault ...
Ok, thanks.
but a PHP function's implicit return is still Z_ISNULL right?
Actually one more question; presumably the zend engine converts an undefined variable to null before it gets back to userland code right? /aka same question as ^^
@ErikBaan I'm using $form->setData($_POST); to set the data to be validated. That stays after the form submits. Isn't there any native ZF2 function that would "unset" this after form submission so that my inputs are cleared. I may have to foreach each input to set its value to ''. Doesn't look so nice though
word of advice: don't make "form builders", because they almost universally fail.
16:01
well.. big applications without form builders are hard to maintain too
@developer10 you should use PRG like mentioned before. If you dont want to do that (but you should), you can also execute setData(array()) again after validating to be sure values are empty
@ErikBaan OK, I should probably look into PRG stuff as that seems to be the best practice and I'm always trying to learn good things. if that fails I'll try the second option you recommended. Thanks!
@bwoebi thx
@ircmaxell now it is, but the old function, not always lxr.php.net/xref/PHP_5_6/Zend/zend_execute_API.c#621 for internal functions, if there's been an exception then it's actually nulled
iirc the original thing was something to do with exception being thrown and retval being null, there's why, it's done on purpose (for some reason)
@JoeWatkins I just checked, it appears to be nulled even when there isn't an exception for 7
interesting
16:09
first it's set undef, so it's always safe to check retval in 7, which is nice ...
then unconditionally set null for internal functions ... lxr.php.net/xref/PHP_TRUNK/Zend/zend_execute_API.c#841
which is bit strange ...
then I guess implicit null for userland functions set by execute_ex, if you get that far down the stack ...
bit messy still really ...
@hohner I'm afraid I have no more recommendations
16:24
You've hit you recommendation limit. You'll need to top up some more beer credits to get more.
^ seriously pissed that in 4 years they haven't done anything with that
@Jimbo Done, but also... who the fuck uses FTP?
there is a quite simple solutions: don't use FTP
Some businesses use FTP, pretty obvious
and that's all they allow
It's also SFTP etc
Jul 11 '14 at 14:45, by DaveRandom
FTP: Fuck That Protocol
16:27
The whole thing can take 4 hours in phpstorm, vs <5 minutes in terminal
@Jimbo seriously, use ssh or sftp or scp...
@ircmaxell The issue is also SFTP I believe
still
bottom line is this: don't use you IDE as "deployment tool"
16:30
It's not. Basically we all use the same shared dev box, and we all sync our IDE's to save our changes directly to the dev box
But it's not deployment
o.O
It's for our own individual codebases - they're not on the laptop
Netbeans is rapid
and I can't see any other options with phpstorm apart from "files are accessible via FTP/SFTP/FTPS"
@Jimbo and I thought that my company has shitty infrastructure ... jeez
1998 called and wants its deployment strategy back
I know right
10 devs - devbox has 200GB storage
I haven't seen it but I bet it's a fucking raspberry pi with a hard drive attached to it via USB
16:34
lol
"the dev box"
If there's a developers hell, then in that the Devil will make me write tests for this 3091652746875000000 NPath complexity.
@Jimbo Used to work in a company where we had a similar dev environment
Only the server had so little hard drive space
That it would occasionally silently reject SVN commits
and at least reconfigure the webserver to use vhosts
16:36
I can't tell you how many times I lost work due to only have 6GB worth of hard drive space on the one dev box
@AlmaDo please tell me that you made up that number
@tereško he could tell you that, but he'd be lying.
@tereško unfortunately not
That method also have cyclomatic complexity as 62
I need to stop this. I just sent another mail to internals...
I think you're looking at that npath complexity the wrong way. You see an insurmountable number, I see an easy 1545826373437500000 reduction for refactoring out an if - how good is that gonna look during review :D

« first day (1546 days earlier)      last day (3627 days later) »