« first day (643 days earlier)      last day (4529 days later) » 

00:08
html question about forms... shouldnt a hidden form element with the same name but different values.. when you submit the form it only takes the last one?
for some reason the forms submitting all of them >_>
oh derp im a fool :)
is there a non js approach to having the following? jsfiddle.net/AD6bK, the user selects a single row's radio and when they submit it only submits that data.
me thinks no
suppose i could do individual forms
user895378
01:11
@hakre I have not, will check it out right now.
interesting about mysql from postgres viewpoint : youtube.com/watch?v=1PoFIohBSM4
3
does anyone know anything about stopping while loops after run three times?
01:27
break;
Um, use a for loop?
for ($i = 0; $i < 3; $i++) {}
oo
thanks!!
user895378
01:43
@hakre And here comes the trait avalanche ...
user895378
The linked traits pdf really doesn't do anything for me.
user895378
My biggest issue is that traits undermine what you're trying to achieve in terms of object orientation. I'd say they're not entirely dissimilar to static class methods in that regard. And while they don't necessarily introduce state issues like static usages can, they do put you on the fast-track to class-based programming. I view traits like a static method scaled up to the level of class abstraction.
user895378
The only tangible benefit of traits (that I can see) is code re-use. Consider: this is the exact same
reason people use for static utility class methods.
user895378
But if you're employing sound OO principles you already have this benefit without traits. For example, adhering to the Single Responsibility Principle means you already have small, modular and fully re-usable units of code. This makes redeploying useful classes in different contexts a triviality: you simply inject your existing units of functionality directly into the classes that need them: it's code re-use without traits.
user895378
Further, there's no more transparent API than the one that asks for its dependencies directly in the constructor. When classes use composition there's no question about what they can do or which modular code units they use to do it.
user895378
01:44
The other reason I see people using to justify traits is, "My code is just too complex for single inheritance. If you saw the business logic I have to deal with you'd agree that traits are necessary."
user895378
Using traits in this situation is like buying a car to walk your dog: you're solving the wrong problem.
user895378
The real problem is the incomplete or undeveloped design of the code; that is the reason why the design is complex in the first place. I always know when I've hit on the right design because it's so simple it almost seems inadequate. That said, all design is an iterative process and you rarely hit on the right design the first time. If I think I need traits it's a sign to me that I haven't got the right design yet, and I keep working.
user895378
(the end)
user895378
I really need to start a blog instead of spamming this room ...
:) Well-expressed, you ought to indeed!
02:00
Traits seem to me another thing for the OO-abusing platform developer-types
user895378
Agreed.
user895378
The seem really useful on the surface, but if you're using accepted OO principles they shouldn't be necessary.
Prefacing this by saying I think jQuery is the Drupal of javascript, I suppose there has to be room for the new school of thought too. Even guys that are doingitwrong are making usable products too; this reminds me of a self-taught guitar player vs. a classically trained one. Some times, the self-taught guy plays notes out of scale or uses chord progressions that make no sense. A casual listener would not notice, it is like nails on chalkboard to the trained ear.
was wondering if anyone could take a look at my question :| stackoverflow.com/questions/11571606/…
"I've been programming small projects in PHP for over two years, just never understood loops" -- this is grievous! I urge you to get a PHP book and learn the basics.
The answer is right there on the question, and we answered in here
user895378
02:11
Please, don't use mysql_* functions to write new code. They are no longer maintained and the community has begun deprecation process. See the red box? Instead you should learn about prepared statements and use either PDO or MySQLi. If you can't decide which, this article will help you. If you pick PDO, here is good tutorial.
user895378
@alexpja
@rdlowrey I can't since I am on a shared server.
user895378
@alexpja if your server has mysql, it has mysqli
user895378
What version of PHP does your shared server use?
of MySQL?
@Chris where in the world can I buy a PHP book, never found a place. Never.
user895378
02:14
the mysqli extension. This function in your code is using the mysql extension:
user895378
mysql_fetch_assoc($result)
Apache version 2.2.22
PHP version 5.3.13
MySQL version 5.1.63-cll
user895378
@alexpja You're on the internet right now. Type amazon.com in your address bar.
user895378
@alexpja Yes, you have PDO -and- mysqli installed. Unfortunately you're using PHP's mysql extension to talk to your MySQL database instead of the other two options which are vastly superior.
user895378
I don't mean to sound harsh, but you desperately need to learn more about the language you're trying to use. Please go buy any book on PHP immediately.
02:19
I am under the age of 18 hence I do not have a credit card, and I do not have a bank account that is not under a custodian, hence I cannot purchase anything online with my own money, besides going to a store and getting a VISA gift card, which is 90% of the time impossible as I have a mother who is constantly wondering where I am going and such, and she wants me to save my money. My father works late hours hence I never see him, so hard to purchase something via him.
@alexpja You are absolutely destroying my defense of self-taught programmers.
anyone has had any experience with setting up GitLab ?
My mother is always like WHY DO YOU NEED TO BUY THAT!?
hence...
There are a ton of tutorials out there too, though
That's how I learned
lol
@alexpja torrents
The first result is a great site for entry-level tutorials
@tereško you can torrent books?
Oh boy you sure can
of course
02:20
I've used tizag for most of my learning process
Don't use w3schools :p
most of books i have read about programming have come from demonoid or isohunt
I don't, they annoy me lol
@Chris ^
user895378
lol so innocent:
and just recommend me a good PHP book and I'll be off torrenting it li
user895378
02:21
1 min ago, by alexpja
@tereško you can torrent books?
@rdlowrey ?
user895378
^That kind of makes me feel like a bad person.
@alexpja , for what skill level ?
I can download your immortal soul as a torrent, are you kidding!
@rdlowrey I buy books.
02:21
i buy food
@rdlowrey I torrent programs :p
@tereško I don't know really lol
user895378
Man if I could torrent beer and hot chicks food I'd never leave the house.
7
@alexpja , what is you skill level , if you cannot thell , i cannot recommend anything
@rdlowrey my exact thoughts about Pepsi
@tereško I don't know, I told you. If there is something I don't know about PHP, I go find a tutorial.
But loops? Loops are kind of.... fundamental
02:24
Yet some tutorials can be worthless reading.
I never use loops, never.
Only when I reallllly need to.
then i you might start with "PHP Masters" ( it's intermediate level ) and then read "PHP Object-Oriented Solution" ( advanced level ) .. and then top it off with "SQL Antipatterns"
mmk, I'll go find them.
if you read all 3 of them , then next step would be language-agnostic materials on architectures and application design
screenshotted for later, thanks @tereško.
@Chris sorry for destroying your defense of self-taught programmers.
@Chris , what are lops ?
02:27
@alexpja I was just joshing you. The guys I was referring to were more like the Drupal core developers and whatnot
@tereško You know? Loops? With the explanditrines and ixtrude core 22; statements?
@Chris joshing meaning...? :P
Duh!
@alexpja joking
@Chris ah okay, thanks :)
user895378
02:29
@alexpja good luck :)
@rdlowrey thanks!
@alexpja - now as for your SO question... you have several correctish answers there, but your comments lead to something else. Do you actually want the loop to stop, or do you want to add a new row every three pictures?
Replied to your comment ;)
we can continue here if you'd like lol.
That's fine
This is a basic approach. Nothing fancy, not taking into account the very good advice that you should switch to mysqli or pdo...
 
3 hours later…
05:37
morning all
Any one here ever worked on Amazon EC2 firewall rules and knows the procedure for the same?
06:31
morning
Bonjour
hey guys.. @hakre @deceze
Salute.
:D
Army man @deceze ?
No, just randomly going through different greetings.
06:44
:)
Yo
hello all
Hello
Any genius in PHP Oauth component?
06:59
Oh.. totally forgot. Amazon EC2 firewall rule addition or some help on how to make rules ? Some help or directions atleast would be nice :)
07:15
So far I have made exactly one EC2 FW rule... was pretty straight forward.
What's the problem?
I haven't tried it as its for my friend
so any good tutorials or some way that I could help him would be nice
Just look in the AWS EC2 console, it's pretty straight forward, really.
morning
@PeeHaa Salue
hmm..
Thing is that I have no idea about it as I have not looked at it.. never used it.. hmm.
@deceze Guess you're right the first step would be to look at it
I'll do that :)
thanks..
07:28
Hy guys?
any one know php oauth integration?
@THOmas Somewhat. Ask your question.
@t
@thoms you asked this question yesterday,
@deceze am trying to create a oauth server and client
the servier is working fine and i created a consumer api key and secret
i replaced the values in client page twoleddged.php and specified a server url for oauth service.But when i run the page iam getting this error Can't verify request, missing oauth_consumer_key or oauth_token----OAuth Verification Failed:
and i downloaded the code from here code.google.com/p/oauth-php/downloads/…
You really, really want that closed, ey?
mh, seems legit
Oh, it's actually a repost... didn't notice. O_o
????
@THOmas ┐(´-`)┌
08:33
@deceze :)
08:53
Hi Guys!
I have thing like this - I use first data application to make checkouts on web store. It uses curl to pass data, but the error it show is "couldn't connect to host*** Invalid query2: MySQL server has gone away". The rest of site works good with mysql connection. But mysql host is "localhost" although it is on a web server. Could it be a problem that mysql host is "localhost" and when it sends data to first data, it receives (or maybe it dont receive mysql host? ) localhost and it is not correct database?
And if web hosting gives me mysql host as localhost, can I ask for a public address instead of localhost?
localhost as seen from a web server is still the web server, it's not your local machine.
Does that help? Otherwise: ┐(´-`)┌
@deceze But localhost differs on each web server.
?
localhost is the local host. I.e. on stackoverflow.com, localhost is stackoverflow.com (speaking simplified).
Hmm, localhost's public name is hosting address, yes?
Unless you have a royally screwed up server configuration, localhost is a loopback address on which a computer can contact itself.
Don't take localhost == "stackoverflow.com" literally, 't was a simplified example.
09:03
@deceze :D I won't take localhost as "stackoverflow.com".
But thank You, I will try.
Are HTML element classes considered presentational?
I'm faced with deciding a class name between "item-yellow" and "item-priority1"
You should give class names by their meaning, not their look.
item-priority1 would be a little bit better
Consider that you may use class names in Javascript to select elements. Now you want to restyle your yellow element to blue. Now what?
@deceze Huh, that would be item-blue
I didn't point out that the difference between priority1/priority2 is the color
09:08
@Christian So you want to rewrite your HTML, Javascript and CSS all together then? Just to change a color?
@deceze Wut? $('a').removeClass('item-yellow').addClass('item-blue');
-_-;;
Works just as well as replace priority-1 with priority-2
You're not separating meaning from styling enough yet.
Naturally, I would do it by meaning if at all possible.
But in this case, the items seem all the same. The only difference is the color.
Even when I mentioned priority, it's not that one is more important than the other, it's just that red looks more important than say, blue.
09:11
The difference between a priority 1 and a priority 2 items is not the color, it's that one has a higher priority than the other. You will probably have some Javascript that deals with this difference: $('.priority1').remindUserNow().
Those high priority items are displayed using a different color, yes.
But that color scheme is irrelevant really, isn't it?
@deceze Nah. I might have used the wrong term there.
Sem
Sem
@Christian Should be 2 classes, item and yellow. Still, don't care about CSS class structures
Maybe today your high priority items are yellow, but next year you want to make them red.
If you name them item-yellow, you have to change the class name in HTML, Javascript and CSS.
Solarized has to be the most well documented set of 16 colours I've ever seen...
If you just name it item-priority1, you can simply change the color in CSS and be done with it.
09:12
@deceze As I said, "priority" might have been the wrong word here.
Whatever it is, naming a class by its looks is bad. The looks are applied through CSS. Don't couple a class name to looks that are applied elsewhere.
Sem
Sem
@deceze $('.item').addClass('priority1') I hope?
@deceze But that's kind of my problem. Between those two items, they just look differently.
Why do they look differently? What's the meaning behind the different color?
The theme kind of. Admin can arrange items in different groups. Each different group has a color associated with it.
09:17
Can you name the groups? group-a, group-b, group-left, group-right, group-1?
But then, the color would loose its meaning. "group-green" points at a group rather than a color.
Hmm, group -$id should work.
For a minute, I thought I've found an exception to the rule. Seems I've got to try harder ;)
So, all good?
yup, thanks.
Sem
Sem
@deceze How would you handle particle images in a background using .animate()?
@deceze can u help me to do oauth?
09:21
@Sem ┐(´-`)┌
@THOmas Again: ┐(´-`)┌
@THOmas You need to give some more details about the problem you have. No idea what's holding you back.
wat u mean ┐(´-`)┌?
Sem
Sem
@deceze Problem solving only huh. Allright.
@Sem I'm not sure what you mean by "particle images in a background using .animate()".
ExceptionRequest failed with code 401: Can't verify request, missing oauth_consumer_key or oauth_token-1-OAuth Verification Failed:
Some one heard of First Data?
09:23
@THOmas Where does that come from, what are the request details, what have you tried, what is your code? Too little details.
Sem
Sem
@deceze I'll make a jsfiddle :)
@deceze i have downloaded the code from code.google.com/p/oauth-php/downloads/…
can u check it?
@THOmas Sorry no, I don't have the time or inclination to dig into some project I have to download first.
Anyone knows of a quick way to checksum files without a 3rd party software?
@deceze that is the php oauth library and one small example only
@deceze the example is not working fine?
09:29
@Truth sha1(file_get_contents($file))?
@deceze I mean in Windows
Arguably the worst possible method though... :P
I know how to do it in PHP :)
@Truth Oh, you didn't say you were crippled...
09:31
@deceze :<
@Sem Nice.
@deceze Windows != Crippled. Probably out of context, but I suppose talking is about web server, yes?
@Sem Wow, sweet :)
@DanielsPitkevičs "Windows != Crippled" - Well, just look at the poor guy, can't even checksum his files... ;)
could anyone tell me why a .html file could have tag like this <?php echo "a"; ?> ,then display correctly ?i thought only .php file can have html tags,
Got a little question.. its most probably stupid.. Actually it is stupid.. but still here goes..

"How to include a file that is couple of folders above the current file?" I tried `require_once('./file.php');` and
`require_once('file.php');` and
`require_once('.file.php');`
but it doesn't seem to be working :(.. Hate when I make such silly mistakes and get stuck there :(
Sem
Sem
09:34
@deceze This has a couple of problems though, older browsers don't like flashy javascript. Maybe you know a way to make this more browser friendly?
then I used ../ and it worked
what is the difference b/w ./ and ../
@deceze That's a bit different. But windows web servers are useful too - ASP.NET (I must say this is one good damn great language) - works best on IIS
in the include or require command
@deceze May be I am a little lazy to search (or ask) on meta, but can we "ask" a new question about how to monitor/look for AJAX requests on Chrome? And may be write an answer with screenshots. The question would be CW (aint doing this for reps). Many newcomers here do not know how to look for it..
@DanielsPitkevičs la la la la I'm not going to get dragged into an OS flamewar today... la la la la
09:35
@ShyamK . = current directory, .. = parent directory
@shyamk ./ means current directory,../ means parent directory
could anyone tell me why a .html file could have tag like this <?php echo "a"; ?> ,then display correctly ?i thought only .php file can have html tags???what about my question,anyone like to help?
Very bad
@Sem Not off the top of my head, no, sorry. Also, the Javascript room is thattaway ---> ;)
@deceze :( I wanted not just OS flamewar, but Server side scripting language flamewar too
Sem
Sem
@deceze I see this place more as a general chatroom :P
09:37
hey guys , what do you think , "help, cannot install GitLab" topic should go in serverfault or superuser ?
@DanielsPitkevičs PHP wins, m'kay? If you want a different winner, try a different room. :P
Sem
Sem
@tereško serverfault I guess :)
@Leigh @RayCheng thanks .. I knew about the single dot but the double dot is new to me.. thanks for the info..
@deceze Well, in this room yes, and I think that PHP is best too, but still, I very enjoy asp.net connection with c# and great usage.
@Thrustmaster You can ask and answer your own questions, there's even a shiny checkbox for doing that when posting the question.
@Thrustmaster I'd think that'd be a good resource to have.
09:44
still a same question ,is it good for a .html file have php code,i knew we could configure httpd.conf file on apache to let apache parse it correctly..
@Thrustmaster Having said that, this is probably borderline on-topic for SO.
@RayCheng I wouldn't call it "good". I don't see what you'd gain by doing it, except for confusing yourself.
@RayCheng , i am not sure what you mean by ".html files" , but it is ok for templates to have php code in them. Only limitation is that you should not have logic in the templates.
hi all
@deceze i'm not doing it,now i have a project it's already became this,
@tereško the templates's extension is .html..
@deceze i just don't know why they did that,
@RayCheng Neither do I. ┐(´-`)┌
09:50
@deceze anyway,thanks,
@tereško thanks too,
the php code that you should have in templates would be <?php echo $something; ?> and foreach ( $list as $item ):
and you should not enable text/html files to be parsed as php scripts
@tereško but i want to know the reason,someone in purpose to let .html could parse php code..
pathological stupidity
hey guys
helllllllllo
android using php libraries
is it a good practice
10:08
@deceze i think i got the reason,for old days ,seo could not get correct infos from dynamic page...so some one find this way...
i suck at writing questions : serverfault.com/questions/409563/…
@RayCheng ಠ_ಠ Hmmmm? Should've at least used RewriteRules instead of that hack...
maybe he is working with 15 year old codebase
which would be really scary
@deceze...old skills ,but if i wan't change it ,i must tell others why i want to change@tereško
in that case , change the company
if you have a lot of developers who never improve or question their own code , the company will eventually implode anyway
10:14
that depend on what kind of the company is,technical company maybe will...
@tereško me too, no answers :( serverfault.com/questions/408263/…
well .. my solutions would be : run webserver on an OS that is for servers
@webbearrto Ah, isse probleme wittha Mario, Ih thinke.
@webarto Start a bounty
It would be answered in no time :)
shiiiii, mario, he no listen, he stupido
@Truth I have no rep ::) Oh I have 100
10:24
How can it happen - script connects to database, creates tables and later it throws an error - couldn't connect to host*** Invalid query2: MySQL server has gone away
may god bless his soul
tell me you are on a shared cheap host?
@webarto Well, I'm not on a shared cheap host
But I also tried to put my website on different server and it throws the same error, and I know that mysql connection has not been closed before execution.
@deceze Hi moderator :)
Greetings
10:36
@Truth , two days required
10:46
morning
can anybody recommend good php library for filtering and validating input data (not Zend Libs) that can work with utf8 data
morning
What do you want to filter/validate?
11:33
Good morning
Good morning to you, fine sir.
why do i keep opening /r/PHP ?!
Dunning–Kruger affected people didn't get anything :)
@tereško There's gotta be a name for that as well. tereško-effect?
its called dunning-kruger effect
maybe dunning-kruger-tereško singularity
11:46
Ah, no, plain old masochism. That was it.
12:20
@tereško Stop feeding the trolls
also, thanks, I shall now reference dunning-kruger far more frequently
@Leigh Likewise, didn't know it had a formal name
@deceze You might as well post your first comment as an answer; if it isn't closed, that's the most valid answer.
Morning all
@Bracketworks ...which will probably be upvoted like crazy. I really don't need or want any more rep for such trivia...
12:55
Hey guys
Hi
sigh What is wrong with people: news.php.net/php.internals/61544
Hey
@PeeHaa dunning-kruger!
@PeeHaa IMO no curly braces should be optional in a language.
Not even for loops or conditions
12:58
@Truth I concur
@Truth I think most can agree with that statement
@Truth Aye
I also loathe endforeach and friends

« first day (643 days earlier)      last day (4529 days later) »