« first day (1050 days earlier)      last day (3913 days later) » 

12:12 AM
hi guys
 
hmm… I feel I must be really strongly in favour of @NikiC 's rfcs with T_ELLIPSIS when I try to defend it on the internals…
 
@bwoebi it's not an ellipsis. it's three dots.
 
he has defined the three dots as T_ELLIPSIS
 
@bwoebi which is incorrect because an ellipsis is …
 
12:17 AM
@Gordon okay… we're going to implement unicode chars in the syntax; no problem...
 
@bwoebi it would work out of the box afaik. the saner choice would be to use *
 
@Gordon the * risk to be not so visible when coding
@Gordon yes… and the users whose os doesn't have a shortcut for that char like alt + dot on os x?^^
they will copy&paste it always from the manual, right? xD
 
@bwoebi Let's triple all the single characters with meaning then &&&$$$foo because &$foo might get overlooked easily
@bwoebi I am not saying he should use …. I am saying he should at least consider putting * to discussion instead of dictating ... because he likes it best.
 
@Gordon no, an ampersand is a big character (occupies many pixels), a dot just a small character...
 
I use youtube api in localhost. It works perfectly. There is no any problem. But on server it does not work properly. I mean when I search for videos it should give me all related videos from youtube. But instead it shows me blank page without errors. So how can I fix it?
 
12:21 AM
@Someone enable error reporting
 
@Someone Or look in the log files for errors.
 
how can I do that in php file?
 
17
Q: PHP: How do I enable error reporting?

LinkskuI recently moved my site from a shared server to my own server. Now, when I have a PHP error, I get a 500 Internal Server Error. At my old host, I'd get something like "Fatal error: Expecting ;". How do I enable that?

 
Hola
 
@Feeds stop spamming.
 
12:24 AM
@Gordon But it is trying to warn us for ze germans!
 
@bwoebi I correct myself: three dots apparently counts as an ellipsis, too. I still like * better
@PeeHaa it's only advertising their talks
 
@Gordon Ah I see. Yep that's an advertisement already
 
@Gordon wait until you have to use&read it… and for asterisks you need to hold the shift key while for dots you don't :-P
 
@bwoebi I find *$foo much more readable than ...$foo. holding down shift doesn't bother me at all. typing both takes almost no time for me.
also given that most coding standards have line limits, putting three char instead of one fills up the limit quicker and I hate putting arguments on multiple lines
 
@bwoebi so you keep the shift key held down while you type the next character anyway. But it's a dumb argument - all that really matters is which is better to read, to understand the code.
 
12:35 AM
@Danack for a $ you don't need a shift key? … but yes, it was more a joke.
@Gordon and I hate coding standards which enforce hard line limits
@Gordon but if people aren't okay with it, we'll see it in the vote ;-)
 
@bwoebi yes - I need a shift key for dollar - so I need shift key for both characters. And hard limits are bad, but incredibly long lines are also bad.
 
@Danack because of 2 chars more a line doesn't explode…
 
@bwoebi no, but that's missing the point. it's to prevent from lines becoming too long with content which is harder to read. So you put a hard limit somewhere reasonable but then you obey that.
Once you waded through a couple hundred lines with HTML, CSS, JS, SQL and PHP mixed and averaging at 400 chars per line, you'll appreciate ;)
 
@Gordon This. And all of it concatenated together
 
@cspray exactly
 
12:45 AM
@Gordon as long as it fits in a 1920px wide line in font-size: 12px; it's fine…
(at least because I anywhere use smaller screen sizes…)
 
@bwoebi uuh, no :)
 
but that's then max. 1% of code which has so long lines
 
I've seen JavaScript created with this kind of horrible formatting in PHP
Like, hundreds of lines of JS like this
 
I find 80 chars completely reasonable. if you need to exceed that you are likely having a code smell anyway
@cspray $mail[] = noob('<td width="100" class="active">'.$foo. moarandmoarandmoar …);
I've been through hundreds of lines of this
 
@Gordon Yes. The things I've seen done with strings and concatenating is borderline abusive
 
12:48 AM
the dev who wrote that asked me why it wouldn't collect the html in $mail
 
@Gordon 80 really isn't that much
 
the noob function did this:
function noob($s)
{
    return echo $s;
}
 
@Gordon
 
and when I asked him why he was littering that all over the place he said: if I cannot write a simple function like this, then I am a noob
at least he had some self reflection :)
oh and of course there was no reason to capture it in $mail at all. When I asked him why he put that there he said because we might maybe need it in the future
I didnt bother asking why he felt it should be captured in an array instead of concatenating
@PeeHaa its sufficient for most code I do
im off to bed. nn
 
@Gordon Once you have to add a third param to a method you will already go over 80 chars
@Gordon night
 
1:08 AM
Personally I like 80 as a soft limit and 120 as a hard limit
 
With that I can live
 
Although I really need to start running some phpcs on my stuff. I've been inconsistent lately with some things
 
@PeeHaa Nice, I'll have to check that out
 
1:30 AM
Hey
 
@LeviMorrison Howdy
 
Are the allowed PHP function names and class names the same (disregarding aliases)?
 
@LeviMorrison Not sure what you mean? But the regex that validates class and function names are the same according to the docs
 
@cspray Can you provide a link to me?
 
http://php.net/manual/en/functions.user-defined.php
http://www.php.net/manual/en/language.oop5.basic.php
 
1:38 AM
people here?
 
@TheGuyWhoCouldn'tTalkToTheGirl Sometimes I count as people
 
lol
@cspray Here is a question for you: What is the for loop equivalent of the following while loop: while (0 != array.length) {
 
@TheGuyWhoCouldn'tTalkToTheGirl /shrug why are you trying to change it to a for loop?
 
Because I want to as well as need to understand what is actually going on in that condition and currently I can't understand anything.
 
@TheGuyWhoCouldn'tTalkToTheGirl Well, what is the code block doing? It seems likely they are removing some elements from the array until it is empty
Or possibly just adding one element to an array
It is hard to say without actually seeing the code
If this is for some established, legacy code base I would advise not changing that to a for loop though
If it is working let it be a while loop, there's nothing wrong with it
 
1:50 AM
I figured it out, but the code came from here: stackoverflow.com/a/2450976/1079641
 
2:01 AM
@TheGuyWhoCouldn'tTalkToTheGirl can. I. haz. a. pic.
 
2:30 AM
pic of what?
 
^ i don't understand anything about what you both are talking about. lol. haha
 
2:46 AM
Laravel 4 - How to add a named route to resource controller ?? i tried this but it doesn't work paste.laravel.com/MYN
 
^ im doing L4 now too. lol
there are automatic named routes of the controllers
Route::resource('admin/clients', 'ClientsController'');
then you should be able to access the names 'admin/clients.{action}'
laravel.com/docs/controllers#restful-controllers there is a Route Name column there
 
3:05 AM
@TheGuyWhoCouldn'tTalkToTheGirl project
 
@CCInc This doesn't really have to do anything with the other project, but I will show you the image once I am close to being done ;)
 
lol
 
How many Windows users use Safari % wise, compared to other browsers? I know support was dropped in 2012, I just need to know if enough people actually still use it to make it worth developing for.
 
@CCInc i can't say about windows but google gives this as first result netmarketshare.com/…
@CCInc safari is the default browser of macs and iphone/ipad
 
3:15 AM
Yeah, reason I ask is right now it's a windows app.. so...
hmm
I bet the format's the same though
so best I add it, in case I ever develop for mac
 
if it works on chrome, usually it also works on safari..
since both are webkit.. but not 100% accurate
 
I'm making a browser syncing tool. It syncs history, bookmarks, passwords, etc
 
like google chrome's?
 
?
 
@ircmaxell I cnt find an alternate way to do so, as salt is always randomizing the hash string so I cannot use something like where uname = user and pwd = hashed string, still I wil think over this, let me see ifm missing something
 
3:17 AM
@CCInc support.google.com/chrome/answer/165139?hl=en signing in to chrome syncs all your info on your account..
 
Right. Like that, except it syncs all browsers.
 
@CCInc that would be cool if it's cross browser.. so i suggest you definitely consider safari too
FF,Chrome, Safari, Opera and IE <~ they usually are the options you need to consider..
 
Big five.. yeah
What OS do you own?
 
win 7, 8, android ICS, win mobile
 
Ah... hm, okay
 
3:26 AM
debian on the vps.. hmm.. well sadly that's all i can test on..
 
 
1 hour later…
4:52 AM
@Mr.Alien No, you don't want to do WHERE pwd = ?, for a number of reasons
you want to fetch the user, and then hash the password in a second step
 
5:13 AM
@ircmaxell I understand the technique but specifically what are the reasons for not implementing the hash in the query? Possible insecurity in the communication channel between the database client and server? Potential that query logging can be turned on leaving the supplied password visible?
 
5:42 AM
When writing doc blocks for method calls should I type parameters and return values using the fully qualified type or the local one?
@param MyClass
      vs
@param \projectNamespace\currentNamespace\MyClass
@LeviMorrison eheheheh blinker fluid
 
@Orangepill You are the first to comment on it :)
As for your question on paths, it's really for letting the user know which type as well as tools. I've done both, depending on the context.
 
So for a used by the masses api I should probably fully qualify them?
 
From what I know about the situation, yes, fully qualified paths could be good.
 
5:59 AM
Thanks.... I was sensitive to the blinker fluid thing because my old room mate in college attributed all unsolved automotive problems as having something to do it. That was the first time I saw someone other then him use the term
 
@ircmaxell yes I didn't, what am doing is select pwd where username = :username and the next step is password_verify($_POST['pwd'], db_pwd_here)
 
m59
6:17 AM
I am trying to search some html and pull out these:
position="foo"
position="bar"
position="etc"
preg_match('/position="([^"])+"/', $tmpl, $positions);
but I just need to capture the stuff in between the quotes into the array
^ that didn't do it.
 
move the plus into the capture group
/position="([^"]+?)"/'
 
m59
ah, hm
 
? mark is to make it not greedy
@hamza is the preg god though...
 
dvl
any joomla experts here ?
 
m59
@dvl I know some
 
dvl
6:21 AM
I am working on a website: humandiscovery.com
 
m59
@Orangepill I'll have to study the greed more. I still don't get how to apply it.
 
dvl
When I am opening this site on my phone... and whenever I click any menu link.. I am redirected back to the home page
Is there any particular reason ?
 
m59
That would be really tough to debug without knowing a ton about your setup.
It doesn't sound like a Joomla problem.
It sounds like a mis-configured component.
Do you have anything installed that is mobile-related?
 
dvl
The menu itself is specific to mobile.. rest is all same
 
m59
that's probably the problem, then.
 
dvl
6:24 AM
The site works well on desktop, laptop and iPad
but I am not able to find any configuration related to redirection in the menu module
 
m59
I dunno...Joomla plugins are a mess like that sometimes.
 
dvl
Can this be related to SEF URLs ?
 
m59
Could be, yes.
 
@dvl cannot reproduce on android (Jelly Bean) with chrome
 
dvl
Its amazing that other menu modules are not showing this problem
 
m59
6:26 AM
Then scratch the SEF lol
 
dvl
I tested on android(3.6) with inbuilt browser
 
what os/browser are you running on your phone.
 
dvl
and iPhone 4.. safari browser (inbuilt)
 
m59
@Orangepill the captured results - it gives me the whole match and the capture groups separately, I just need the groups. I'm assuming that I should just take myArray[1] and use it? Or can I make it not send the match to the array?
 
dvl
Let me try a few things in a minute.. will be right back
 
6:31 AM
myArray[1] will alway be your first capture group... myArray[0] will be the portion matching the entire pattern.
 
m59
using preg_match_all, btw. Yeah, I was just making sure there isn't a more direct way. Obviously, no problem to just use that.
 
@m59 what are you going to do with it if it matches... preg_replace or preg_replace_callback may be helpful for you
 
m59
just outputting a json, (listing them)
 
@m59 So you are extracting data and tossing the source document.
 
m59
yep.
 
6:35 AM
so preg_match/preg_match_all is the right function to use
 
m59
$foo = simplexml_load_file('foo.xml');
$foo->bar = [];
 
@HamZa if you want to pick on some code check out github.com/cgray/geronimo
 
m59
How to make that work according to SO post: $foo = array( (string) $xml->channel->item->title );
I don't get it.
Oh, there's a lot more to this whole thing. I was thinking it was just an object.
 
all I know is from my experience simplexml tends to give you strings and arrays interchangeably ... this code just seems to force the output to an arry.
simplexml is a little schizophrinic
if you have a document that can contain 1 or more foo elements under the document node, if there is 1 $doc->foo will be a simplexml node object, if there is more then 1 then it will be a simplexml node list. (the nameing of the types is my own but it should get the idea across).
 
m59
$foo = json_decode(json_encode(simplexml_load_file("foo.xml")));
ftw @Orangepill :)
There really ought to be a shorthand of that.
 
6:50 AM
@m59 that is shorthand compared to the way I always tackled it... I threw my hands up long ago with simplexml and use DomDocument now when I need to parse xml
 
m59
lol
my xml is 3 lines :)
 
why are you using xml then.... json up that shit
or ini
 
m59
Just easier on the eyes, I guess.
<template>
  <title>Template Name</title>
</template>
 
you may want to have your eyes checked :D
 
m59
hahah
 
6:52 AM
[template]
title = "Template Name";
parse_ini_file($filename, true);
 
m59
{
  "title": "Template Name"
}
lol, I guess I'm just used to it from Joomla or something.
 
@m59 That's money right there ...
 
m59
Though, I do hate Joomla ;)
 
XML is for when you are talking to Java or you did something bad and you want to punish yourself.
 
m59
hahaha
Java doesn't have json?
 
6:56 AM
I believe it does...
 
m59
Your statement about "talking to Java" confused me.
 
Java just tends to be XML heavy..
 
m59
Sounds fail.
Java always sounds fail.
 
Java was a good idea... write once run anywhere.
Surprisingly though I can do the same thing with php, perl , ruby , javascript,...
"Saying Java is good because it works on all operating systems is like saying anal sex is good because it works on all genders.”
 
m59
7:11 AM
haha. Ruby looks pretty sweet.
It's closer to js, which I love.
I like php, but it's more because I like web development so much.
That foo->bar and foo['bar'] aren't interchangeable drives me crazy.
"{$however}, this syntax is totally win."
 
you mean as in ${$however}
 
m59
....
no idea.
 
variable variables?
$a = "hello world";
$b = "a";
echo ${$b};
 
m59
$foo = "my/path/{$someVar}/{$someFile}.html"
I mean concatenation.
 
ahh variable interpolation.
 
m59
7:21 AM
Alright, sleepy time. Night dude!
Thanks for the help!
 
8:38 AM
guten mornings
 
gm everyone :3
 
hakre, that is really or fake? >.<
 
wow quora is awesome
 
@Tarun who is quora >.>
?
 
Good morning everyone :)
 
@Adrian.S a happy new day sir!
how is localhost going?
 
9:16 AM
Not so great, haha
having a hard time with ajax :(
 
@Adrian.S what? :S
Isn't too hard, come on :S
 
@MarcosEusebi playing around with a infinite scroll system, but then once I implemented that my like/dislike ajax stopped working :|
I'm still a newb when it comes to Ajax :P
 
Sec
Let me do a code.
 
and it works as intended, but then my like/dislike system stops working :(
 
10:14 AM
@Adrian.S jsfiddle.net/JMDXv/1
try that
just ajax missing
the v3
 
10:41 AM
@MarcosEusebi , @Adrian.S : please go to javascript chat room
 
whats the best local version-ing tool available ?
 
I was wrong :s
 
@TheLuckyGoof git ?
 
@tereško git desktop(local) version-ing ?
 
what "desktop versioning"?
all the commits in git are local
 
10:45 AM
@tereško i mean within our local network we want to have a local versioning software
 
what
then install a repository in your local network
git !== github
 
am installing github for windows
 
WUT ?!?!
there is no "github for windows"
 
oh .. gods
you have completely no clue what you are doing
7 mins ago, by tereško
git !== github
did you understand what that line meant ?
 
10:54 AM
both r not equal!
 
then why are you downloading "github for windows" ?
 
git is a repository data system storage
same as SVN or CUT
I guess, for a project
or something like that
 
Anonymous
The difference I can't get is b/n gist and repos
 
@tereško Am just trying the App(for the very 1st tym), its pretty well to maintain local repositories, let me explore to find what more i can do with github for windows
 
Anonymous
@tereško got a question.
 
Anonymous
10:58 AM
I swear, its not dumb one this time
 
that would be a welcome change of scenery at this point
 
Anonymous
E_VAGUE
 
Anonymous
@tereško what say you?
 
Just, nothing >.<
@tereško are you a developer?
 
@Simon_eQ well .. ask, I you are gonna
 
Anonymous
11:03 AM
Ok, let me draw this first :)
 
sadly 'github for windows' is sync-ing with my github account, but i want to maintain a local repo with versioning
 
thanks let me try
 
Anonymous
 
Anonymous
check this out, I am litterally making 6-7 queries on a page refresh, and just to minimize the amount of query
 
Anonymous
11:08 AM
I was thinking, maybe after the first page load, I could assign some results to sessions
 
Anonymous
and just display the sessions values instead of new queries
 
Anonymous
for ex: if page is first loaded I could assign $_SESSION['top_5_news'] = to the result of the query
 
@MarcosEusebi no, as a day-job I catch small children in Texas and sell them to North Korea
 
Anonymous
and then, just show the sessions-based values after that
 
Anonymous
@tereško what think you?
 
11:09 AM
reading .. looking .. wait
 
Anonymous
the overall idea is not to have to make 6-7 different queries, to show the same result every time the page is loaded.
 
First of all, sessions are not form of cache. If you want to store some data for quicker access, use APC (or some distributed cache, if you have several servers).
 
Anonymous
for example, the queries on the right side, are not likely to change during the user's browsing time.
 
That said, 7 queries are not a lot. You should do some benchmarking, but I would estimate that the whole page is still generated in way less then 0.4s
 
Anonymous
@tereško may not be a lot, but this is a simple example. And the idea is how to minimize redundant queries.
 
11:12 AM
@Simon_eQ Here's a cool little method of speeding up the site reddit.com/r/webdev/comments/1kf84d/bustlecoms_speed
 
Anonymous
@Fabien thanks. You're always to the rescue :)
 
Also, I suspect that "latest blogs" section could be queried in a single request
 
Anonymous
@tereško Yea, that was not a best example, but imagine for a bit, if you had 100 different queries. An advanced know-how about mysql would probably help, but Would APC be your only option in that case?
 
Just don't overdo the optimization. First of all you should determine even if your 7 queries are causing ANY issues
 
@Simon_eQ Also @Simon_eQ, moqups.com might make things a little easier to draw out.
 
11:16 AM
@Simon_eQ If you have 100 queries, then at first you should look at what the hell is going on, because 100 queries per page is not normal
Do not optimize for optimization's sake
 
Anonymous
@tereško lol, true. But, I would assume most social sites may have that much queries.
 
Anonymous
I could be wrong though.
 
Anonymous
as I am frequently wrong about things. :)
 
Anonymous
@Fabien seen that before.
 
Yeah, my CTO had me increase the MySQL connection limit from 900 something to 1400 because we had " 1040 too many connections". The real problem was not the number of connections.
 
Anonymous
11:20 AM
@Fabien Do you really use that moqups?
 
Anonymous
It doesn't seem healthy approach to me.
 
@Simon_eQ nah, but I used similar tools. Only for drawing stuff out, never for actual usage.
gliffy.com is another good one, good for DB Schema too.
 
Anonymous
You are like an encyclopedia of links.
 
heh. I am quite the bookmarker yeah. Runs the risk of a lot of crap ones though because I never usually have time/reason to look at them fully.
 
Anonymous
@Fabien that digg article was short, but the site is really fast
 
11:28 AM
Yeah, he doesn't go in to much detail but provides some methods to look in to.
 
Anonymous
I am sure, even @tereško will be surprised.
 
Whether it's applicable to what you wish to do is a question too.
If you're using this as a method to really look in to site speed check out stevesouders.com/blog/2010/05/01/har-to-page-speed
 
Anonymous
sadly, the only image is that comes to mind, when I hear "rails" is a train track.
 
Anonymous
Anyway, speed is the least of my concerns right now.
 
Anonymous
As I need to have a good understand of PHP at the moment.
 
Anonymous
11:32 AM
what say you code acadamy vs tree house ?
 
Did you pick up that book @tereško recommended about OOP?
Aren't both those more targeted to beginners?
 
Anonymous
@Fabien Didn't try them both, but I have skipped lots of things, so I could find a surprise here and there, who knows.
 
Anonymous
@Fabien are you checking out geronimo?
 
Yeah, i get a lot of email alerts. Has it been githubbed yet?
 
11:38 AM
@Fabien the main "OOP book" that I recommend is PoEAA, but one need to understand quite a lot to start picking at it
 
@tereško I'll bookmark that for a few months down the line then. martinfowler.com/eaaCatalog must be a useful reference tool after you've read it.
 
yes and no
patterns are not tools for developing , instead patterns are tools for explaining what have you made
 
@tereško Which I feel is very much the thing I need to learn most atm
 
Anonymous
@Fabien what do you think about the repo?
 
@Simon_eQ it's a good start, I get the impression OrangePill knows a lot more about OOP than the rest of us ;)
 
Anonymous
11:45 AM
@Fabien I think he got carried away and finished it by himself.
 
Anonymous
I don't understand any of it
 
Anonymous
this is why I said, lets start small
 
Anonymous
so, we could be on the same page.
 
Perhaps it'd be useful for him to webcast run us through it then, if he's ok with that.
 
Anonymous
@Orangepill Please do this ^
 
Anonymous
11:47 AM
What I am going to do now? waste time to learn about how the code works?
 
Anonymous
arghhh... good job btw.
 
:P
 
Anonymous
if Orangepill was a football player, he would be Samuel Eto.
 
Anonymous
No teamwork :)
 
lol. I think he was just excited to work on a project. It's still a good learning opportunity for us which is what this was primarily about.
 
Anonymous
11:51 AM
Well, yea. I wanted to start from scratch.
 
Anonymous
@Fabien make sure to star/fork/commit ..
 
@Fabien compared to ircmaxell and gordon, he know approximately "nothing" about OOP
 
hi
 
Anonymous
@tereško bullshit. "nothing" is mine
 
@tereško lol. I'm not sure if that's more worrying for me :P.
 
Anonymous
11:53 AM
and mine only.
 
.. any "un-approximate" estimate could be explained by statistical error
 
Hi @Rishi
 
@Fabien hi
 
Anonymous
$read = file_get_contents('rob.txt');
$newValue = $read + 1;
fwrite(fopen('rob.txt', 'w'), $newValue);
 
Anonymous
How about this to write page visits to a file?
 
Anonymous
11:54 AM
I need to record page visits of my site, on a plain txt, instead of storing it to db
 
Anonymous
@Fabien better approach?
 
@Simon_eQ why not simply use google's analytics or w3counter?
 
Anonymous
@tereško speed is the name of the game
 
Anonymous
I know about those two.
 
sqlite?
 
11:56 AM
since it would use external resource, speed would not be an issue
@Fabien SQLite's selling points are portability and small footprint .. not speed
 
I'd go with GA too personally. They do a good enough job.
 
Anonymous
@tereško not sure if I get that. But, I had once to put some code of Google's analytics to let is do its job
 
@Simon_eQ then you probably did it wrong
the way it works is that you put a script at the bottom of your HTML doc (after all other scripts of yours)
 
Anonymous
> you put a script at the bottom of your HTML doc
 

« first day (1050 days earlier)      last day (3913 days later) »