« first day (573 days earlier)      last day (4374 days later) » 

6:01 PM
@orourkek I've been thinking of building a *nix box, what distro do you suggest?
 
we use CENTOS for our servers
but if it's a personal project, then any linux distro would work
 
what do you think is the best distro to learn linux on?
 
I learned on ubuntu/mint, and I'm building a server at home now running mint
do you have any experience with linux? especially linux setup?
 
no, thats why I asked what would be best to learn on
 
learn ? depends on how serous you are about learning
 
user895378
6:06 PM
I still haven't found any code documentors for PHP that handle traits well. phpDocumentor 2 reports trait methods as global functions.
 
they kinda are
 
user895378
Yeah, but it makes for misleading documentation
 
I'm pretty serious about learning it, I read ubuntu/mint/slackware are best for learning
 
@EventHorizon I would suggest ubuntu or mint, because of the community size and ease of transition
and ease of setup
 
ubuntu is for "first look"
 
6:08 PM
^^
 
user895378
phpDocumentor2 doesn't say anything about the trait at all. The way it's documented leads you to believe that the methods are literally global functions
 
if you want to start of by going in the deep end , i would recommend gentoo : superior documentation
and it will also force you to read said documentation
 
I just read that on Slashdot that it was Painful but Informative
After going through the Gentoo installation handbook one should acquire some basic knowledge about the inner workings of a Linux based system. Not just how to use a Linux system but also how to assemble and manage one.
 
So there you go, a "shallow end" suggestion and a "deep end" one :]
 
Where does Mint lie on difficulty? around Ubuntu?
 
6:12 PM
welll .. on BSD side i would have recommended PCBSD (much better learning curve, because it is a freebsd underneath with userfriendly initial "contact")
 
mint is a flavor of ubuntu, but without all the windows-like bells and whistles
(put simply)
I used mint for all 4 years of college, it was fantastic
 
Hmm, interesting
 
@orourkek , Mint wont teach you what to do if Xorg goes tits up
 
@tereško it is well suited for playing around with linux, though
and learning linux in general
 
Maybe I should do Gentoo so I'm not lost when something outside my scope goes belly up.
 
6:16 PM
with gentoo you will be lost to begin with
 
the irony is that gentoo will be easier to get lost in
If you're starting with a fresh box, I'd say just pick one and try to install it. If you don't like it, wipe the drive and start over :]
 
oh .. yeah .. a good reminder
 
Since we're talking about Linux does anybody here use linode?
 
So ratings would be something like:

Ubuntu - Noob
Mint -Mid-low
? - Mid-high
Gentoo - Hardcore
 
first time i tried this , i installed it side-by-side windows .. on first try i lost my windows .. on second : the entire content of HDD , and on third it worked
 
6:19 PM
Ouch
Good thing I'm going to do a fresh box
 
@tereško same thing happened to me :P
 
more like :

ubuntu/mint - noob
fedora - mid-level
gentoo/arch - hardcore
 
That chart makes more sense
 
Maybe I'll just start from Mint->Fedora->Gentoo, is there a certain point on each one where I should just move to the next?
 
suse/centos could be added to mid-level also (possible even noob, depending)
 
6:21 PM
my only extensive experience with centos was by setting up asterisk
 
@EventHorizon you can do it however, I don't really have an answer to that :/
I used ubuntu and mint for years, and experimented with other distros (fedora, opensuse, etc) on the side
 
what's your fav os?
 
don't have a favorite
I use osx for work, linux and windows at home, VMs with tons of other distros
too many to pick from :]
 
sounds ... like wasting time
 
hardly
 
6:25 PM
i really liked elementary os, but i'm waiting for it's next release which will drive on 12.04 ubuntu
they really nailed the UI part
which is why i liked it
 
My next distro to get running will be backtrack linux
 
my fav is FreeBSD
 
why do you prefer BSD over linux besides that its free? any other reasons?
 
FreeBSD is a BSD distro
they are all free
NetBSD OpenBSD FreeBSD are the big three
Linux Mint doesn't taste minty - it's just a name
 
well he was stating that he liked BSD over linux because of price earlier
i wasn't referring to the name
 
6:32 PM
no , i said that i prefer FreeBSD over linux distros because of GPL license
 
Ah my mistake
 
hehehe I would think FreeBSD would be under the BSD license :P
stupid GNU
 
i think i need stitchec
stiches*
whatever
 
So the licensing on Linux is way stricter eh?
 
@EventHorizon , to compare : FreeBSD license and Ubuntu GPL part of licenses
 
6:34 PM
i broke my hand in two places, cuts are real deep and wide, and my hand starts to go numb
 
oh .. wait .. wrong one
GPL license has version .. this is the latest : gnu.org/licenses/gpl.html
 
too long to care
 
that's part of the problem .. @Chris , compare it to freebsd's license
 
yup
 
it basically says : give us credit for coding this, but do not sue
 
6:38 PM
 
@Event_Horizon , the main reason why i prefer it is ports system : freebsd.org/ports/index.html
its basically a semi-automatic tool that lets you compile and maintain your applications by compiling them from source for your exact hardware setup
 
Thats pretty cool @tereško
 
which means that to install apache , i do : cd /usr/ports/www/apache/ && make install clean and go make some coffee
 
6:43 PM
this would automatically download , configure and install the application and all the stuff it depends on
 
Been reading about BSD/Linux differences:
3
Q: What are the main differences between BSD- and linux-based operating systems?

jcwx86I am a long time linux user and have recently become interested in playing about with BSD-based operating systems. What are the differences between linux and BSD-based systems. I am interested in learning about the functional, practical and also historical differences.

 
In PHP and JavaScript, "==" is pronounced "probably equals."
2
 
so true, making it so very useless.
 
using "==" only checks the value is the same and not the type right?
 
yes
 
6:46 PM
@Chris Exactly why I left.
 
does it regularly break on small apps?
 
It depends. Not usually, unless you're making something like a calculator, or something with numbers or booleans in it.
At least from what I've seen.
 
user895378
@ScottyC Same. I've just moved to G+ ... though I don't use it much
 
its more for integration with search
you can see what other people what marked as useful for same/similar query
 
G+ is nicer without a doubt. Personally I like it because most of the people there are geeks, and thus, are less stupid. xD
 
6:51 PM
I like the finer grain controls in G+ and it does seem that the community there is more tech oriented than Facebook.
 
if they'd only have plus.google.com/username urls
 
user895378
Well, once I made the mistake of allowing all my extended family to be friends with me on facebook I couldn't use it any more. At least G+ lets you restrict information by circle
 
and fb with groups
same things
 
user895378
doesn't matter. fb sucks.
4
 
user895378
:)
 
user895378
6:52 PM
I just pulled a "Chris"
 
yes
 
user895378
You proved my point invalid but I didn't even care.
 
user895378
My opinion totally overwhelmed the correctness of your counter-argument.
 
1) view are completely biased 2) towards personal wanting = me
 
@rdlowrey Heh, I'm actually having the same problem. Only instead of restricting the information I share with them I realize that I don't really care anything at all about what they post on FB most of the time.
 
6:53 PM
Is there a built-in function in PHP to shorten the array size to x indexes starting from the back?
 
blackhole opens up
 
@dukevin needs more explanation, but probably ;)
@dukevin could be array_slice($array, -$x)
 
for example [1][2][3][4][5] shorten to 3 indexes from end = [3][4][5]
 
then array_slice should do ;)
 
word
 
6:56 PM
@NikiC array_splice, thanks!
 
@EventHorizon OMNOMNOMNOMNOM
 
excel
 
haha @tereško
export to excel -> modify -> save as csv -> import to db
WOOT
 
array_pop could work too right?
 
stackoverflow.com/questions/10557070/… this brings a good question up
 
user895378
7:00 PM
array_pop only pops off the last item in the array ... not multiples
 
how could one count unique hits for machines behind a WAN ip address without the use of cookies.
 
@rdlowrey you could loop it...
 
thats inefficient
 
user895378
but that would be horribly inefficient when you could make a single array_slice call to do the same thing
 
x2
 
7:01 PM
well yeah but it would work
 
using your finger as a toothbrush would work too
but it doesnt make much sense now does it.
 
no, but it does work :P
 
sigh
yes but if done for long periods of time it can lead to tooth decay and ginigvitis
;)
why the hell would you use a butter knife to cut a steak when you have a perfectly good steak knife sitting right next to the butter knife, catching my analogies yet?
 
well it depends, how are you brushing with your finger? if you scrape with your nails you might stave off tooth decay at the least
XD
 
yeah yeah yeah
point is execution time & mem usage of array_slice() vs array_pop in a loop ... array_slice is better.
 
7:07 PM
@NikiC array_slice would work better for my case
 
yeah i get that, I was just asking to see if it could be done, not for use
 
word
 
all arrays in php are passby reference right?
so I don't have to reassign
 
si
 
Dav
Hi.
 
7:09 PM
from what i know
 
gracias
 
Dav
So... I was looking around. Is there an httpd room anywhere?
 
hey @rdlowrey or @ircmaxell which is better in php terms... for() or while() when using an increment e.g; $i++;
 
@dukevin Wait, what? No? If you pass an array into a function and then manipulate that array the original variable will not be changed unless you explicitly say that the array was passed into the function by reference.
 
probly not
 
7:11 PM
so array_splice($array, 5) will not edit the array?
I need to $array = array_splice($array,5); ?
 
user895378
@Mike I always use for unless I specifically want an infinite loop, in which case I do while(1) or while(TRUE)
 
@Mike , micro-optimization , the root of all evil
 
Clearly the documentation states that the parameter is passed by reference
But that does not mean all arrays are passed by reference
 
@dukevin Yes, that or a new variable.
 
7:12 PM
@tereško oh i know, just curious :)
 
@Mike generic question is generic
 
@tereško im familiar with for() in js, just never thought to use it instead of a while() loop.
 
array_splice(&$array, 5) would allow me to not use a new array then correct?
 
@dukevin no, that won't work
 
There is no reference sign on a function call - only on function definitions.
 
7:13 PM
@dukevin No, only objects are
 
i was writing a helper function to iterate through an array and append a > seperator between each value when going through them, and i wanted to make sure the last one didnt have the > on the end so i used the for loop.
@dukevin i was wrong, sorry :)
 
it works without reassigning
 
Yes, because clearly the array_splice documentation shows that the $array parameter is pass by reference
 
user895378
@dukevin as the documentation clearly states, parameter 1 in array_splice is passed by reference
 
user895378
but that doesn't mean ALL arrays are passed by reference.
 
7:15 PM
@Mike , for() makes more sense if the main goal is to transverse some range , while() on other hand focuses on the reaching a condition ... most likely they both produce same bytecodes , but the difference is how you read them
 
This does not change the fact that arrays are not passed by reference as a default. You must explicitly state, in your function definition, that a particular parameter is pass-by-reference
 
thanks @tereško!
 
@duckvin You might try pastebin.com for code sharing. It's nicer than codepad I think.
 
 
and FYI =& is how you define by reference right?
 
7:17 PM
pastebin doesn't parse the code though
 
@tereško they definitely don't generate the same opcode ;-)
@Mike No, don't do that
 
then how would one define a arg as reference?
 
@Mike You probably don't want to do that, particularly if you don't fully understand references in PHP
@Mike In the function definition
 
Pro Tip: If you don't understand references, don't use them... #php
 
Is nobody clicking on the links to the documentation?
 
user895378
7:18 PM
lol
 
hence why ive never used them @ircmaxell lol
 
@ircmaxell , i probably should have said in a bit different way ..
 
why read documentation when i have @rdlowrey here.
 
From pastie.org "All your pastes are belong to us." LOLz
 
@tereško I know, I was being pedantic :-P
 
user895378
7:19 PM
$f = function(&$phpChat) { $phpChat = 'reference clusterF'; };
 
@Mike , why do you think that you need a reference ?
 
@tereško oh i don't just learning something new.
 
then watch this :: PHP UK Conference 2012 - PHP under the hood
 
click click
Johannes lol @ accent
love it
zee germans, theres procedures to follow... and i like procedures
 
british would have same reaction to your accent
 
7:22 PM
oh im sure
 
can i ask question in sql ?
 
idk can you?
 
@gosto I would love to see a question posed in the form of a SQL statement. Or do you mean you have a question about SQL?
 
@CharlesSprayberry yes about SQL
 
@Mike My dad says that, too. ;)
 
7:25 PM
are there many words in your question ?
 
not much
 
how many letter A are there in your question ?
 
lol
 
he's still not getting it
 
flagged as stupid
 
7:28 PM
Probably not going to help you get an answer. Just sayin...
 
HUH
 
i have this sql
$sql = mysql_query("SELECT $menucompare, (substr($menucompare, 12, 9) ) AS daynames FROM data WHERE $ww >0 and $ww = $button GROUP BY daynames");
and i have this second sql
$sql2 = mysql_query("SELECT $menucompare, (COUNT($menucompare)* 100 / (SELECT COUNT( $menucompare ) FROM data WHERE $ww = $button )) AS percentday FROM data WHERE $ww >0 ");
 
user895378
yesterday, by tereško
Please stop writing new code with the ancient mysql_* functions. They are no longer maintained and community has begun the deprecation process . Instead you should learn about prepared statements and use either PDO or MySQLi. If you cannot decide, this article will help to choose. If you care to learn, here is a quite good PDO-related tutorial.
 
/me sits back and watches.
 
7:31 PM
im looping the first sql by while loop
 
user895378
yesterday, by tereško
Please stop writing new code with the ancient mysql_* functions. They are no longer maintained and community has begun the deprecation process . Instead you should learn about prepared statements and use either PDO or MySQLi. If you cannot decide, this article will help to choose. If you care to learn, here is a quite good PDO-related tutorial.
 
@rdlowrey that's lame
 
@tree How?
 
is not continues with popcorn
 
it just comfirm php is not consistent
 
7:32 PM
@tree Huh?
 
user895378
Oh no, I tried to pull up @rlemon's meme generator to do a "I'm too tanned for the mysql extension" but it's not up anymore :(
 
oh LOOORD
@ScottyC same here
 
so my question is > how to make WHERE clause with 'daynames' here $sql2 = mysql_query("SELECT $menucompare, (COUNT($menucompare)* 100 / (SELECT COUNT( $menucompare ) FROM data WHERE $ww = $button AND ------------- )
 
user895378
yesterday, by tereško
Please stop writing new code with the ancient mysql_* functions. They are no longer maintained and community has begun the deprecation process . Instead you should learn about prepared statements and use either PDO or MySQLi. If you cannot decide, this article will help to choose. If you care to learn, here is a quite good PDO-related tutorial.
 
mwhaaaa
 
user895378
7:34 PM
Okay, I'm finished.
 
@rdlowrey im writing sql by old , if u dont like stay back
 
@rdlowrey Sadly I feel that we'll never be finished trying to kill mysql_*
 
sounds like a challenge.
 
user895378
 
im asking those who want help , not those who want make comments
 
7:35 PM
@gosto He is helping
That is the help you need. Get away from mysql_*
 
user895378
Trying to, anyway.
 
@gosto who want TO help
 
what do you need gosto
 
@Ciro He needs to stop using mysql_*
 
LMFAO
 
7:36 PM
rdlow he is commenting , and i will take your advice later not now , now i want solve this problem
 
@Charles maybe in a perfect world?
 
@rdlowrey its only those who cant , who comments so much , bla bla bla
 
actually more pressing would be for him to learn SQL
 
how about this. Ask your question on SO where people get rep for helping you. Maybe there you might get a more tangible answer.
instead of a suggestion to quit using deprecated features.
because, afterall.. we all LOOOOVE to use them
 
@Ciro Not in a perfect world, in this one. There's no reason to use mysql_* in new projects and old projects should probably start looking at transitioning to a different API since it is deprecated and all.
 
7:39 PM
i thought i can find answer here quickly , but its the opposite , only advices
14
 
rollseyes
 
i like using deprecated functions, triggers cool warnings
 
user895378
I have an overwhelming desire to post help that involves a DROP statement.
 
user895378
But I won't. Because I don't know what I'm talking about.
 
@Ciro until one day you upgrade php and go WTF why's my shit not work.
 
7:40 PM
Hey there people of earth!
 
@rdlowrey Yea, you nooblet
 
"oh, thats right.. i never upgraded my code"
 
And @tereško too :P
 
@mike you don't upgrade whats working
 
and there in lies your problem.
 
user895378
7:40 PM
Yeah, IE6 works great for me.
 
lol
 
user895378
Actually I still use the AOL branded netscape.
 
i prefer nutscrape
 
@rdlowrey I'm still using Windows 3.1. I can bang away in Notepad on it. What else do I need?
 
ok thx , guys bye
 
7:41 PM
i had to star that line about advices ... its beautiful
 
the most advicer i knew here in chat its you @tereško
 
advicer? is that a word?
 
some things just can't be upgraded. Be at a good company and tell your boss you want to upgrade all system. His only question is: "What new features does it will have?" Your answer:"none"
 
more like "what bugfixes and performance increases does it provide"
 
user895378
@tereško You need business cards listing your title as "The Most Advicer" ... that's awesome.
 
7:42 PM
u just put your hand under your face and think and advice
 
WHATF
 
@Ciro If you can't come up with arguments to move away from mysql_* then perhaps you should educate yourself
 
@Ciro , features : "better performance" , "bugfixes"
 
Better security, if used properly
 
The advice I'm thinking of don't put your hand UNDER your face thats not healthy. Below will do.
 
7:43 PM
oh @CharlesSprayberry, did i mention better performance?
 
@gosto , yeah , this is what i do whole day: make shit up
 
on a side note, had a client say he didnt want to use wordpress because he didnt want to inttall the php lib on his IIS server today.
i facepalmed at that one.. i expected "i dont want to use WP because it sucks"
then proceeded to ask me if WP supports MSSQL.
 
I don't want to live on this planet anymore
 
then shoot yourself in under your face.
 
user895378
Free downvotes for anyone who wants 'em! Is it just me or do all chat rooms go to hell on friday afternoons?
 
7:46 PM
OK, I think I'm moving over to the programmers stack exchange.
You can get 51 upvotes just for stating the bloody obvious
 
Well if was bloody obvious my diagnosis is murder.
 
I'm honestly staggered.
 
user895378
@GordonM Yeah I saw that -- it seems like SO is a noob-magnet and the Qs/As on programmers.se are significantly better
 
is it just me or is programmmers SE close to identical to SO
 
@Mike It is just you
 
7:48 PM
thought so.
programmers = theory, SO = code?
 
Programmers = whiteboard, design problems. SO = actionable code problem
 
user895378
I got +80 rep for this bit of awesomeness on programmers:
 
ahahhh
 
user895378
8
A: PHP Programming Online Education

rdlowrey$f = function() { return "php.net/manual" === "All you need"; }; var_dump($f()); // true But seriously: php.net/manual

 
In theory anyway.
Seems more like SO lately is "How do I shot web"
 
7:49 PM
Not to say that programmers doesn't involve code at times but if it is a problem with the code being wrong it probably belongs on SO
If it is a problem with a design or theory it probably belongs on Programmers
 
90 now
 
1
A: Is this a secure method, oop

TruthSee this answer for how to use bcrypt to hash passwords. It's more secure than yours because it allows for deliberate slow-down of the hashing algorithm (so if anyone tries to brute force, they would be limited to 1M iterations per second or so, instead of 1B, which is the difference between hour...

Anything I missed?
 
@rdlowrey That'd return false!
 
user895378
@GordonM I know, read the comments :)
 
user895378
I've all but given up on ever receiving a peer-pressure badge
 
user895378
7:52 PM
@Truth Why do you say the OP "should be using PDO's named placeholders, instead of the unnamed ones"
 
user895378
Named placeholders aren't intrinsically superior
 
user895378
It's down to personal preference
 
@rdlowrey More convenient, no need to remember placeholder order
Increased abstraction due to the latter.
 
PHP NOOB question: Why set variable as a function? What use can you get out of this? (seen it a couple of times but never got told why it is used)
 
@rdlowrey Just post a question on SO asking how to insert a form into a database, include some code that uses mysql_* and keep refreshing so you don't miss the precious window between getting 2 downvotes and teh question getting closed
 
user895378
7:54 PM
@GordonM lol, you're right
 
@Event_Horizon You can pass that as a callable to functions which needs a callable, such as array_map
Also, you may call the function like so: $variable_function(arg1, arg2);
 
ah ok, never knew that
I'm champin every day
 
@Event_Horizon It's a language feature called anonymous functions. They let you pass functions around like variables, which might not sound all that useful at first but is a seriously powerful programming technique when used properly
 
@GordonM I've never been in a situation where I've had to use something like that so far, but its good to know nonetheless.
 
user895378
I find the design of programmers.stackexchange extremely difficult to read. It hurts my eyes.
 
7:57 PM
same here @rdlowrey
 
user895378
The background is so noisy it's hard to figure out what I'm supposed to be reading.
 
0
A: Is this a secure method, oop

ircmaxellNo, the code you've provided is not secure. First off, you're using a non-iterated simple hash. See this answer and this blog post for information as to why. Second, you're not using a salt... Third, you're exposed to timing attacks against the password hash, since the database isn't using...

 
@rdlowrey yea i dun fucked up rlemon.github.com/lememe is an older version.... stupid git... Y U LET ME PUSH OLD CODE! Y U LET ME REBASE TOO FAR BACK!
 
@rdlowrey Yeah that background is mighty noisy, hurts my eyes too.
 
u know whatd be cool, donation of rep
lol
j/k
 
7:58 PM
Anonymous functions are used a lot more frequently in JavaScript. the jQuery library makes good use of them.
 
@ScottyC It works much better in asynchronous languages like JavaScript
 
Yeah I've noticed that, but in PHP I haven't used them at all.
 
Where you need to pass a callable for every second function
@Event_Horizon array_map is a classic example
 
user895378
@rlemon gh-pages is too tanned for fast-forward pushes.
 
(function() {
     /// do some animation shit!!!
    setTimeout(arguments.callee, 1000/60);
}());
 

« first day (573 days earlier)      last day (4374 days later) »