« first day (616 days earlier)      last day (4338 days later) » 
00:00 - 18:0018:00 - 00:00

6:01 PM
any suggestion for magically tuned songs?
 
user895378
@GordonM I think the "Resource" is an abstract concept. In a request to /kumqat the kumquat is the resource. That doesn't mean your application code needs to model kumqats in some sort of resource class. This is the power of decoupling your application from its delivery mechanism: regardless of how a kumqat needs to be handled or delivered, your internal code doesn't change.
 
For example in an MVC CMS you'd have some kind of controller that would interperate requests for a Page object, but in RMR the Page object would handle the request itself, though both would use an external module to actually render their content (view or representation)
The guy who wrote the RMR article gave the impression that his beef was that in MVC a URL addressed something that obscured the actual business object?
 
user895378
I think having a Page object in the first place violates the architectural principle of keeping your application in the dark about how it's going to be delivered.
 
Well if you're delivering a CMS then that kind of implies that it's a web application anyway doesn't it?
 
user895378
@GordonM What if I want to write a desktop application to modify the same content data, though?
 
user895378
6:07 PM
@GordonM I haven't read it in a while, but I only view RMR as being helpful as an adapter to represent your business objects in terms of HTTP resources. But if you structure an application to specifically only work for web requests I think it's a mistake, regardless of what whomever coined the "RMR" termed thinks.
 
user895378
It's just a classic benefit of decoupling. That's all. If you're confident you have no use for your application outside of a web delivery mechanism and never will, you don't have to decouple it.
 
ok, either I'm misunderstanding RMR or RMR has some issues.
I can see how to easily decouple stuff in MVC but you hear so much about MVC being wrong for the web.
 
user895378
I think as long as you focus on writing applications and not web sites you can't go wrong.
 
user895378
Maybe some people want to tightly couple their applications to a web delivery mechanism, but I don't.
 
Maybe I should just forget this whole RMR thing and just stick with MVC, where the boundary is is a lot clearer (or in theory should be).
 
user895378
6:12 PM
I'd have to look back at the RMR article to see what the guy actually espouses, but my thoughts on the matter are the above few messages.
 
peej.co.uk/articles/rmr-architecture.html Maybe I'm just misreading it, but I really got the impression it was a model/controller combo.
 
user895378
I disagree with this:
 
user895378
> URL routing is evil
 
user895378
But I agree with this:
 
user895378
> actions are methods on controllers exposed as resources rather than methods on resources themselves
 
user895378
6:21 PM
I use the RMR as a basis to expose thin controllers that act as resources exposing methods like get, post, put etc on controller classes
 
user895378
I think it's dumb to shoehorn controllers into a directory structure to match your web application's resource structure, though. You can get the same benefits from URL routing without tightly coupling your app to the web delivery mechanism.
 
:/
Going to have to seriously rethink things
 
user895378
It's not bad ... it's just like tying your app to a specific database system. You lose flexibility when your app only functions in the context of the web.
 
user895378
And I think in terms of design, it's best to abstract everything as much as possible.
 
Yeah, I get that. I guess I'm just failing how to reconcile that idea with the idea of RMR. It's a lot easier to disconnect the business objects from the web in MVC. Of course in MVC you have really nasty routing and stuff. Stuff like /module/controller/action/param1/param2
 
user895378
6:30 PM
I know you're not crazy about routing, but to me the problem is easily solved by pre-specifying routes ...
 
user895378
But RMR can be used perfectly well if you don't mind tightly coupling your app to the web
 
Most of the stuff I do is related to web sites in one way or another so it's kinda difficult to not think in terms with the web. :)
All the stuff I work on are CMSes or web shops or things like that.
 
@GordonM But do you have automated tests for them?
 
Nobody I've ever worked with seems to believe in unit tests.
 
@GordonM I don't work with anyone. I learned for myself the unit tests are a good thing.
 
6:35 PM
Then again the guy I currently works for thinks MyISAM is the best database table type because he thinks it's faster.
So I'm thinking it's time to be looking for some other line of work.
 
@GordonM Maybe it is helpful to think about this way: modern web 'MVC' tries to do everything outside of the HTTP spec, dipping down into it only when it has to. RMR fully embraces the HTTP spec, leveraging what it gives you.
Also, the letters in MVC are layers, not objects.
 
Seriously. I just got shouted down for saying everything should be InnoDB unless you have a really good reason why a specific table must be MyISAM
Frustrating.
 
Yeah, look for a new job
 
user895378
@LeviMorrison Same here. Never worked with anyone, but man, I can't even imagine working without unit tests now. Holy cow.
 
@rdlowrey I still live with it every day. I only have tests for maybe . . . 15% of my application.
I spend most of my time refactoring, pulling things apart so I can manage it better. Very brittle as it is right now.
 
6:39 PM
I'm finding them really useful here, so I wrote a big long essay/tutorial for my boss at work as to why unit testing is a good idea and the basic of how phpunit works. He never read it.
 
user895378
Just seeing how often my tests start failing from changes that I thought wouldn't have much effect makes me terrified to know how often I was running live with bugs before I started testing. Yikes.
 
user895378
@GordonM Hehe, you should get him into chat so everyone can berate him :)
 
user895378
PHPUnit definitely had a learning curve for me ...
 
user895378
But the best way to learn to write tests is to just start writing tests and figure it out as you go.
 
I can live with my lead developer being less knowledgeable about coding than I am, I really can, but when he's less knowledgeable AND doesn't listen to one of his programmers who has experience in areas he doesn't... Suffice to say after nearly a year there I still don't get his system because the vast majority of the business code is in the controllers
And he doesn't believe in foreign keys. Hence the MyISAM tables everywhere.
Oh, did I mention that he serializes data and blats that into the database?
Fuck's sake.
 
user895378
6:42 PM
lol
 
You wouldn't be laughing if you were the guy who had to debug the fucking thing! And add all the frustrations of ZF1 on top of that...
 
user895378
Sounds like a confluence of programming awesomeness. But I get the feeling than many (most?) outfits are like that.
 
user895378
With a few good places around: islands of sanity and best-practices in a world of crap coders and script kiddies who think they're omniscient because they taught themselves php.
 
I wonder if it's just something peculiar to professional PHP programmers, or whether there's just as much crap being written in Java and C++ shops
 
user895378
I can't say ... though there's probably a much higher incidence of it in PHP since the other languages generally coincide with university education in the field.
 
6:46 PM
I did self-learn PHP but I studied computer science and learned a load of lots of other languages before I'd ever even touched it
Hmm... think I might have a better idea for doing RMR that's still RMR but treats the Methods bit as if it was a separate controller rather than a part of the resource itself.
 
user895378
For me, it just boils down to this: if something's worth doing, it's worth doing well. People who just show up to collect a paycheck and never improve are doing it wrong.
 
user895378
Conclusion: hiring the right people is so important.
 
Your business objects are things like Pages, Products, Users, Kumquats, whatever. You have a PageResource which always composes a Page, a UserController that always composes a User, etc. All the Resources have a Get(), Post(), Put(), etc method, which figures out the intent of a given HTTP request and invokes the correct API calls on the business object. That might be better.
@rdlowrey I agree, but when you're stuck working for a guy who doesn't grasp the stuff that you do it makes pushing real improvement an uphill struggle
So second conclusion, don't work for someone who is too tanned for foreign keys. :)
OK, I'll stop ranting now, I'm sure I'm just boring everyone.
 
ok i know that i'm using The factory pattern for that
 
The business object itself doesn't need to know that there's an RMR Resource coupled to it.
 
user1440875
7:02 PM
You should have 1 Database class which would load appropriate driver
 
The front controller parses the URL, fetches the object that corresponds to it, determines that it's a Kumquat, fetches the KumquatResource, and passes that the Kumquat and the request so it can decide what to do with it. The Resource determines the request type and invokes the appropriate API calls on teh business object. That way the URL still addresses an object directly instead of addressing a controller, but there's a controller-like thing to handle the actual request.
 
but how could i handle erros using extended excpetions
i'm using factory pattern for handling these ten classes
but how about the extended excpetions ?? every database has it's own way to handle errors ?
 
user1440875
I see. So you want to set error handler in each database driver
 
but that's a lot because am gonna write ten classes an example
 
user1440875
7:08 PM
and in you error handling function you can throw OracleDriverException
 
MysqlExcpetions extend excpetions
and so on tell the last class
OracleExcetion extend ...
sqlliteExcption extedn ..
that's a lot is there another idea ??
or there is no way to do this ??
 
user1440875
you don't have to have 10 more files you could define them all in one file and call it Exceptions
 
and i gonna write these ten classes in this file
 
?
oh that's nice
thank you
there is one more question is factory pattern good for these drivers ? or i should use something like dependency injection
i made an interface for these classes and all these classes handled from DatabaseFactory
 
user1440875
7:13 PM
I think factory pattern is more common usage
 
but if i added a new class i should edit the database factory that's wrong in OO design
 
user1440875
However you could use PDO as well
 
PDO dosn't let have the full capablities for a database
 
user1440875
Yes, that's good point
 
Oracle company recommend using MySQLi and said that PDO broken by design
 
7:24 PM
@user1464822 It's a case where Oracle is wrong. They are disconnected from their user-base
When you do mysqli, you CONSTANTLY have to check for errors.
PDO just throws exceptions
PDO supports parameterized queries.
MySQLi doesn't.
There are things that MySQLi does that PDO doesn't, but they aren't the things people commonly are using.
For most use-cases, PDO is just flat-out easier to use.
 
 
1 hour later…
9:03 PM
 
hi peeha!
 
hiya mr@hakre
 
the night I started to really look into the update problem. you know what?
internet outtake for about 2 hours or so.
when it was over I was too drunk and tired to continue.
 
damn :( That's a bad excuse ;)
 
lol :)
 
9:11 PM
hehe
Than again. Being drunk is a valid excuse
 
I can only code drunken when I do TDD.
 
@hakre I almost don't dare to tell you, but I haven't done any real TDD yet. Up till now it mostly has been FDD :(
On the bright side: I'm going to throw out my current framework and start all over (again). TDD all the way from now on :)
 
Well it's cheating in the drunken case. Because before anyone else notices that you just coded crap, you did your own through testing. So you only publish code that works ;)
Okay, until the point you're that drunken you push anyway ^^
 
@hakre :D
 
'Time for dinner, brb
 
9:16 PM
k
That's some late dinner btw :P
 
9:29 PM
You have a problem with something CSS doesn't support: use jQuery!!!!!!!1111!!
...
hey is that @ThiefMaster lurking in here. Gratz on the promotion :)
 
thanks
and oops, forgot to leave again ;p
 
lol
@ThiefMaster Anyway good to see someone I voted for made it. Now don't disappoint me! ;)
 
well .. my first choice was guy who could not drink yet
 
minitech?
 
@tereško hiya
 
9:34 PM
evenin'
i dont recall the name
but i liked his "speech" and the post history was pretty good too
 
he's the 14y old guy
 
I voted for because he / she would know what shit we have to put up with every day ;)
 
he had that air of someone who is capable to get masters degree by 18
 
is not better (maybe even worse?)
@tereško Yes, he clearly seems to be smart. Reminds me a bit of myself when I was in that age.
 
well , all my votes went to
 
But then again, I don't know if helping a guy like him into another time-consuming "hobby" would be such a good idea.. when looking back at the childhood there are so much things one could have done (and I don't mean hanging out with idiots and smoking cigs/weed)
 
thats what you do in university
=P
 
@tereško /me agrees 100%
:-D
 
my university experience consisted of being high and/or teaching others
 
stfu I have an exam in C tomorrow morning, haven't touched it...
 
9:40 PM
Heh, I tend to go there only for the lectures and then back home.
 
.. and in the evenings we went to beach and got drunk
 
I'll just write PHP... it's the same...
 
And I'm at a technical university and there are still tons of people who can't write a proper program.
@webarto I'd swap with you. A C exam sounds much nicer than one about IT project management and ITIL.....
 
@ThiefMaster The educational system in most countries is fucked up (at least regarding this topic)
 
@ThiefMaster was ist dein namen von dein universitat :P <-- my poor deutsch
 
9:41 PM
English bitte
:D
 
how yes no
looks and sounds fancy
 
this was mine : venta.lv/en
 
Well, at least the exams are easily passable with ~2 days of learning for each one
 
Hey
 
9:42 PM
So it's perfect for a lazy student like myself :D
 
@Chacha102 hellow
 
I just pay to go to college on weekends
I don't have time for that s*** honestly
 
Does that mean it is reopened once or something like that?
 
'CV'?
 
@PeeHaa have you tried F5 :P
I can cv
 
9:44 PM
Jun 18 at 10:19, by Gordon
What does mean: https://gist.github.com/1689430
@webarto Yes I have and I also rebooted my machine... ;)
 
ah
 
Does the option just not come up?
because I get the menu..
I like how that question is one I answered a long time ago..
 
@Chacha102 I get the popup only without the radio buttons
 
It was reopened by a mod so you probably cannot vote to close it again.
And the likely "duplicate" is 2 years newer than this question...
 
9:46 PM
@ThiefMaster grrrrrr.
 
I get the radio buttons and everything
 
:(
 
If you don't get a proper message it might be worth reporting it on meta.
I remember getting one of those orange notices when trying to undelete-vote on something deleted by a mod some time ago.
 
@PeeHaa all the headers sent messages but the very first should be deleted
 
@Gordon Everything should point to the canonical
at least
 
9:49 PM
I got one of those tall monitors that make you 'above the fold' really really large
 
confused
 
damn you college y u no let me sleep on weekends
 
what are you guys talking about
 
even with the dup given, they dont stop answering it
 
@PeeHaa delicious
was in concert and then some cooking
 
9:50 PM
@Gordon That's why I changed my name from repwhore back to just PH. I just couldn't do it ;)
 
@hakre what concert?
 
too slow
 
lou reed
 
@ThiefMaster can you reopen and close stackoverflow.com/questions/11173161/… with the dupe please. and maybe the answers into it if appropriate.
@hakre interesting
 
9:57 PM
@tereško what are the benefits of completing college IRL, except getting drunk and stoned... since you are older and everything...
 
@webarto , it gave you reason to learn stuff , you should have ignored otherwise
and of course , it gives you contacts
it kinda depends on the university you choose , and the people you gather around yourself
 
@webarto The main reason for me was to have a paper to get started (and start learning) somewhere
 
not here .. papers are kinda useless
 
10:01 PM
@ThiefMaster Ohh, so we have another German :)
 
=/
 
yeah, you guys live in developed countries... :) I'm pretty much going to get a paper because you can't get visa or anything without higher education...
 
i am even the only latvian in ##php ( when I visit )
 
See, Germans taking over the world :P
(Once again)
 
@NikiC yeah, he should change his name to ziefmaster ;)
@NikiC Ze Germans
 
10:03 PM
@NikiC , lets not talk about politics and euro zone
 
I don't care much for politics
I think it's pretty much all BS and that's it
 
@NikiC Politics is a game that is played on your money too. Even if you don't care.
 
night
 
I hate that the review section doesn't show if questions have been answered etc :s
 
debug please
 
10:13 PM
You are logged in as root
 
so is this some MS s*** or I'm total root
noob
 
yeah I broke my debian :) so root or nothing
 
:P
@webarto could you check whether the file is on your system
?
updatedb
locate stdio.h
 
/usr/lib/perl/5.10.1/CORE/nostdio.h
/usr/share/doc/nodejs/api/stdio.html
thanks
 
10:18 PM
Why the *&^% would one reopen this: stackoverflow.com/posts/1183726/revisions ?
 
btw am I the only one who thinks that node.js is a crap?
 
@webarto looks like you are missing some stuff
 
I'm not sure, but can you try to install build-essential?
apt-get install build-essential
 
thank you but I messed up with dependencies bigtime
The following packages have unmet dependencies:
build-essential : Depends: libc6-dev but it is not going to be installed or
libc-dev
Depends: g++ (>= 4:4.4.3) but it is not going to be installed
 
I was trying to install mysql 5.5 and s* happened, thank you for your help
 
@webarto Well. You should be installing postgresql anyway ;)
 
@Gordon gn8
@webarto @webarto: keep a worklog. so it's easier to recover if things go wrong, and easier to re-do if you need to do it again.
as long as this is about packages, you can normally easily re-install things.
 
@PeeHaa to be honest, everything is developing so quickly that you can't catch (learn) even part of it... so basically I decided to stick with LAMP and improve as much as I can, and make as much money as I can because this wont last forever :)
 
@webarto That's smart
 
10:30 PM
@hakre yeah, it's just that I rush and don't log with stuff and naturally it breaks :) thanks
 
okay, you know that your bash has a history?
 
@hakre nope :) example?
 
well press the cursor up key?
or use ctrl+r and then type something
this is in a textfile IIRC
 
ah :) great, I didn't know you can see history from previous sessions, thanks
 
try just history.
 
10:35 PM
@webarto But generally (and do yourself a big favor) document what you do.
I've wanted to kill myself to many times after finally being able to compile something and "forgot" to document it.
 
haha smart man writes, fool remembers :) @hakre awesome, like they say :)
 
btw to == too (I hate those mistakes)
 
it can happen too everyone
 
:P
 
@PeeHaa That's why I sometimes write a blogpost. Just writing down and giving little explanation as well.
Best thing is: you can google it later.
 
10:43 PM
@hakre I do the same thing only with tutorial kind of things :)
 
beer
 
@tereško Yes please
 
to repeat myself, why node.js :\
 
@webarto What so bad about it?
It sounds so hip!!! ;)
 
hehe :) just can't figure out why not to use websockets and PHP :) regarding hip, in previous company I worked in, "HR manager" sent an email to all saying we should all switch to node.js, socket.io and few other hip stuff.. luckily I don't work there anymore :)
 
:)
 
well , honestly , in PHP it comes with additional amount of pain
then again , i have been trying to learn erlang bit-by-bit just for this kind of use-case
 
11:42 PM
first P in PHP is for Pain
:P
 
It is a shame that every time there is some new interesting product/library everyone just jumps on the bandwagon, promoting it etc, while the people who could actually judge the quality of it try to be conservative about features it may have knowing that they don't know enough about it to accurately judge it :s
 
@webarto , was that the same company where team-leader got excited for if ( something ) foreach ?
 
@tereško correct
 
what the fuck
:s
 
just to check ... are you from India ?
 
11:45 PM
while($row = mysql_fetch_array(..)) {
  $arr[] = $row;
}

$n = mysq_num_rows
return $arr[$n]
and this is how you get last row from table
me, no, currently in Belgrade (serbia = india no 2)
 
was that the Bosnia-Herzegovina territory ?
(sorry .. i am kinda bad at geography for europian)
 
I make a mess of eastern europe all the time
which is logical with countries changing names/splitting up every few years :|
 
pokit.org/get/img/ee0a804d05a493332fcb15b312f45892.png it was all former Yugoslavia, I shuffle between 1 and 5...
 
@sg3s , it kinda depends on your definition of "eastern"
i kinda count "baltic states" as eastern
 
anything east of germany more or less
:p
minus greece which I've always been able to place without thinking
 
11:55 PM
so ... Finland is eastern europe
that's interesting
if you look at the map , you will see that between Germany and Russia there are only Poland and "baltic states"
with europe there is always a problem to draw a line between east and north
 
@tereško The germans didn't think it was that hard
 
ze germans
 
00:00 - 18:0018:00 - 00:00

« first day (616 days earlier)      last day (4338 days later) »