« first day (1039 days earlier)      last day (3898 days later) » 

3:01 PM
@Sem cool thanks!
 
@Duikboot You need to understand DNS to do that
The Domain Name System (DNS) is a hierarchical distributed naming system for computers, services, or any resource connected to the Internet or a private network. It associates various information with domain names assigned to each of the participating entities. Most prominently, it translates easily memorized domain names to the numerical IP addresses needed for the purpose of locating computer services and devices worldwide. By providing a worldwide, distributed keyword-based redirection service, the Domain Name System is an essential component of the functionality of the Internet. An o...
 
DNS != dedicated nameserver == Domain name system
 
Sem
@Incognito Nope, an API works fine :D give a string like "example.com" and retrieve a boolean with suggestions.
 
A boolean with suggestion?
Not that many suggestions ni that case
pick one
 
Sem
3:05 PM
@PeeHaa "Gorilla.com is not available, however albinogorilla.com is"
 
@Sem Good point. I don't know of any API providers for that however
 
Sem
@Incognito I already send a link up there, it's a dutch one. You can even register domains
 
Ah, didn't see it!
Neat.
 
Hey Guys
if you look at
is says:
If the input arrays have the same string keys, then the later value for that key will overwrite the previous one. If, however, the arrays contain numeric keys, the later value will not overwrite the original value, but will be appended.
How can I overwrite if they do have the same numerical key?
 
Wow, 4 seconds.
The time between me joining the java chatroom and someone dissing jquery or PHP.
Both, in fact! :)
 
3:16 PM
@BillyMathews Post both arrays. $array_1 + $array_2 should do it.
 
@webarto Ohh, simple! Thanks
 
I'm not saying it will without seeing what you have :)
 
@webarto warning, the left value will overwrite the right one.
 
@igorw Yes, Sir.
I have array operations printed on wall.
I just can't remember them.
$return this;
That's a sign that I shouldn't make fluent interface.
 
Put your dollars where your this is. ;)
Also it kinda bugs me that people call everything that does return $this fluent.
Every fluent interface returns this, but not everythng that returns this is a fluent interface.
Fluent interfaces choose method names that make it possible to construct "sentences" too.
 
3:24 PM
@Neal That sounds horrible :/
@tereško was about to wonder why something this offensive is starred .. saw it was about Neal .. starred
 
it's actually not offensive at all
i was just pointing out that he's digging a hole for himself with that sort of statements when it come to management
 
No, it's not, because he is a bad developer and he cannot be trusted. I just initially thought it was aimed at some random user without context just looking at the star.
Although, he does have massive rep, I think he's one of the few people who get SO.
 
yay! 2800 twitter followers!
in JavaScript, Aug 5 at 15:13, by Benjamin Gruenbaum
The only one doing SO right is @Neal , he is the one who really gets it. Proving day after day you don't need to be particularly smart, or know any programming to get high rep in SO. All you need to do is answer the same question a thousand times and use google generously.
3
 
@ircmaxell Neal has family ties to Kolink?
 
lol
 
3:32 PM
for fun and profit!
 
Funny thread.
 
@igorw Are the following syntaxes both valid and equivalent in composer?
1.0.*
1.0
 
how to write if ( $_FILES ) ? getting errors
 
what errors?
 
3:38 PM
0
Q: Can't link user to their corresponding results CODEIGNITOR

user2696666i have a page that shows all student profiles with their results. all the user info i putted in the table "user" and then i have another table "results" that shows all the students their scores from diffrent courses. the thing is i don't know how to write the query or controller function to link ...

 
@LeviMorrison as far as I know, 1.0 indicates 1.0.0
 
@Ocramius And if that's so, it's a horrible decision (no offense @igorw, that's just how I feel).
 
is knowing how your framework is spelled considered minimal understanding?
 
@LeviMorrison what's the problem with 1.0.* ? Mozilla has been using it for ages IIRC
 
@LeviMorrison valid, yes. equivalent, no.
 
3:39 PM
If you write str_replace(["\r", "\n"], ...); doesn't that cover "\r\n" too?
 
@igorw Explain 1.0 to me then.
 
1.0 means 1.0.0 aka 1.0.0.0. it's a specific version.
 
@ircmaxell actually no error.. but when there is no files it returns true
should return false no?
 
Without wildcards in general it is a specific version
 
1.0.* is a range and is internally converted to >=1.0,<1.1-dev (fixed)
 
3:40 PM
@bushdiver var_dump() it to see
 
~, >, <, <=, >=, , and * are the special chars in version numbers that I'm aware of
 
That seems like a really stupid decision. When I'm talking about the whole PHP 5.4 series I don't use PHP 5.4, I use 5.4 because that's the logical versioning.
 
@LeviMorrison no, you use 5.4.* O_o
 
Nobody does that.
 
I do that... I support whatever version within 5.4 is the latest
 
3:41 PM
They just say 5.4. I'm not talking about composer, I'm talking about normal conversation and writing.
 
@LeviMorrison for constraints, read this and this.
 
@LeviMorrison that's because we abbreviate
 
@Ocramius I'd generally go with >=5.4
 
"I use 5.3" or "I use 5.3.3" are very very different things :S
 
@Ocramius "I use 5.3" means I don't need a specific version of 5.3. Any in the whole series is good.
 
3:43 PM
> As of PHP 5.4 you can also use the short array syntax, which replaces array() with [].
 
@igorw I wouldn't just use >= there, but I admit I am doing the same
@LeviMorrison no?
 
How, man?
 
@LeviMorrison nobody uses 5.3.0 or 5.3.2? Except crazy people?
 
@Ocramius if you use 5.4.*, then nobody can run your crap on 5.5...
 
@igorw yes, what I suggest is using ~5.4
 
3:44 PM
In any case, it's not a big deal. I was just saying I think it was a confusing decision.
"horrible" was a bit too strong.
 
:P
@igorw we don't know if PHP6 (if it will ever exist) will work :D
 
@Ocramius that is the same as >=5.4, except it also has an upper bound of <6.0-dev, which is pretty much irrelevant atm...
 
@igorw that's what I mean ;)
 
@BenjaminGruenbaum yea... but I get to make all the decisions! MOO HAHAHAHA (sort of)
 
also, when you change that to ~5.4.4 because you need a specific fix from that version, you're screwed. because then the meaning changes to <5.5-dev.
 
3:46 PM
And if I ever write an alternative to composer (I've thought about it a bit), you already know which way I'll be using 5.4 syntax :)
 
@igorw I had some particular problems with early versions of the doctrine modules. Some people are getting very old versions because the constraints were less strict
@LeviMorrison there's PEAR
/me hides
 
@LeviMorrison please use XML. we've had lots of complaints about the JSON.
 
yep
an RDF would be awesome
 
But using XML would mean @NikiC would hate me :)
 
SOAP please!
 
3:47 PM
YAML
 
@ircmaxell I am gonna puke!
had to debug yaml yesterday. Most.useless.config.format.ever.
 
@salathe Don't even joke about that. I still have flashbacks :(
 
@LeviMorrison Yes (whatever it is you're talking about right now)
 
s-expressions! drops mic
 
@GordonM Sorry
 
3:48 PM
Can't we all just start doing web development in common Lisp or Fortran77?
 
/me kicks @salathe from the room
 
@ircmaxell for saying sorry?
 
for saying SOAP
 
could someone help me with a .htaccess problem I'm having; I'm clueless
 
we have a 0-tolerance policy for that kind of cruft around here
 
3:49 PM
I'm getting 403 error when I'm trying to login to wordpress
I notice this at the top of the .htaccess file:
ErrorDocument 403 default

<Files wp-login.php>
    <Limit POST>
        Order deny,allow
        Deny from all
    </Limit>
</files>
 
@ircmaxell Okay... *leaves*
 
@BillyMathews That's Antivirus rule.
 
@igorw uhmmmm. how about NO? :D
 
Which I think is the problem.. also, I didn't put that there and I'm the only one who should be able to edit the .htaccess, you don't think it could be an attempt to breach the site?
 
@salathe :-P
 
3:51 PM
@webarto What does it mean?
 
It means ain't nobody gonna POST to wp-login.php.
 
Just remove that crap rule.
 
Okay
I was going to say.. don't you need to POST the details?
 
@Ocramius @ircmaxell So you'd want something like an explicit minimum and optional maximum version as different fields/attributes?
 
3:53 PM
@LeviMorrison I think the current way that it works is fine
 
is there anyway to get new records using sql query ? (Insert,delete,update) in whole database (MYSQL) ??????????
 
but I'd REALLY want the ability to run code to test things like feature detection, where right now there's no way to abort an install based on code...
 
Also, I haven't looked at the underlying composer stuff. Maybe all it needs is a new front-end.
 
@LeviMorrison nah, I was just making an example of what mozilla uses
 
@ircmaxell You mean like extensions?
 
3:54 PM
it's quite good since those RDFs are signed and uploaded
 
@LeviMorrison well, composer can do extensions
 
@ircmaxell it could be done with some hooks...
 
I want to be able to do: '*0' !== crypt(...);, to prove that the feature is supported, because version number is unreliable...
 
@ircmaxell hahahahahahahaha
 
I think lsmith and thinkscape were working on it
 
3:55 PM
@NikiC ?
 
@ircmaxell configure?!?!
 
@Ocramius last I looked, there was no way to abort the install... You can error, or do other stuff, but not say that "requirements are not met"
@NikiC that too, but mainly backported features, like Linux distros like to do
 
I'm really not a big fan of the buildconf-configure-make monstrosity and I would rather not have anything going in that direction in PHP ;)
 
i know the ternary operator can do this:
echo ( $i < 20 ) ? 'less than twenty' : 'not less than twenty';

but can it also execute commands or functions like this?
( $i < 20 ) ? $this->my_function() : exit('Bye bye.');
 
@ircmaxell hmm, I see
 
3:57 PM
for example, 2y was introduced in 5.3.6, but RedHat backported it to 5.3.3. So requiring 5.3.6 misses a bunch of valid installs
 
yes, that may be an interesting point to bring up
@ircmaxell you may look into github.com/zendframework/ZendDiagnostics and tell that to those guys
 
@NikiC fair, but some of it may be interesting...
 
that's surely something they'd be interested in =D
 
No actually how do i run the exe file in linux — user2699972 3 hours ago
 
not as 3 separate steps, but as a "pass/fail"
 
3:58 PM
^ lol
 
@ircmaxell Can you give a simple proposal of what you would like?
 
@ircmaxell I might be a bit biased here, but I don't think that the whole "try to compile about 1000 C codes to determine the environment" has done us any good
 
@NikiC it's because we're trying to do conditional dependencies and all sorts of ifdef garbage
 
@JPLew Try it... but the answer is yes
 
I'm pointing to a simple pass/fail: we require this. You don't have it. We won't install. Sorry
 
4:00 PM
@NikiC no, but you can detect obvious failures... for example some paths being unaccessible, or some missing env vars, or some missing executable
 
I'm about 2000% sure this will be heavily misused
 
If I install an app that requires ffmpeg then I wanna check it's there on deploy, no?
yes, sounds like provisioning
 
user895378
@JPLew why not try it yourself and see?
 
require-file: [
    "require-def.php": {
        "check_function": "Checking some attribute",
        "check_function2": "Checking some otherattribute"
    }
]
@NikiC whatever
 
@rdlowery, @Orangepill
I tried it
 
user895378
4:02 PM
And?
 
but it returns bool(false);
 
@ircmaxell bäh
 
no matter what I set $i equal to
 
@ircmaxell And what prevents the misuse of check_function to modify my filesystem or anything else? I can see why this doesn't exist.
But I understand the need.
 
@LeviMorrison What prevents your actual library code to do that? :)
 
4:04 PM
@LeviMorrison nothing. Nothing at all
 
@NikiC I suppose that's true.
 
this fails to echo anything each time: ( $i < 20 ) ? echo "Yes" : echo "no";
 
Of course this makes it somewhat more dangerous by being run automatically
 
is that different case because it's issuing a command?
 
@ircmaxell Perhaps something PHPunit like.
Give me a moment.
 
4:05 PM
@JPLew echo is a statement, the ternary only accepts expressions
 
user895378
@LeviMorrison ?
 
echo is invalid, but print would work
 
@Nik
why is that?
 
@rdlowrey Oops. I missed the i before r before I hit tab :)
 
user895378
@LeviMorrison /me shakes tiny fist
 
4:06 PM
@JPLew Basically speaking: print has a return value, whereas echo does not
 
@LeviMorrison I linked it above. the problem is just getting it to run before install ;)
 
@NikiC ok thanks, that makes sense
 
@Ocramius I guess I missed it. can you relink me?
 
Writing echo in there is a bit like writing $i < 20 ? class Foo {} : while(1) {} or something ^^ You just can't put these kind of things in an expression context
 
basically big array 'o closures
s/closures/callbacks
 
4:07 PM
> Returns 1, always.
Epic.
 
The behaviour of intval() and it's $base argument is stupid. intval('100', 2); // int(100) ... intval('0100', 2); // int(64) It basically just ignores it unless it's 8 or 16, and even then the format of the string takes precedence - dafuq PHP.
 
PHP has logic problems? Since when?
 
@DaveRandom Didn't know it has $base.
 
It might as well not
 
Explain.
 
4:11 PM
@NikiC ok, i see
then is there a way to shorten this:
    if ( $this->page_to ) {
        update_post_meta( $post_id, 'page_to', $this->page_to );
    }
 
There is no need to shorten that.
 
like to get it on one line? it's already pretty short but I have to do this a zillion times
 
$this->page_to AND update_post_meta( $post_id, 'page_to', $this->page_to );
 
@webarto AND
 
$this->page_to ? update_post_meta($post_id, 'page_to', $this->page_to') : false;
@webarto Oooh, never seen something like that before
 
4:13 PM
@NikiC F* me, right.
 
That's just basically an if without the else, then
 
oh cool
 
@JPLew It's okay as is. You just have to remove the whitespace after ( and before ) :P
 
@igorw @Ocramius Quick question. I've created no tags or branches. I just have master. Would the following work in composer?
  "require-dev": {
    "organization/application": "*"
  }
 
think it's meant for dbl/long conversion ... dunno why base is used
 
4:14 PM
if ( $this->page_to ) update_post_meta( $post_id, 'page_to', $this->page_to );
 
No no I liked the first one
 
ok, in bash you can do this:
[[ -f file.txt ]] && "Do This" || "Do That"
in PHP the && means something completely different, right?
 
Hello Ruby. No.
 
is there an equivalent to that bash shorthand?
 
@DaveRandom it's for strings ... php -r "var_dump(intval(\"100\", 2));"
 
4:16 PM
come to think of it that's just the same as the ternary operator in PHP
ok, forget that last question :)
 
Yes.
 
@JPLew Assuming 'do this' and 'do that' are functions, use an if.
 
@Jimbo Now you're oldschool.
 
@DaveRandom Both intval('100', 2) and intval('0100', 2) correctly give me int(4).
 
@NikiC bit strange that intval(100, 2) doesn't ... you might expect it too, loose types and all ...
 
4:18 PM
Excuse me while I , I screwed up my mixed-command-line-and-php syntax
 
@JoeWatkins No, you can't, really
 
@LeviMorrison no, because default minimum-stability is "stable".
 
@SweetieBelle, got it. thx
 
read this to understand how composer does stability stuff.
 
@JoeWatkins It doesn't specify that the input should be a string
@NikiC Yeh it's now working for me once I stopped being a numpty.
 
4:21 PM
Function [ <internal:standard> function intval ] {

  - Parameters [2] {
    Parameter #0 [ <required> $var ]
    Parameter #1 [ <optional> $base ]
  }
}
 
@LeviMorrison you could use *@dev or just @dev, but I'd recommend against it, because it gives you some random branch, you have no control over what you get. see also, the other blog post I linked to earlier.
 
@igorw Even in require-dev?
 
no help in the js room, maybe someone can provide feedback here:
in JavaScript, 3 mins ago, by Carrie Kendall
why does "Example:index0Example:index1Example:index2".split("Example:"); return ["", "index0", "index1", "index2"] ?
 
@LeviMorrison yes, the stability constraints are the same for require and require-dev.
 
@CarrieKendall Because it's splitting on every "Example:" ? What did you expect to happen?
 
4:32 PM
@CarrieKendall Because .split assumes that there is an argument before the first split string.
 
@igorw ... so what's the difference between require and require-dev? This is one reason an alternative front-end would be nice. I feel like names are very misleading, etc.
 
@SweetieBelle okay, that makes sense
 
@DaveRandom Ha! PHP does the right thing for once :P
 
@LeviMorrison the multiple meaning of "dev" are a bit unfortunate, yes.
 
@NikiC more than once
 
4:34 PM
require-dev is just like require, but only applies to the root package. you will only get your own require-dev deps, you won't get the require-devs of the things you depend on.
so you can put stuff like phpunit in there that you only need during development of your own code.
 
I see. Thank you for the explanation.
 
@ircmaxell :)
 
for example: function scoping is done right in PHP IMHO
 
indeed
 
Hello All
 
4:48 PM
@ircmaxell how about class methods made public by default?
 
eih, that's trivial
 
yeah but I don't feel it is right...
 
huh? I don't "mind" either way, I don't think it's good or bad
 
If you forget about it, all your methods are made public
 
wat
 
4:51 PM
whereas if it was the other way, you would have to define the methods that you need to make public
 
hmmm. if you don't add visibility constructs to your methods, your methods won't be limited in visibility. Yeah...
 
@cheesemacfly Why would ever want to leave out the visibility modifier?
 
Default visibility was made public for backwards compatibility, if I remember correctly
Doesn't mean it's right, though
 
I should say I am used to code in C# where a method is private by default
 
@NikiC Because I hate extra keywords.
 
4:53 PM
@NikiC Why not? Why not use the default behavior?
 
> Internal is the default if no access modifier is specified.
@cheesemacfly
 
@cheesemacfly This is something every developer should know when they develop in any language.
If you "forget about it" then that's your issue.
 
user895378
Yeah, failure to specify method accessibility is a developer problem, not a language problem ... IMO.
 
Amen!
 
@LeviMorrison Yes but if the language can help you make it right or at least less wrong...
 
4:57 PM
Anyone know of a good resource for "do's and don'ts" of semantic HTML patterns; for commonly occurring content blocks/components (like postal addresses, etc.)
 
Bad web applications due to bad programming practices are language agnostic.
 
@cheesemacfly In this case there is nothing wrong about public visibility by default.
Nor is there anything wrong with C++ for defaulting to private.
 
@webarto yes, but you got my point
 
Yes, but your argument is invalid.
 
I surrender :)
 
4:58 PM
@cheesemacfly Same with C#; private default.
 
@Bracketworks Isn't it Internal?
 
(frankly, I think it should be a syntax error; everything should require an explicit visibility modifier)
 
internal for the class and private for the members
 
@webarto Is it? I can't remember now, I always explicitly denote visibility.
@cheesemacfly Ah there we go.
 
Let me double check since none of us is sure :D
 
5:00 PM
Well, it doesn't matter; omission should be a syntax error. Everywhere.
 
I have no idea what I'm talking about.
 
Dogs on the internet.
 
@Bracketworks I vote for your solution!
 
I vote for nested classes and class visibility in PHP!
Although that won't work :-(
 
Okay. I'm having issues setting up SemVer for Travis CI. I have .travis.yml and I tested my service hook in github, which worked. Yet viewing the repo on travis-ci.org shows that none of my repositories are set up yet. Ideas?
 
5:04 PM
@LeviMorrison Have you tried saying "semantic" in a more trendy way? If you don't have the right tone of voice, the buzzword loses a lot of the magic power...
 
@LeviMorrison have you registered the hook?
 
@NikiC I believe so. It has the blue "on" icon in Travis and in github it shows up in my service hooks.
I did this a couple days ago.
I am waiting for a build complete email but I somehow think something isn't set up correctly.
 
@LeviMorrison did you send a payload?
 
@Ocramius As in "test hook"? Yes.
 
hrm
 
5:10 PM
Oh well
 
WTF Java
7
Q: How does Java distinguish these multiple methods with the same name/signature?

DogI was tracking down a bug today, and I noticed something strange within one of our classes. I cut out as much code as possible to post here: class A { static int obtainNumber() { return 42; } static int obtainNumber() { return 3; } static int obtainNumber() { return -1; } static ...

 
@GordonM lol
 
On the plus side you could do that and ensure your job security.
Nobody would ever figure that out if you left the company!
 
hahaha
 
5:17 PM
How does one hide a character?
ZERO WIDTH NO-BREAK SPACE
My new favorite character.
 
This user even printed out something and took a picture of it and added it to his answer :O
1
A: Printing rotated text from web page

Anshuman DwibhashiYou can use PHP to generate an image of the rotated text and then print it: here's how your PHP file (image_gen.php) should look: <?php // create a 100*100 image $im = imagecreatetruecolor(100, 100); // Write the text $textcolor = imagecolorallocate($im, 0xFF, 0xFF, 0xFF); imagestringup($im, 3...

 
any mac users in with pthreads installed ?
 
@GordonM PHP has that feature as well pastebin.com/PX3LQkwA
<?php

    $​ = 'magix';
    echo $​;

    function ​(){
        echo 'bar';
    }

    ​();
?>
 
good grief
Still something to have fun with next week when I'm back at work...
 
5:33 PM
function (╯°□°)╯︵ ┻━┻() {}
2
 
@JoeWatkins do you know if extension_loaded('apc') works also with APCu?
 
function (╯°□°)╯︵┻━┻() {};
Actually :)
 
@Danack we are finaly ready to make pQuery
on a completely unrelated note:
 
@tereško still waiting ...
 
One major issue with distros that take time to upgrade kernel - you have a lots of time with nothing productive to do .. so you read .. and you read manuals. This results in realization, that after 3 hours of compiling crap you need to start it over, because you managed to find a metric ton of tweaks that you want to implement in said kernel build ..
 
5:45 PM
"after 3 hours of compiling crap" Time to buy an SSD?
 
it's a small VPS
 
Bet the people who are sharing that underlying hardware love you then.
 
I'm using only one core at ~80% of my available CPU time (and the plan itself is locked to 60% of the physical cpu)
 
Yeah - but the issue will be that compiling is super heavy on IO, so the shared hard drive will be in continuous use for those 3 hours. TBH they get what they paid for, so it's not your problem.
 
http://stackoverflow.com/questions/18341795/php-mysql-qr-code
 
5:52 PM
 
@Ocramius by default APCu builds in compat mode and so yes, apc ext is registered ...
 
thx!
@LeviMorrison yes, that would work
 
@Ocramius I <3
 
FYI, @rdlowrey and I created a really tiny Router class to tack onto the webserver he's been working on. Initial benchmarks are showing something like 2x the speed of Phalcon. That's a promising start :)
The router actually does some interesting regex and mapping magic if anyone is bored and wonders how we do it.
 
user895378
$app = (new AppDefinition)
    ->bind(80, '127.0.0.1', 'mysite.com')
    ->encrypt($tlsSettings)
    ->setDocumentRoot('/path/to/static/files')
    ->addDynamicRoute('GET', '/', ['MyApp', 'hello'])
    ->addDynamicRoute('GET', '/static', 'MyApp::staticMethod')
    ->addDynamicRoute('GET', '/$#arg1/$#arg2/$arg3', ['MyApp', 'args'])
    ->addDynamicRoute('GET', '/function', 'myFunction')
    ->addDynamicRoute('GET', '/closure', $closureHandler);
    ->addWebsocketEndpoint('/chat', 'ChatEndpointClass');
 

« first day (1039 days earlier)      last day (3898 days later) »