« first day (673 days earlier)      last day (4289 days later) » 

user1125394
2:00 PM
this is a joke
 
user1125394
$pattern = '/^(?!(?:(?:\\x22?\\x5C[\\x00-\\x7E]\\x22?)|(?:\\x22?[^\\x5C\\x22]\\x22?)){255,})(?!(?:(?:\\x22?\\x5C[\\x00-\\x7E]\\x22?)|(?:\\x22?[^\\x5C\\x22]\\x22?)){65,}@)(?:(?:[\\x21\\x23-\\x27\\x2A\\x2B\\x2D\\x2F-\\x39\\x3D\\x3F\\x5E-\\x7E]+)|(?:\\x22(?:[\\x01-\\x08\\x0B\\x0C\\x0E-\\x1F\\x21\\x23-\\x5B\\x5D-\\x7F]|(?:\\x5C[\\x00-\\x7F]))*\\x22))(?:\\.(?:(?...
 
@cyril ?
 
@PeeHaa the cake is a lie, that's all you need to know about that
 
lol
 
user1125394
2:03 PM
@PeeHaa your regex pattern is it serious?
 
@cyril Why not?
 
function validateEmail($email) {
  return filter_var($email, FILTER_VALIDATE_EMAIL)
}
 
user1125394
All email providers have their email rules
 
user1125394
gmail => only letters numbers and dot
 
2:06 PM
and you validate that by the traditional confirmation email
:)
 
@Lusitanian I'm going to add this into my question
 
@PeeHaa "Writing a regex to match an RFC-conforming email is possible, but you'd waste a lot of time doing it. Instead, just use filter_var. Someone already did all the work for you!". That's the canonical answer :P
 
@NikiC I just stated it's impossible for mortals :)
 
Me? Never :P
 
:)
 
2:10 PM
I might have stated that it is hard and a waste of time ;)
 
@cyril , why would that matter? The validity of email address is not based on provider rules but on RFCs
 
user1125394
yes true, but gmail IS the rfc ;)
 
@cyril right...
Any drawbacks of doing this?
if (!(checkdnsrr($domain, 'MX')) {
    // domain is not valid
}
Besides the typo is just spotted
 
the typo :P
 
user1125394
the email down?
 
user1125394
2:15 PM
the email domain?
 
@PeeHaa I always did that and seemed to work fine
 
great
 
user1125394
I should look the email RFC, to see if we can put unicodes in emails an​*̶͑̾̾​̅ͫ͏̙̤g͇̫͛͆̾ͫ̑͆l͖͉̗̩̳̟̍ͫͥͨe̠̅s@mail.com
 
you can
 
@cyril The extension supports unicode characters.
 
2:17 PM
.. if you should is a but different question
 
user1125394
so then it's not a good idea to validate using Regex
 
@cyril Everything is a regex
How else do you think all the validation tools work?
 
1 min ago, by cyril
so then it's not a good idea to validate using Regex
in what context ?
is it bad to use some half-arsed regexp for validation ? yes
 
user1125394
for emails, but you are right
 
is it bad to use the regexp which PeeHaa posted in that answer ? no
 
user1125394
2:21 PM
regex can do those things as long as you don't use them for structured documents
 
wtf are you talking about now ?
 
user1125394
I was still thinking dome unicodes could break regex :)
 
i seems like you are trying (and failing) to troll
 
@NikiC I was thinking. Is that something you can just use (the regex from the PHP source) or is that (can that be) copyrighted? Meaning you cannot use it / you have to credit PHP?
 
user1125394
answering your "in what context"
 
2:23 PM
@PeeHaa "Copyright © Michael Rushton 2009-10" (from the comment above it)
 
@NikiC Can you copyright a regex pattern?
 
no idea
they probably included the copyright notice to be on the safe side
 
@PeeHaa , i have seen copyrighted SQL queries , so the safe bet would be "yes"
 
@tereško lol wow. Will add the info to the answer or see whether mr Rushton is still alive :)
 
user895378
@cspray I did not -- try again ... "rd_lowr_ey" (without the underscores )@gmail.com
 
2:25 PM
@rdlowrey morning :)
 
user895378
morning all
 
user895378
I just set a recent personal record for earliest time waking up on a Sunday morning :)
 
@rdlowrey I was transposing the "e" and the "r", of course.
 
@rdlowrey 10:30? ish
 
9:26 AM? :)
 
user895378
2:26 PM
I woke up ~10 :)
 
noice :)
 
user895378
@cspray no problem lots of people switch those. happens all the time.
 
I only wake up on 7AM on Sunday :D
 
user895378
@cspray League invite sent.
 
@rdlowrey What is this fantasy football thingy?
 
user895378
2:31 PM
@PeeHaa Basically you have a draft where each team selects american football players for their own personal team. Then, each week, you accrue points for the statistical performance of the players on your team for that week.
 
user895378
And each week your team is competing against another team in the league.
 
user895378
At the end of the season you have playoffs and an eventual winner.
 
user895378
It's a lot of fun if you're into american football.
 
@rdlowrey Neh. It's the wrong kind of football for me ;-)
 
user895378
@PeeHaa yeah, I figured :)
 
@tereško hey, is the first answer good? stackoverflow.com/questions/1497497/…
 
@JoeySalacHipolito not really , it's MVP
 
lol
this article is so nice! now I know MVC much more! — 尤川豪 Jan 13 at 9:04
 
then again , which is the "first answer" ? maybe you have different orderingby defaul
 
@JoeySalacHipolito Link the answer directly by pasting the share URL.
 
I thought I have a CodeIgniter folder in my C:\Windows\System32... a quick recheck revealed that it's CodeIntegrity...
 
@JoeySalacHipolito , i would recommend to user this : r.je/mvc-in-php.html as "hello world for MVC"
ehh .. today i have been listening to only one band (that was the short version) one band again
 
thanks guys!!!
 
3:31 PM
@teresko i'm trying to create a mini-mvc framework . . i'll create a base controller, a base model, and a base view, any suggestion on what this base class can have inside? in my previous work, the base model do this in its constructor
$this->db = new Database(DB_TYPE, DB_HOST, DB_NAME, DB_USER, DB_PASS);

and the base controller have this in its constructor
$this->load = new View;

and the base view contains a method called render($name, $data)

but base from r.je i need to create an instance of the controller and the model inside the view, so i need to have this inside the base view, righ
?
 
@JoeySalacHipolito Don't have Base* stuff
 
@JoeySalacHipolito you don't want anything base*
and you don't want data access from your domain objects, that violates the SRP
and a view isn't a template
 
yess .. Katatonia has a new album
 
what do you mean by don't have the base . .
 
don't have a BaseController or BaseView or whatever
 
3:35 PM
@JoeySalacHipolito , in the r.je link the view an model is created outside the controller
 
@tereško yes, i've seen that.
 
then what is your question ?
 
im confuse
*confused
i shouldn't create a base stuffs? where my other controllers can extend to? or the other models can extend to, or the views?
 
why do you want to extend anything ?
 
Exactly
 
3:40 PM
for example, for the other models to access the db, i could just extend the baseModel that contains this $this->db = new Database(DB_TYPE, DB_HOST, DB_NAME, DB_USER, DB_PASS);
 
@JoeySalacHipolito Don't tightly couple your database class to your models
 
@JoeySalacHipolito I already said that you shouldn't have db access from a domain object
that violates the SRP
 
i actually do not understand what do you mean @Lusitanian, can you tell it in simple language, lol
 
In object-oriented programming, the single responsibility principle states that every class should have a single responsibility, and that responsibility should be entirely encapsulated by the class. All its services should be narrowly aligned with that responsibility. The term was introduced by Robert C. Martin in an article by the same name as part of his Principles of Object Oriented Design, made popular by his book Agile Software Development, Principles, Patterns, and Practices. Martin described it as being based on the principle of cohesion, as described by Tom DeMarco in his book...
 
i actually do not understand what do you mean @Lusitanian, can you tell it in simple language, lol
 
3:44 PM
this is what yo mean with "you do not understand OOP"
 
@JoeySalacHipolito SRP === Single Responsibility Principle
SRP should extend to procedural programming with functions as well. It is important regardless of the paradigm I would imagine.
 
@JoeySalacHipolito SRP = single responsibility principle. each class should only have one responsibility
 
so by extending it, i violated it, coz the model, is used on other responsiblity?
 
no.
by using the database from within the domain object, you violate it
 
and how is that applied to ->db = new db... ?
 
3:46 PM
@meze because it's from within a domain object
 
SRP isn't about that.
 
it's tightly coupling the domain object to the database class and giving the domain object multiple responsibilities
 
$connection = new PDO('sqlite::memory:');
$model = new Model( $connection );
or even better
 
@Lusitanian double win! tigerblood!
 
if you're going to try an active-record style setup which is an anti-pattern, at least use DI as @tereško just showed
@PeeHaa m-m-m-m-m-monster k-kk-ill
 
3:47 PM
$provider = function(){
    $instance  = new PDO('sqlite::memory:');
    return $instance;
};
$model = new Model( $provider );
 
@tereško what do that code means, i know its pdo stuff..but what do you mean by that
 
lolwut ?
 
wol-lut?
 
waha...nvm . .
 
@meze you have not seen the code we are referring to .. he's be at this for days now
looking for the magical pill, which gives one complete knowledge of OOP and understanding of MVC without learning it
 
3:50 PM
@JoeySalacHipolito also damieng.com/blog/2007/05/07/…
 
@Lusitanian , that wasn't why he said that this is not about SRP ..
 
uhmm, maybe i could ask this, why is codeigniter extending a "Controller" to other controlers, or a "Model" to other models, what does this "Model" & "Controller" contains...
 
@tereško oh
@tereško no i just tagged wrong person
codeigniter is a piece of crap @JoeySalacHipolito
 
@JoeySalacHipolito , the source of codeigniter is available. What's stopping you from reading it ?
 
3:52 PM
oh!!! that gives me light @Lusitanian . . now i understand
 
how did you read it that quickly? lol
 
he read the title
 
thank you guys.
LOL!
 
3:54 PM
btw, i was referring to "codeigniter is a piece of crap" ahahaha
 
uhmm, one question, so how does a model fetch data from the database?
 
ya know .. a developer would have asked "why do you say that i tis piece of crap" ?
 
You mean a domain object. and it doesn't
also, here's another good qusetion/set of answers: programmers.stackexchange.com/questions/119352/…
 
@Lusitanian , he's usign r.je/mvc-in-php.html now as tutorial
there is only one "model" object in that example
it is a hello-world level tutorial
 
3:57 PM
ah
 
or at least i hope that he is using it
 
0
A: GeoIP installed / loaded, but not returning records

BabaThe Database might be outdated. Why don't use use a remote solution that is properly updated such as http://www.geoplugin.net/ Simple Example $xml = simplexml_load_file("http://www.geoplugin.net/xml.gp?ip=76.109.14.196"); echo $xml->geoplugin_countryName ; Output United States Full X...

 
i've read up to the user interaction . . but still can't get some parts..
maybe i must not ask further, until i get it completely
 
@tereško that's actually a pretty good tutorial
 
i know, that's why i suggested it
 
4:04 PM
good but wrong ;) new View($controller, $model) isn't it a controller responsible to choose a view?
 
uhmm, earlier ive asked about extending, uhhmm, if there are different views, i would include this code in it's construct? always?
$this->controller = $controller;
$this->model = $model;
 
@meze , your right ... damn , i thought i had found one tutorial which did not suck by default
 
so if it is quite wrong what should be change to make it right?
 
new View($model)
new Controller($model, $view)
 
wait, where is it instantiating the view and why is the view being passed the controller
 
4:14 PM
okies..gotta not that..
*note
 
@tereško that doesn't make sense, the view doesn't use the controller in his example...or ever
 
@meze , but you are wrong about the view there : controller does not choose view. It only changes the state of it.
@Lusitanian i think it is a mistake , but then it is repeated in following articles too ... i'm not sure
 
i understand the part that it only changes the state of it,
it is necessary to have a controller right?
 
@tereško hm i follow this scheme: psychopathya.files.wordpress.com/2010/02/mvc.jpg
 
so whenever i need to change the state of the view, i'll use a controller, to change the state of the view, and the view fetches the new data from its model
am i right?
 
4:16 PM
@meze , thats actually version of MVP ( with a passive view )
and even then controller should not create the view , just interact with it
 
MVP doesn't have controller at all
 
meze vs teresko . . .
 
@meze well , yes. It has a presenter , it has a different name because the responsibilities of presenter are different from controller
the same way as ViewModel in MVVM is different from Presenter
in classical MVC and Model2 MVC patterns you have an active view , which requests information from model layer
the different variation of original MVC pattern are mostly centered around the changes in implementation of presentation layer
 
@tereško how long have you been programming php?
 
a bit over 6 years (5 of them as paid developer), started actually learning it ~2 years ago
 
@tereško i thought you were undercover ;)
 
how about hoow long have you been programming?
 
@Lusitanian , that's my cover story and i am sticking with it
 
hehehe
 
29 mins ago, by tereško
@Lusitanian , he's usign http://r.je/mvc-in-php.html now as tutorial
reading insead of doing the job. ty
 
4:27 PM
lol
 
@hookman , keep[ in mind that we @meze found a mistake there
 
It's not a serious one though, as the way he describes it conceptually is still accurate
 
the we should repost it somewhere else..lol
or maybe teresko must create his own tutorial
 
too much effort
 
i'm looking forward to that though
 
@tereško When I'm reading something new, it takes some time and analysis to treat it as best practice
Extending PDO class to use prepared statements is rather oddball approach though
he-he
 
i read an article that extending it is not a good practice, what can you say @tereško
referring to PDO
 
it's mostly pointless practice when it comes to PDO
OOP has this rule of thumb :
> favor composition over inheritance
 
@tereško never worked with MVP but it looks like an UI pattern for decoupling view and model
 
4:35 PM
@meze , that would describe all MVC-related patterns
but if you have used a framework which claims to use MVC, then you most likely have used some poor variation of MVP
 
let's take asp.net mvc as an example
 
that's doing it right, right?
 
well , ASP.NET MVC is one of the better examples when it come to Model2 MVC (especially if you use what they call "viewmodel" but what actually is just fully realized View)
i was thinking more of RoR, Django and CodeIgniter
 
interesting, facebook chat is written in erlang
 
fak the facebook
couchDB is written in erlang
 
4:42 PM
indeed
 
Hey, hey
 
it has been on my "read when stranded on public transport" list for almost a year now
 
I was stuck down in the good'ol mysql, then I was told by a bunch of people to switch to mysqli, because mysql is depreciated. I need some advice with it though. What can I use in mysqli instead of the old mysql_result?
 
@JordanRichards use pdo . . mysql depreciated? no.
 
I looked on the manual, but it's hard to find the one that I need, there's sooo many!#
 
Nah, I don't want to use PDO
mysql has been said to be depreciated...
 
-_-
why no pdo
 
use pdo or die . . lol
 
@JordanRichards Hey there.
 
lol.. I've already started using mysqli
so PDO is a no-go
Hey Levi!
 
4:46 PM
why is everyone talking to small avatar people again ?
 
you can still use pdo even when using mysqli
 
I was just thinking "If only Levi was here..."
 
or you'll need to rewrite it again when they deprecate mysqli
 
@meze There are no plans to do so.
 
this conversation is making me also @meze why would they deprecate it
 
4:46 PM
in the future i mean ;)
 
with the mythical php 7 :)
 
@meze lol, I doubt that,
levi, to a chat room?
 
you should use PDO though
 
@Lusitanian for the same reason as mysql - noone wanted to maintain it
 
@JordanRichards Sure.
 
4:47 PM
@Lusitanian why should I?
 
that's not really why
 
@meze , problem with old ext/mysql is that it has not been maintained for more then 5 years now. It's not supporting current MySQL capabilities
 
@JordanRichards it's the 'preferred' method of db-access [arguably] and gives you abstraction over multiple rdbms apis
 
mysqli and pdo_mysql are both based on mysqlnd
 
meaning you don't need to change the $db->prepare statements, etc if you decide to change to a new rdbms like postgre
 
4:48 PM
oh so you mean i should use mysqli too?
 
no.
 
if i move to mysqli what should i change. im using pdo?
 
you would not be able to use named parameters and exceptions for error handling
 
it can't use exceptions?
 
in mysqli , afaik , no you cannot
 
4:52 PM
it uses some sort of last_error property
 
i see... so what do you use @tereško . . mysqli or mysql?
 
but with 100% more jquery
 
@JoeySalacHipolito I use PDO
 
database type?
 
4:55 PM
postgre , sqlite and mysql
 
most of the time?
 
yes =P
 
okies..i'll read their difference later..hehe
 
@Lusitanian , you might be interested in pragprog.com/articles/erlang and learnyousomeerlang.com/content
 
@tereško bookmarked under my "read-when-I-have-time-to-use" folder
 

« first day (673 days earlier)      last day (4289 days later) »