« first day (1285 days earlier)      last day (3648 days later) » 

8:00 AM
I try to :) but what I am doing now feels like a steep learning curve
 
8 hours ago, by HamZa
ow ow ow, my last non-regex, php answer is from Aug 12 '13...
 
( bootstrapping/ autoloading etc ) and then showing a view the right oop-way.
 
@HamZa rofl
@Duikboot I also felt like that when I started answering in JS/PHP tags
 
@SecondRikudo You finally got that job as a porn fluffer?
gratz :-P
 
@Fabien Yes, their back end is in Java
 
8:02 AM
@SecondRikudo Going to learn?
 
I thought I'd take this opportunity to explore other areas, yeah.
 
Sounds like a good opportunity.
 
inroite
 
Nice. Well congrats again.
 
8:06 AM
@HamZa it is low quality, but shouldn't be closed imo
downvote seems adequate for lack of minimum PCRE knowledge or minimum debugging effort
 
@FabrícioMatté I'm tired of escaping problems
 
I'm tired of 99% of the questions posted on SO lol
 
focus on specific tags
 
@FabrícioMatté There's a lot of duplicates, tired to search for one. So I closed it as typo
@tereško I'm focusing on regex
 
lol, then you might need to visit a specialist
 
8:08 AM
8 hours ago, by HamZa
ow ow ow, my last non-regex, php answer is from Aug 12 '13...
 
Herro all!
 
morning Jimbo
 
It's a good day, and I haz 10k! :-)
 
@Jimbo congratz
@tereško ehehehehe, I'm still waiting for your awesome MVC example on github :)
 
@Jimbo gratz
 
8:10 AM
How do you refer from your 'public' or 'www' folder to a view? I would simply start loading a view as basic start.
 
@HamZa why ?
 
@Duikboot framework usually provides a base_url function
 
I am not using a framework.
 
@tereško Well I just wanted to see an example how you do it
 
@Duikboot I have an APP_ROOT constant or variable on my bootstrap file.
If you feel fancy, have an AppConfig object.
 
8:12 AM
Do you have a bootstrap file with a composer.json?
 
@Duikboot Can't say I used composer much.
 
@Duikboot, your /public/index.php file contains basically one line <?php require '../application/bootstrap.php';
 
^ And it's the only file that's actually public
 
the bootstrap then routes the request, loads the classes and calls methos on theose instances
 
Oh wait
I Was just doing that Ill push it up to git
 
8:13 AM
What's peoples thoughts on __DIR__ . '/../'; vs '../' ?
 
I actually use former
 
@Fabien I generally keep the root folder in a constant and work it up from there.
 
What about dirname(__DIR__)
 
@Fabien former, the latter is relative to the starting script IIRC
 
Rather then try to work backwards from my current directory.
 
8:14 AM
@Jimbo what's the point?
 
@Fabien always use absolute paths where possible, assuming the cwd is something in particular is effectively relying on global state
 
Typically I always use full paths when I can. ^
 
@SecondRikudo Congrats on the new job! What are you doing there and how's it going? Don't tell us you defected to another language like Carrie, the judas
@tereško I just don't like lots of ../../../../../
 
@Jimbo so , you think his is better:dirname(dirname(dirname(dirname(dirname(dirname(__DIR__)))))) ?
 
8:17 AM
ehehehe
 
Gah, I think they're both crap, but okay, what about just one dirname vs ../
 
I use __DIR__
 
Everything in moderation right ;)
 
@Jimbo __DIR__.'/../' looks more intuitive
 
:D
 
8:21 AM
@andho Even only singularly?
 
@Jimbo for me yes
dirname doesn't tell me that it removes the last (path?)
i'm expecting the dir name from the input and if the input is a dir then why is it removing it
 
because directories are inside directories too ...
 
because it's not called parentdirname. that's the problem
or just, parentdir
 
I once saw this used in a company:
define('CONFIG_CMS_ROOT', "http://$_SERVER[HTTP_HOST]/cms/");
define('BASEHREF', "http://$_SERVER[HTTP_HOST]/");
define('FILEHREF', "http://$_SERVER[HTTP_HOST]/");
define('ABSOLUTEHREF', "E:/wamp/www/");
define('SESSION_PATH', "E:/wamp/session/");
define('SESSION_NAME', "websitename");
define('CONFIG_CMS_PATH', "E:/wamp/www/cms/");
define('IMAGEMAGICK_PATH', "E:/wamp/ImageMagick/");
What do you guys think about it?
 
I think they should use a Config thingy
 
8:26 AM
@HamZa could refactor a bit and use SERVR_NAME instead of HTTP_HOST but yeah
 
@Duikboot you might find this helpful: stackoverflow.com/a/19309893/727208
 
among other thoughts
 
@HamZa I tend to avoid defining constants, because they represent immutable global state
 
@andho you mean a standard object with config?
 
yay Joomla getInstance
 
8:28 AM
here is a rule of thumb that I came up with just now: if codebase contains a method called "getInstance", it is crap
 
@tereško oh that company used the "include" pattern. Not sure if that's the right name but there was no class or anything.
 
@tereško lol
 
oh .. .. include oriented programming
 
@HamZa something like a config library, Zend\Config or whatevs
XD
 
I see...
 
8:32 AM
foreach ($files as $file)
{
    // trolololol
    include $file;
}
 
Dec 18 '12 at 17:00, by tereško
class SomeClassThatIsInheritedByEveryOtherClass{

    function __get($objName) {
        // Try Load dynamic module from disk
        if (!isset($this->$objName)) {

            $fName = strtr($objName, array("." => "", "~" => "", "/" => "", "\\" => ""));
            $fName = dirname(__FILE__)."/modules/".$fName.".php";
            if (!is_readable($fName)) return NULL;

            $this->loadClass($fName, $objName);
            $this->$objName	= new $objName($this);
        }

        // Return pointer on object
 
hi..
 
Sweet mother of god
 
ahahaha
 
Every'Other'Class?
 
8:34 AM
@tereško github.com/… :)
 
@tereško oh god no. The return NULL should be cached to reduce disk IO.
 
@tereško what the actual fuck
 
i want to make an rss feed for the android appstore. but how do i do it.
 
when i get home, I will show unedited version of that code
since I have left that company
@Leri I stand by my previous statement
 
@Leri interface getInstance {} lolol
 
8:38 AM
I agree with it as well. That is just statistics how fucked up php projects are.
@Jack If @JoeWatkins's RFC about internal classes was accepted we could get something really interesting.
 
Hmmm
 
@Leri where is that?
 
@andho Oops, I meant anon classes. And here it's.
 
Ok good, I made it.
https://bitbucket.org/duikb00t/learning-autoloading/src

This exercise is loading 1 view from the bootstrapped file.

Next up is to find a way how to interact with model view controllers to load pages dynamically.

So I can link to a controller and do something like:
return View->render(mypage.html);
 
@Duikboot I'd change www to public btw. It's small but should you ever want a subdomain it'll be less confusing.
 
8:43 AM
If a person never rejects, (s)he will eventually fail too many audits. A bigger problem is reviewers who accept everything except audits.... — S.L. Barth 20 mins ago
lol
 
@Duikboot view is not a template
 
@Jimbo heh, I'm going to be a JavaScript developer in Taboola, with touches of Java here and there
 
I know that's bad naming.
 
How is your JavaScript @SecondRikudo?
 
@Fabien Pretty good
 
8:45 AM
@Leri no having nice things ... because php ...
 
Got anything online (repo)? :)
 
template = a holder for views you mean? ( @tereško )
 
Also @Duikboot views isn't templates. :)
Oh @tereško is addressing it. nm.
 
template == like layout?

You pass views into layouts/templates.
 
view selects/works with templates.
 
8:48 AM
@Fabien No, AFAIK it's an internal repo
Besides, I only started to work today, give me a break :D
 
@JoeWatkins There was another thing that was missing in RFC (or I am missing information) how anon class could be defined in internals?
 
@SecondRikudo Bleh. Ah well. I trust your good enough was just looking for a potential learning resource :D
 
(I'm chatting here while downloading and building my environment :D)
 
morning
 
@PeeHaa Morning
 
8:49 AM
morning @PeeHaa
 
@Leri doesn't really make sense ... plus whenever I look at the rfc index it puts me in a bad mood, php is missing a bunch of stuff that people already wrote ... here's another brilliant one of @ircmaxell wiki.php.net/rfc/protocol_type_hinting
 
morning @PeeHaa
 
no having nice things ...
 
So where am I doing it wrong? :) Hi Peehaa.
 
@Duikboot view assembles the response from multitude of templates
 
8:51 AM
moin @PeeHaa
 
I used 1 of your repo's as an example for learning myself autoloading etc.
 
anon classes was always confusing to "read" when doing Java. Because I didn't know what the hell it was :)
 
pure energy out there in the universe. ready to slip through time and space.
 
someone should update this one: ekisto.sq.ro
 
@JoeWatkins Yeah. Well.. The only real argument was: We already have closures... Anyways, I appreciate that many good thing is still made.
 
8:55 AM
Yay >> Received a badge. "Active member for a year, earning at least 200 reputation. This badge can be awarded multiple times."
 
@Duikboot gratz :)
 
@Leri ...
I am having a hard time picturing a real-world use-case for this.

-Rasmus
first reply ...
 
May I have question about Mod-Rewrite?
 
internals are dicks, there about 8 people I have any time for and most of them are in here everyday ...
 
@JoeWatkins Hey, that sounds familiar.
 
8:58 AM
@Boris_yo just ask!
 
@Boris_yo What color has the t-shirt you're wearing?
 
Then again, there will be many people who think that what they have just cooked up in their php garage is the next big thing.
 
and they get drunk in awesomeness.
 
My iOS app works ... my job is done here ;-)
 
/me goes grumbling to work, where at least the code I write is used ...
 
9:02 AM
Jack flies off in to the atmosphere
 
/me does the same
Later
 
lata
 
What's the job about @SecondRikudo? Please say killing kittens
 
9:05 AM
The guy responsible for deployment/server management and development has left the company where I work. I am now responsible for this.
All the websites are in the /home folder -_-
 
@SecondRikudo What's that? ads?
 
@PeeHaa Sorta
Content recommendation ("Articles you may like:")
 
have a question
There is a many to many relation in ERD is it valid ?
to break down the many to many relation and make another table to store the both tables information. In ERD or its the DB Level thing to do ?
 
@tereško lol I think I am one of the highest "buildings" in a city. I indeed highly doubt that is correct :P
The github map that is
 
@RanaMuhammadWaqas an ERD represents how your DB is built (relation between tables, indexes etc...)
 
9:08 AM
2012 lulz
 
anyone has some basic sf2 knowledge? I have a services.xml which contains a service, I then extended that service class and now want to "extend" the service in the services.xml as well - e.g. just adding two constructor parameters, the new service configuration should inherit from the previous one. possible?
 
@RanaMuhammadWaqas I think normalisation helps remove many-to-many relationships. The ERD represents your DB, so you'd normalise in an ERD first, then create your DB schema from your ERD
 
@SecondRikudo damn I think I understand why they needed a frontend developer...
 
@Jimbo so you are telling me that breaking the many to many relation is valid in ERD ?
@ham
 
@RanaMuhammadWaqas You don't 'break' it, you 'normalise' :-) I guess your intermediary table might be many to many, but it's just a "link" table. I googled and found this video haven't watched it yet.
 
9:10 AM
@HamZa Why's that?
 
@PeeHaa i have my own town
 
@RanaMuhammadWaqas If you ping me, please at least give me a sentence to read...
 
ok .. UK people, what can you tell me about XCRI-CAP ?
 
@SecondRikudo this is how it looks
 
is it wide-spread in united kingdom ?
 
9:13 AM
nevermind, I think I found it.
 
I can tell you I had to google it -_-
 
@HamZa lol
 
@tereško Never heard of it tbh
 
@Jimbo , @Fabien .. I am loking at you guys
 
lol for spome reason @pekka's head always stands out :P
Not sure if man-love
 
9:14 AM
lol
 
;-)
 
kekekeke
 
what about other countries in EU?
@hakre , heard about XCRI-CAP ?
 
@HamZa I am sorry, it was a mistake
 
@tereško Never heard of it tbh
 
9:18 AM
tsup guys!
howzit goin?
 
@SecondRikudo oh, I just opened it in firefox and it's not showing a page from the 90'. Make sure to support Opera while you're there :P
Hey man, nice and fine!
Welcome!
 
@HamZa I think there's a problem with your Opera, not our site :D
 
I know too basic is not really a valid cv reason, but
0
Q: redirect of session does not equal admin

user3523964is it possible to redirect to a designated page if the session does not match a name, for example <?PHP session_start(); if (!(isset($_SESSION['login']) && $_SESSION['login'] != '')) { header ("Location: login.php"); } ?> The above checks if the session exists and if not redirects. Can anyone...

WTFBBQOMGLOL
 
yo guys, who's familiar with git here?
 
@SecondRikudo awww so cute, getting in defense mode for his company :D
 
9:20 AM
@HamZa good to hear man!
 
@jimbo there is an argument about it
normalizing the table as you said so we make a 3rd table which satisfy the anomalies but that table is not entity right ? because it have just foreign keys . And ERD is Entity relationship Diagram so why we putting a thing which isnt entity at ERD level ?
 
@HamZa :P
 
who still uses opera?
 
tereško
 
@RanaMuhammadWaqas Nope it's not an entity, it's just a link table. But it still belongs in an ERD because the ERD is there to show entity relationships and if an entity has a relationship via a link-table, that's important to know
 
9:21 AM
@RanaMuhammadWaqas aw man, are you coding in php?
 
@RanaMuhammadWaqas Don't forget an ERD is really just for transforming into a DB schema at a later date, so you might as well include all relevant info in there
 
@pythonian29033 it was great, it's crap since they removed all the great features.
 
@HamZa yeah
@Jimbo Thanks man that answer my question somehow ;)
 
@pythonian29033 just throw your question at us
 
@tereško nope, not so far.
 
9:26 AM
user image
4
 
lol
 
git noob btw;
so I just did a commit, simple string change and added a pic to the project, but when I went to create the pull request for it; I look under the 'commits' tab, and instead of just my changes, I see a million other commits there. . .wtf?
 
here's my workflow:
git pull origin master -> get latest version
-> work on something
git add * -> to add files I created, if you added just one file you might use git add test.php
git commit -m "comment what I did"
git push origin master -> push my work to the server
 
better to work on pr's in branches really
 
5
Q: Community ♦ bot doesn't like markdown?

AdityaRecently the Community ♦ bot was ran on Ask Ubuntu Meta to migrate all the MSO links to MSE links. But in the process, the bot converted all the posts written in markdown to HTML. An example preview: This bot doesn't like markdown and I want it to be handed a time-bound suspension. It has vand...

 
9:33 AM
yes, I'm merging a branch here
 
@HamZa your workflow there is probably the root of the problem isn't it, our of sync master ... if you work on a pr in a branch you can keep merging master into your local master and then pr branch while you work on it ...
 
I am little bit stuck and need some architectural suggestion. Context
 
@JoeWatkins I get lost when using branches, probably because I never read/used it...
 
Additional information: DBMS is SQLite and I write inline sql in DAOs.
 
Hnnnng being forced to use cPanel
 
9:37 AM
oooooh
I know that one, @Leri
 
sorry guys, noob error; I looked at the commits before I selected the branch to merge into. . .may bad! nevermind
 
I just can't really tell you how to do it in java :\
 
but otherwise how's it? with the rep on the downlow and all?
 
@Ocramius Just algorithm/idea is perfectly fine.
 
@Leri common ORMs put fake objects on the collections
Something like this PersistentCollection
 
9:40 AM
@HamZa git pull && git checkout -b feature/hamza_regex && git commit ... && git rebase master && git rebase -i HEAD^n && git push -u origin feature/hamza_regex :D
 
@TOOTSKI I've no idea what you did there :O
 
You should work in branches if it's a feature because master will likely be out of sync soon (if multiple people working) and you can't merge in that case. What Joe said actually :)
 
@Ocramius That's too much overhead for mobile app, imho...
 
@Leri then use the data access layer directly instead of object references
 
Not sure if I got you.
 
9:45 AM
@Leri what I mean is that List<Contact> becomes List<Id>
 
@TOOTSKI I know, that's why I try to work on a different time schedule. What I'm wondering is the following: Say for example I work in branches but 2 people are working on the same file, say router.php. How does git handle a merge in this case?
 
@Ocramius And whenever I need to get all contacts in group, iterate over list and query for contact. With some caching it sounds good option. Thanks.
 
@HamZa problem is 3 people are working on the same file. Git will give you (the user) the job of merging it (Y)
 
git has different merge strategies and can normally merge all changes from all remotes ...
 
sighs /me needs to learn more about git...
 
9:47 AM
@HamZa I second that motion
 
@HamZa It would be OK most of the times if you are not working on the same lines. Otherwise, that file would have so called conflicts, you'd have to manually pick what to keep (conflicts would be separated with sort of like open and close tag) and what to dismiss and sort of say "it's OK now, I've fixed it, continue git".
Don't worry 'bout it, you learn as you go i.e. experience the problem.
 
I see, thanks
 
Anyone used this WHM VPS crap? looks at @TOOTSKI
 
@hakre @HamZa Can you tell me what in the world are backslashes doing here? ( \ )
It makes it very uneasy for eyes to look at and only complicates stuff.
 
@Fabien I had to do something with it last week for a client
That shit is fucking huge
 
9:51 AM
@PeeHaa Ah. Cool. No kidding.
 
1 message moved to bin
 
@Fabien Noooooo. WHM is crap :)
 
I created an a record for a subdomain and pointed it to this server.
 
@Boris_yo Post actual code instead of an image when sharing code
 
Turns out the server is running WHM.
I need to edit the vhost (presumably) to accept this. But I can't modify the vhost manually as it's auto generated
where the heck are you supposed to do it?
 
9:52 AM
@Boris_yo it tries to escape characters I think which is AFAIK pretty much bullshit
 
I see override files but that doesn't seem right.
 
That's the problem :) I have no idea, sorry.
 
@Fabien let me login in the client's thing \
Ow nice. It's in zerman now :|
 
@Boris_yo Also read this. Basically, you don't need to escape - in your expression. Also, AFAIK you also don't need to escape / in a htaccess file
 
@PeeHaa Technical support of shared hosting told me that they're escaping special characters that would otherwise be wildcards or modifiers.
 
9:54 AM
@Boris_yo Is this some generated thing?
 
@HamZa Nothing to do with code except looking at it.
@PeeHaa cPanel > Redirects
 
The dot . needs to be escaped since it means "match anything except newline". You might also use [.] which also matches a dot, but that might be a choice by preference
 
Looks like a simple better ESCAPE ALL THE THINGS because fuck you that's why
@HamZa In a plain rewrite rule?
 
The problem is that this \ marks special characters. Without it, those characters won't be treated correctly?
 
Well tbh I don't know any apache :)
 
9:56 AM
@Boris_yo I hate it when people share a screenshot of their code instead of pasting the actual code. Why in the world a screenshot?
 
@PeeHaa me either :(
 
@PeeHaa are you talking about the fact that we need to escape . in apache?
 
@Fabien can't find anything in client's panel regarding vhosts. Maybe other account
@HamZa yes
 
@HamZa If I paste it, will it help you?
 
@PeeHaa yes, you need to escape the dot
 
9:57 AM
ah k. Than my memory is messing with me again :)
 
@PeeHaa Sure seems like a lot of wankery in this WHM thing.
 
@Boris_yo in this example it won't. But most of the times it is appreciated. As a helper it makes it easier to help you instead of wasting time to write over the whole code
 
sigh
that moment, when you realize that writing interesting stuff has come to an end, and you now have to write the damn HTML...
 
/@PeeHaa is filtered on
 

« first day (1285 days earlier)      last day (3648 days later) »