« first day (1506 days earlier)      last day (3449 days later) » 
00:00 - 14:0014:00 - 00:00

2:08 PM
Monring room 11
 
Ringmon @PeeHaa
 
Anyone here works in CakePHP?
 
probably not, but if you have a question, you could try and ask it anyways
 
Ok this is my question:
0
A: How to perform complex multiple join operation using $belongsTo in CakePHP

mcgowan.bYou can run a sub-query, or you can load the model on the fly with ClassRegistry::init('region'); and call a find first, passing in the foreign key. I'd recommend the first though, as it'd be more efficient.

 
you just got a answer 28 min ago
 
2:20 PM
Basically, what I want is this - I want to retrieve data from a table which doesn't have any direct relationship with my current table.
I want a detailed answer.
I was not able to make myself clear in that question, as it's not my actual project, I just tried to post a demo scenario to get some idea.
 
You can not really demand a detailed answer, what is wrong with the answer you got?
 
In my CakePHP project, the problem is far more complicated.
Ok, by detailed answer, I didn't mean a complete code. I wanted a step-by-step instruction. I'll write the codes myself based on the instructions.
There isn't anything wrong with the answer. The problem is, I couldn't explain my problem clearly. It's my fault. I acknowledge.
Basically, my problem is something like this. I want to view data like the following query:
SELECT D.something, B.something, B.something,
B.something, B.something,
A.something, A.something, A.something,
A.something
FROM A
LEFT JOIN B ON A.something = B.id
LEFT JOIN C ON B.id = C.something
 
@Capt.JackSparrow Pro tip: when somebody says their query is somehow complex it it pretty easy 99% of the time
 
LEFT JOIN D ON C.something = D.id
 
guys
composer update doesnt work for me.
 
2:27 PM
@HassanAlthaf, errors? =]
 
it says
composer not found
i mean
composer: command not found
 
did you mv the composer.phar to /usr/local/bin/composer or similar?
It is not composer update that is not working, it is that you have not "installed" composer
 
composer.phar is in the root folder of my project
with composer.json
nvm u must type php composer.phar update
 
did you read the webpage
`curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer`
 
I did install it already
Thanks, i fixed it
I love you guys.
You taught me something good.
 
2:31 PM
@Capt.JackSparrow, I am not understanding what the problem is. You seem to know how to make a multiple left joins
 
(I am by no means homo, just assume it as brotherly love)
 
Ronni,
 
Ow sorry I kicked you :(
I pushed the wrong button
 
Hello
 
2:32 PM
Hello @l0oky, happy sunday
 
Will you let me finish before hitting your keyboards?? >:(
 
Sorry @hassan didn't mean to do that
I blame chat's horrible interface
 
@Capt.JackSparrow use a pastie/pastebin etc
@HassanAlthaf could this be deleted.. it was not offensive before.. now it is..
 
@RonniSkansing Thanks i guess.. I've been frustrated by a simple HTTP POST request all day/night
0
Q: Can't make a successful multipart/form-data POST request

l0okyI've been trying to use this file uploader made by jonjenkins for a while now. It's a very small script, works great, shows you how to use multer package for node.js - you can upload a file using the HTML form, no problem. Then I was trying to upload a file by making a custom POST request to th...

 
@l0oky is it a node.js question?
 
2:38 PM
@l0oky Didn't @BenjaminGruenbaum already asked for the minimal code to reproduce in JS room?
 
No..
It isnt about node.js -.-'
It's a general HTTP question ..
 
@PeeHaa yo , what's up? Did you get to your hotel OK on Friday?
 
Am I really that bad at communicating..
 
I was super sleepy and in Amsterdam mode - sorry about that :D
 
@BenjaminGruenbaum Yeah totally. Only to find out the bar was still open :D
 
2:40 PM
Hah :D
 
There is nothing wrong with my join query. Problem is not there. Problem is, I don't know how to make this relationship in cakephp.
 
Did stay an extra day though, because the next day I started drinking too soon up to the point I couldn't drive back anyway :P
 
This is an indirect relationship between A and D. belongsTo and hasMany don't help. Should I use hasAndBelongsToMany?
 
@Capt.JackSparrow Use pdo, don't use that active record crap
 
2:43 PM
@BenjaminGruenbaum Meh it's ok. Booze didn't stop flowing so all is ok :)
When are you going back home?
 
I am home, I went back the next day it was my last day there
 
Ah cool. You didn't had to go too early in the morning I hope
 
@Patrick, You call Active Record 'crap'? Why?
 
36
A: Does the ActiveRecord pattern follow/encourage the SOLID design principles?

Yannis RizosThere's some valid criticism on ActiveRecord. As always, Uncle Bob sums it up perfectly: The problem I have with Active Record is that it creates confusion about these two very different styles of programming. A database table is a data structure. It has exposed data and no behavior. But an A...

 
@PeeHaa about 10:00 was ok though
 
2:49 PM
@BenjaminGruenbaum So next meetup is going to be in israel? :P
 
@BenjaminGruenbaum How's @PeeHaa behind that blue and white icon and the broom?
 
Sure, Israel sounds good :)
 
Sorry about before if it was offensive.
 
@Patrick This is interesting. Then what do you say about 'Object-Relational Mapping?' in Java and .NET? Here a Database Table is mapped to the Object of a Class.
Database Table => Data Structures, Object => object.
:)
 
2:52 PM
If you want to use something similar in php, use [doctrine](http://www.doctrine-project.org). ORM !== AR
But most of the time you are better of without either one of them
 
So you prefer raw SQL queries?
 
@Capt.JackSparrow all the cool tools you're used to from .NET? Yeah, PHP doesn't have those yet.
 
:)
(y)
I like that.
 
No LINQ, SQL itself is pretty decent if you use an editor, it's testable and not very verbose.
 
@Capt.JackSparrow Don't listen to Benjamin, he's a javascript troll
@Capt.JackSparrow most of the time yes.
 
2:53 PM
@Patrick what? All I said is completely true - PHP doesn't have the language facilities to do stuff like LINQ yet.
 
@BenjaminGruenbaum Pardon me Sir. I've never used ORM in .NET. Only just heard of them.
 
@BenjaminGruenbaum He was not talking about LINQ, he was talking about ORMs
 
Oh, .NET has something called LINQ that lets you query objects and collections and the database the same way.
 
The only .NET project I worked in, most of the times I wrote raw SQL queries.
 
@Capt.JackSparrow On the other hand, why are you using cakephp?
 
2:54 PM
@Patrick yes, but usually when people refer to LINQ and SQL (at least since LINQ-to-SQL was pretty much killed) they mean entity framework.
 
@BenjaminGruenbaum Yes sir. I've heard about it.
@Patrick Working in a CakePHP project in my office
Cake 1.2.5, PHP 5.2.11, MySQL 5.1.36. Awesome!!!!! Couldn't have been any better than this!!!!
:P
 
On a sunday? eww
 
In my country, the normal working days are Sun-Thu
 
@Capt.JackSparrow lol your life sucks :P
 
@Capt.JackSparrow But yeah, when dealing with a framework, avoid everything framework related once you get past the controllers. After the controllers, just use plain old php objects and dependency injection
 
2:57 PM
Although most Software Companies here have Mon-Fri working days, but my company has the traditional working days of Sun-Thu
 
So guys,
 
@Patrick Aye!
 
whats ur fav ide/editor for PHP?
 
I was just worried that you are working on a cakephp project in your free time... :)
 
@HassanAlthaf Sublime? :D
 
2:58 PM
@HassanAlthaf I use Netbeans 8.0.1. Works pretty good for me.
 
@l0oky hifive
@Capt.JackSparrow umm isnt the size very huge? :P
@l0oky do you know good plugins for sublime for PHP?
@l0oky what theme u use?
 
ok people. Today I will once again attempt to fix my ssl situation for once and for all. I might need some help @Danack @DaveRandom so you guys better wake up
 
I stick with the original theme and plugins :D
 
@HassanAlthaf The download file size? Ahhh ... yeah ... pretty big ... almost 200 MB. You have problem downloading it? Low bandwidth??? I thought you have pretty good bandwidth there in Sri Lanka.
 
dark one :D
 
2:59 PM
@Capt.JackSparrow no, its only 25 GB per month. Internet is expensive here. And no, my MacBook HDD is limited, only 126 GB HDD
 
Troll detected.
 
#truestory
night guys
 
@HassanAlthaf OMG. Your MacBook sucks. Your country net service sucks too. Big time!!!
 
@Capt.JackSparrow Cool story brah
 
@HassanAlthaf Yeah goodnight!
@l0oky What story?
 
3:02 PM
I don't know. Which one?
 
@l0oky You said >Cool story brah. That's why I'm asking. What story?
 
Is it bad in any way to add updatedb to the crontab?
 
@Capt.JackSparrow I already said it the COOL story... how many times am I going to repeat myself?
 
@PeeHaa so long as it runs with low priority (nice, ionice), no.
 
kthx
 
3:10 PM
@l0oky Ok sorry. The 'COOL' story. Let's be cool with it. :D
 
Exactly you figured it out! :D
 
Another thing. Can anyone here tell me how to create and use a layout view page in all the view files in CodeIgniter application?
 
3:44 PM
@DaveRandom I needz your halpz
 
@Capt.JackSparrow What do you mean? Some code in a pastebin always is always a good idea.
 
3:57 PM
I am trying (and failing) to get my certificate to work, but for some reason I always get an error:
> nginx: [emerg] SSL_CTX_use_PrivateKey_file("/etc/ssl/certs/pieterhordijk_com.key") failed (SSL: error:0B080074:x509 certificate routines:X509_check_private_key:key values mismatch)
nginx: configuration file /etc/nginx/nginx.conf test failed
I have checked my key, csr and actual cert and they all give me the same output:
openssl rsa -noout -modulus -in /etc/ssl/certs/pieterhordijk_com.key
openssl req -noout -modulus -in /root/ssh_keys_generated/pieterhordijk_com.csr
openssl x509 -noout -modulus -in /etc/ssl/certs/pieterhordijk_com.chained.crt
 
@PeeHaa Did you run the commands as the nginx user? (shot in the dark)
 
No I did not, but the files are readable (checked it)
I'm starting to think either I am really stupid or the issuer fucked up
 
4:45 PM
morning
 
Morniig @NikiC
 
Hey
yolisp sores to new heights, fixing all PHP's problems
 
5:02 PM
=]
 
5:14 PM
Yolisp supports IIFEs. Yolisp supports Uniform Variable Syntax. Yolisp has merged symbol tables.
 
@crypticツ I've got some issues with it, and RC1 is already out... I don't think it will
 
Morning @obiNullPoiиteяkenobi
 
5:29 PM
sup !
 
Yo
Not sure if I google this before asking because most likely googling gives answer which are 3 book pages long, but does php go through a sort of compiler so the server knows what it is?
 
5:49 PM
@AndreaFaulds merged symbol tables suck...
 
@bwoebi What, how so?
 
I like to call my getters just like my properties…
 
@bwoebi Well that's only an issue because PHP lacks proper property accessors
 
@AndreaFaulds yes, though, I'm not sure if I'd like them …
 
I'd love them
writing getters/setters is a huge pita
@bwoebi I have a mac, and I don't have OSX :P
 
5:56 PM
@FlorianMargaine pfff^^
 
when I started my new job, they offered me a macbook pro and a lenovo thinkpad... I chose the lenovo, linux is easier to install on it
 
wtf
 
I have a macbook at work and at home. Ubuntu on both :)
 
fedora on my home mbp
ubuntu on my work laptop... but I think I'll switch to fedora
 
@FlorianMargaine no it isn't
I got a patch for that ... in 7 ...
if someone wants to pick it up to change the syntax, welcome ...
going back to what I was doing now ... which is cooking ... lata ...
 
6:11 PM
@bwoebi That's bad naming.
 
@NikiC it's a combined getter/setter
 
@bwoebi Even worse.
 
@NikiC why?
 
You don't see anything wrong with a method that can either get or set a value?
 
no.
 
6:19 PM
in a word: SRP
 
@FlorianMargaine If you call it two responsibilities… For me getting/setting counts as only one.
 
as a rule of thumb, it's usually one verb per responsiblity
 
@bwoebi so how do you name your methods?
 
@bwoebi The "/" should have given you a hint ;)
 
@NikiC then call it property accessor. which is one thing for both.
 
6:30 PM
$foo->getSetBar($isThisRealLife);
 
$foo->bar($isThisRealLife);
 
^ very descriptive... :x
 
I'm having some real trouble implementing context switching on arm :/
 
Well, that's what you get when tackling hard problems.
 
what did I miss ?
 
6:45 PM
@tereško me
@NikiC any chance you could implement a param to preg_match_all that excludes the numeric index in the array when I have defined a named capture group? that would be awesome.
 
@NikiC Native code? HEATHEN!
 
@Gordon why can't you just remove it yourself?
 
@bwoebi that's not the question. why is it in there in the first place.
 
oh ok
 
when I define something like commit\s+(?<commit>[a-z0-9]+)\n, the $matches array will contain the same value twice for that group. One with a numeric key and one with "commit". I put the named group there for a reason, so why does it give me the numeric index as well. That only doubles the size of the $matches array.
 
6:51 PM
@Gordon A bit like the awesome default feature of a pdo recordset
 
@PeeHaa yeah, somewhat
 
It's just retarded
 
@Gordon can you open a bug on bugs.php.net for that?
 
@FlorianMargaine yeah, well. I'd like to have it solved, not rot in a bugtracker no one reads anyway :)
 
7:14 PM
@Gordon we need bugs to have references in commits
and branch names
@Gordon that said... why does it bother you? performance? have you noticed a slowdown that could be reduced with this?
 
7:29 PM
Not much star board action as of late.
Also, GERHD MERNERNG
 
sub lr, lr, #4
sub sp, sp, #4
stmdb sp, {r0-r14}^
str lr, [sp], #-(4*15)
mrs r0, spsr
str r0, [sp, #-8]!
bl aic_source1_handler
ldr r0, [sp], #(8+4*16)
msr spsr_all, r0
ldmdb sp, {r0-r15}^
 
^^ Already linked it earlier, but if you missed, do check it out. Fucking hilarious.
Random chat stars out of context.
 
@Patrick I literally lol'd.
 
7:38 PM
 
^ lol
 
12
Q: Shit SE Says - Stack Exchange chat stars out of context

Mark Henderson Screenshot / Code Snippet About The first thing you need to know is that it took me about 5 minutes of refreshing that the app to find two screenshots that were Safe For Work (and as a bonus, contained no swearing). So this app isn't for those who are easily offended. This app takes all of...

^^ +1 the dev
 
8:49 PM
Moah, implemented prepared statements in Mysql… It took me eternities to not have failures (in combination with send_long_data)…
 
9:03 PM
@FlorianMargaine it bothers me because it will bloat the array. I like to use named captured groups for improved readability of the regex and the result array. But when I use them, I double the result array for no good reason.
 
9:24 PM
gn have a good one
 
Why do people put answers as comments on SO?
Seen it a few times today. It really baffles me
 
9:41 PM
@BenjaminGruenbaum I am tempted to add PHP Task: Lean back. Enjoy. You have 80% market share anyway. You don't need to prove you are useful.
;)
 
Wrote a new [chapter](https://github.com/PatrickLouys/no-framework-tutorial/blob/master/10-dynamic-pages.md) for the no framework tutorial.
As always, feedback is very welcome :)
 
@Gordon Slavery used to have quite the market share at the day.
 
gah, what's wrong with that markdown? :(
 
@BenjaminGruenbaum it still has. it just doesnt show openly.
@Patrick looks like a bug
 
@Gordon just like php, people use it but no one likes it - it's mostly common in third world countries where education is not as available
 
9:46 PM
@BenjaminGruenbaum everyone likes it. no one admits it.
although I do admit I like PHP
it pays my bills
 
@BenjaminGruenbaum It's not that bad. At least it has interfaces ;-)
 
Slavery or php? :D
 
I guess I replied to the wrong line... php of course :D
 
10:37 PM
Well, implementing an interface is shackling yourself to it. We could draw some parallels.
 
@Patrick MD doesn't work with multi-line here
 
I like PHP… because it allows me to write code fast where I do loose control after > 2k LOC…
I hate hacks which ensure correct queuing and storing for restarting if connection gets lost
// things like this:

	private function conn() {
		if ($this->conn->alive()) {
			return $this->conn;
		}
		$restore = $this->conn->getConfig()->restore;
		if (isset($restore)) {
			$restore()->prepare($this->query)->when(function($error, $stmt) {
				if ($error) {
					while (list(, $args) = $this->virtualConn->getCall()) {
						end($args)->fail($error);
					}
				} else {
					$this->conn = $stmt->conn;
					$this->stmtId = $stmt->stmtId;
					foreach ($this->prebound as $paramId => $msg) {
That's async library mess.
That's async application yield overflow.
I hate code which I wrote and then don't like.
4
 
11:05 PM
3
Q: Not mathematics again?

ThreeFxSo I was given this puzzle quite some time ago and just thought it would make a nice addition to this site: Your task is to determine the method how the result is determined from the given number. A few example cases include: 177383 -> 2 267453 -> 2 111111 -> 0 636240 -> 4 367183 -> 3 247123 ->...

 
So… I thought I'd store a std::function in a particular struct… turns out that baby is six words of space!
 
@bwoebi I feel the pain :)
 
11:37 PM
@HamZa It's a not well-known feeling for me… Usually I'm not writing that complex code. My normal code is usually fine at the first write and a few tiny local refactors.
 
@bwoebi well as long you realise it's not "perfect" and reflect on it for the next time. It's all good :)
 
@HamZa Code never is perfect.
It always only might be good enough.
 
@bwoebi I know. I couldn't find the right words. Maybe I meant "as long as you realise it's bad"?
 
@HamZa Not 100% what you want to tell me
 
It's late and I'm working with Android code. Probably why I lost some of my sanity?
 
11:46 PM
@HamZa yeah^^
 
00:00 - 14:0014:00 - 00:00

« first day (1506 days earlier)      last day (3449 days later) »