« first day (814 days earlier)      last day (4134 days later) » 

8:00 PM
@rdlowrey true
@goodmood that's a very serious accusation. Please don't make an accusation like that without significant evidence to back it up. And just because he closed one question doesn't count as evidence...
 
ok , thx for talking
i just wonder
 
this guy suffers of delusions. how can you tag something as racist based on nothing?
 
@goodmood He closed the question because it cannot and will not be answered.
 
Anonymous
Does anyone have a good idea on how to change absolute urls for menus, images, styleshits when changing from localhost to a server
 
8:03 PM
@MadaraUchiha of course there is an answer ,its updating a query by a loop
 
Anonymous
that means without having to go to each file and modify the path?
 
@goodmood It will not be answered, because the OP has showed 0 effort on his side
"I want a function that'll do A, B, and C? How can I do it? Can you do it for me?"
 
ok , thx all , no problem
 
@goodmood I'm a Jew from Israel
 
@MadaraUchiha u welcome
 
8:05 PM
I've helped and answered countless of Abduls, Ahmeds and Saeeds. I generally don't even look at names
 
@MadaraUchiha, I do look at acceptance rates, my bad
 
Anonymous
@MadaraUchiha I need help about my question?
 
user895378
<-- The only time a name influences my answering/close-vote behavior is if it matches /^user[0-9]+$/
5
 
@TheCOMPLETEPHPNewbie You should generally have some sort of URL factory
 
@ircmaxell Dependency Inversion {Principal => Principle}
 
Anonymous
8:06 PM
URL factory? What does that mean, any links or tuts?
 
user1125394
traits == php language copy/paste
 
dam
 
@rdlowrey fair enough
 
@Alexander Same, and then I look at the user's profile and try and determine whether he knows how to accept an answer.
 
Anonymous
I just uploaded my site to server and it took me over 30 minutes to change all the absolute URL, searching between all my files for missed ones too.. It was a BIG headache
 
8:08 PM
You know, 20% accept rate means nothing, if he asked 5 eligible questions and didn't receive a suitable answer for 4 of them.
 
Anonymous
Can I use global maybe? to assign the path ?
 
@TheCOMPLETEPHPNewbie Your IDE should have some sort of refactoring function.
 
@@timpost ping
 
Or, at the very least, search and replace.
 
@MadaraUchiha, I do the same, I do look at the 5 latests questions
 
Anonymous
8:08 PM
I am using Notepad++
 
user1125394
wordpad here
 
@MadaraUchiha, When I have time enough for it though, usually in there's a shitload of stupid answers. Upvoted without reason whatsoever
 
Anonymous
How about if I use `global fake_url = "localhost/site/"`
Then in my localhost I could use fake_url an then change it when I upload to server what do you think @MadaraUchiha
 
a VERY good day on Meta Stack Overflow indeed.
 
8:10 PM
@MadaraUchiha congrats
 
@Alexander PHP is practically the same.
We're lucky to have the to help us with that
 
Anonymous
Hey guys I need opinions here
 
user1125394
 
@ircmaxell I find it helpful to describe the container as an array of objects, where the objects are created only when they are needed. (although this applies more directly to pimple, as it uses array access). but more importantly, you should think of the container as the configuration of the dependency graph. that was missing a bit -- and IMO container is extremely hard for newbies to grasp because it's described in such an abstract way.
 
@cab Damn, there were so many already!?
 
8:14 PM
@igorw Ok, I'll expand that a bit. Thanks for the feedback!
 
I personally don't like OOP examples with real world objects like building a house, but that's just me. overall looks good :)
 
@igorw Btw, I remember you having had some question about the QM_ASSIGN ops some time ago. Is that already resolved?
 
Fair enough...
I just really like the house building metaphor
 
@igorw Write practical ones about Users and Rooms and AccessLevels, in an example chat application, for instance.
Or about Cards and Suits in an example blackjack game
 
@ircmaxell it's mostly based on my own OOP learning experience where those abstract examples really confused me. but I'm sure it works for other people
 
8:18 PM
fair enough
 
user895378
@igorw That's a really nice explanation for a DiC ... though I'd prefer to not encourage the distinctly PHP-based notion that all datastructures are Arrays :) Still, that's about as accessible an explanation as I've seen.
 
@NikiC you mean the difference between ZEND_QM_ASSIGN and ZEND_QM_ASSIGN_VAR?
 
something like that
 
I found the commit that introduced it, apparently it's an optimization for a particular case ("returning arrays"). that's about as much as I understood from it. see: markmail.org/download.xqy?id=5frjxho3lswpflzp&number=1
 
it's because the entire refcounting pointer system is a horribly fragile beast
 
8:23 PM
@Alexander gist.github.com/4476432 this is current, yesterday I posted what I had so far here in chat ;)
 
@igorw Yes, exactly, that's right
 
@AlejoSimon static coupling has no place in "design". And traits are the pure embodiment of static coupling. Therefore...
 
Ternary was always copying the values returned from the branches before
Now it can use copy on write for CV and VAR
@ircmaxell Are you saying my CodeIgniter code has bad design?!?!
 
Your CI code?
 
@ircmaxell Result of my hard work today: github.com/nikic/php-src/commit/…
 
8:26 PM
@hakre ok. But, the timings of it with dateinterval were not that good though
because of dateinterval itself not of the algorithm, of course
 
holy cr@p
 
@Alexander no this is slow. it's a trade against memory. sometimes the array variant is even faster, even it it takes 1.5 times the iterations.
 
@NikiC Again your CI code?
 
@NikiC O_o
 
@ircmaxell nevermind, just a joke ^^
 
@NikiC I know, I'm pointing out that from you that's odd :-P
 
PHP really needs something like Python's Pyrex
 
Ruby: where all the principals of OO code (including encapsulation and dependency inversion) don't matter: http://david.heinemeierhansson.com/2012/dependency-injection-is-not-a-virtue.html
 
@ircmaxell he is essentially arguing against composition
 
zebra approves your message
:D
 
8:33 PM
composition, encapsulation, polymorphism, dependency inversion, single responsibility principle, LSP, etc
2 messages moved to recycle bin
 
booo
humbug
 
relax. animated gifs cause problems here (people have complained about them burning CPUs)
 
burning a CPU ? is their cpu from 1950ies? lol
 
@ircmaxell Well then I wonder why they still have their browser configured to display them... hmm.... ;)
 
@raspi +1 actually I heard that PHP used to have something like it
 
8:36 PM
whatsa pyrex?
 
@raspi It has it...
 
Pyrex is a programming language developed to aid in creating Python modules. Its syntax is very close to Python, with the aim of making it easy for Python programmers to write the non-Python code usually required for such modules in a language which at least is very close. Python limitation Python itself only provides a C API to write extension modules, which allows writing of functions and datatypes in C. These can then be accessed from Python. It is thus also possible to wrap the functions and datatypes of existing C libraries as Python objects and therefore make them available to Pyt...
 
@ircmaxell r u serious?
 
@igorw when? PHP3 times?
 
we get complaints in JS that overdoing images or gif can cause browser lag (memory consumption issues) but never complaints about CPU usage.
 
but just what I have observed in there :)
 
@ircmaxell I'm not sure I understand the intention behind that Tweet. In particular not sure whether sarcasm, condescension or ...?
 
@rlemon that's what I'm talking about...
@NikiC A little bit of both
 
no recently? really!?
 
@ircmaxell Did you know that Ruby has mutable strings?
 
8:41 PM
yeah...
 
@NikiC you can write almost Python lookalike code that's compiled into C to write Python modules.
 
I only found out recently
That was a real WTF moment
 
interesting point that apparently perl also has them
 
8:43 PM
@igorw I saw that question and didn't find everything valueable in there
 
Damn that was faster than pasting
 
The "mutable strings are easier to work with" argument makes no sense whatsoever to me
 
ie. I could write PHP with static typing that could be compiled to PHP extension like phalcon is now.
 
@NikiC yeah, just posted it for the note about perl. I'm not trying to say that mutable strings make any sense at all
 
@NikiC on the backend, they are
 
8:45 PM
@ircmaxell on the backend?
 
the core code.
Think about how much easier things in the engine would be if there wasn't copy on write
 
I'm not sure I understand
Ah, that
You mean, mutable strings are easier to implement?
 
correct
for the user, as long as you present a clean API to the programmer in the language, who cares what it uses (some odd edge-cases aside)
 
Okay, I thought that answer was refferring to using them being easier
@ircmaxell no...
 
Well, aside from optimization strategies
 
8:47 PM
Am I the only one here who thinks that mutable strings are a really terrible idea?
 
yes.
 
Okay...
Though they clearly were terrible enough for Ruby to introduce symbols ^^
 
user1125394
@NikiC in python also? string are mutable?
 
@cab No. Python is a good language
 
8:52 PM
@ircmaxell Easier for who?
 
user1125394
strings ~ lists i don't see why it"'s bad
 
Am I the only one around here who has no idea what mutable strings are? :D
 
user1125394
'boo'.splice('f', 0, 1)
 
@MadaraUchiha Nope :P
 
user1125394
in ruby everything is an object
 
8:56 PM
@webarto Oh, good. does jQuery have mutable strings?
 
@GoogleGuy the engine
@cab nope, that's not what a mutible string is
 
user1125394
what is then sorry
 
@cab People viewing strings as a simple list of characters is the source of so many misconceptions and issues ;) [general statement, not related to mutability]
 
7
Q: What is the difference between a mutable and immutable string in C#?

VenkadeshWhat is the difference between a mutable and immutable string in C#?

 
user1125394
sorry I didn't know ;)
 
8:59 PM
In object-oriented and functional programming, an immutable object is an object whose state cannot be modified after it is created. This is in contrast to a mutable object, which can be modified after it is created. In some cases, an object is considered immutable even if some internally used attributes change but the object's state appears to be unchanging from an external point of view. For example, an object that uses memoization to cache the results of expensive computations could still be considered an immutable object. Immutable objects are often useful because they are inherently ...
 
@ircmaxell Well, it's a necessary complexity unless you want to remove all the memory efficiency problems COW solves.
 
user1125394
@ircmaxell have done some erlang recently, so I get immutables
 
@GoogleGuy I'm not saying it shouldn't be done. I'm just saying that the level of complexity it adds is very non-trivial
 
@ircmaxell fair enough.
COW certainly isn't a trivial problem to solve.
 
yup
 
9:10 PM
@ircmaxell Okay, so what difference does it make?
Mutable vs immutable strings?
What would make you prefer one over the other?
 
Evening
 
@DaveRandom Yo
 
holy crap... I just read an strace /bin/true... wow
 
-bash: strace: command not found
and dtruss gives me all kinds of other stuff related to dynamic linking
 
9:27 PM
Will mention PHPPHP on my #FOSDEM talk. So awesome project :D /cc @ircmaxell
 
FOSDEM anyone?
 
@webarto Free and Open Source Developers' European Meeting
 
@MadaraUchiha I was trying to say, is anyone from here going :P Oh, that tooltip is nice...
 
9:33 PM
@webarto I am not
 
@ircmaxell You don't want to or it doesn't fit your schedule? I hear all the cool kids are coming :P
 
user895378
^ I don't usually feel like those kinds of questions should be subsidized, but I've been wrong before.
 
@MadaraUchiha Thanks!
 
@webarto ;)
 
9:35 PM
@webarto schedule
 
hey guys..can someone shed some light on something relativly simple i'm trying to achieve?
 
i'm currently displaying user avatar like so:
 
@rdlowrey Hey, happy new year!
 
9:37 PM
  <?php
        global $current_user;
        get_currentuserinfo();
        echo get_avatar( $current_user->ID, 64 );
 ?>
is there a way to add a "good morning" message to that avatar using time of day ?
by adding the user name ofcourse...like..good morning Mike
 
user895378
@hakre happy NYE to you, sir!
 
We've been shedding light all day.. sorry, we ran out of the light for the day...
 
uhhh theres always light to spread..look from withing ;)
 
@TonalDev Sure, just inspect date('G')
 
9:41 PM
@MadaraUchiha Nice :D
 
a bit new to php coding..how should i implement it on 'if' statement
?
if 6am echo goodmorning user...for example
'user' being the username fetched from get_currentuserinfo
 
@MadaraUchiha lol xD
 
@TonalDev Well you do for ex
$hour = date('G');
if ($hour < 12) {
  /* it's morning */
} else if ($hour < 18) {
  /* it's afternoon */
} else {
  /* it's night */
}
 
@DaveRandom thanx..but how do i attach it to the username? what is the echo for users in wordpress?
echo get_avatar( $current_user->ID, 64 );
 
Wordpress I cannot help you with I'm afraid
 
9:48 PM
i see..
 
how can i perform this in php ?
$var = if ($somthing = 0 then $var else $var2)
 
Hopeful answers:
 
well just to sum up..i attach that code and echo $hour?
 
0
A: saving the values of drop down menu into a cookie by php

SreeCan you double check this line setcookie ("chosenlang",$myselection, $t); I hope it should be $chooseone not $myselection.

 
@DaveRandom echo 'good morning '.get_avatar( $current_user->ID, 64 );
 
9:49 PM
$var = ! $something ? $var: $var2;
@goodmood
 
@cdnicoll yes but that will just echo good morning along with the picture :)
 
user1125394
$var = ! $something ?: $var2; actually shorter
 
ohh :O thx
 
Ah, thought that was the username. oh well
 
@TonalDev No you probably don't want to echo $hour, you just use it to create the appropriate greeting string, so in each block in the above if tree you'd do $greeting = 'Good morning'; etc as appropriate to the current time (which is what you are checking with date('G'))
 
9:53 PM
@cab no, this will make $something become a bool
 
@DaveRandom if ($hour < 12) {
	        $greeting = 'Good Morning'
}
?
 
Yes exactly
 
:)
thank you!
 
9:54 PM
i just need to find the get function for username and were all set
 
I'm on fire with the memes tonight :o
 
Hey @PeeHaa, @MadaraUchiha's being mean to you again!
 
I take it with a smile :) i am new after all
 
I offer professional avatar picture designs. I also offer PSD to avatar service with quick turnaround times.
 
9:58 PM
I wish there was some mechanism on SO that prevented people from asking SOAP related questions on the grounds that it is a ridiculous way to communicate.
 
@DaveRandom Well, that would be funny to see how that would work out.
Let's create a censored version of SO
 
Syntax error? where?! lol
if ($hour < 12) {
	        $greeting = 'Good Morning'
	  } else if ($hour < 18) {
		    $greeting = 'Good Evening'
  	  } else {
	  	    $greeting = 'Good Night'
}

 ?>
 
@TonalDev Missing ;s ;-)
 
lol
thanx
 
...
 
10:02 PM
Can anyone give me a country name which provides free internet?
(funded by ads or smth)
 
@hakre I already filter out from because every question with both those tags that I have ever seen is the result of someone doing something very, very fundamentally wrong.
@MadaraUchiha What you mean like free dial up or something?
 
@DaveRandom I mean you can access the internet for free
 
one last question if i may...how to combine these to one echo in a div... echo ($greeting);
echo $current_user->user_login;
 
@MadaraUchiha Surely nowhere does that... I mean even if it's "free" it would still just be taxpayer funded so you'd still be paying for it, you just wouldn't get a bill.
@TonalDev echo accepts multiple arguments, you can do echo 1, 2; and the output will be 12. Get the idea?
 
hmm yup i get it :) thank you m8
 
10:07 PM
@MadaraUchiha Would you count free WiFi in coffee shops?
 
@DaveRandom No, I mean like this: techcrunch.com/2009/10/14/…
 
the full code if someone is intrested:
                <?php
        global $current_user;
        get_currentuserinfo();
        echo get_avatar( $current_user->ID, 64 );
        $hour = date('G');
        if ($hour < 12) {
	        $greeting = 'Good Morning';
	  } else if ($hour < 18) {
		    $greeting = 'Good Evening';
  	  } else {
	  	    $greeting = 'Good Night';
}

echo ($greeting), $current_user->user_login;
 ?>
 
@DaveRandom thanx again m8
 
np :-)
 
@MadaraUchiha that's interesting but I don't think it's free, I think that's more about forcing ISPs to ensure that their networks can reach everyone in the country. They still have to pay for it (from what I can see)
 
> I mean even if it's "free" it would still just be taxpayer funded so you'd still be paying for it, you just wouldn't get a bill.
This.
 
Operating an ISP is an expensive business, I doubt any governments are going to fund it
 
Yeah. I imagine operating an ISP in a country where places are miles and miles apart, and being dictated by the government how much you can charge people for it, is terribly difficult... but maybe it works, the article is 3 years old, I have no idea how things are there.
 
lol..yet again, syntax error?
echo '<div class="greeting">'.($greeting). , .$current_user->user_login. '</div>';
 
10:18 PM
@TonalDev did you read the syntax error? what did it say?
 
@Pekka웃 I'd be surprised if the "legal right" business has anything to do with pricing (it may stipulate something vague like "must not be prohibitively expensive" or something but I doubt they'd be really restrictive) - guaranteeing 1Mbps says to me that they forced ISPs to make sure that every telephone line in the country could be connected to a DSLAM. 100Mbps by 2015 again just says to me that they are laying a planned fibre network. I'd be surprised if it goes further than that.
I could be wrong though.
 
syntax error, unexpected ','
i assume thats the way to add 2 variables in an echo
,
 
How can you confuse concatenation after being using it thrice?
 
Anonymous
can anyone explain to me, if using Global to change url paths, is good/bad thing?
 
@TheCOMPLETEPHPNewbie Using globals is always a bad thing.
Unless you know exactly what you are doing, and clearly, you don't, it's always a bad thing.
 
Anonymous
10:22 PM
why?
 
@TheCOMPLETEPHPNewbie It makes your application unpredictable and unreadable.
 
...and untestable
 
@DaveRandom He isn't near that stage yet, so I hadn't included it.
 
user1125394
not solid
 
@DaveRandom Also nearly* untestable.
 
10:23 PM
liquid programming ftw
 
@TheCOMPLETEPHPNewbie Consider the following function
function select_from_db($query)
What does it need in order to work?
 
343
Q: Don't throw away all votes when a user is deleted

Mad ScientistCurrently, when a moderator deletes a user all of the user's votes are removed along with the user himself. I was pretty surprised at this behaviour when I first heard about it, and I don't think it is a good idea to throw away all of the votes just because the user is deleted. Votes are locked ...

 
@TheCOMPLETEPHPNewbie well?
 
@DaveRandom makes sense.
 
Anonymous
here is problem, when I am working on a site from localhost, all the url's are absolute, like header(), images, style shits... Now, when I upload the site to my server, I have to manually open each file and change all the url's. Now, with global I just need to assign one a path global variable and just change that one only, when i upload the files to server..

Is this good/bad idea???
 
10:29 PM
lol @ style shits
@Pekka웃 I guess you are drunk, nothing I say makes sense :-P
 
@TheCOMPLETEPHPNewbie It's quite obvious you are not interested in learning, but only on your specific problems. I tried to help you several times while you were here, but even I have my limits.
I can't help someone not interested in helping himself.
 
Anonymous
sorry for being slow, i am using crappy mobile
 
@TheCOMPLETEPHPNewbie read what I wrote
 
Anonymous
I am using Nokia5800 it has the tiniest keyborad and i must refresh the page to see your/my posts, im not lacking interest, i am not able to do much thats all?
 
Anonymous
ok
 
Anonymous
10:36 PM
It needs mysql query to work, but what has that to do with urls
 
@TheCOMPLETEPHPNewbie Well, it also needs a database connection.
But you didn't know that, because you used global $conn inside of the function :)
 
Using globals makes your application awkward and hard to read, do not use them.
 
Using a constant for the specified purpose is arguably fine, though.
 
Anonymous
It's funny, the last time you told me how to get the conn inside a function, but the ditched your method and was using global inside a function, and kept saying to myself '' why didn't he ask me to use globals, this is much easier '' didn't know glabals were bad idea, I thought only register globals was a bad idea (or so i have heard)
 
10:42 PM
@Pekka웃 arguably, but again, since he doesn't know exactly what he's doing
a general taboo is better IMHO than starting to pick what to use and what not
 
Anonymous
It seems half of what is in PHP is a bad idea. I am not so familiar constants, how about a function to store the abolute paths
 
what do you mean a function to store absolute paths?
 
Anonymous
function url(){
fakepath=''localhost/sitefolder'';
return fakepath;
}
 
Anonymous
the use url(); as absolute url for localhost, then when i upload my files to server i can only change the value inside, instead of all the files
 
10:52 PM
@TheCOMPLETEPHPNewbie Try and avoid using absolute URLs if possible. There are some case where this is not possible (header redirects for example) but wherever possible user relative paths and then there won't be anything to change. Also note that you can detect the current domain name by inspecting $_SERVER['HTTP_HOST']
 
Anonymous
Yea, I know, but I use a lot of headers but I will check with the server variables,
 
@DaveRandom you can detect the current domain name just by looking into the URL bar in chrome (;
 

« first day (814 days earlier)      last day (4134 days later) »