« first day (895 days earlier)      last day (4050 days later) » 

12:01 AM
I wonder how sandboxed it is?
bot> document.body.innerHTML
 
@DaveRandom "ReferenceError: document is not defined"
 
Interesting, I wonder how that's been done
 
in Sandbox, 52 secs ago, by SO ChatBot
@uınbɐɥs "undefined" Logged: Array,Boolean,Date,Error,EvalError,Function,Infinity,JSON,Math,NaN,Number,Objec‌​t,RangeError,ReferenceError,RegExp,String,SyntaxError,TypeError,URIError,atob,bto‌​a,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,eval,global,isFinite,‌​isNaN,onmessage,parseFloat,parseInt,postMessage,self,undefined,whitey,ArrayBuffer‌​,Blob,Float32Array,Float64Array,Int8Array,Int16Array,Int32Array,Uint8Array,Uin (snip)
 
phpdistribution.com bad name to pick for "SEO".
 
lol
 
12:03 AM
bot> process
 
@DaveRandom "ReferenceError: window is not defined"
now I'm really gone. laters all
@DaveRandom "ReferenceError: process is not defined"
 
bot> "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx".match(/(x+x+)+y/)
Ooooh you can still break it like that
 
lol
bot> "hello world"
 
It might be, err, busy...
 
bot/tell @PeeHaa to go home
 
12:11 AM
lol
 
bot> (+ 1 2)
 
new video tomorrow
 
It's tomorrow here already. Can I have it now?
:-P
 
I could give you a 500mb rendering now
 
I wonder if you have enough UL bandwidth for me to get the whole thing before it's actually released?
What's upload bandwidth like from commercial providers in the US?
 
12:15 AM
It's on Dropbox already
 
Mine really sucks, I generally max out at around 2Mbps even though I'm supposed to get 5
 
I used to upload 10gb renderings to Youtube... I've cut that down lately, but...
 
Does it actually make a practical difference to the flv?
 
speaking of which, I need to start archiving some of the videos before I run out of space in DropBox
@DaveRandom I was doing AVIs with light compression. now I'm doing H.264 mp4's... At high compressions
 
Hmm, maybe I should have given it less xs
 
12:16 AM
some difference, but not a heck of a lot
@DaveRandom assuming it hasn't thrown an exception or otherwise died
 
@ircmaxell Ugh, I hate the mp4 container. Irrationally so. I just like my matroska. Although it's a pita format for converting back to mpeg-based containers, it just gives a much smoother playback experience, the splitter has a lot less work to do.
 
@DaveRandom I'm just using it as a container, not as a delivery mechanism
 
@ircmaxell Yeh I know, and my dislike is pretty irrational anyway. It only makes a noticeable difference on really low spec systems.
 
yeah, I archive via uncompressed AVI
yesterday's video was 50gb
:-O
 
Meh, HDDs are cheap :-P
 
12:22 AM
Question, is the intent of the following immediately apparent?
Excuse the var_dump($this);
 
@Bracketworks no
 
Damn. Surely, with API docs and such it would ... well be comprehensible.
Routing trees are hard to construct in a human readable fashion.
Bah well, I'm off to get sloppy drunk; night all.
 
why off? I'm drinking right now
 
@Crell if it returns a list, I agree. if it returns a map, then null or exception are more appropriate.
And if it returns a string? Return empty string? @igo
 
@ircmaxell Some people have this really concept they like to call "social skills". I'm not a fan.
 
12:31 AM
@DaveRandom eih, skills. blah
 
@DaveRandom where can I buy these skills you speak of?
 
@webarto Less of an issue IMO, since scalars happily typecast promiscuously (if you treat false as a string it's still an empty string). But if your code is expecting a vector to be returned and it returns a scalar you can have real problems/mess.
@igorw I've got some left over from my experiments, I'll send you some, I'm not using them.
 
@DaveRandom I tend to if !== false do shit, haven't seen these "rules" so far.
 
@webarto Consider foreach (func() as $whatever) ... though, if func() returns false on error you can't do that
 
@webarto in the end it's all about intent. my point was mostly about a function producing a single value (a map) vs. a function producing a collection (an array). you cannot really truly generalize it based on types though.
 
12:34 AM
@igorw beer. That works.
 
@DaveRandom Ah, I see, that's legit.
@igorw I understand, I wasn't saying that you are wrong or anything, just asking.
 
People in bars often seem to be under the impression that the bar sells social skills. Ironically these are usually the people to whom the bar refuses to sell said social skills.
 
@DaveRandom you mean MDMA?
 
@igorw Yeh that's true, null probably makes more sense there. Exceptions are context dependent but also possibly sensible.
 
@webarto but a function could also produce a single value that is an array of things. and then my advice would be wrong. for example something like JSON path (xpath for JSON) where I point to a field that is an array. If that field is missing, then that's an error condition.
 
12:38 AM
@Ocramius I did not, I need to start going to the bars you frequent.
 
it's a convoluted example, I'm sure there are better ones :)
 
@igorw It's still about the single value though, you are talking about something the returns "the target collection" rather than "a collection", if you know what I mean.
 
yep, and that's exactly what I mean by intent.
at least that's the best word I could come up with to describe it
 
12:53 AM
WOOT!
@ircmaxell You’re invited to join our #glassexplorers program. Woohoo! Make sure to follow us - we’ll DM in the coming weeks.
 
@ircmaxell congrats!
 
now, just to decide if I actually want to run with it
 
what did you propose?
 
I think I will
#ifihadglass I would implement a secure, private and transparent two-factor authentication system.
and another one I can't find
something about presentation notes while giving talks
Now, to get contacts so I don't always have to wear them...
 
<- ZzZz
 
1:04 AM
 
the site is offline :-(
no, it's back online already :-)
 
huh?
 
Stackexchange performed a quick update of their website
 
ah ok
 
2:01 AM
posted on March 29, 2013 by Larry Garfield

Earlier today, I posted a brief tweet (isn't that redundant?) about return values in PHP (or really, any language). Originally it was about return values from functions (such an exciting topic, I know), but it ended up generating a fair bit of lively conversation, as well as a patch against Drupal 8. So lively, in fact, that I think it deserves more than 140 characters. New rule: If your fu

 
2:22 AM
I just starred a @Feeds post o.0
 
2:33 AM
lol
 
 
1 hour later…
3:45 AM
morning
 
MVC: 1) Is model a layer or an abstraction? 2) Has MVVC its own place in PHP world?
I've noticed that some devs define Model as a Layer, but its not exactly true, because MVC itself acts as a layer. If so, then Model could be defined as a sub-layer.
 
@crypticツ that's your response to a "morning"? :P
 
@crypticツ , i have started to learn PHP and MySQL with notepad.exe :^ )
 
@sectus please use an IDE =oP
@Lusitanian a morning is never complete without a fresh cv-pls
It's part of a well balanced breakfast
 
lolol
 
4:06 AM
@crypticツ , those times in english is hard to me. I mean i started to learn... few years ago.
 
IDE=Internet Development Engine
use that^
 
Or Notepad++
:P
 
@uınbɐɥs <3 NotePad++ it's what I use right now, but I want to use PhpStorm, but it's not free =o(
 
@crypticツ start a FOSS project and get a license :)
 
@Lusitanian I don't know if my Hello World script will count as a FOSS project =o(
 
4:11 AM
@crypticツ do something cool, like a blagging engine
 
@crypticツ I tried PhpStorm, but I didn't really like it :-P
 
@uınbɐɥs HEATHEN. LEAVE.
 
@Lusitanian heh, I knew I would get a comment about that message from someone
 
for good reason
:)
 
@uınbɐɥs It's a matter of taste
 
4:12 AM
why don't ya like it?
 
I just found it was too bloated, though things like autocompletion are nice, Notepad++ fits my needs right now.
BTW, Notepad++ has function suggestions
 
yeah i know
it is a terrific text editor
 
Aptana has function detection to tell you the name of your functions and parameters you coded
 
morning
 
as well as function suggestions
 
4:15 AM
@uınbɐɥs (shaquin backwards) tried Geany ?
 
@kaᵠ whut ... idm ? (internet download manager ) :P
 
Also, I find it funny that people prefer Sublime Text "because it supports multiple selections" (Notepad++ does too, but it's disabled by default).
@kaᵠ I think so, when I switched to Linux for a time
 
@NullFony... ?
you can get it on windocks also @uınbɐɥs
 
@kaᵠ Yeah, but I don't like it as much as Notepad++
 
@uınbɐɥs notepad++ is better
 
4:18 AM
@NullPonyPointer yeah.
 
@uınbɐɥs but not as much as netbean editor
 
I like Aptana
 
@NullPonyPointer IDE=intra-dermic enima :P
ouch
 
The only reason I use Wine is to run NotePad++ which takes a few secs to load up. If I can ditch both that would be great. It also, crashes time to time =o(
 
@crypticツ try netbean its fast once its loaded
 
4:20 AM
@crypticツ wooot? u on linux? use geany and ditch wine&dine with notepad
 
wine is such a pain
 
@kaᵠ lol
 
@crypticツ argh, it's Notepad++, not NotePad++
 
fastest @ide@ i found
 
@kaᵠ which one ?
 
4:22 AM
@uınbɐɥs no, it's Note Pad Plus Plus
 
Geany
but can't really say it's a proper IDE
 
@crypticツ
downloads the 90MB JDK to try NetBeans
 
@uınbɐɥs you mean you are trying NetBeans first time?
 
@crypticツ just like c++ is: See Plus Plus
 
not a fan of netbeans
 
4:24 AM
@NullPonyPointer Yeah, I don't try many IDEs
 
2 second load time is TOO MUCH !
 
@Lusitanian at-least its better than phpstrom and eclipse and some ide @kaᵠ telling
 
I've tried Eclipse (horribly slow, memory-hungry, and a bit annoying to use)
 
@uınbɐɥs than you may like netbeans its fast but dont install full package i mean only install php version its fast ..and only ~50mb
 
4:27 AM
@NullPonyPointer I know, but it still requires the 90MB JDK
 
true, true ^
 
:)))))))))
]loved the one about CSS with a famly guy scene
 
@metal_fan MVC is anything but a layer
 
@andho like onion ? :P
 
4:30 AM
@NullPonyPointer phpstorm is way better
imho anyway
 
@NullPonyPointer like cake
that's why there is cake php. because of it's layers
 
@andho Zend Framework2 defines MVC as a layer.
 
@andho than onion php is also a better name since there is lots of layers and many people love it too :P
 
@NullPonyPointer it makes people cry, while cakes make people smile
 
Not model itself. its kinda logic abstraction
 
4:34 AM
7 hours ago, by webarto
user image
4
 
@kaᵠ this is the truest analogy i have ever seen
 
@andho but if you will eat cake like onion you will be big fat man
 
 
really lmaorofl-ed at this, true
 
@kaᵠ lol
 
4:35 AM
@metal_fan layers are also kind of logic abstraction
 
@andho Cake sucks because of its global state, and SRP/POLS violations
 
there are several kind of abstractions. Layer, Module, Component...etc
 
several or exactly 3 :) ?
+ plugin = 4
 
all these abstractions expose an external API (interface)
 
@metal_fan so does all other sucks too
 
4:37 AM
plugins are not abstractions
 
@Class lol
 
they plugin to another abstracted layer using an interface that is exposed
 
@NullPonyPointer Most of them suck (esp CodeIgniter and Yii). but Zend Framewok 2 does not
 
2 mins ago, by metal_fan
several or exactly 3 :) ?
"...etc" is there for a reason.
 
@metal_fan ya but i don't like any framework all are same and sucks more than custom code
 
4:41 AM
Well, actually plugins are (event) listeners when properly implemented (Mediator pattern or smth like that)
 
Morning
 
@Rikesh morning
 
@NullPonyPointer Try Zend Framework 2. It follows SOLID, and MVVC + no global state.
@andho A plugin will be another form of abstraction if it has bunch of logic encapsulated within domain object
 
@metal_fan yes looks something i should try (Model-View-ViewModel)
 
what's worse? user_function() overhead or internal_function() overhead?
 
4:47 AM
@NullPonyPointer how does that work
 
Hey everybody greetings for the day .. can anybody expain me what is difference b.w .* and .*? in php regex .... I studied that using ? the search becomes lazy ..what what does that mean .. sorry for this trivial question .. but I cant figure it out ....
 
@kaᵠ mmmmm. probably user_function() because "it has been defined" at runtime, rather that compile time
 
@new_developer , have you found any documentation about regexp?
 
4:51 AM
@new_developer you'll find everything you need to know here: chat.stackoverflow.com/rooms/25767/regex
@uınbɐɥs OUCH 500Mb ram is baaad
 
@sectus I have tried to searh a lot .. byt didnt found any example or something that will help me to grasp the idea
:(
 
LOL
 
@metal_fan i know they're both bad, noticed a huge speed increase when calling a function several times against using it's contents in a loop
 
@ka* well, you cannot avoid them anyway. So if you care about performance, internal_function() is the way to go
@new_developer ? is equivalent to {0,1} which means 0 or 1 times only. Google for Mastering Regular expressions
 
@metal_fan it's not! {0,1} will try to match MAX if greedy, ? makes it match less
also using ? with the ungreedy U modifier makes it greedy :)
 
5:01 AM
@new_developer , what are you trying to do?
 
@ka* probably you're right I'm not good at Regex's
 
to try to take over the world.. what elsed?
@metal_fan use tab to autocomplete a nick with @
 
"What have you tried" is kinda stereotype :) (eww don't beat me) :)
 
@kaᵠ thats what I want to know ... whats greedy and ungreedy ...
 
@new_developer exactly what it sounds like, read the docs
 
5:06 AM
@kaᵠ hmm... probably you are right .. I think I should give it a more try ...
 
@metal_fan yes looks something i should try (Model-View-ViewModel)
 
@NullPonyPointer LOL Yes, but you said that already :)
 
@uınbɐɥs yet its less than chrome :P
 
damn wired headphones, left one went dead! argh!!!
 
i dont know why this happen
 
5:10 AM
LOL
 
and than i clicked on retry button
 
@NullPonyPointer somebody's using @DaveRandom's plugin :)
 
@kaᵠ you mean its because of @DaveRandom 's plugin ?
 
looks like it, not sure
 
I don't think so...It happens with me too before I have installed Dave plugin
 
5:13 AM
@kaᵠ btw my net is crap for some days ....it may be because of internet speed
 
It's all about Xhr, not the network
 
do you think we should create post on meta ?
 
no
 
no no
really
 
@kaᵠ why its like a bug .isnt it ?
 
5:14 AM
I'm quite sure that must be your net speed @NullPonyPointer
 
unless you can replicate the behaviour and others can too
 
Even in FB chat it gives retry option when it get failed to send chat message...That's a feature I guess not a bug :)
 
@kaᵠ ya its quite tough to reproduce internet crap
 
@Rikesh it's a workaround maybe
 
Jquery XMLHttpRequest has sent another POST request to the server. That's all.
 
5:17 AM
@NullPonyPointer then... what to fix if you're not sure it's broken? or how to fix if you don't know what?...
 
@Rikesh i am not telling that retry/cancel button is but i am telling it submitted and than also show the retry/cancel button
 
Oh than it can be :p
 
@kaᵠ sorry i mean "@kaᵠ ya its quite tough to reproduce crap internet "
 
@NullPonyPointer actually it's not!
hook your cellphone to your pc, activate internet on it
if you have 3G/4G... place it in a lead containter :P
or, set up some rules on your router, or linux box
 
@kaᵠ i have wired broadband connection ... and use on mobile device by wifi and because i work from home i dont use 3g/4g internet on mobile :(
i think there is something wrong with my isp ...
 
5:26 AM
Jon Skeet, Reading, United Kingdom
548k 174 2927 4369
 
@NullPonyPointer keep a ping open on a website, do some traceroutes, if timings are off pick up the phone and call your ISP
@metal_fan ?
 
@kaᵠ ya that is what i am trying to do
 
@NullPonyPointer since you're working from home... it wouldn't hurt to have a secondary ISP and maybe even join both pipes :D
 
@kaᵠ yes now looks i should take new connection but i am somewhat lazy to apply for new connection its quite time taking
 
you still have a lazy connection till you get another one...
 
@metal_fan 548isnt too much when you have 25k answers .. :P
see Mysticial profile :P
see Mysticial profile :P
 
that's a wow, and he owns some world records for computing Pi & stuff
 
@kaᵠ bt G174 S2927 B4369 badge is quite awesome ...
 
yea...
 
@kaᵠ without rep limit john skeet would have bean reached to 1500k yet
 
5:53 AM
anyway, A.Lee's answer about branch prediction is really worth it's +1's in gold!
 
0
Q: PHP: A Class as a member inside another Class

SeevaliIn my PHP project, I have 2 classes named User & Category as follows. class User{ public $Id; public $Name; public $Category; } class Category{ public $CategoryId; public $CategoryName; } My requirement is to include both CategoryId & CategoryName inside the $Ca...

 
6:26 AM
@sectus Thanks. Can you give me some sample code please?
 
hi, friends,how to reload only page content, not the whole page after ajax success function
 
@Seevali , answer of your question got sample code.
 
@lalith222 , you can use api.jquery.com/replaceWith
 
can u give some sample code
 
6:30 AM
@lalith222 , page has examples.
 
sample code
<html>
<head>
<title>Joovy</title>
<script src="jquery-1.8.3.min.js"></script>
<script type="text/javascript">
$(function(){
$('.send').click(function(){
var status=$('.status').text();
$.ajax({
type: 'POST',
url: 'http://localhost/status/updatestatus.php',
data: 'status='+status,
success : function (e)
{
var response=e;
alert(response);
//location.reload();
},
error: function()
{
alert('error');
}
});
});
});
</script>
</head>
<body>
<?php
require 'dbconnect.php';
$sql="select * from tbl_status where id='1'";
 
@sectus I got that. But it should call the method manually. I want to auto load the category details. If I loaded all User records from the DB, I want to automatically bind the category details to the user objects.
 
@Seevali , your code does not contain something about loading. I can't imagine it by myself.
 
@lalith222 learn about SOLID and OOP
 
6:41 AM
@sectus Then it was my question. When I query a user from the db [by $User->getUser('1')] I want that user to include the category of it (I can include the category table to that same query inside the getUser() method. But I want the Category class a separated one and can be callable by independently from the user .
 
@Seevali , and simple methods to your question.
 
@crypticツ define the two $sz_err, $tp_err vars in the beginning of the code as shown in the answer
 
Is abstract static method legal in >=php5.3 ?
 
@Seevali what?
 
@crypticツ The "These two Bold Variables are" = $sz_err, $tp_err ?
 
6:47 AM
@Seevali that is not my question. I am just posting a cv-pls link see gist.github.com/1689430
 
Static methods act as a namespace and should be used carefully.
 
@metal_fan , in php5.4 it's work... documentation said that it must throw strict error since php5.2
 
@sectus Are you talking about static calls, right?
 
@metal_fan , static methods, but not static calls. :^ )
 
@sectus Static calls do include both methods and variables :)
Foo::bar() Foo::$bar - they are both static calls by definition
 
6:52 AM
@metal_fan , i want object methods without object state dependencies
@metal_fan , do you know that i can call static methods from object?
$foo::bar(); $foo->bar();
 
@metal_fan , it is about static calls
 
Static methods as well as variables are another form of global state (which is anti-pattern). Everybody knows that.
here
 
@crypticツ Oh... thanks..
 
You should avoid static calls as much as possible @sectus
They don't "belong" to OOP paradigm
 
6:55 AM
@metal_fan , $bar->foo() is static call?
 
No
Bar::foo() is
 
@metal_fan , but foo is static function. And could be called by nonstatic calling.
 
Well, methods are not functions. foo is a static method (not a function). Yes. It could be, but you should avoid calls like this one
Statics are anti-OOP
 
@metal_fan , do you use class constants?
 
Consider refactoring your architecture @sectus
 
7:00 AM
@Seevali btw this is wrong
 
Well, class constant is kinda better way to configure a class itself, but only. Say, PDO_FETCH_MODE::PDO_FETCH_ASSOC - yeah, its valid and scoped point to use them. @sectus
 
@metal_fan , but what are you going to do if you need to use array as constant?
 
First and foremost, arrays don't tend to hold the data which aims to be "permanent". So, its better to Class Foo { private $data = array(...); public function getData(){ return $this->data; } }
because: 1) It does not break encapsulation 2) it's more reusable (say, Dependency Injection "could be helpful" )
@sectus Read some articles on: www.phpmaster.com ->Expert. this could be helpful to get into
 
@metal_fan , i want to use enum-like expression.
 
7:11 AM
like Dictionary in Python? right?
 
@metal_fan , enum... it's like constant array. I understand that i cannot use all enums features... but static function with return array() only is closest than your example.
 
Ok. You can not do the same thing in PHP. Just use an array: class Foo { private $enum = array('Monday' => 'foo_1', 'Holy' => '***'); public function getEnumStorage(return $this->enum;) }
 
Enum is global
 
Yes it is. Global state is root of evil
 
@metal_fan , is values of consts part of global state?
 
7:18 AM
Values are not, while containers are.
$enum is a container and it would be global (in your case)
 
@metal_fan global !== global state.... all class names are global
 
LOL
You didn't understand the concept itself
Global state implies both global variables and methods. Oh yeah, and static call too (like pure static classes and Singleton's)
 
we need more opinions
 
lol
 
Wiki said: "Interaction mechanisms with global variables are called global environment (see also global state) mechanisms."
If you do not use global variables (directly or indirectly) there is no global state.
 
7:25 AM
That is what I've been talking about
 
static function(){return array();} -- there is no variables.
 
what then? You're missing the concept. It not about what it returns
public static function foo(){} // <- This is already global state
Because you always access it like class Bar { public function dostuff(){ thatClass::foo() } }
thatClass::foo() comes from global scope
 
like constats or other php builtin function. Do you use constats and buildin functions?
And more about static functions. How you can refactor this: php.net/manual/en/datetime.createfromformat.php?
 
Yeah built-in functions as well as built-in constants - they all come from global scope. The concept itself comes down to language design. PHP isn't purely OOP. We all know that.
I do abstract my "ideas" encapsulating all stuff within some class.
yes, DateTime::createFromFormat is static. What then? $_POST, and $_GET are superglobals too.
Both $_POST and $_GET should be encapsulated within Request class (look at how Zend/Symfony does it)
 
@metal_fan , you telling me that i must avoid static calls. How could you refactor DateTime class?
@metal_fan , $_POST, $_GET are global state couse they are variables. There is no two opinions about this.
 
7:35 AM
I'm telling you that should avoid global state. Nothing more, nothing less.
@sectus it's all about Separation of Concepts and data abstraction. class Request { public function getPostParam($key){ return $_POST[$key]; } }
So when you need to get some stuff from $_POST, you'll do it this way: $request->getPostParam($key) rather than $_POST[$key]
I think it sounds crazy to you :)
 
@metal_fan , you are moving to other question with superglobal variables.
 
They are called "superglobals" just because you don't have to declare global keyword within a function. Nothing more.
 
@metal_fan , i didn't say anything about superglobal variables.
@metal_fan , and other globals variables.
 
morning, kids
 
Good Morning Mr. @tereško
 
7:49 AM
morning
 
Helloo
Anyone got tips? I put a .php page with html on it and a php script in it.
 
@Duikboot It's fine. What problem you are facing ?
 
When I run the page local it works
when I put the page online ... the PHP won't parse
When I look in the source code I can see the PHP code wish is not good...
Anyone got suggestions/
 
Obv it is not good
 
@Duikboot , who adiminstrating server?
 
7:58 AM
make sure Apache service is running at your server
 
Not me... It's a new server since yesterday
It is
Apache 2.2.24 Running
 
<?php
phpinfo();
?>
 
Got nothing...
even when I do :
<?php
echo 'hi';
?>
 
0
Q: Apache doesn't parse PHP on VHOST while it works on default

purplerI set up a Debian 6 VPS to host couple of small sites and it works beautifully for default one. Next i created new user and copy/paste default vhost file and enabled it with a2ensite and only adjusted paths accordingly for that new user but for some reason PHP files aren't parsed and only their ...

 
@DaveRandom Now it was sleeping with me
 

« first day (895 days earlier)      last day (4050 days later) »