« first day (1130 days earlier)      last day (3834 days later) » 

10:12 AM
@Fabien I've decided to fresh my memory reading sql anti-patterns book :D
 
wonderful book that :)
 
I like the cover :p
 
@AlmaDo I've not even started yet :(
 
@Fabien I've read parts from there. But now decided to read it entirely
 
Introducing the ** operator :)
5
 
10:18 AM
@Fabien since I've noticed that I have time for Go - I decided to improve my knowledge :p
 
@AlmaDo Well the offer for lessons is always available to you :) Just let me know when you're free and if I am too I am happy to oblige :)
I wonder what's a really nice set up for developing on windows.
My website folders are all over the place.
 
well, I'm planning to change my job soon, so may be I will not have any free time :\
actually, I'll have to change it till March
 
Why the change?
 
now I have similar to @ircmaxell's situation: I'm doing nothing, but paid for that :p
@Fabien my department will be shut down
 
10:23 AM
Damn. What's going on with us all
 
well, it's half of November.. December, January and February.. about 3.5 month of free paid time :D
 
Do you have any concerns finding a new job? You're fairly talented so I couldn't imagine it's a big issue.
 
@Fabien I don't know for now. I have not great portfolio, unfortunately
there was an option to work in Dubai - but it seems it's no longer available :\
and - like @ircmaxell's said - to be employed by, for example, US employer - you must be really advanced & talented (so employer will offer a job to you and not US citizen)
 
@Jack woot! yesterday I wrote something like 1024 ^ 2, and it took me a while to figure that's not pow(1024, 2) :D
 
@webarto haha no it's not :)
 
10:27 AM
@webarto :p
 
Good morning.
 
Morning room 11
@AlmaDo I have an interview with a US employer on Wednesday (Thursday my time)
 
@SweetieBelle you too? welcome to our club :p
 
0
Q: Access a class's method

Mr_GreenI am trying to access a class's method using Mage::getSingleton() I have done the following: <?php $allReviews = Mage::getSingleton('efkreports/product_allReviews')->getAllProductReviews(); ?> <?php zend_debug::dump($allReviews); ?> But this is giving me error: Fatal error: Call to a memb...

 
@AlmaDo I'm employed
Just not going to turn down the opportunity of Amazon :P
 
10:29 AM
@SweetieBelle so do I
 
@SweetieBelle What position at Aws?
 
@SweetieBelle but I doubt I'll be in Amazon :\
 
@Jack Optimization job
@Jack It's something cloud-based, I think Whispersync
They're not that clear in the descriptions :P
 
Yeah, it does sound a bit vague hehe
 
I guess they move people between different services a lot
 
10:30 AM
I was thinking of applying for solutions architect ... but not sure whether I'm qualified enough heh
 
So dont want to give you a job on one specific component
 
@Jack I think, ideal place is where you're 'not fit' at ~30% - then you'll 70% fit position and 30% - to learn
 
I'm like hovering around the 50% haha
 
if you fit position at 100% - then.. huh, no self-development will be done
@Jack I'm not so risky :D
 
@AlmaDo Yeah I think I'm somewhere 70-80%
I need to swot up on algorithm efficiency calculations though
I suck at big-theta and o notation :/
 
10:34 AM
@SweetieBelle :) I like big-O/big-Theta/big-Omega
 
@SweetieBelle There's an iTunes U course on that stuff.
 
I do too, I just always forget which one's which :D
@Jack Thanks, will take a look
 
Introduction to Algorithms ... is the supporting book.
 
I cant blame my university, they made me write all kinds of algorithms in asm and analyze them :P
I just dont get to use it much since then
 
nobody analyses asm once it's written hehe
 
big-Theta is equal estimation ("function depends of N with same speed as ..."), big-O is 'less than' estimation ("function depends of N with speed not greater than ...") and big-Omega is 'greater than' estimation ("function depends of N with speed not lesser than ...")
very easy explanation :p
 
Found it on yt
 
Oh, nice, it has a Kindle ver
I <3 Kindle
 
good morning guys
 
10:40 AM
(in case you're reading, Amazon! :D)
 
I'm wondering what you guys think of this one:
2
Q: What's a good way to make a PHP website approach the database object oriented?

RobbertPlease note I'm not looking for 'use a framework' answers. I'm trying to structurally improve the way I code websites and approach databases from PHP. I'm building a web service from scratch, without any frameworks. I'm using a LAMP stack and am trying to learn a bit of PHP's OO functionality wh...

I like Arlaud's answer so far
 
@Robbert For one you should drop the global $db;
 
Jack, stahp
lol
10 people already called me out for using global :(
 
@Robbert Good :P
 
It can't be said enough.
 
10:43 AM
@Robbert questions, starting with 'Best practice ..', 'What's a best/good way ..' are always opinion-based. If you want certain help, be more specific
 
global is bad
 
now I feel like an idiot thinking I was posting a constructive question
but I want opinions, Alma
:)
 
Don't try to approach the database as object oriented, use layers

Domain Objects
----
Database Table Access Objects
----
The Database
That's what I do
 
@Robbert SO fits bad for that - since among different opinions there's no 'right way' in most cases.
 
@Robbert it is the least stupid one from the bunch. But it could be simply a byproduct of being the shortest.
 
10:45 AM
hi guys how can we dcode json in php
 
Database tables map 1:1 with table objects, on top of the table objects you have a model layer
@AnshulParashar json_decode?
 
@SweetieBelle no
 
@AnshulParashar echo str_repeat('wow ', 9001);
 
that's true Alma, which is why I'm hesitant to pick a best answer. I like the discussion more
 
10:46 AM
I'm not looking for a best approach, just wondering how different people with different backgrounds approach this problem.. looking for a way that fits best with my coding style and ideals
 
@tereško no why?
 
@SweetieBelle UserGroups ... it is retarded to have "table objects" for intersections
 
@Robbert There are right & wrong ways to do this. If you follow SOLID principles you'll be doing more right than wrong.
 
honestly, it is retarded to have "table objects" in any capacity
 
unless they always truly match.
 
10:49 AM
@Jack that applies only to Hello Words applications
 
@tereško I like to abstract SQL out of my domain models
Want it at a lower level
 
what are domain models?
 
what do you mean by "abstract sql out"? You mean ORM then?
 
@Jack Yes
 
10:53 AM
@Robbert "domain model" is singular. It is a word that describes all of the knowledge of particular business, that gets used in an application. You should read his, to have some basic grasp on the term: amazon.com/Domain-Driven-Design-Tackling-Complexity-Software/dp/…
 
@Robbert A domain object is an object which represents a business object rather than something abstract which is only used for the good of programmers.
i.e. an account, a customer, etc
 
@SweetieBelle BULLSHIT. Also, that was NOT what he asked about
 
@tereško No.
 
ORM is for your blog :D
 
domain object !== domain model
 
10:55 AM
Laziness costs...
 
@tereško Domain object = concrete instance of domain model.
 
Ehmm
 
wrong
 
Customer model = class. Customer object = one customer (object).
 
wrong
 
10:56 AM
Saying 'wrong' without offering a correction is valueless.
 
throw new RottenTomato;
 
@SweetieBelle i used that but its not working
 
user652649
@tereško STFU
 
@AnshulParashar In what way is it not working?
 
mvc model !== domain model !== domain objects
stop confusing the basic terms
 
10:57 AM
@AnshulParashar: You can use jsondecode function of php
 
@tereško MVC model = model layer, domain model is a part of the model layer
 
@SweetieBelle i have a array and not done clearly
@chiragNandwani yep i used it but issue not solve
 
@AnshulParashar: Dont forget to place true for make it as anarray
@AnshulParashar: What is your issue in json?
 
@SweetieBelle "domain model" is NOT a piece of code. It is a word that describes accumulated knowledge about project
please learn what terms means before you use them
 
@chiragNandwani i have an array of json
 
10:59 AM
@AnshulParashar This is basic usage of json_decode: eval.in/69770
 
Ok now you want to use that array
 
@chiragNandwani having many issue to not get values use all things
 
simply take a variable of php and use array name
 
@tereško I'm not interested in arguing semantics, but I said 'domain objects', he was asking about my use of 'domain models' (I admit, that's the wrong term, should be domain classes) in a prior sentence.
 
What was the HTTP status code if you do a GET to a resource that requires a POST?
 
11:01 AM
@chiragNandwani yep i take it but not decoded
 
Is a 403 returned? Can't remember
 
@AnshulParashar: EXample if there is a value name in hotel array you can use as folow: $a=$obj['hotel']['name'];
 
Or a 406, not acceptible...
 
Could be 405, method not allowed.
 
@chiragNandwani yep exactly like that i want to fectch
 
11:02 AM
@Jimbo 405 isn't it?
 
@Jimbo: it shows you a blank page over webservise
 
@chiragNandwani I'm on about the headers specifically
 
@AnshulParashar Put your code on eval.in
 
@SweetieBelle Ah yes, 405... method not allowed
Thanks!
 
np
Think @jack beat me to it :P
 
11:03 AM
^.^
 
@Jack Sorry, didn't see that!! Thank you :)
 
np~
 
@chiragNandwani have any different what i missing ?
 
@bwoebi It's done, more or less ... still have to write a few test cases though.
 
@AnshulParashar: Either you can use foreach loop for call a tag multiple times
 
11:05 AM
@AnshulParashar It's impossible to say without seeing your code. Probably you either have malformed JSON or you're creating an object and trying to use it as an array.
 
@may be you forget to put true i show you in my next comment
 
@AnshulParashar Read the documentation.
 
@SweetieBelle yep wait i show code
 
@AnshulParashar: json_decode(//your URL,true); This make the json as an array
 
@chiragNandwani yep its work man
thanks !!
@SweetieBelle thnx...its appreciable
 
11:09 AM
@Robbert In practice, when coding, you want abstraction where possible. You don't want to be worrying about underlying implementations and SQL code when you try to get a customer's name, you just want to do $customer->getName();
 
@AnshulParashar: Your welcome
 
$_SERVER[REQUEST_TIME'] is in UTC or local time
 
@Cody Don't use $_SERVER['REQUEST_TIME'] for anything that matters. It is a UNIX timestamp, which is always UTC based.
 
Sabhi ko diwali ki ram ram
 
@chiragNandwani Use English please.
 
11:17 AM
HAppy diwali to all
 
@SweetieBelle thanx
@chiragNandwani same to you man
 
@chiragNandwani same to you but its be lated
 
No this wish is for next year .. so you can say it is so early
 
@chiragNandwani lols okieee man
 
@Cody: Welcome, Where is my diwali gift???
 
11:20 AM
who the fuck is staring everything ?!
please, stop
 
@Cody: Just Joking.. enjoy php..
 
@chiragNandwani lol
@chiragNandwani where you from
 
@Cody: I am from India . Where You from
 
me too
 
And now, the minimum star reputation proposal has merit.
But seriously, wtf?
 
11:23 AM
@chiragNandwani So you must be doing engineering ...
 
@Cody: You are from India .. Your name is not Indian. .. From which state ?
I Completed my B.Tech. .. And You?
 
U.P
don't go after name
 
Stop starring retarded irrelevant things.
 
@chiragNandwani BCA
2 sem
 
ok... BCA .. Nice 4 more sem and lots of knowledge waiting for you
 
11:26 AM
@SweetieBelle Stop being retarded, starring irrelevant things. *fixed*
 
@tereško do you know how to work with web sockets with remote servers .I'm using this code.google.com/p/phpwebsocket
$client = new WebSocket("ws://127.0.0.1:12345/echo/");
 
@DanLugg I'm supposed to be cutting down on my use of the term 'retarded'.
 
Do you mean BCA means lot of knowledge ??
 
But it's hard, it's my go-to for absurd and unintelligent behavior.
 
@SweetieBelle Well, there's a time and place for anything.
And this is the one for retarded.
Though, kudos on that.
 
11:27 AM
Could someone remove those starred messages ? It's annoying
@AnshulParashar @chiragNandwani please remove those stars
 
@Cody: don't go after name (BCA) . Just try to learn more and more thing.
 
@chiragNandwani ok
 
@HamZa they are not staring them .. it's "Cody"
 
damn, it's childish
 
@tereško do you know the answer of my question ?
 
11:30 AM
@HamZa: I am not doing anything. Just for first time in chat room so i try to know how it s work .. but i give only 2 stars nothing else
 
I already sent a notice to mods
 
Well, the silver lining in that person's retarded behavior is this:
24
Q: Chat room stars, personal vs. room

Dan LuggUpdate This just happened. I waltzed into the PHP room, and sure enough: Alternative While I believe functionality in this proposal would be optimal, it is perfectly understandable that such an implementation may be too large for reasonable expectations. Alternatively, as has been discussed...

 
yup +1
 
@tereško i didn't starring
 
oh .. but you are
 
11:32 AM
@webarto ppping
 
you see, one cannot star his own messages ... well .. unless you are room owner
 
^ lolz
 
@tereško: I am not room Owner by god
 
@tereško well even room owners can't star their own message, however they could "pin" it
 
Well good news is I'm getting recruiters ringing me constantly atm
 
11:34 AM
don't blame me
 
@HamZa and when they "unpin" the message, it has gained a star ... it's a known bug
 
ooooooh didn't know that !
 
Just Chill Guys.. Remember the first php program you create and forget all mess.
 
It doesn't matter, whoever did it hopefully helped seal the deal of that proposal.
@chiragNandwani No, we use this room to discuss things of relevance, and someone is fucking with it.
 
Back to PHP
 
11:36 AM
@chiragNandwani this behaviour is totally childish and unacceptable
 
@JoeWatkins pppong
@Fabien That's not good news :P
 
@DanLugg : Its Happen This world is full of unexpected people . So , Why we get furstration for other irrlavance
 
@webarto Evidently you should move to Southampton
 
JUst be cool .....
 
@chiragNandwani It's not unexpected that people are retarded. It's unexpected that they come here and are able to pull their fingers out of their asses long enough to use the mouse to star everything. That is what contributes to frustration.
 
11:39 AM
Can any body help me to jquery slider or i ask that question in another room
 

JavaScript

Topic: Anything JavaScript, ECMAScript including Node, React, ...
 
@chiragNandwani also jquery is hated here. And ofc you should try the js room, not sure if they would love it though
 
lol, yea, I don't believe they'll be particularly receptive to a jQuery question either.
 
"jquery" is an ancient armenian word for "I cannot write javascript"
10
 
lol
 
11:41 AM
@HamZa: YEAh , Jquery And Javascript ruined all php too.
 
@chiragNandwani what's wrong with JS ?
 
And wtf do they have to do with ruining PHP?
PHP ruins PHP. ;-)
 
jquery means "Ja Kyu RHI h" In english(why you are go ?) just opposite to its behaviour
 
@chiragNandwani did you use google translate ?
 
No. I just break down the word in hindi and that's meaning comes
 
11:44 AM
@JoeWatkins are you around?
 
11:58 AM
@AlmaDo @JoeWatkins is currently busy, please leave a message.
:P
@tereško Imma star dat.
 
@webarto ok, that's about mt_rand() in PHP. From here I've found that it spoils result by shifting it right to 1 (cause of >> 1). So am I correct that it's a 'dirty hack'?
also I guess there's no way to restore original value because >> 1 already spoiled it
i.e. no other way rather than implement own _rand()-like function
 
PHP by itself is a hack :P I get it, but really can't comment as I'm not competitive. @JoeWatkins ^
 
I tried << 1 but with no luck, of course (again, because one shifted bit was lost)
@webarto that's about
$i = 2000000001;
var_dump($i); //int(2000000001)
var_dump($j = $i >> 1); //int(1000000000)
var_dump($j << 1);//int(2000000000) <----- [spoil]
and I wonder why such thing persists in that function :\
 
@chiragNandwani How did JS ruin PHP? JS augments PHP.
 
js has nothing to do with PHP :p
 
12:11 PM
They are used on the same projects :P
 
Tongue-out-face to feel included :P
 
well, I'm wearing my boots and my shirt :p They both are used by me. They have nothing to do with each other
 
Soda pop ruined doorknobs!
 
I want to post a blog post on Silex, but my blog post is automatically updated in feeds here and I need someone to proof read it and let me know what they think...
 
@AlmaDo Dont know about you but I try to choose clothes that complement each other :P
I dont wear a hawaiian shirt with a suit
 
12:16 PM
@SweetieBelle ah yes, I know that you're wearing a pony tail :D
 
I totally should
But I'm not :(
Would have to wear the pony ears too to make it work
Current coding track (pony related).
 
Rawr :X
 
12:33 PM
posted on November 19, 2013 by James Mallison

Silex is a PHP micro-framework built by the makers of the Symfony2 framework and the pimple DiC, and it provides a great set of tools to architect your own application with ease. The problem is, when you first start with Silex, you're thrown into the deep end. The documentation on Silex is very thin and there are no simple tutorials out there to help you hit the ground running. For this re

 
FU FEEDS
 
HAHA
 
Pffft, nice exposure ;)
 
crap
 
Well, you could at least say why!
;D
 
12:39 PM
why do I need to say why?
 
@Jimbo don't forget about us when you become famous :D
@AlmaDo Let's wait for internals guys :)
 
@webarto no other options, yes. However, there's a clue in comments:
331    /*
332     * Melo: hmms.. randomMT() returns 32 random bits...
333     * Yet, the previous php_rand only returns 31 at most.
334     * So I put a right shift to loose the lsb. It *seems*
335     * better than clearing the msb.
336     * Update:
337     * I talked with Cokus via email and it won't ruin the algorithm
338     */
sad, but true :D
 
:D
 
looks like some ancient crap
I see how it "works", truncating (long) to 31-bit (actually, unsigned "half-long"), but the reason... huh..
 
12:54 PM
two choices: go to the database to fetch a direct descendant of EVERY parent; or run loops on the full set to determine this. Which one is more efficient?
 
the one with less sql queries
also, cache it
 
@Duikboot lol .. I'm just reading about this anti-pattern :D
 
:D
 
I know that before, yes. But this is funny that I'm reading about this in same time :p
@Duikboot read this (available for reading) from page 35 till chapter's end
 
@igorw you're already a collaborator for phpphp, so you can just push :-D
 
1:09 PM
ok thanks!
 
Is "please no" intentional or you meant "please know" @ircmaxell
 
please no was intentional
as in "Please, no. Don't do that. No. Please. For the love of god"
 
exactly :D
 
mornin!
 
Interesting, @fabpot is splitting up the PHP community into “low-end” (wordpress users etc) and “professional” (frameworks) #zceu
WP is really great, until it's not...
good morning Philippines!
 
1:37 PM
@webarto but it's 9:37PM here.. and i dont get that last message of yours lol.. :P
 
Has anyone ever tried to use this PHP Printer Module before on Ubuntu? :X.. Long shot..
 
@MackieeE does it print PHP codes? >=p
 
@reikyoushin Hahah :D almost.. :P
@reikyoushin The next best thing, plain text strings! :|
 
holy crap. that thread is getting interesting
> It's amazing how quickly the lessons of the GOPHP5 movement have been forgotten. Hosts will upgrade if the projects demand newer versions. If projects wait for hosts to upgrade, it will never happen. Be the change you need to see in the world. Don't play politics with the security of people's business. Everyone loses that way.
that's my last line to my new reply
 
And you're right...
If WP requires 5.4, every f* host would upgrade...
5.2 etc. are available only because "legacy" apps.
 
1:44 PM
@webarto Will not happen. :/ See my request and the responses in that thread.
 
Who cares
 
I'll get flamed for this but..
 
wordpress is a cancer... I really believe that. With their unwillingness to fix problems, to step up and clean their codebase. To teach best practices. To actually make a meaningful impact. Instead, they don't care about developers, they just care about the bottom line. And that's horrific.
 
@toscho Every word is in correct place IMHO...
WP is really really sad...
 
Well, If you look at what PHP was built for, a templating language; Doesn't wordpress sort of fit that 'profile' ?
 
1:46 PM
huh?
 
It fits, 10 years ago...
 
I'm not saying WP needs to adopt Symfony and go with composer
 
Hi all
Can anyone help me in my issue, please?
2
Q: How to set background watermark image using pdfcrowd HTML to PDF API for PHP?

PHPLoverI'm using "pdfcrowd HTML to PDF API for PHP" to generate PDF files from the PHP and smarty file. I'm able to generate the PDF but not able to put the background watermark image to the PDF I'm printing out. I tried everything but still couldn't put the background watermark image. Can anyone please...

 
I'm talking about basic best practices, like FILTER-IN, ESCAPE-OUT. Prepared statements. Code isolation and autoloading
Focusing on readable code and reasonable abstractions
doing just those few things would make a huge difference
 
It's not f* rocket science, they can rewrite it and make it pretty code-wise, but they won't.
 
1:48 PM
they don't even need a rewrite
some targeted refactoring would do huge things
 
@ircmaxell one problem is: the people capable of writing that better code have left or given up
 
@toscho hmm.. i dont see you usually here in room 11. hello ^_^
 
because they have been driven away by the people in the core
@toscho And I think there are at least a few left that would do it. They are just being handcuffed by their own policies and philosophies
 
It's easier not to care...
 
not to mention that there are capable people who would step in if they made a significant effort in that regard
 
1:50 PM
the priorities for wp core devs are backwards compatibility and UI
and it works
 
it works very well for people not writing code
 
as long at it works it will not change
 
for people writing code, all it does is teach bad practices and "how to do it wrong"
 
I opened few files yesterday, just starred in the screen, lost...
 
@toscho let me show you something
 
1:53 PM
@webarto you still didn't answer me.. haha. what's that for :P
 
that's measuring average complexity over time of the 3 projects. it's not working for WP. Over time they can't clean up mistakes, and they will continue to build, backing them into a corner.
 
@ircmaxell I have seen that. :)
 
it's like quicksand. If they never pay their debt, they will eventually be swallowed by it
 
WP_Query::get_posts() is my favorite example.
 
@reikyoushin making some plugins so I afford to eat :P
@toscho :(
 
1:56 PM
@toscho I think I just threw up a little in my mouth
 
@toscho No, it doesn't. Everybody loses.
 
@DanLugg depends on your viewpoint
 

« first day (1130 days earlier)      last day (3834 days later) »