« first day (503 days earlier)      last day (4438 days later) » 

12:03 AM
@edorian well ... you can try listening to audobooks as a prophylactic measure
 
@edorian: Whats swiss german, like normal german but full of holes?
 
but , yeah , sounds bad
 
@Leigh Hmmm.. actually that makes a lot of sense.. phonetically
 
got a new job in a different country ?
 
@tereško Discovering the devnology postcast helped
 
12:04 AM
@edorian: I only said it for the cheese reference. I speak enough German to eavesdrop conversations
 
@Leigh I got the reference. But it is really nice on multiple levels :)
Yeah I moved from Germany to Switzerland a month ago, new job
(hence me not being here a lot)
 
ah, well being German, I guess it's not so bad, I'm sure if I moved to Switzerland (being English myself), the little German I know would probably be no help whatsoever
 
Well most Swizz people speak fluent high german and also pretty good english and they are nice about switching languages a lot
 
"high german" has the same aftertaste as "queen's english"
 
except the phrase is only used in switzerland and not in germany :P
(as far as I'm aware)
 
12:09 AM
actually.. heute abend ich hatte einen deutsch abendskurs .. I think. I definitely had my evening class tonight
my girlfriend is German, so I have to make an effort
 
anyone here know how to implement a database connection pool?
 
@MelvinProtacio Yes. What's your use-case?
 
In php? Why?
 
@MelvinProtacio in what? you can create persistent connections using most db access thingies in PHP
btw, speaking of evil stuff: Persistent connections are evil :D
 
haha! that's one thing that uses singleton
 
12:16 AM
that's one of first classes people make , when they start using OOP in php
@MelvinProtacio , if you are using singletons for DB connections , then you are doing it wrong
 
. . . here we go again . . .
 
:D
 
not for db connection, it's for the connection pool class
:D
 
exactly the same thing .. not needed
 
12:17 AM
and especially not for php
 
@MelvinProtacio $connectionPool = new ConnectionPool; => I don't see no Singleton...
 
@MelvinProtacio , be a nice boy , and learn what Dependency Injection is
 
@edorian yeah probably not for php :D
 
shared nothing architecture and all .. but maybe you have a very special use case
 
The thing I hate about dependency injection, is the list of parameters as long as my arm, for every damn class
 
12:18 AM
@MelvinProtacio You can do connection pooling wrong in java with singletons :)
 
@Leigh true
 
@Leigh , then you are doing it wrong
 
@Leigh Then you at least are feeling the pain that your classes to way to much
Everything that depends on more than 2 (max 3) things is usually to big and does to much
 
@Leigh , this might help : youtube.com/watch?v=RlfLCWKxHJ0
 
@Leigh and you have to have unnecessary wrapper classes to encapsulate your parameter passing to avoid the long parameter list
 
12:19 AM
or is not properly encapsulated
 
@MelvinProtacio , and that is just wrong
 
@tereško: Actually I lied, I normally end up passing 3-4 things, but it gets annoying to pass them during every instantiation, when it could be so simple to just have the constructor.. getInstance ;)
 
@tereško it's always wrong anyways, so why do i have to bother. :P
 
because you are feeding this bullshit to others
 
@tereško i am not, it's just a freedom of expression :P
 
12:22 AM
@Leigh seperate object construction from where the objects do work and the amount of hassle shrinks :)
 
@MelvinProtacio , development oriented chat rooms are not akin to public square .. they are more like classrooms , and the "freedom of speech" is a limited comcept in such setting
 
@MelvinProtacio In PHP, each request shares nothing with any others. Having a 'connection pool' in PHP is not possible unless you want to implement it in PECL. If you are using a 'connection pool' to connect to different databases, you probably want the registry pattern.
 
@tereško i ask questions for all of us to think and discuss something relevant. if you are very much concerned on some people thinking in a different way and more than what conformist has to think, then there's nothing to be discussed about and it void the purpose of this chatroom
 
@MelvinProtacio , and in this context you are more like the strange home-schooled kid who thinks that world is 12'000 year old
 
^ tempted to star that.
 
12:25 AM
@LeviMorrison i agree that in php it may not be the case, since the connection may be shared and is the default
 
I was that kid once upon a time.
 
damn .. you are american .. so this might actually be a true story
 
racist and conformist :P
 
( sorry .. following the GOP has damaged my opinion on americans .. though i doubt that i can be blamed for it )
 
@LeviMorrison You were?
 
12:28 AM
I took that metaphorically in regards to OO
 
@NikiC I learned some stuff in schools but it wasn't well-taught, didn't go in-depth at all, and I ended up learning most of it on my own. So not home-taught, but self-taught. I started with early PHP 4.x, and when I came back from a two year break I sure had a surprise with PHP 5.2.
PHP was my first programming/scripting language. That also explains some of it.
 
yeah , it would
 
I have most of it sorted out by now, especially as far as PHP is concerned.
 
in that case you should pick up some book from Fowler
 
I haven't read anything in book form from him, but I have read pieces of his website as well as unclebob.
 
12:31 AM
of course , you can always just dig though his website
 
I've read Code Complete
Listened to a lot of talks from Google Tech Talks.
Built some larger applications on my own using different styles.
The multi-threaded webserver in C was an interesting one.
 
hi
 
I'd like to rewrite it using C++11. I'm sure the code would be cleaner and more understandable, but I'm curious to know about their compared performance.
 
any super smart people wanna look at this one? stackoverflow.com/questions/9526329/behaviour-of-is-callable-on
 
@Petah What an odd situation.
 
12:34 AM
yea
annoying as heck
 
emm .. what is the point of is_callable('/') ? some sort of OS spoofing ?
 
no, its really is_callable($result), where $result is a configuration option
if the config is set to a funciton, then the function should be called
but its failing because it thinks '/' is a function
 
@Petah Is this reproducable in a small testcase?
 
yes, I literally run <?php function t() {} var_dump(is_callble('/'));
and it returns true
 
Can you try running this from the cli?
(Or do you already try this on cli?)
 
12:44 AM
ill give it a shot
no i havent tried that yet
$ php -r "function t(){} var_dump(is_callable('/'));"
bool(true)
 
@Petah: it's actually really strange that it only works that way if the function is called t too..
 
and if i change t to b it works
$ php -r "function b(){} var_dump(is_callable('/'));"
bool(false)
i know wtf
 
indeed
do you have zend multibyte enabled?
 
don't think so
php -i | grep zend
report_zend_debug => Off => Off
zend.enable_gc => On => On
 
hrm
and your t is just a normal t, right?
 
12:50 AM
sure is
 
did you compile php yourself?
 
i didn't personally, my hosting provider may have
 
@Petah: If you put 2 blocks of that code in a row, does it return true for both? Or just the first instance, or the second instance?
actually you can't redeclare t(), ignor eme
 
@Petah var_dump(get_defined_functions()) (especially the "user" index)
 
ok...
that might be a problem
im getting some weird results
 
12:53 AM
which?
 
var_dump(get_defined_functions())
ones my server stops freaking out ill get some results
 
yeah, I mean which weird results ;)
 
Did it give you an ASCII art of cthulu? because if you did it you know whats up right..
 
ah ^^
 
umm ascii art?
there is some weird (maybe UTF 8) function names in there
 
12:57 AM
wow, thats pretty messsed up, just before the user section
i see ioncube
i'll put money on that being your problem
 
i should just start reading the H.P.Lovecraft books soon
 
lovercraft? it's like lovecraft vs hovercraft
 
hmm, can I disable ioncube with php.ini
 
sorry , @Leigh , missed the E
well .. not missed , pressed between the keys
 
@tereško: don't be sorry, this is the best entertainment I have right now...
 
1:00 AM
naah .. its 3:00 , i'm off
tomorrow i have a job interview
 
3:00... hmm, finland?
 
latvia , its like 400km ( ~300 miles ) south
 
finland was a silly guess, they don't have an s with a u shape on top :D
night night
 
"š" is pronounced as "sh"
 
like turkish, except their s modification is on the bottom
 
1:03 AM
well .. we also have ķ and ņ
 
well you're just strange!
 
one quick question.. except for returning an object and array is there any other significant difference between mysql_fetch_row and mysql_fetch_object?
 
the side-effects are the same
 
i see that there is no difference in the speed etc
other than that is there any other difference that I may not be aware of?
 
is it just me who cringes at the sight of the mysql_* functions these days?
 
1:05 AM
.. and you should NOT use either one , mysql_* functions are ancient and should no be used for new code .. instead you should look into PDO and prepared statements
 
yeah i do prepare statement
 
guess that answers my question :P
 
but i have an interview
so :(
 
well impress your interviewers and tell them how they can improve their code
 
yeah guess i should do that!
 
1:07 AM
although don't be cocky, employers don't like that.
 
php community has been recommending to stop the use of mysql_* functions since release of 5.3
it has not been the recommended practice for more then 2 years
there is nothing bad about looking up function in a manual , if you have not used it in so long
 
yeah but i had 2 interviews and both asked some mysql stuff
so kinda making sure
 
I had an interview a few months back, they made me write code.. on paper.. with a pencil
 
then hope that you are not picked by them
sounds like they are still living in stone age
 
it was just a test to prove i wasn't pretending I guess
 
1:10 AM
haa haa yeah.. tomorrow its a php/wordpress interview
 
I actually found them through SO careers
 
or the systems you will be working on are legacy...
 
so no big idea what can be expected
 
@webgal , you might need to look into better offers
 
i support a system that still relys on magic quotes
 
1:11 AM
:)
 
haa haa
tomorrow its with a big company
 
@Petah , my condolences
 
relies on is so much worse than uses
 
so hope they are not stuck with mysql
 
mysql itself is not bad
 
1:12 AM
@webgal: you said wordpress, so yea, mysql
 
the use of ancient API for accessing them - is
 
i think the paper pen thing is like copying google whiteboard
 
@tereško: I'm having a hard time promoting the migration of non-relational data to a document database
 
why would you ?
 
system admins don't want to support another DBMS
and lots of people don't want to migrate code/data
even when the benefits are clear
 
1:14 AM
sounds like a loose-loose situation
look for different company , let this one fade in oblivion
 
its a good company, i just need to bend them to my will a little more
 
a NoSQL database would be a bad choice
 
no it wouldn't
most of the data is dynamic, and they're storing it as EAV structured in mysql
 
oh , thats a bit different then
in that case you should create a demo
you should be able so set up two simple servers in a VM
 
its ok, google just invented a SQL wrapper for NoSQL
 
1:17 AM
nosql is definitely a good choice, I did a lot of research (I even have bug reports filed with MongoDB because of my testing), but the projects are so big, changing databases is not a small task
 
maybe instead of going the way of "changing database" , you can sell it as "caching mechanism"
evening , @CarrieKendall
 
we have memcached for cache :p
 
hey @tereško
 
then .. emm ... the switch is pointless
 
you think NoSQL is only good for caching?
 
1:20 AM
no
 
good
 
i think that noSQL is for fast storage of simple data
the "fast" part would be handled by memcached already
 
not so much simple, Mongo supports embedded arrays (and you can index on them!)
stuff like spatial searching is awesomely fast with 2d indexes
 
are you sure that this isnt just the justification of hype ?
anyway ,
 
sweet dreams :)
and no, i really do have good use cases for it
 
1:23 AM
who cares about "sweet" , i want "interesting"
 
ok, dream in code :)
 
looks up the reference
 
@tereško i need to pick your brain tomorrow about OOP practices
 
sure
 
@CarrieKendall: why not pick the hive mind that is SO?
 
1:25 AM
avoid poorly written answers from rep whores and go with a pro :P
 
@ircmaxell should be still online
he's the one whose brains i tend to pick
 
What's up?
 
I find the quality of the question directly affects the quality of the answers. Questions that require the reader to engage brain rarely get the 2 line answers from indians on their lunch break
 
Absolutely
 
and if it's a duplicate, Gordon will simply manifest from wherever he is and direct you to the right place
probably to something he wrote himself :p
 
1:31 AM
lol
and if it's bad quality (or subjective), I'll shoot it down
 
nice little syndicate these guys have going here
 
yup :-D
Sometimes I hate how little documentation PHP's source has
 
hey @ircmaxell, while you're tinkering, fix the hash algorithm
 
which hash algorithm? The hash dos
 
yea, the one where their fix was.. we'll just limit the number of variables
 
1:38 AM
lol
That was a valid method though
 
it didn't fix the problem, it just stopped the exponential processing time going through the roof
 
Oh jeeze. I see what's happening
That's ingenious, but rediculous at the same time
 
@Leigh @NikiC @tereško I found a work around
$name = '/';
$actual = null;
if (is_callable($name, false, $actual) && $name === $actual) {
// Method is actually callable
}
 
@Petah: isn't it a moot case, since '/' is never actually going to be callable?
 
yes, but thats just an example, in the real would i have no control over what $name is
 
1:47 AM
@Petah: sanitise/validate it?
 
What are you trying to do?
 
@ircmaxell: it's kind of special, if you really want to catch up, it's around chat.stackoverflow.com/transcript/message/2809060#2809060
a bizarre case where on a certain OS a result returns differently to every other OS
 
user895378
Question: the PHP New Functions in 5.4 page lists http_reponse_code() with no link in the "core" section. Is this really a core function and not part of the HTTP PECL extension? Finally, does the lack of a link just mean that the documentation team hasn't gotten to it yet?
 
wait, is_callable('/') returns true?
 
@ircmaxell: Only on CentOS when the function t() is defined :D
(apparently)
 
1:51 AM
ummm
 
exactly!
 
yea
1
A: Behaviour of is_callable on '/'

PetahAs a work around you could try this: $name = '/'; $actual = null; if (is_callable($name, false, $actual) && $name === $actual) { // Method is actually callable }

 
hrm...
 
@Leigh in regards to validating it, I could strip out all illegal chars, but then that kinda make is_callable useless
 
I know why
 
1:54 AM
@Petah: I'm interested, to make $name !== $actual, what is returned in $actual?
 
in that case $actual is 't'
 
@ircmaxell: that was my original thought, but I thought I remembered that there was non single character hash collisions
 
sec
@Petah: do you have shell access to the server?
 
unless it's a different hash algorithm, the djb33x or whatever only had collisions with 2+ chars
 
1:57 AM
@Petah: if you have ssh access, I can walk you through running gdb on it to step through to see what's happening...
 
@ircmaxell: Yea I know it, for a single char there cannt be a collision
 
i do have ssh
but its a shared server
 
@ircmaxell: because it multiplies then adds the ascii value, the collision comes when the second addition (ie second char) makes it the same as another one
 
so i don't know if i will have access
 
@Leigh fair enough
@Petah try logging in, and try running gdb php
 
2:01 AM
no such command
 
eih, that sucls
 
@ircmaxell: to fill you in, he did a dump of registered functions, there was ioncube, and lots of mangled function names
 
that's the problem then
 
thats what i said :p
 
you have a heap corruption somwhere for some reason
uninstall ioncube and suhosin, and then you should be ok
 
2:03 AM
its a shared server, so i have no control over ioncube and suhosin
 
i think the exact quote was "I'll post the result of get_defined_functions when the server stops spazzing out"
 
@Petah get a new host, and you're set
 
i understand your point, but they are cheap, unlimited and we have 100s of sites hosted with them
 
@ircmaxell: it's a harsh and unhelpful answer, but also true :/
 
@Petah You get what you pay for
@Leigh It's harsh, but completely helpful
 
2:06 AM
@Petah: well "get a new host" generally doesn't help people :P
oops, was for max
 
First off, I don't believe in shared hosting. It's a bad model that is not useful for anyone but the hosting company
you have something you care about, get a VPS, it's not that much more $$$, but TONS more control and stability
 
@Petah: Maybe you could convince them (since you host 100s of sites with them) to do you a favour and fix their install?
 
we have both VPS and shared hosting
 
user895378
Random two cents ($0.02): I don't understand how anyone who does professional work uses shared hosting. Baffling.
 
Yup, agree
 
2:08 AM
our VPS is $100-$500 a month, our unlimited shared hosting is $40 a month
quite a big difference
 
WHAT?
 
user895378
That's high ...
 
user895378
for both
 
That's REALLY high
 
$40 for as many websites as we want...
not 1
 
2:09 AM
i'll keep quiet about our rackspace costs... whistles
 
spry.com (fully managed) and vpslink.com/vps-hosting (non-managed)
 
user895378
Shared hosting is usually like $5 bucks and VPS $40 or $50 in my experience
 
@Petah That's still really high
 
i would like to see a $5 host
 
user895378
Or cheaper as per ircmaxell's links
 
2:10 AM
one.com .. £6/year
they're terrible though, cheap, but don't expect any features
 
our $500 VPS is a 16 core 32GB ram beast
 
sounds like my home PC, wonder how much it would cost for me to colocate that
 
user895378
@Leigh lol
 
user895378
Sounds like a damn Ferrari is what it sounds like.
 
ok I lie, mine home PC is about half that
 
2:12 AM
and i don't think you quite understand what i mean when i say unlimited. as in HDD, bandwidth, virtual hosts etc, one.com has usage costs
oh and also i was wrong
 
one.com has no usage costs
 
user895378
Yeah, but is it worth it when you're shackled with all the drawbacks of shared hosting?
 
we have dedicated servers, not virtual servers
 
it was just an example of a really cheap host
 
user895378
Does the sweet, sweet shared hosting come with ... dare I say it ... PLESK or cPanel?
 
2:14 AM
cpanel
 
i gotta be up in 5 hours for work, night all, and @Petah: 100% ioncube (and thus your host) who is to blame for the issue
 
sigh
 
thanks
all good
i fonud a work around anyway
 
user895378
I don't know. Take it for what it's worth but I would definitely suggest not using shared hosting for anything other than ... well ... I just wouldn't use it for anything.
 
@rdlowrey cPanel. cPanel... cPanel.
 
user895378
2:27 AM
@andrewjackson Yeah. Gasp.
 
user895378
I think cPanel still comes with a geocities plugin or something :)
 
GeoCities is still around???
 
user895378
Hehe I don't believe so. That was a joke.
 
that was old school
 
user895378
2:50 AM
R.I.P. my erroneously accumulated rep that just vanished. You will be missed.
 
lol
Rebuilding zend_language_parser.y for the first time crosses-fingers
 
hello everyone...
is anybody uses yii framework here?
can someone help me im currently stucked with this problem stackoverflow.com/questions/9527165/…
 
user895378
Isn't Yii the next-gen Nintendo console?
 
user895378
Just kidding, but sorry, no Yii for me.
 
no no... its a php framework i think ^^
anyways i have no idea in nitendo ^_^
thank you
 
2:57 AM
compiling
 
"Undefined variable: model"
 
crosses-fingers
 
what line???
what file??
 
nope
 
oh yes...
its on line 11 of my view file
 
2:58 AM
you might wanna modify your quesiton with that information before you get a shitstorm of down votes
 
ok...
 
where are you calling actionLogin()?
 
user895378
@ircmaxell ... well my electricity didn't go out, so the compile couldn't have gone that badly
 

« first day (503 days earlier)      last day (4438 days later) »