« first day (1077 days earlier)      last day (3885 days later) » 

m59
9:00 PM
@gr4devel not what I showed you. My old code worked yes, but it was soooo sloppy
I'm trying to improve it
It wasn't as expandable as it ought to have been
 
@MadaraUchiha if that's the case, whats the concern of the controller then, is his sole responsibility to know which model and views are needed then let em talk to each other by themselves?
 
@reikyoushin No
 
@m59 nice buddy I think that the refactoring must begin by looking at your old code and identify the core points of it
 
The controller is only responsible for taking the user's input, and use that to change the state of the model.
 
@m59 and then looking at the core points of the classical REST api
 
9:02 PM
The view's responsibility is to take the model's state, and use that to product output for the user.
@reikyoushin Also, there's no such thing as "which model"
Model is a layer not a class or an object.
 
@MadaraUchiha which * domain object *
 
@m59 then you should shift gradually by looking what of your old code can be encapsulated in the core points of the classical REST api structure
 
how do you escape * here in chat o.O?
 
m59
All I'm positive about is parsing the url into a collection and item, then using those, the request verb, and the media type to determine what methods are used to create the output. Also, I need to separate out the resource methods into different files.
 
@reikyoushin *test*?
 
9:03 PM
am using prepare() and execute() for select statements which has no user inputs, anything wrong? or should I use query() straight away
 
@MadaraUchiha yeah
 
Just like you think you do :P
 
^^?
 
@MadaraUchiha huh?
 
@reikyoushin Use \*
@Mr.Alien No need for a prepared statements
Even if it doesn't really matter, the difference is marginal.
 
9:04 PM
@MadaraUchiha oh ic, ^_^
 
@m59 yeah why not I think it's a good thing :)
 
@MadaraUchiha yeah so lets use prepare and execute, actually no big change as am using queries in functions, so I can modify code anytime ;)
 
@reikyoushin you do not inderact with domain objects in presentation layer
 
@tereško Not directly anyway
 
@MadaraUchiha i think its clearer now, so literally it "is" a controller, like a remote control to change channels.. but i dont get how you do that in OO PHP. T-T
 
9:07 PM
Damn it @crypticツ please can you start pre-compiling the less, I really don't want to have to go through the rigmarole of setting up something to handle .less files dynamically just set up a test instance...
It makes it really hard to deploy :-(
 
is it me or is captcha getting proper wierd
 
@MadaraUchiha thats my original question.. i hate this, i always get the wrong terms. T-T do you need to use the controller to make the ui logic (@tereško's presentation layer) and the services talk?
 
(well not hard, but not as easy as it could be)
 
I go to sign up somewhere and have to assemble a virtual puzzle of a jetski to prove I am human ... A JETSKI ... this has gone to far, someone put out a memo ...
 
And wtf even is .jscc?
 
9:08 PM
@reikyoushin No, you don't need the controller for that.
Both the controller and the view (a.k.a. your ui logic) talk to the model
But they don't need each other, that's the point.
 
@DaveRandom sorries, you can grab compiled copy from here for now cv-pls.com/assets/cache/main.css
 
@MadaraUchiha so this is why using frameworks is bad.. because you do everything inside always need the controller o.O?
 
@JoeWatkins I had a recaptcha the other day where the OCR word was a fragment of a picture with some olde-english-style lettering on a postbox or something
 
@reikyoushin Many of the popular frameworks are doing it wrong
And by doing, and teaching wrong, they alter the perception of the original MVC, and cause a huge mess in education of new programmers.
 
@DaveRandom it's for the Google JavaScript Closure Compiler developers.google.com/closure/compiler
 
9:10 PM
@MadaraUchiha this is my problem. i get confused most of the time. T-T
 
@DaveRandom After failing several times, he ended up giving me "חמור" :X
 
@DaveRandom it will only compile .jscc file, will leave .js files untouched
 
@crypticツ Yeh I know but then I have to modify backlog.php so it points at the .css file. I don't have any problem with using less or closure compiler, but we should have a build.php file which builds the raw files and deploys them to the public dir so it's nice and easy to deploy and, crucially, easier to debug
 
@DaveRandom keycaptcha.wordpress.com too much ...
 
@reikyoushin you do "everything in controller" because they do not have views and (because of obsessive active record abuse) model layer cannot contain application logic (the bit that deals with interaction between domain entities and persistence). Both of those parts get merged in "controller"
 
9:13 PM
now i think i get it a bit clearer when @tereško said that frameworks only say it is MVC "just for sell"... but does that mean using frameworks would mean you cannot do it properly already.. correct?
 
essentially you end up having ORM-Template-Logic instead Model-View-Controller
 
@JoeWatkins dafuq. Is text based captcha really getting too easy to work around or something?
 
see I'm not kidding, I actually had to put together a puzzle, of a jetski ...
 
@reikyoushin I am quite certain, that frameworks cannot implement MVC. It is not a responsibility of a framework to begin with. It's your code that implements (or fails to implement) MVC
 
@JoeWatkins Wow - Those examples have almost 3 bits of entropy, going to take hackers ages to brute force them.
 
9:15 PM
plus I'm pretty sure it's less secure ...
yeah I'm sure it's less secure isn't it ?
I mean pretty clean white edges
 
@m59 , if you stumble on bit you cannot understand in that repository, please let me know .. it will give me some indication on where to start adding comments and documentation
 
@tereško and in a typical framework, the ORM is the data mapper, the template is the view minus the presentation layer/ui logic, and the "logic" is what frameworks call a controller ( ill call it 'framework controller' for now). now the domain objects and the ui logic bleeds into the so called framework controller.. thus getting all the code jumbled/messed up. (please be kind to this post, ;) im still trying to grasp everything. so much to learn. phew!)
 
@reikyoushin ORM is not data mapper. ORM's are persistence frameworks. Data mapper is a persistence pattern. And most of popular ORMs implement active record and not data mapper
 
@JoeWatkins Someone would need to write a bit of JS to do the drag and dropping (or just outsource it to amazon turk) but yeah it's useless.
 
@tereško but that is his job? im trying to map the framework parts into the mvc parts..
 
9:21 PM
active record combines both responsibilities of data mapper and domain object .. but yeah. That bleed-over is the reason why code in common frameworks rots so fast
 
@DaveRandom I'll redo it so the HTML points to the cached CSS and JS files which will be provided pre-compiled in minified and un-minified form, alongside the uncompiled versions. So it will work out of the box, if someone needs to debug etc, they can modify the cache files or if they want to recompile they can compile the other file. Would that work?
 
I remember when all this captcha thing arrived on the scene, then the libraries to break em, forged from other manipulation libraries ... at first they were pretty useful, and as a user they kinda made you feel a bit more secure ... but now they are just so damn stupid; either some stupid question, some absolutely illegible word and now puzzles of random objects .... I don't feel safe anymore, I feel annoyed ...
 
@tereško what else does a model layer have that the domain obj and data mapper does not do?
 
it should not be tedious or difficult to prove that you are human if you are a human ...
 
"That bleed-over is the reason why code in common frameworks rots so fast" so basically, using a framework means you'll bleed to death because of the bleed-overs. hehe.
 
9:23 PM
by the time they were deployed they were pretty useless, there was already code to break em almost immediately ... but they still had value ... I don't think I'll ever use one again ... ever ...
 
@JoeWatkins does not compute ;)
 
@reikyoushin services. Those are instances that govern interaction between multiple domain object , and the interaction between domain objects and storage abstractions (sometimes, instead of directly working with mappers, you would be using Units of Work). What services do can be summed up as "application logic". It's where relation between domain model entities is put into code.
 
@JoeWatkins But even that isn't good enough. Scammers can outsource the work of solving a captcha to people in 3rd world countries, so even a perfect captcha that can tell humans and computers apart isn't going to prevent scammers from being able to sign up huge numbers of false accounts.
 
@Danack that has already been done for a while now..
 
also, @reikyoushin, pleas not that "domain model" !== "domain object" !== "model layer" .. this are 3 different concepts
 
9:27 PM
well it depends on what you are doing, in general interacting with public to give a personal experience doesn't actually involve any sensitive information, so you can present a nice signup interface including something like captcha and that's reasonable to do so ... if you're dealing with sensitive information and think that captcha was ever providing anything then you are barking mad, completely barking mad .... I don't think it was really ever meant for that, imagine a bank using captcha !!
 
@reikyoushin not all frameworks. Symfony2 and ZF2 let you create the code that will not have this sort of flaws .. but neither of those is marketed as "mvc framework"
 
whats the diff between domain model and domain obj? and which is the business model among the two? or is it another concept?
@tereško but will you not experience the bleed-over when using those two?
 
@reikyoushin in case of those two, it will be your fault and not an inherit design problem in framework
@reikyoushin "business model" is not really a specific term. People use it to describe either domain model or model layer .. depending on phase of moon
 
@tereško but they use ORMs too right? does that mean i need to wrap the ORM objects so i can put the services with it so i can say that it is a model then?
 
63
Q: Feedback request: New top bar and MultiCollider redesign

Jeremy TunnellTL;DR: We’ve incorporated a ton of your requests for the top bar into a new version, and we’re going to ask you to test it here on Meta sometime in the next 2-3 weeks (double-time!). First, we wanted to share the current work in progress and get your input on anything glaring you think we shoul...

New top bar \o/
 
9:32 PM
dude keeps putting things on twitter about pthreads in japaneze or chinese or whatever, I think he is asking questions but the translations are really poor (always are) ... is it rude to ask him to speak english ??
 
I already linked to t where you can read brief summary of what "domain model" is.To read about domain objects, go here: c2.com/cgi/wiki?DomainObject
the main difference will be: one is a concept, other is an implemented class
 
oooh oooh can anyone translate ??
 
@JoeWatkins Try seeking help on Anime & Manga or Japanese Language & Usage (chats)
 
... sorry , I'm only now starting to learn japanese
 
@JoeWatkins Also, Japanese or Chinese?
 
9:35 PM
he's posting a lot, I think he's getting frustrated ... it's japaneze according to google translate ...
 
@tereško ahhh. so one is just a concept then. need to memorize that. :)
 
@MadaraUchiha ... and it will turn out to be korean
 
not being racist, I genuinely cannot tell the difference ... or remember it, apparently ...
 
@JoeWatkins Have an example text?
 
i can tell if its jap, chi or korean.. but i cant translate though
 
9:36 PM
PHPのpthreadsのMUTEXって何の役にたつの
 
@JoeWatkins Chinese glyphs generally have sharper edges and more complex forms.
@JoeWatkins That's japanese
 
japanese..
 
@reikyoushin in few words: domain model is the sum of all knowledge that you have amassed for a specific project
there are whole books about just that one term, big and scary looking books
 
is there a question mark, or equiv in japanese ?
 
"ka", at the end of sentence
 
9:39 PM
no glyph ?
I don't see "ka" anywhere, maybe he's not asking questions ...
 
か (but don't quote me on that)
 
@tereško wait, domain model is how the project components are structured as a whole? or is it a unit or block of info that forms the system? aka many domain models that form a system?
 
ah, that's everywhere ...
PHPでpthreads使ってもsleepとかそういうのはメインスレッドで停止するから意味ない。DBアクセスとかにしか訳に立たないことが判明
the translation makes absolutely no sense whatsoever, I've no hope of helping him if he doesn't speak in english ...
 
@JoeWatkins there's 5 there.. haha
 
@JoeWatkins He's speaking to you?
 
9:42 PM
hes posting on twitter, all the time
 
Tell him you don't speak Japanese, and be over with it
Why do you care?
 
the question also has to begin with "warewa".. or similar
 
5 times in the last day ...
 
it's compicated
 
@JoeWatkins lol "No meaning because the stop in the main thread is sort of thing such as sleep even if I use pthreads in PHP. Do not stand to reason only such as DB access turned out to"
 
9:43 PM
because others that do speak japanese might be listening to him having trouble, and what he wants to do is probably quite easy ... not gonna loose any sleep, I just keep noticing him in searches is all ...
 
@reikyoushin have you completed reading PoEAA ?
 
@tereško is this for me?
 
@reikyoushin yeah I have literally no idea what the problem is, that is worse than the japanese ...
 
@tereško nope.. twas why i was asking for an easier resource for beginners because PoEAA overwhelms me. i havent got to a bookstore yet, and im not fond of reading in PDFs, it make my eyes hurt.
 
well .. hmm
 
9:46 PM
there's no way to word it without it sounding rude, and probably ruder or non-sensical once translated into his language ... so I'll just have to put up with the annoyance ...
 
@reikyoushin in that case, don't focus on "domain model" , just understand that it means the sum knowledge of project .. it is not code°. Anything more will just confuse you right now.
 
@tereško ok. will always use domain objects for the mean time since its usually what i mean when i talk..
 
yes
and there is not PoEAA-lite, at least not that I am aware off
 
@tereško Wish there was :(
Still trying to push through it
 
@reikyoushin have you tried going the links here? It might help a little.
@MadaraUchiha it took me two and a half read-through to grasp the general gist of it
I might go for the 3rd read in few month
 
9:50 PM
@tereško so besides the orm part on this, is the mapping of framework to MVC as how i understand it, okay now?
@tereško ill be going in a bit.. will bookmark this. thanks!
 
what do you mean by "mapping of framework to MVC" ?
 
im trying to know which is which in a framework, like the orm in a framework is the domain object + data mapper in MVC, etc..
im thinking if i should make this a question in SO. hmm.. do you think its a valid question though?
 
most of ORMs are variations on active record pattern
which means that each instance usually attempts to map a DB table to an object and have all the associated business rules in that object
I guess you have to understand how active record works to undestand how it is used in php frameworks
the exception is Doctrine2 persistence frameworks, because it attempts to build on data mapper pattern .. but then again, all but Sf2 and Zf2 seem to ignore it
 
@tereško sf2 and zf2 ignores it unless the dev uses it as a mapper.. so it depends on how it is used?
 
"all but X" expression means "everyone except X"
 
10:00 PM
http://thephp.cc/viewpoints/blog/2013/09/drupalcon-europe
Planet PHP
DrupalCon Europe
thePHP.cc
1380265200
posted on September 27, 2013 by Nomad PHP

Mocking Dependencies in PHPUnit Presented by Matt Frost (@shrtwhitebldguy) Date: 12/19/2013 Time: 20:00 CET 19:00 UTC, 13:00 CST, 11:00 PST Not sure of the time in your area? Check it on the Time Zone Conversion Writing good unit tests is nearly impossible with out being able to mock your dependencies. This talk will cover why you should mock, when you should mock and a practical ap

posted on September 27, 2013 by Nomad PHP

Scaling PHP with HipHop Presented by Sara Golemon (@saramg) Date: 12/19/2013 Time: 20:00 CDT 18:00 PST, 03:00 CET (Dec. 20), 02:00 UTC (Dec. 20) Not sure of the time in your area? Check it on the Time Zone Conversion HipHop is the Open Source PHP language compiler and runtime designed and used by Facebook. HipHop offers a significant speed improvement over the official PHP runtime a

 
@Feeds, you are drunk, go away
 
Arg. I hate not being able to sleep
 
still in europe ?
 
Ya. Alarm in 4 hours to train to Germany...
 
ouch .. that usually when I start debating whether it's even worth trying to sleep anymore, cause you will end up feeling like crap any way (and sleeping comes with added risk of missing the alarm)
 
10:03 PM
Yup. Driving all day... Sigh...
 
.. which is how i once almost got stuck in london
 
gotta go. thanks @tereško
 
you're welcome
 
was supposed to ask on "all but Sf2 and Zf2 seem to ignore it", what that "ignore" means.. but ill be going. guess ill just check on the notif later..
bye!
 
10:15 PM
@Danack classic. hacker got an octocat tattoo. then was banned from github. then, a few months later, reinstated iirc.
 
@Danack lets put it this way: few weeks ago I decide to watch some videos from one of ruby conferences ... the presentation was about security in web applications & rails
I laughed whole way through it .. and I consider myself to be noob at security
 
@Danack also, would you trust someone called Egor? I mean really?
 
@igorw I'd trust them to fetch me some fresh brains.
 
@Igorw it shouldn't make a difference ... but no, definitely not, nor would I trust anyone that would ... because they'd have to be, what, some kind of elf ... or whatever ...
 
You guys have any opinions on the best libraries to use in php to encrypt passwords? Ik php 5.5 has it build it. The server I am using doesn't have it yet.
 
10:21 PM
@tereško hehe
 
^ that , or you can just use native blowfish hash
 
@JoeWatkins you wouldn't trust anyone that would... what exactly?
 
trust someone named Egor
 
or Igor
 
@NikiC my point exactly ;-)
 
10:24 PM
@NikiC good ruddy point ... it is very close ...
 
@NikiC Thanks, that looks pretty awesome. Gona use that.
 
10:43 PM
@tereško i executed this ps aux | grep helloWorld.php
 
depends on what command you executed to get it
 
oops!!! here is the output again: root 21693 0.0 0.1 1772 568 ttyp0 R+ 02:41 0:00 grep helloWorld.php
 
if you do ps aux without grep, the legend will be at the top
 
@tereško oh! the second one! 21693 is the pid, thanks :)
@tereško oh! the pid keeps changing? everytime i execute ps aux | grep helloWorld.php , the pid keeps on increasing by +2 , is that normal? How do i kill the process if the pid keeps on changing!?
 
root 21693 0.0 0.1 1772 568 ttyp0 R+ 02:41 0:00 grep helloWorld.php
refers to       <---- this part ---->
        ps aux | grep helloWorld.php
 
10:53 PM
:(
my slow brain, i don't understand :(
 
the PID add 2 each time because you are seeing results of your own command
 
oh!
 
one pid for "ps aux" and another one for "grep helloWorld.php"
 
shit
 
lol
 
10:55 PM
but its not suppose to increase :|
wait, i'll show you screenprint :)
 
it is supposed to increase , because every time you call "ps aux | grep helloWorld.php" you launch two new applications , which then exit
 
@tereško ah! that's why i see this error postimg.org/image/nb4tlixit :(
 
yes
 
why pkill 'helloworld.php' dont kill helloworld.php? :/
 
because there is nothing to kill
 
11:06 PM
oh! helloworld.php is just an example. Actually, its testdaemon.php
@tereško there is nothing to kill? How? I still think that the testdaemon.php is running
 
and how do you know that ?
 
because i'm not able to open my phpLiteAdmin page :(
i could open it easily before i ran this *testdaemon.php* but after i ran it i cant open phpLiteAdmin page. :|
 
how do you know that testdaemon.php is still running ?
 
@tereško because i'm still not able to open phpLiteAdmin page. testdaemon.php use sqlite3
ok, i'm tired. Now, hours and hours went by on this stupid daemon :(
i'll restart apache2. If it dont work, then i'll reinstall whole OS :D
eeeee!!! after restarting apache2, now, i can open my phpLitePage. Stupid me was writing getmypid() into sqlite db. Now, i got the pid 21579 hehe
 
11:33 PM
Does PHP not allow include(../file.php) or something?
Keep getting file not found, when its clearly there.
 
probably its NO there
try using absolute path
require __DIR__ . '/../file.php';
 
If I use absolute path, it will work fr now, but then it will fail when I push it on a real server
Right now I just did $_SERVER['DOCUMENT_ROOT']
 
why would you do something like that
 
its technically still returning the absolute path
 
ok , ok .. do as you like, I have better things to do
 
11:42 PM
@Mr.IDon'tCare don't mind @tereško, he genuinely doesn't care ... it's nothing personal ...
 
Well if I am doing something stupendously wrong, then I'd be happy if you tell me and I'd certainly listen to you. But if you think I am doing something wrong but don't say anything about it, then I won't find out.
@JoeWatkins :)
 
he provided you with good advice
infact ../ is acceptable, but it's still not a good idea to use relative paths, as you can tell, it can cause problems ...
 
Yeah, won't do that again.
 
so use an absolute path, the problem will go away, as @tereško suggested you can use constants to resolve the path using FILE or DIR or whatever, it shouldn't present a problem ...
@Mr.IDon'tCare a bit of advice, you didn't ask, but you're gonna get it anyway ... to ask for advice and argue with the answer proves that you are approaching the question with a presupposition, this is not the best route to understanding ... something to think about ...
 

« first day (1077 days earlier)      last day (3885 days later) »