« first day (594 days earlier)      last day (4340 days later) » 

5:02 PM
@MattMcDonald For your troubleshooting needs: stackoverflow.com/a/6403260/367456
 
user1385191
it works now
 
> Array(8).join((+[][[]]+[])[+[]]+(+[][[]]+[])[++[[]][+[]]])+([]+{})[7]+String.fro‌​‌​mCharCode(66)+(+[][[]]+[])[++[[]][+[]]]+(+[![]]+[+(++[[]][+[]]+([+[][[]]]+[][[]‌​])[‌​++[[]][+[]]+[+[]]]+[++[[]][+[]]]+[+[]]+[+[]]+[+[]])])[9]+(0["constructor"]+[‌​])[11‌​]+(![]+[])[+!+[]]+([][[]]+[])[+!+[]]
paste that into your browser console.
 
Is it like "press ALT+F4" ?
SyntaxError: illegal character
 
Anyone have some good folder/image monitoring/tagging/tracking program suggestions?
 
5:08 PM
Not sure what you mean by that
 
I mean, track when its moved to in folder, when its moved out, what tags it has, disallow editing or deleting of said folders or files.
 
ah. Nope, sorry :]
 
I know its a really specific thing, I was thinking I could do it in PHP, not sure how I should go about it yet, probably write out a syllabus or something to plan it out.
 
@Event_Horizon Please take a look at the FAM Functions. No idea what you mean by tags, as far as meta-data with images is concerned you can read them with PHP, too.
 
@hakre Very helpful thanks.
 
5:36 PM
@hakre FAM Functions seem to be unsupported and removed from default install as of 5.1, do you think I could accomplish the same thing with SplFileInfo ?
 
one question
im using this server-side validation class
but i cannot redirect user to another page since it echos out something
how does it actually works i mean in a registration website
after server validation does it redirects to a new page?
 
^ the chat was adding an illegal character
 
@rlemon u there?
quick question if u dont mind
i want to validate the form server side
so im using this class tht it validates fields, but i cannot redirect it to a new page
do u use a class for server -side validation?
 
that is generally the case when using third party scripts which you do not understand.
no i write my own code
so yes I use a class... which I wrote
 
5:49 PM
mm
 
usually client and server side validation is the way to go, with varying degrees of complexity for both
though only server side is presumably just as secure
i totally mis-read that question. Need more coffee it seems
 
im looking for a class to use
 
what are your requirements
what doesn't work with what you have
better still: what have you tried
 
5:52 PM
SHOW US YOUR CODE!
NOT THE CLASS </yell-type>
 
but i dont knw y i cannot redirect to a new page since it displays something which it apparently notihing
$validator = new FormValidator();
$validator->addValidation("name","req","Please enter the Required field");
$validator->addValidation("mail","req","Please enter the Required field");
$validator->addValidation("mail","email","Please enter a valid email");

$validator->addValidation("confirm_email","eqelmnt=mail","erere");
$validator->addValidation("password","minlen=6","erer");
if($validator->ValidateForm())
{


header('Location: http://www.google.com/');




}

else
{


echo "error";
}

}
 
@rlemon troll removal 101, i lolled
 
lol
i love my meme generator
working on a new UI
@SoroushAtarod ok, so the form is not validating. now find out why
 
form validates
but it cannot redirect
 
if($validator->ValidateForm()) // I must be returning falsey
 
5:54 PM
it returns true
 
then what is the error
if header is being run, and there are no errors, the page will redirect.
 
since its returning true it cannot redirect :S
 
otherwise there are errors (possibly not being reported)
you are possibly outputting data prior to setting the header
 
<?php
session_start();
require_once('includes/formvalidator.php');
if( isset($_POST['submit'])) {
session_register('name');
$_SESSION['name'] = $_POST['name'];
$_SESSION['mail']= $_POST['mail'];
$_SESSION['confirmMail']= $_POST['confirmMail'];
$_SESSION['location']= $_POST['location'];
$_SESSION['password'] = $_POST['password'];

$validator = new FormValidator();
$validator->addValidation("name","req","Please enter the Required field");
$validator->addValidation("mail","req","Please enter the Required field");
 
posting walls of code is not going to change my opinion on your problem.
 
5:57 PM
il go through it
 
change header() to die('here');
 
i believe i better spend the time writing in on my own
 
see if you can see that
 
somebody can help me with an apache problem ? I want to access another hard disk than my hard disk where wamp is installed
how can i do that ?
 
@rlemon I can see it
 
5:58 PM
IF $validator->ValidateForm() IS RETURNING TRUE THE ERROR IS IN THE header() FUNCTION... YOU NEED TO ENSURE ERROR REPORTING IT ENABLED SO YOU CAN SEE IT.
yell typing is the only way to be heard by some.
 
Also, you should include the protocol in the URI within header(), else it might think it's relative
 
@orourkek that is the chat
converting links
i assume
 
ah, could be
 
header('Location: google.ca'); is actually header('Location: http://google.ca');
this is why it is important people learn how the formatting works and format their code when pasting it in here :P
 
or use an online code paste system that won't do silly things like that :]
 
6:01 PM
@SoroushAtarod last thing I can think of is put error_reporting(E_ALL); at the top of your page, to ensure you are seeing all errors
 
@rlemon thats what I did
Deprecated: Function eregi() is deprecated in F:\xampp\htdocs\recently\includes\formvalidator.php on line 237
its old
 
idk how you saw the die statement if there were errors before it
don't use that validator.
it's not hard, PHP tries to make it easy
 
1 min ago, by rlemon
write your own. http://php.net/manual/en/filter.filters.validate.php
1 min ago, by rlemon
it's not hard, PHP tries to make it easy
keep using third party scripts and i'll see you back here on monday trying to figure them out
write your own and you'll know how it works and when you have an issue you can be like "Yo, this exact line is my problem, i'm trying to do XYZ but in it's current form it's doing ZZB can anyone help"
 
@rlemon no errors are reporting
@rlemon yet i cannot redirect
this is to interesting
 
6:08 PM
3 mins ago, by rlemon
1 min ago, by rlemon
write your own. http://php.net/manual/en/filter.filters.validate.php
 
if i solve this I will learn something new
 
33 secs ago, by rlemon
3 mins ago, by rlemon
1 min ago, by rlemon
write your own. http://php.net/manual/en/filter.filters.validate.php
 
it usually works that way
 
^ do this and you will learn even more
 
@Event_Horizon No, SPLFileInfo has not file-system notifications. However, search the site a bit you find various unix utilities and libraries that can do this. Try to integrate with one of those. It's not trivial to code file-system notification, so take something that exists.
 
6:19 PM
@rlemon i fixed it :D
there was a space after closing tag :O
 
closing php tag?
 
Alright, I'm thinking I'll mix DirectoryIterator and some other classes/functions together. It seems to have MOST of what I need to do, I'll build the rest myself if I don't find anything.
 
Hello, can someone take a look at this for me please
0
Q: ORM Mapping two tables with PHP

Tom HalleyCurrent situation I have two tables in my database, one for posts, and one for ratings. These are linked with a relation in the MySQL so that one post may have 0, 1 or multiple ratings, but one rating can only be applied to one post. When I fetch a list of posts, I also want to get ratings, but...

 
yea
@orourkek after ?> there was a space
 
You can omit the closing php tag in most scripts, and won't have to worry about that
 
6:23 PM
do u mind telling me how?
 
HV alert
 
btw , that post (linked higher) looks really well written
 
thanks haha
 
@tereško agreed
 
that problem yesterday i had with my sql that i asked you about teresko
 
6:27 PM
@SoroushAtarod How what? how to omit the closing tag?
 
I taught you know :
You can omit the closing php tag in most scripts, and won't have to worry about that
 
turned out that by adding the join to my query it made the WHERE clause ambiguous
 
Yeah, the closing tag (?>) is completely optional. Unless it's inline code, of course
 
didnt knw tht @orourkek
thx :)
 
user895378
Does anyone have any good links to discussion on when it's preferable to use constructor injection for objects passed by reference and modified as opposed to directly typehinting and asking for an object in the method that operates on the object in question (I'm not talking bout setter injection here)?
 
user895378
6:29 PM
I guess I'm asking if it's preferable to just ask for an object in a method signature instead of the constructor if only that specific method operates on the object in question.
 
user895378
As opposed to a mutable object passed by reference being operated on and having its state altered covertly inside another object ...
 
@rdlowrey Will the consuming object need the passed object at any time during its life except during the call of the single method?
 
links? no. Opinion? sure: typehinting, assuming the container won't need to be extended later to use the object more
 
That's an easy one. If more than a few methods well require the same object instance, pass it as a field. If not, pass it directly to the method.
 
user895378
@Bracketworks I don't have a specific case in mind, just interested in opinions and discussion on the general concepts surrounding objects passed by reference and best-practices for altering their state inside other objects.
 
6:32 PM
there are two things you might look into :
- store to total rating with the post ( i know that this would be against 3NF, but it's good for optimization)
- user `SELECT SUM(rating) .. GROUP BY statusId`
 
Do what makes sense
 
that's of course if i understood what you meant , @TomHalley
 
^^
 
user895378
@Truth I get that, but I'm more interested in discussion on how people feel about altering the state of an object passed by reference inside another object
 
user895378
It's kind of an obtuse subject I guess ...
 
6:33 PM
If only one method uses the object then it seems silly to pass it into a class field
but, that would be more extensible I suppose
 
If you for instance have a Door object, with a paint() method which requires a Paint object, it doesn't make sense for the door to hold that object in the first place. Only that method will ever use it.
 
@tereško haha okay i think your second option is what im afte
 
@TomHalley .. oh , and what you have there looks less like an ORM and more along th lines of DataMapper
 
Another example is an IRC bot I made a while ago.
 
6:35 PM
@rdlowrey, you still struggling whit that Response object ?
 
user895378
Value objects should generally be immutable because you don't want their state changed out from under you, but I'm talking specifically about the efficacy of object A modifying the state of object B.
 
user895378
@tereško Not specifically, I really just want to look more at the ideas @LeviMorrison mentioned.
 
It holds a list of User objects it knows, because the bot constantly interacts with them
 
@rdlowrey , $mapper->fetch( $user ); .. seems fine to me
 
@rdlowrey if you're just looking at the general efficacy of it, then the discussion is done because both methods can produce the same result, no?
 
6:38 PM
@TomHalley , the first option would be more practical , with large data sets
do you really think that SO is re-counting your reputation on each refresh ?
 
can you go into a bit more detail with the first option you posted teresko?
 
@TomHalley basically you need two have same two tables: post and ratings. But the Posts table contains another column - total_rating , which is updated when rating is added (it could be a trigger in table or daemon running in the background )
 
user895378
@orourkek It's less about where object A gets access to object B and more about is it a better idea not to have object A transparently changing the state of object B while it has access to it. Like how globals are bad because you can't ever be sure of their state. I guess as long as the object being operated on has a clearly defined interface/black box you're always sure it's in an operable state. Public properties are right out.
 
yeah that's what i have
 
the Ratings table become something like "proof of total rating"
 
6:42 PM
could do but i would have to limit the ratings to 1 per user
 
@rdlowrey Restricted access to Object B from Object A is probably the more manageable route
 
you use it , for example, if rating from some user get deleted , and you need to recalculate the total
 
in terms of predictability
 
okay i see what your saying, i will try that
 
the trick is , that you do not recalculate the total rating on each read
just on each write
 
user895378
6:43 PM
Yeah, that's the general conclusion I've come to. As long as object B is sufficiently encapsulated you shouldn't need to worry about it.
 
switching back to OOP thread
 
yeah, got it.
thankyou
 
hmm .. maybe i should write that up in answer
 
user895378
Otherwise you wouldn't be able to have a Microwave object operate on the Pizza object and call Pizza::heatMe() to change the private Pizza::$prepartionStatus property from "frozen" to "delicious and warm"
 
@rdlowrey The object (B) is still only as predictable as it's interface, assuming it has one, combined with whatever method Object A uses to modify it. Passing Object B into a field of Object A opens it up to potential exposure in all of the other methods as well
 
user895378
6:48 PM
@orourkek Right, that's why encapsulation and using interfaces to enforce design contracts is important.
 
Microwave Pizza? Yuck :]
 
user895378
@orourkek I know, right. Gross :)
 
user895378
I kind of just needed to talk out why object references aren't evil as long as you write your objects correctly.
 
@rdlowrey Au contraire; Dominoes pizza is somewhere around 800 times better after being nuked.
 
user895378
6:50 PM
@Bracketworks I prefer room-temperature leftover pizza, personally
 
@rdlowrey Likewise, it was more of a jab at Domino's
 
user895378
I don't care what the advertisements say, any delivery pizza > frozen pizza from the grocery
 
Oven pizza is awesome
If you know how to do it right
 
user895378
Maybe that's my problem: if it isn't breakfast cereal I probably can't cook it correctly.
 
I used to have a recipe for making them myself
Far superior to any delivery I've had. And about 70% cheaper to
 
user895378
6:55 PM
In a related note, I think the above encapsulation discussion necessarily means that you should be very careful about getters exposing object properties (because of references) to avoid having other objects modify the properties of composition objects.
 
@rdlowrey , what's with you an questioning of best OOP practices ?!
 
user895378
@tereško Not questioning, investigating for better understanding :)
 
user895378
I disagreed with a couple of things that came up in chat yesterday about object references but realized I didn't know why I disagreed, so I needed to work out the logic behind my opinions :)
 
user895378
I do think it's important not to break encapsulation using getters to return objects by reference (and give outside classes access to the black box if they shouldn't have it).
 
user895378
7:04 PM
Often people just write getters for everything by default without giving any thought to why or if other objects should have access to those private/protected properties.
 
7:16 PM
 
user895378
@tereško lol if that title doesn't scream HIGH QUALITY I don't know what does.
 
My eyes get as far as "Dreamw" before I immediately black out the last few seconds of my life and skip down the page
 
@rdlowrey Just keep copying the "advice" comment. He'll get the picture.
 
..
 
7:24 PM
Am I seeing this right? if (PHP_VERSION < 6) { (from stackoverflow.com/questions/10856048/…)
 
@tereško yep the first option you gave me has fixed it. thank you very much.
 
@TomHalley , keep in mind that this solution will work slower and slower as the ratings table begins to GROW
 
user895378
@Bracketworks oh no ... oh no ... OH NO!!!!!!
 
Nevermind.
 
Because of the great demand, here is Part II: Kiss my tanned little ass. – Tanned Collection Part 2
4
 
user895378
7:31 PM
@Bracketworks Justice has been done:
 
user895378
Wait, wait, wait. WAIT! ... if (PHP_VERSION < 6) { ??? Really? — rdlowrey 1 min ago
 
I'm sure thats just analogous for if (!$pigs->canFly()) {
 
user895378
Yeah, it's kind of like the WHERE 0 = 1 in his SQL query.
 
user895378
That's one of the all-around worst questions I've ever seen on SO.
 
At least he knows that DW is poop. He could always skin Eclipse/Netbeans to look like it.
 
7:41 PM
Hi!
 
@Bracketworks , there is difference between "knows" and "understands"
 
@tereško True
 
@tereško priceless
 
/me is using Dreamweaver right now
 
7:52 PM
my condolences
 
PhpDesigner does the job.
 
no , i would actually contend that PHP Designer is worse then Dreamweaver
 
no need, I actually like using it.
 
@teresko ...so u r saying the tool for the job is?
 
what ?
please, write in english
php designer is what happens if some asks Delphi developer to build an IDE for PHP
 
7:56 PM
@tereško Lol..so what do you propose as the 'best' tool?
 
I'm guessing he's gonna say either emacs or Sublime
 
@RedCoder Anyone can use anything. Use punch cards. Some IDEs simply have better work flow. This comes from dev teams that understand the problem domain of working with a given language.
 
It's like with frameworks. There are no "best" , but the "worst" are quite clear
@Marcel , as an ST2 user , i can say that it sucks for php , but it has few redeaming qualities (also , it is not an IDE, different category all-together)
 
user895378
The bigger issue with Dreamweaver is not that it's terrible (which it is), but that on average the quality of developers who use Dreamweaver is statistically much lower. Serious developers use serious tools. Dreamweaver is a point-and-click tool mostly popular with people who want an IDE that writes code for them. It is not a serious tool.
 
@Bracketworks Ok...let me just rephrase it. Give me an example of a tool written by those who 'understand the problem domain....given language'
 
7:59 PM
@RedCoder I favor Netbeans/Notepad++. Come at me bro.
 
@RedCoder , i would say that bot PHPStorm and Aptana are good at it , but there are issues with both of them
 
But seriously, people will take issue with it, they don't like it, etc. Frankly, I believe it provides a thorough development experience, through the use of plugins and exhaustive settings.
 
I just realised we're in PHP, so I would have said Eclipse or Aptana
Think Light Table will be any good?
 
@Bracketworks Windows tools?I think Aptana is Linux.
 
@Marcel , for what ?
@RedCoder lol .. so naive , most of IDEs are cross-platform (except dreamweaver and kdevelop)
 
8:02 PM
Sorry, I meant Light Table
 
@tereško Lol...haven't tried most of them.
 
is saw the concept video .. but i cannot remember why i disliked it
 
@RedCoder All the more reason to drop PhpDesigner for a week and explore. If you honestly can't find something better, then go back to it. Or punch cards. Six of one, really.
 
@tereško phpDesigner works great for me.
 
@RedCoder , so you like phpDesigner , because you have not tried any other
 
8:04 PM
@tereško Well, netbeans is slow...you'd expect that from a java written program.
 
@RedCoder , it is slow because you know it or because someone told you so
 
@tereško Because i used it.
 
@RedCoder Aaand? You switch from it based solely on it being "slow"? To PhpDesigner no less.
 
btw , does you IDE supports php 5.3 ?
as in namespaces an closures
 
@Bracketworks Yes. I now have a very slow computer and phpDesigner is very lightweight. Does a neat job for me. And full featured. Written in c++.
 
8:13 PM
Never had any major speed issues with netbeans.
Just issues with how it's autocomplete tries to help you out
 
@RedCoder , does .. it .. support namespaces and closures
 
@RedCoder I used to use it, version 6 something. I stopped. I use Netbeans. It is thorough in its features, has a large community, and is multi-platform. I found PhpDesigner was not.
@tereško It does. As of January 2012.
 
lolwut , php 5.3 was released in 30 June 2009
 
lol
 
@rdlowrey He you changed your avatar ;)
 
so the php 5.4 support should be added some time in mid-2015
 
@tereško These, are all facts sir. All facts. lol
 
hi there, please help me!
 
@Bracketworks It's in version 8 now. A lot of new stuff implemented though not sure of the community.
 
8:18 PM
I have something like this jsfiddle.net/rlemon/qfN2v/1
 
@RedCoder Netbeans had support for 5.4 before it was out of RC. /convo
 
@Hypn0tizeR , this is php room
 
When I submit the form and if there are validation errors on my page, all the new elements dissapear
 
user895378
@hakre I wanted to switch to the mad men avatar for a few days because the last episode was maybe the best non-premium-channel hour of television I've ever seen. Never fear, the "Too Tanned Guy" brogrammer avatar will be back soon :)
 
how to make them to not dissepear with php?
 
8:19 PM
It's the end of an era
 
@RedCoder , also , how comes it support HTML5 and CSS3 , when the standards have not been completed yet
 
I understood that this is php room) I add some new elements with javascript, but they dissapear after submiting, if there is a validation error :)
 
@tereško Why not? Everyone else claims to support them
 
@tereško (lol, so does Netbeans)
 
That thar bandwagon's ripe for the jumpin' on
 
8:21 PM
@tereško HTML5 is on...u haven't noticed. Of course not all standards have been implemented but they're in the oven.
 
@GordonM What era is that? Is the timestamp going to turn over or something?
 
@Hypn0tizeR AJAX!!1!
 
The end of the Too Tan Guy era
 
<?php foreach($data as $row): ?>
<tr>
<td><input type="text" name="trackNumbers[]" /><?php echo $row['trackNumbers']; ?></td>
<td><input type="text" name="trackTitles[]" maxlength="128" style="width:225px;" /><?php echo $row['trackTitles']; ?></td>
<td><input type="text" name="trackLengths[]" maxlength="6" size="7" /><?php echo $row['trackLengths']; ?></td></tr>
<?php endforeach; ?> How to define the $data here to make those fields to not dissapear? :))
 
8:24 PM
@GordonM He'll be back... he'll be back.
 
@Hypn0tizeR , here is the key to solution if ( !empty($_POST)){ var_dump( $_POST ); exit; }
 
@Hypn0tizeR Have you asked a proper (read; actual) question yet?
 
@tereško Angry birds is a prime example of HTML5. End of examples.
 
Ok, I add new tr each time when I hit a button. So I have a lot of TR's like this. But those dissapear when I submit the form and if there's an validation error on the form
 
8:26 PM
HTML5 is dandy. Pre-emptive support for half-baked standards is alright if you ask me. It's not supporting implementations 3 years old that's the problem.
@Hypn0tizeR
>Have you asked a proper (read; actual) question yet?
 
i want to remember all the information from these inputs
 
@Hypn0tizeR Open a commandline and type sudo apt-get remove php5
 
how to do it? :D
 
@GordonM harsh!
 
8:28 PM
Yeah, sorry. Newbie fatigue, I think.
 
Off.
 
@Hypn0tizeR You should have client side validation and server side validation that do the same thing. In JS, make sure the form is valid before it will be allowed to be submitted.
 
@Hypn0tizeR My real advice would be, do some research, try building something simpler, learn the ropes and try to understand what you're doing before anything else.
 
On the server, make sure it's valid before you save it to the database.
 
@Hypn0tizeR I think this link might get you moving in the right direction.
 
8:31 PM
Ok, I will ask my question there in some minutes
You can't get my question here
 
@rdlowrey you have a link to that tv series?
 
Yay for anonymous classes.
 
8:53 PM
0
Q: How to POST/echo values of more arrays?

Hypn0tizeRI have a js function which multiplies a DOM element. I hit it 2 times (for example) and I get 3 Elements like this: <tr id="toBeMultiplied"> <td> <!-- How to echo the value of this input? --> <input type="text" name="numbers[]" /> </td> ...

help please :)
 
@Hypn0tizeR So you want to tell me you are not smart enough to solve that?
 
:}
 
I don't know how to manage that
 
Imagine that the solution is very, very simple.
 
9:09 PM
How to echo values continuously on my form, after a refresh for example? Values remain but inputs disappear! :/
 
user895378
@hakre yes, my sister has worked on it for the last two or three years ... and it's a really good show
 
@Hypn0tizeR does the submit bring you back to the same screen that created the form?
 
yes
 
Are the values always filled in when you submit?
or are the blank blocks?
 
I check the values by print_r, and they are just there. But my new DOM elements disappear!
 
9:17 PM
@Hypn0tizeR i just posted a possible solution
 
 
@djdy Oh Ok, great, looks like the best answer for me!
 
> How to not order social buttons.
 
@hakre haha
 
Thanks
this is my first time working with arrays
@hakre
 
9:22 PM
@djdy That's what I meant that @Hypn0tizeR should imagine the answer is very, very simple.
 
is this your answer?
i mean the same like djdy answered?
 
@Hypn0tizeR Yes.
That is the only way you can do it if you want to have this in a roundtrip.
 
Now I understand that this is a really simple
thank you guys one more time
 
by the way, i would escape it before sticking it back into value=""
otherwise it'll be very easy to break the form
 
@rdlowrey cool, the The Good German.
 
9:26 PM
@djdy what do you mean?
 
if someone enters this into the input: "><div>blablabla</div>
and you're inserting it back into value="" without treating " and > differently
that entry will end up closing the input field, and starting a div
 
i do strip_tags on values
and htmlspecialchars of course
thank you one more time
 
@rdlowrey I now pre-ordered the series, it's not available here.
 
9:58 PM
jo
 
10:19 PM
jo, 44 times hell won't break my score ;)
 
10:43 PM
can some one tell me.. how i can insert a pic inside a cell of excel sheet?
I am trying to make a php generated excel sheet
but can't insert image inside
I have tried everything but the PHP_Excel library
but can there be a simpler way?
 
@ppant PHPExcel is pretty simple
 
user895378
@hakre Well, it's very easy to get via torrent, and I couldn't care less about my sister's residuals :)
 
user895378
@RepWhoringPeeHaa lol
 
@rdlowrey :-) btw what happened to your face?
 
user895378
10:57 PM
@RepWhoringPeeHaa Too much tanning -- had to get plastic surgery to fix it -- now I look like a cartoon :)
 
@RepWhoringPeeHaa Just did the same thing to a few rules myself :P
 

« first day (594 days earlier)      last day (4340 days later) »