« first day (671 days earlier)      last day (4293 days later) » 

12:58 AM
@rdlowrey It was only line separator differences. So annoying.
 
/me wants Dart
 
Ooh, a PHP channel.
 
@DanGrossman OMG, you're right! It's a PHP channel. :P
 
Written in C#.
 
@Lusitanian As do I. It's very nice.
 
1:05 AM
@rdlowrey congrats, it works (:
 
user895378
@Lusitanian nice.
 
@DanGrossman What is written in C#?
 
This PHP channel.
 
@LeviMorrison I've been browsing the language spec, the C++-eey templates are shiny
 
@DanGrossman Hmm, didn't know that. How do you know?
 
1:06 AM
stackexchange network is written in .NET
thus it stands to reason that the chat system is also
 
SO said so. Also, because less than an hour ago, SO and chat.SO went down and were spewing ASP.NET errors.
 
user895378
@Lusitanian The bulk of the work is accounting for network IO failures. Every time you do anything you have to suppress the built-in php error, check a return value and potentially throw an exception. Makes testing a PITA because there are so many conditionals.
 
15
Q: What technologies were used to build the chat?

Bill PaetzkeI realize there is a similar, broader question here. But the answer is old and does not include the chat technology. Let me know (even if they completely rolled their own). Thanks! I am most interested in how they implemented Comet (aka HTTP push) it in .NET.

 
@rdlowrey i wish there a way to convert errors into exceptions for just one class
or just the current scope
 
user895378
@Lusitanian Well, you can easily set a custom handler in a scope and then restore the previous handler, but that's very cumbersome and gets ugly very quickly.
 
1:08 AM
Yes...but bleh.
set_error_handler( $callable, E_ALL, ERROR_SCOPE_CLASS );
 
user895378
IMHO, all errors should result in exceptions. But if you're writing a library for outside use, you can't really force that. You can at a framework level, but not at the library level. So for native functions in a library you mostly have to suppress and verify return values and throw exceptions at your own level of abstraction.
 
I agree. The PHP error handling is a pre-exception relic
Converting it all to exceptions would be on my PHP6 wishlist
totally dumping trigger_error and all that other crapola
 
user895378
trigger_error should be killed with fire.
 
trigger_error('There is no reason this shouldn't be an exception');
 
user895378
Plus, when you're dealing with native global functions that can potentially trigger errors all over the place (specifically networking functions) your code is going to be nothing but try/catch blocks. So networking with native PHP functions is about the only place I'm pro-suppression with @
 
1:13 AM
You could use set_exception_handler
I hate the @ operator in general
I guess the result is pretty much the same
Except with set_exception_handler you get the globally scoped handler again
"Hello Dartisans," -- i lol'd
 
user895378
@Lusitanian I meant to ping you to mention the change in Client method names from "request" to "send" ... sorry if you had to work that out on your own :)
 
Heh, it's fine, didn't take very long (:
 
user895378
2:16 AM
@Lusitanian What's your preferred editor for PHP code?
 
As just a plain text editor I tend to use kate because it's the default in KDE
 
user895378
var_dump($preseason_football === 'stupid'); // bool(true)
 
I use phpStorm 95% of the time though
 
user895378
Yeah there seems to be a lot of that going around these days. I might have to try it eventually.
 
It's pretty nice, the new version that's going to come out (5) will probably be nicer
Favorite IDE combo of all time = Visual Assist X + Visual Studio - holyshitgood
 
user895378
2:20 AM
I've never done any sort of windows-type development, so I wouldn't know
 
user895378
I find gedit works just fine for my purposes, mostly
 
I've never been a huge GNOME fan but I haven't used it in years
There are people who write long testimonials claiming that Visual Assist X changed their life as though it were a 30 minute infomercial product
 
user895378
I have an automatic distrust of anything with "Visual" in the name as it relates to writing code.
 
It's not literally visual (: - it just provides really good code completion and incredibly useful refactoring tools
also, it does fancy stuff with camelcased vars
thisIsAReallyLongVarName
this->someMethod(tiarlvn)
it'll translate the acronym
 
user895378
lol that seems so excessive to me :)
 
user895378
2:25 AM
I literally lol'd, but hey, whatever gets your code written faster is good I guess
 
VS by default has crappy (though improved in later versions) code completion for C++ because it's an absurdly complex language so it does a really good job of completing it --- seems useless for .NET though
Systems hungarian notation is the most redundant thing imaginable in a statically typed language. (no matter what Steve McConnell says)
 
@rdlowrey Code writing speed at the expense of code readability is no good. Translating camel-cased acronyms seems...dirty.
 
@cspray it's readable after it's translated - i find it to be a neat feature
 
@Lusitanian Yea...but still seems so wrong.
I know programmers should be lazy...but come on
 
Heh, to each [his/her/its] own.
 
user895378
2:29 AM
I suspect I'm going to spend this entire football season trying to convince people that they want to participate in a programmers-only fantasy football league next year. I need to find more programmers who like football :)
 
user895378
Because fantasy football is AWESOME.
 
@rdlowrey sign me up
 
user895378
I wish we could get >= 8 people together this year for an SO-chat league. Would make for good trash talking.
 
@rdlowrey You can count me in. I've never done fantasy but I'd be up for it.
 
BRB writing a fantasy football engine
back, got sued by the NFL
 
user895378
2:31 AM
It's really fun. I wonder if we could convince five more people to participate.
 
I know a guy at work who's a sports fan
 
user895378
I've got a buddy who works at microsoft who would play ... that would get us to 5 programmers :)
 
League description: "If you can describe 3/5 elements of SOLID and like football, join now!"
 
user895378
I'm going to continue to stump for this ...
 
codinghorror.com/blog/2007/02/why-cant-programmers-program.html <--- that people can't pass that fizzbuzz test is amazing to me
 
user895378
2:33 AM
Does anyone else want to participate in an SO-chat fantasy football league this season?
4
 
@Lusitanian Some of my buddies at work said I was the only applicant that was able to pass the test
 
@cspray which test
 
@Lusitanian Fizzbuz
 
@Lusitanian Yes. The words were different but the same exact logic
 
2:38 AM
wow
 
@Lusitanian Yea. That's what I said. I mean...I have no degree or anything and everything I know about programming has been self taught. The idea that people can't pass that test boggles my mind
 
@cspray other than improper line handling done in 48 seconds: ideone.com/A4Z7E
i don't understand why that's so hard
i also added really pointless comments (:
 
True that. But you missed if (i % 5 == 0 && i % 3 == 0) 'fizzbuzz'
 
no, it'll print both
it's not an elseif, it's an if
 
Ah, yes...I see that in your output. I expected to see fizzbuzz and not them separated on two lines
Touche my friend. Touche
 
2:43 AM
Yeah, that's what i meant about the line endings
 
Anyway, the frau said she wants to take a shower. So, naked chick > you guys
 
user895378
lol -- good call on that one
 
I take offense to that
enjoy
var_dump( new Task('writing a web application in C++')->isOverkill() ); // bool(true)
 
Mic
2:59 AM
Hi guys, nobody answers my question yet about binding of arrays may you help me please. I post my question a while ago. Thank you so much.
 
user895378
@Mic Your question has so much detail that few people will want to take the time to wade through it all to figure out what you're actually asking. I'd suggest trimming it down to one specific problem instead of doing a code dump and asking "why doesn't this work"
 
Mic
@rdlowrey, Im so sorry, I will edit my question again. Thank you for your concern.
 
completely off topic, but I know we programmers travel.. need discount airfare?
 
user895378
@Mic No problem. In general you'll get better results with something more targeted and concise.
 
Mic
@rdlowrey, Thank you so much, I will review again my question and post it, I hope somebody could help me.
 
user895378
3:13 AM
@LeviMorrison A hypothetical Response Client::sendRaw(string $rawHttpRequestMsg) -- useful?
 
Mic
@rdlowrey, Im done editing my question, Please see it if it's ok.Thank you.
 
user895378
@Mic Are you sure that the following code isn't a mistake? ...
 
user895378
foreach ($this->arrays as $keys => $data) {
    foreach($this->result as $keyss => $value){
 
user895378
Should that not be:
 
user895378
foreach($this->result as $keys => $value){
 
user895378
3:20 AM
($keyss --> $keys)
 
user895378
Because that would cause your erroneous output.
 
Mic
@rdlowrey, but $keys is just a variable, is it affect the output?
@rdlowrey, I'm done editing my variable, but there's no change in the output.
 
user895378
Oh, sorry, misread your code. That's not the issue.
 
user895378
Hold on, I'll take a look at it.
 
@rdlowrey Unsure. Could be.
 
Mic
3:24 AM
@rdlowrey, Just fine :) I've been working with that prob for almost 1 week but still I got a wrong output.
@rdlowrey, Ok sir, I appreciate your concern. Thank you.
 
user895378
@LeviMorrison I was thinking it might be helpful for debugging ... i.e. if something seemed amiss you could verify that the Client wasn't doing something wrong because the same response was returned using a raw http request
 
@rdlowrey True. A nicer interface than telnet :_
 
user895378
And it would give you full control over the request message (without any of the auto-header population that the client would otherwise do like adding missing Host, Content-Length, User-Agent, etc.
 
Mic
@rdlowrey, have you forgotten me? :(
 
user895378
If you separate out the individual parts of what your larger function is trying to accomplish, it will be much easier to debug (and understand)
 
user895378
3:35 AM
Dah -- I did not mean to delete that.
 
user895378
@Mic I hate to say it, but your code is a bit difficult to follow -- having if/elseif conditionals deeply nested inside two levels of foreach loops is almost certainly the reason for your confusion. You should try to follow the SRP (Single Responsibility Principal) for each method in your class. For example, instead of deeply nesting your control structures, add more methods to the class such as protected function mergeTransactions($arr1, $arr2)
 
hello anyone know how to write × in the html since when i write this it shows some other character like ~a-
 
user895378
@Mic If you need more than two (and usually one) level of indentation in a method you're probably doing it wrong. Keep your life simple with small, cohesive functions with names that reflect exactly what they do.
 
Mic
@rdlowrey, actually, I'm near to the output what I need. Just modify my codes earlier, but instead of printing the Deposit => 0, Reload => 0, Redemption => 0, it copies the output of the data of BEFORE SiteID to the NEXT SiteID.
 
3:58 AM
hey how do you all keep track of your clients passwords?
hard paper, local script/db, word doc?
 
user895378
In plain-text right next to their credit card numbers, dates-of-birth and lists of family pet names
 
@rdlowrey i thought it was just me
 
4:16 AM
Oh man, functions that do one thing...how I miss this. There's a function at work that includes the "phrase" createUpdateSelect
...it also deletes
:'(
 
user895378
lol
 
user895378
"If I don't use the word And in the name, they won't realize it violates the SRP!"
 
Everytime I see it I want to refactor it
But something that big you can't just go and refactor without fubaring all the things
 
user895378
Yeah, refactoring something like createUpdateSelect would be like pulling the proverbial finger out of the dyke: you'd soon have to refactor the entire application.
 
Well, off to bed so I can dream about code that doesn't rape SRP
See you guys later
 
user895378
4:27 AM
later
 
5:04 AM
@rdlowrey How often do you think someone would want to attach the same listener to an event more than once?
 
@LeviMorrison Are you talking about javascript? The same "listener" to an "event". What do you mean by that?
 
@Nile No, I'm talking about PHP.
PHP doesn't have events built into it, but you can code them up.
 
@LeviMorrison Okay, then never mind.
 
It's actually a very useful practice.
Onc piece of your code determines when events happen, and a different piece determines what happens at the event.
 
@LeviMorrison where would you use them?
 
5:08 AM
@Nile All over the place, actually
 
@LeviMorrison never actually heard of that... i'll have to look that up later.
 
Here's a real example from my work.
Someone completes a form that requests an account for the supercomputer.
First, is the request in the proper format?
 
user895378
@LeviMorrison I'm not sure -- it would be simple to implement with the auxiliary methods in the current Notifier implementation though.
 
Second, is that person authorized to submit a request?
Third, persist the request to the database
Do anything you want on success.
It's not a complicated process.
However, if you use listeners you can implement hooks into it.
 
@LeviMorrison i see. well its bed time for me. i'll have to read about these later
 
5:11 AM
What do you do when the request isn't valid? What if it's not authorized? What if the database screwed up?
@rdlowrey I was creating a mediator for something at work (don't want to throw all of Artax into work source code just yet).
And I'll never be using the same listener more than once for the same event.
What it means is that removal can be really fast.
    /**
     * @param string $event
     * @param callable $callable
     *
     * @return void
     */
    public function addListener($event, $callable) {
        $this->events[$event][$this->hash($callable)] = $callable;
    }

    /**
     * @param string $event
     * @param callable $callable
     *
     * @return void
     */
    public function removeListener($event, $callable) {
        unset($this->events[$event][$this->hash($callable)]);
    }
 
user895378
I'd say it's a valid thing to do ... a listener might want to remove itself after it's been notified in lieu of maintaining its own state to know if it's been invoked already the next time around.
 
user895378
@LeviMorrison BTW I went ahead and removed the cap on concurrent connections to an individual host in the http client. It'll be gone the next time I push :)
 
user895378
Anyway, bedtime for this guy. I'll catch ya tomorrow.
 
G'night.
 
Mic
Out of the topic, how will you love your work if you don't really love it? :( some sort of thoughts..
 
6:12 AM
@Mic I guess if you don't really love it... You just don't love it..
 
deep thoughts.. some one go through a rough break up recently?
 
@ShyamK This one has to forget about the past, but must not forget about the joy the other one brought to him/her.
 
ya.. move on... seriously.. feels a lil dead here today...
 
Mic
6:37 AM
@ShyamK and @Troy, it's not about love life, it's all about work, thank you for the concern :) love it
 
6:49 AM
Hey you guys
Guys, if you are in a situation where a java developer and a .net developer are connected to a time bomb and only way to stop the time bomb is to kill one of them. Which one would you save? If you don't kill one you gonna die too because of explosion
 
RUN!!!!
 
7:04 AM
hey hey hey
 
Good morning
 
hi All
 
if i have a class that implements an interface example 'Itest', Itest has 4 methods in it like test1(),test()2,test3() and test4(). On my class when i define the methods. can i create a method not listed on my interface like test5() ??
 
7:49 AM
@tom Sure. That the class implements the interface just guarantees that it will respond to the methods defined in the interface. What it does beyond that is entirely up to you.
 
thank you @deceze
too bad , i was searching for something like multiple class inheritance, but i found out that PHP does not support that, so it will be up to me to, make my own strategy . do you have any advice?
 
Don't use multiple inheritance. There's a reason many languages don't support it. :)
You can play around with traits in PHP 5.4 if you want...
 
Sem
Good mornin chaps
@deceze Do you have a PDO/ MySQLi DAL class that you're proud of or frequently use? I'm searching for the perfect example.
 
@deceze traits? that's new to me, thank you googling :D
 
Mic
8:05 AM
Hi guys, I post a question recently, Please see.. Thank you :)
 
morning
 
Mic
goodmorning too @PeeHa
 
Sem
@PeeHaa Heb jij een mooie DAL Class voor mij als voorbeeld? Pretty please :D
 
@PeeHaa Hello
 
@Sem Cannot share one from my job. Have to wait till I get home tonight :)
hiya mr Robik! Long time
 
Sem
8:12 AM
@PeeHaa I see, can't be online tonight but I'll definitely ask you again! :)
 
np
 
@PeeHaa Hell yeah!
 
@Sem I've come back around to simply using prepared statements. DALs are either so thin that they don't get in your way but by doing so offer barely any advantage over prepared statements, or they're so thick that they get in your way when you know what you want but can't get the DAL to do it. At least that's my experience. :)
 
Sem
@deceze Then how would you design your model?
 
how come there isn't an upload option in the chat here?
 
8:26 AM
@Sem just query the shit in your model layer :)
 
Sem
@PeeHaa After spending sometime trying to understand the headlines of architecture my conclusion is that it's basically about seperating db logic and presentation logic. Is that a correct way to look at it?
 
@Sem I tend to think of my models in terms of self-contained objects (classes). Code them to work without a database, have your logic in code. Then you persist the model data to the database. I.e. a model object can save its state to the database and restore its state from same. The database is not your model.
 
Sem
@deceze What do you mean by saying "Code them to work without a database"?
 
morning
 
$user = new User;
$user->setName('Bob');
$user->persist($pdo);
$id = $user->getId();
unset($user);

$user = User::restoreById($pdo, $id);
echo $user->getName();
@Sem The saving to and restoring from database part is entirely optional in the above code.
The class would work just fine without database.
 
Sem
8:36 AM
@deceze You initialise a new object by calling a static function returning a user object?(this)
 
Mic
Hi guys, Im having problem with array_walks, am I lack of curly braces and parenthesis? here's the code:
array_walk($componentsToSites, function (&$site) use ($siteAccounts) {
$aids = array();
array_walk($siteAccounts, function ($acct) use ($site, &$aids) {
if ($acct['SiteID'] === $site['SiteID'])
$aids[] = $acct['AID'];
})
$site['CorpAID'] = $aids;

print_r($componentsToSites);
 
Load Average 4.73, 6.09, 6.51 - I think we need a secondary dev server
 
@Sem Yes User::restoreById returns an instance of the User class. Not $this.
public static function restoreById(PDO $pdo, $id) {
    $data = $pdo->...;
    $user = new self;
    $user->name = $data['name'];
    return $user;
}
 
Sem
@deceze I see, do you ever use a normal __construct(){}? BTW thanks man, I need stuff like this. Can't get things like this from tutorials or books. Because the good ones are all based on other languages. That is my experience of course.
 
@Sem Sure, depending on the business logic. If all users have to have a name, it would be part of the constructor. You could not construct and hence save a user without a name. That's your data validation right there.
 
Sem
8:43 AM
$user = new User($this->getConnection());
$user->setId(1);
$user->getInfoById();
@deceze That's how I would do it nowadays. Only using MySQLi at the moment. New projects will be using PDO.
 
Mic
no one answers me :(
 
morning; and what do you think? ::
I think we should create a canonical question on how to escape/encode for Mysql LIKE and Mysql REGEXP out of this and as it does not exist so far (at least how far I know) might be worth a bounty. — hakra 28 secs ago
 
@Sem That means you can have incomplete instances of a User object. Which means type hinting will become mostly meaningless. If you make data validation part of the object, then every time you have an instance of User you know it's valid data. That's one of the advantages of OOP if you use correctly, each object is responsible for its own integrity.
 
Related Question is:
5
Q: PHP & MySQL: preparing user-defined search term(s) for query

inhanFor a search feature I wrote a MySQL query to be executed by a PHP script. I'm not doing a fulltext search. Instead, I'm doing a search using the following method: ... WHERE field LIKE '%etc%' AND field REGEXP '[[:<:]]etc[[:>:]]' Now, my idea is to prepare these dynamic values in PHP, lik...

 
@Sem If you decouple "saving to database" from "instance of class", this makes this a lot easier.
 
Sem
8:47 AM
@deceze Basically you make static custom constructors, am I right?
 
@Sem Each model class first and foremost represents that once specific kind of object you're dealing with, and it's responsible for being in a valid state at all times. The model class is not simply a 1:1 interface to your database table.
If that means the constructor needs to be a certain way because the type of thing you're dealing with requires it, so be it.
Whether those constructors are static depends on what you're dealing with.
 
hello awl
 
There should be a canonical constructor you can use with new. But static constructors are useful as "alternative constructors". Like, "construct from database record", or maybe "construct from some other type of data".
 
///*\\\@///\\///*\\\@///
 
Sem
@deceze That is how I see it now.. keeping it in a valid state at all times feels logical. But the problem with new mindsets is that I need a few examples in different situations to understand it completely.
 
8:53 AM
@Sem Well, again, just write some objects according to your business logic without database. Unit test the hell out of these objects to see if you can get them into an invalid state.
 
Sem
@deceze How would your default constructor look like for the user? And about unit tests, I'm also never applied that practically. Still need a lot to learn.
 
@Sem If my business logic was that each user needed to have a valid email address, but everything else was optional, i'd have such a constructor:
public function __construct($email) {
    $this->setEmail($email);
}
public function setEmail($email) {
    if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
       throw new InvalidArgumentException;
    }
    $this->email = $email;
}
Or something along those lines.
Whichever way you want to set an email address, it needs to be valid. Otherwise you won't even get an instance of the User object. Which means type hinting for a User instance will suddenly become meaningful in the rest of your code. Type safety FTW.
 
Sem
@deceze Awesome man. InvalidArgumentException is an extended class of Exception I guess? Only used specific Exceptions in Java lessons.
 
Sem
@deceze And about $pdo->...;, You just make a normal PDO request there without ORM or any other type of abstraction?
 
9:04 AM
@Sem Depends. I may use a custom database wrapper class, but only a very thin layer around real SQL. No abstraction like $db->find('first')->where(array('foo' => 'bar')); which then may or may not actually write the correct SQL for you. I have found this only gets in my way more often than not.
 
How can we embed HTML pages in a wab page other than frames ?
 
@Sem And PDO is a pretty full-featured class already. Unless you're allergic to writing SQL by hand, there's hardly a need to abstract it any further.
 
I really dislike ORM in general.
 
Sem
@deceze Awesome, everything makes so much sense hehe. I'm happy I focused on readability and structure in my framework. Now it's relatively easy to adjust.
 
@Sem Play around with objects as described above including a full set of unit tests for them. It'll be an eye opener.
 
Sem
9:10 AM
@deceze Only 1 thing remains unclear atm, why aren't these models 1:1 table interfaces? That is, when they use database connections.
 
@Sem Because to store things in nicely normalized SQL is not always the way you want to think about it in your object. Say your users can have multiple email addresses. You'll want two tables for that: users and emails. In your code that would then mean you'd have to deal with two objects which really belong together. Isn't it a lot nicer to abstract that to have a $user->getEmails() method instead which returns an array? The User class can take care of persisting that to the database.
 
Sem
@deceze And there you go, I'm completely comvinced. I thank you once again. If you can show me a place where to learn a good way to make unit tests I'm all set for the next chapter! :)
 
9:30 AM
@Sem Of course you could further decouple the storage from your business model. Instead of passing a PDO instance, you could pass the object to some sort of PersistanceManager which knows how to persist that particular object. That gives you even more flexibility to change your storage layer later and keeps your model thinner. It all depends on your circumstances.
 
Sem
@deceze The more flexiblity the better, right? :)
 
@Sem There's a limit to it. You can keep abstracting your code into infinity without committing to any one particular way of doing things. That doesn't mean you're actually getting things done or are keeping it understandable. ManagerFactoryFactoryAbstractFactoryLocatorFactory is an anti-pattern in itself... :)
 
morning @tereško and @hakra!
 
morning
 
Sem
9:40 AM
@deceze Of course it's a gray area but still, it's a thing to go for :). Do you use phpUnit every time you make unit tests?
 
People Plz help
I found this page web-source.net/embedding_web_pages.htm to Embed HTML
 
@Sem It's pretty much the unit testing framework for PHP.
 
But I want to remove Scrolls
 
Sem
@deceze Alright. Don't like to use frameworks without really knowing what is going on but I guess it wouldn't harm when testing :)
 
posted on August 17, 2012 by Lorna Mitchell

This post is mostly about a tutorial I will be delivering at PHPNW on October 5th in Manchester, UK, and why I think a tutorial that contains no PHP belongs at a PHP conference In October, I'll be delivering a tutorial at the mighty PHPNW Conference which contains very little PHP. Why? Because I think, as developers, it's our other professional skills that suffer. As a consultant, I work w

 
9:49 AM
morning
 
@deceze faceface, is that like a headbutt or a kiss?
 
@Leigh It's a What is this i don't even with my head if full of X-(
 
Sem
@deceze Thinking back to the default constructor of the user example. Would you also make parameters for the optional attributes of the class? Like __construct($email, $secondEmail = false); or would you add them with seperate functions?
 
good noon
 
Sem
9:58 AM
@webarto good morning! (3 more min of morningness left here).
 
yup, same TZ, yet two worlds apart...
 
@Sem Questionable. If it makes the rest of your code that is constructing this object that much better without making the constructor too fat and still keeping everything sane, there's little reason against it. It's a slippery slope though. If you have many properties for an object, do you want to add all of them to the constructor? If not, why only some? Just makes it harder to remember what is part of the constructor and what isn't.
 
2
Q: Stitch two mysql tables with a common column

tamizhgeekI have two tables like this, Table1 : +-------------+--------+--------+--------+ | contract_id | price1 | price2 | price3 | +-------------+--------+--------+--------+ | 1 | 23 | 45 | 56 | | 1 | 22 | 21 | 453 | | 1 | 45 | 564 | 456 ...

 
"closed as not a real question ... 8 mins ago", "answered 3 mins ago"
^ O_o?
 
Sem
@deceze So it's a good standard to go for separate functions. Because you will always be facing a class with many attributes.
 
10:02 AM
@Sem I'd typically say so.
 
Sem
@deceze Sauce plz?
 
Simplicity first. Constructor arguments are required. Other setters are not.
@Sem BBQ.
 
Sem
@deceze Another question if you don't mind. It's about front controllers. I used to end up making a specific template for each first segment of the URL. How would you handle it?
 
I am connecting PDO in loop. I suppose every time a new connection will open up in loop.
that's it, no Stackoverflow today.
 
10:15 AM
lol
if sweat shops are sex shop, I receive both — roine 14 mins ago
 
@Sem Haven't really done much with front controllers yet. I typically use routing, where URLs don't necessarily have much to do with the controllers behind them. That's actually something I want to look into deeper at some point...
 
@Sem , IMHO , it is better to create a regexp-based pattern matching for routes
and , as i understand it , "front controller" is not necessarily a class
 
Sem
@tereško That is correct. It's just a gate where everything is redirected to an index.php , So I heard. And what about hierarchical controllers?
 
.in domain name, who'd have guessed :)
 
Sem
@Leigh Stopped reading at Colud xD
 
10:28 AM
Could or Cloud .. :(
 
@Leigh hey, I have .in domains :D
 
@webarto are they for humorous vhosts?
 
@Leigh leakd.in :) (was going to make bait for leaked.in)
 
Nice site
cgi-bin .. fail
Let me guess, you were hosting your own codepad? :D
 
@Leigh nah, was gonna make this leakedin.org , there is linkd.in and this would be leakd.in :) this is give me teh password attempt of course :)
 
10:31 AM
you could go for.. inkd.in, a tatto based social site
 
"I'm making this social site network..."
 
"I'm making this movie, about a language, used to make a social network... "
 
@Sem , I have no crystallized opinion on hierarchical controllers of HMVC pattern in general (not anymore). What I can say about it is that the name "hmvc" is misleading. The nature of pattern is not "hierarchical" but "distributed". And it actually does not trace back to the original MVC pattern as envisioned for Smalltalk.
 
"I'm making this movie about this language that was used to create a language that was used to create a social network..."
 
Hell .. a year ago I thought that i understood what HMVC is and how it should work ..
 
10:38 AM
@tereško dat answer you have is probably one of the best on SO
 
lolwut
 
95
A: How should a model be structured in MVC?

tereško Disclaimer: the following is description of how I understand MVC-like patterns in context of PHP based web applications. All the external links, that are used in the content, are there to explain terms and concepts and not to imply my own credibility on subject. Updated version The first th...

dat, force is strong in it
 
@all How i can convert a string to bytes ?
 
7 mins ago, by tereško
lolwut
 
28 secs ago, by webarto
7 mins ago, by tereško
lolwut
 
10:48 AM
i just see it as extended rant
@Warrior are you looking for a way to turn string in binary or hex code ?
 
^ bytes, read the question...
 
all data is already in bytes
 
aaaaand it's answered
 
@tereško actually i have file with some binary data, that is created by C#. I need to convert back into normal value
using php
 
@Warrior All data is binary. That by itself doesn't mean anything. What binary format is it, what does it represent?
 
10:54 AM
Sometimes it is best to know when you aren't up to a task. If you are asking these sort of questions (and I mean this in the nicest way) you probably aren't ready to make that sort of application in the quality it deserves. — Fluffeh 16 secs ago
 
^ Was just about to paste the same... :D
 

« first day (671 days earlier)      last day (4293 days later) »