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

user895378
8:04 PM
@Nick It's entirely up to you. Accept an array or Traversable object when you construct your internal "route list" and then you can use polymorphism to create any number of "RouteLoader" classes. That way you could pull in the list of routes from XML, JSON, YAML, flat files, native PHP files ... anything you want ... then dump that object or an array created from it into your main "RouteList"
 
@rdlowrey Just to clarify, do you mean "....Except an array or Traversable object..."
 
user895378
No, I mean accept ...
 
okay, just making sure
because originally I was thinking of setting a specific array, and check using array_key_exists
 
user895378
You might have something like ...
 
user895378
class RouteList implements Iterator {
    public function __construct($arrOrTraversable)
    {
        if (!(is_array($arrOrTraversable)
            || !$arrOrTraversable instanceof Traversable)
        ) {
            throw new InvalidArgumentException;
        }
        $this->routes = $arrOrTraversable;
    }

    // ... Iterator implementation details here ...
}
 
user895378
8:08 PM
You could limit it to an array, but you're limiting how someone can use your program. You're saying, "I won't allow you to implement a Traversable object for a solution to this problem"
 
user895378
Like I said, it's entirely up to you. There's not a "right" way to do it.
 
@rdlowrey yeah thanks that snippet of code makes alot of sense actually
@rdlowrey Well Like I mentioned, It's an application so theres going to be specific paths put in place
 
user895378
With the above RouteList you could specify a ConfigLoader extends Iterator interface and then have an infinite number of objects that implement it, say XmlConfigLoader, JsonConfigLoader, etc. and then inject the ConfigLoader instances directly into the RouteList constructor.
 
but thanks alot rdlowrey, makes a lot of sense. This is my first time writing OOP I always feel like im doing the wrong thing
 
Is this guy right? I don't think he is, but I may be missing something.
 
user895378
8:13 PM
Remember, if a hammer is the only thing in your toolbox, everything looks like a nail. Strive to write object oriented code, not array-oriented code.
 
xy_
hi guys
 
@rdlowrey Array-oriented code: the story of PHP.
 
xy_
I moved my host from Linux Pleks to cPanel and it returns Internal Server Error
how can I see what the problem is?
 
@xy_ You need access to the webserver error logs.
 
user895378
@LeviMorrison What!?!?!?! I thought ALL data-structures were arrays ???
 
8:14 PM
@rdlowrey Yeah I find it really hard to get out of that mentality
 
xy_
is that the only way?
is there a way with htaccess
 
@rdlowrey In PHP, they practically are.
 
@Nick , well , put the source online somewhere
we will point out the mistakes
 
@tereško I know you guys will, hence why I tend to not show source code. I feel like I'll get ripped apart haha
But yeah I'll update my github
 
user895378
@vascowhite Safely preventing SQL-injection with mysql_* is a circuitous, pitfall-laden path. It's not to be recommended and very easy to do incorrectly. Not to mention the extension is in the process of being deprecated, so even if you implement it safely, you're closing your eyes to the fact that it's only a matter of time before code that uses mysql_* starts triggering errors.
 
user895378
8:17 PM
@vascowhite So I would say, "No, he isn't right."
 
@Nick , here is a free unrelated advice : don't keep the main part of application in document root , that's just begging for shit to happen an spill all your source for everyone to see
 
@rdlowrey Thanks, I agree with you, although I probably couldn't have put it so well :)
 
@tereško Haha, yeah thanks
 
the document root should contain only file where you redirect the requests , and the files that you already want the users to see, like css, js and design images
 
I actually have a specific project folder for it right now, and I have a redirect set to that folder right now
 
8:21 PM
not the files which explain how you validate uploads and connect to database
what do you mean by "redirect" ?
 
htaccess
 
that's still visible from outside
 
I'm not using a VPS so I think I have to use htaccess, I've been told to use VirtualHosts
can't you just deny access
deny from all
 
keeling system files outside document root protects against fu*kups on server level
 
allow from 123.123.123
 
8:24 PM
and what if the httpd.conf get over-written ?
what if you loose the permission to use htaccess ? what if php is not interpreted anymore ?
 
obviously I don't know what I'm doing
I should almost quit
:P
 
no , you are just putting the fingers in the ears and going "nja-nja-nja-nja"
 
Hahaha I wouldn't say im ignorant. I just have no clue what you're talking about. httpd.conf gets over-written? I'm not on VPS on a shared server..
I can only hope I can keep learning to the point where I can hold up a conversation with you @tereško
 
@Nick Files and folders outside the document root will still be available to php, but not to anybody accessing your server via http.
 
is UPS worthwhile for anything? they can't even deliver packages correctly
 
8:33 PM
@vascowhite Okay so where's the security concern ?
 
Happy towel day
 
@Nick @tereško is pointing out that most of your application should be kept outside the document root to avoid any security concerns. he's concerned that you are keeping them in the wrong place.
@GordonM Same to you :)
 
@vascowhite ahh okay I get it now. But the thing is im on shared server, not a VPS. Which means I only have access to /www/ ..
So I'm thinking my solution should be local haha
 
@Nick that's unusual, are you sure? I have some projects on shared hosting and I have a /user/www, and can create /user/application: /user/www is the document route, so /user/application is safe.
 
user895378
@GordonM Hey just so you know I haven't forgotten about your unit tests, but I haven't had a chance to get to it yet. I will definitely before the end of the weekend, though.
 
8:39 PM
@vascowhite Im pretty sure, I only have access to /user/www
I can always inquire this with my hosting company
 
@Nick shame. Change your host :)
 
@vascowhite Lmao I should, I hate them, hence why I didn't mention who it was
I'm actually ashamed to say the name
 
@Nick lol
 
can anyone guess who :D ??
 
G*D***y?
 
8:41 PM
... yeah :$
elephant killers
 
give me a present for guessing
cookies
 
@vascowhite
GET /spec.html HTTP/1.1
Host: www.example.org
Cookie: name=vascowhite; prize=you win
Accept: */*
 
lovely, thank you. :)
 
@tereško Here's my shitty code, rip me a new one ;) github.com/nybouchard/Flawk-Framework/tree/master/…
 
@rdlowrey Okay, don't stress over it or anything :)
 
8:47 PM
@Nick constants. Enough said :-P
 
@Nick classes named "Router_Router"
 
@ircmaxell lol haha, alright an evening of researching what constants are
@tereško yeah haha, i'll fix this
@tereško because of my autoloader :S
 
besides, don't use DIRECTORY_SEPARATOR, just use /, PHP knows how to translate for you
 
@ircmaxell aren't you on vacation ?
:P
@ircmaxell good point, i'll add this to the list of things to change
 
he is, which means you get his advice for free :)
 
8:51 PM
@vascowhite no, I get paid to take vacations
 
@ircmaxell lol
 
@Nick No, require_once(FLAWK_LIB_PATH . DS . 'Router' . DS . 'Router.php');
 
autoload?
 
@ircmaxell yeah just noticed this I'll fix this right now.
 
8:57 PM
Technically the includes and requires shouldn't have parenthesis either
they're not functions, after all
 
@orourkek Good point fixing righ tnow
 
stackoverflow.com/questions/10761179/… can anybody help about this timetable?
 
Jon
Hello, Could anyone recommend a best practise CakePHP file structure to incorporate an admin backend? I'm slightly familiar with the built in admin route, i'd like to be able to add/edit blog posts and do image uploads for a gallery on one admin page preferably in one controller?
 
rm -rf cakephp should do it.
9
 
lmao
 
9:17 PM
@Jon Not many people in this chat use (or are even interested in) cakePHP
 
Jon
i figured
 
I jest of course, I'm not familiar enough with cake to comment on whether it sucks or not.
But I don't think there's much love for it here.
 
^^
 
I'm sure it's better documented than Zend.
 
Jon
i dont understand what everyone uses, does everyone just write their own and reuse?
 
9:21 PM
@Jon I use Zend Framework, but generally you'll find whatever you use somebody will tell you why you shouldn't. Use what works for you, there is no such thing as the perfect framework, not even the one you write yourself :)
 
@Jon depends greatly on who you ask, but the bottom line is that all frameworks have their pitfalls
 
Thanks to everyone who gave me feedback on my project. I think I fixed all those previous problems.
 
Though Kohana seems to have the least amont of "what the..." code, from what I've seen
 
@Nick I would make one more comment if you don't mind. Use more comments, docblocks and phpdocumentor, it will make life much easier when your framework gets larger. Even if you don't produce documentation your IDE will use the dockblocks to give you hints on useage.
 
Jon
Thanks for your feedback. I've tried writing my own, I've used CI, i'm using Cake and I'd love to use Zend tbh I keep going round in circles. But thanks.
 
9:29 PM
@Jon Choose one and stick with it. Its the only way.
 
@vascowhite Yeah my commenting is pretty horrible
I'll add this to my whiteboard
 
What IDE do you use?
@Nick
 
@Jon I don't use a framework at all
 
Coda 2
@vascowhite are docblocks easier to read ?
 
I'm not familiar with it, but I think most IDE's will autocomplete in docblocks for you. It makes commenting much easier. I just use netbeans and that does it.
 
9:35 PM
@vascowhite I'm an OSX user haha, I don't know why I decided not to use docblocks.
 
@Nick well, they're pretty clear. The best thing is the hinting in your IDE if you use them properly.
 
@Nick I just switched to coda 2 so I havent found one yet, but try to find a plugin to do it for you. I have one for ST2 that auto-creates the docblock after typing /** and pressing tab, it fills in any variables, types, return vals, etc
 
@vascowhite Alright thanks, I'll look into it and change my current commenting to docblocks
@orourkek oh damn that sounds amazing
 
@orourkek @Nick That's exactly what netbeans does.
@LearningSlowly not me.
 
@LearningSlowly Yes, you can make just about any sort of website with the LAMP stack
 
9:41 PM
lol, my shortest answer on SO yet! stackoverflow.com/a/10761552/212940
 
posted on May 25, 2012 by Christian Weiske

I've just released phorkie 0.2.0 which brings search functionality via Elasticsearch. The nice thing about Elasticsearch is that it allows boosting of certain fields (paste title is higher ranked than the file content) and has a bunch of search query features: Exclusion: +foo -bar Logical OR: foo OR bar Quoting: "foo bar" Partial words: foo* Re

 
lmao
 
@Nick this plugin works in coda2, I just tested it
exactly what you need :]
 
@orourkek noice thanks
 
9:43 PM
ctrl + shift + d
 
for the docblcoks ?
 
yep
 
Heloo, how can i make chat like facebook ? He just append new rows to chat window ..How please ?
 
well, thats what it set my keybind to anyways, I assume it's the plugin default
@LearningSlowly :P
 
9:45 PM
@HarisMuharemović I suggest you read this
 
@orourkek Thanks man, added and working !!
 
np, I needed it myself :P
 
@LearningSlowly please stop spamming, if people want to answer they will.
regardless of what your uncle wants
 
c'mon guys
give me some tutorials about jquery / php chat :D
 
sigh
@HarisMuharemović here
ooo SO failed to parse the link :[
 
9:49 PM
@LearningSlowly flash is a dying technology, don't make any websites with it
 
You probably shouldn't be asking for help with Flash in a PHP room. You might want to try... a Flash room :)
 
@HarisMuharemović Is this what you're looking for ? anantgarg.com/2009/05/13/gmail-facebook-style-jquery-chat
 
lmgtfy will soon be my most visited site
 
wow .. its bad
 
@tereško run, while there's still time!
 
9:52 PM
@LearningSlowly the site you linked, can be made without flash
will be much butter too, because it can actually be indexed
what's your budget?
 
google indexes flash sites now, don't they? (or at least partially)
 
@orourkek you can provide them with hooks, yes
but still, flash is a dying technology
 
(not that I would recommend flash, of course :P)
 
you want ppl with iPads to be able to see your page, don't you
@LearningSlowly if you want something good, it won't be enough
@LearningSlowly prices can't be made just by looking at another page, prices are made by talking to the customer about the exact needs, it's a process
you'll definitely find somebody who tells you that they will make it for you for that price, but then you'll be in for trouble of all kind
 
9:57 PM
@LearningSlowly where are you from?
 
@vascowhite I just threw up in my mouth a little bit...
 
rofl
 
@vascowhite MVC isn't a great fit for the web though, and you do end up seeing code like that a lot more than you'd like.
Even so,
 
@LearningSlowly ok, I'm sure there are good web agencies in Bangalore, Pune and other IT hubs which will make you offers for such a site, why pay a western price if you have your own silicon valley which surely has a different price level for indian customers
 
@GordonM What was it you were working on? resource something.... I can't remember the acronym now.
@orourkek To be perfectly honest, i was probably guilty of writing code like that at one time. :/
 
10:02 PM
@vascowhite Yeah, I'm sure there's still code like that on some of the live sites that I manage
 
anyway, got to go. Have a good weekend all.
enjoy what's left of Super Towel day.
 
@LearningSlowly maybe you chose the wrong partners, anyway, asking for prices is relative, depending on the price levels and purchasing powers of each country
 
@vascowhite Thanks for the help today :D enjoy your weekend
 
@Nick NP. You too.
 
Lol oh I will !! my 20th birthday tomorrow
 
10:06 PM
@LearningSlowly what do you mean with one time solution?
 
Does anyone know of anything weird that is known to happen when using spl_autoload_register with extended classes? Been debugging and googling for 40 min with no progress - extended class is not loaded
 
@vascowhite RMR (Resource, Method, Representation) though I've not had much time to work on it lately :(
 
@orourkek I thought they were automatically suppose to include the extended classes
 
@Nick Yep, that's what i want to happen, but sadly it's not
 
as you described it,,, weird...
 
10:11 PM
@LearningSlowly I understand, if you were my customer, I would try to find out your exact needs and then evaluate whether your needs can be covered with an existing CMS or whether it's necessary to create a custom CMS for you. Then I would write you an offer with some fixed prices and some agile estimates. the price could probably range between 3000 and 15000 dollars (very wild guess) for such a site
 
it's a complex schema to explain, but it's not an issue with the autoloader - under normal use (new className) it loads fine, just not when extended
 
@LearningSlowly the most important thing is to find a partner you trust, meeting face-to-face is never a bad idea
@LearningSlowly I would very much recommend to forget about flash, yes
 
@LearningSlowly I would too, 100%
 
@LearningSlowly Yes, very few sites use flash nowadays and there are even fewer developers out there that work with flash
 
holy shit 8k
@LearningSlowly btw ignore my previous comment, I'm 19 I have no clue what price ranges are and markus would have a better idea
 
10:15 PM
@LearningSlowly no, you're not interpreting that correctly, you can't nail it down, you have to keep the range
 
hourly rates are so drastically different in this field
 
@LearningSlowly you may find someone good with a relatively low rate who can do this for you for 3000, but it may also turn out that you need something custom, then it will be more, unless you find somebody very good with a really low rate
 
the word "flash" is a red flag in this industry
 
It is, because there are a bunch of idiots in this industry
There is no suitable replacement for flash in the majority of its use cases, irrespective of what most people say...
 
but , but .. apple .. said . .. they said .. bad .. flash bad
 
10:27 PM
HTML5 will be nice, but it is not supported enough, way too slow, and not nearly feature rich enough to take flash on full frontal...
No matter its flaws or what jobs said about it..
 
right now even <video> is not usable , at least not on my netbook
 
Nope...
 
@ircmaxell wtf?
 
@ircmaxell Flash in the context of media is one thing, but a [full] website in flash is another thing completely
 
@ircmaxell I don't think the point is whether or not there is a replacement for flash, the question is rather per case, and with pages that are supposed to represent a company it is just a very bad idea to chose flash for a website
@orourkek exactly
 
10:31 PM
but flash is pretty!
 
@ircmaxell so if you look at the link LearningsSlowly posted, you will agree that such a page should not be made with flash, which is more expensive to maintain and will cut out a large part of users
 
@nikic?
No, I am just sick of the "flash is dead/evil" bandwaggon....
 
@markustharkun the best part is the 5-10 sec loading screen XD
 
@ircmaxell It's not a bandwagon. People are just seriously fed up with it.
 
10:33 PM
@ircmaxell The only talk like that in here was about flash as a web design paradigm, not as a media channel
 
@ircmaxell I understand, but it seems to me that you didn't read the context of the discussion
 
no
 
@LearningSlowly No, this isn't the case.
 
@nikic: it surely is a bandwaggon... people dispel reality to proclaim in favor of the almighty <canvas>... it works, but there is a huge super set of functionality that can only be done in flash today...
 
@LearningSlowly The example you gave us demonstrate a bad usage of flash.
 
10:36 PM
@ircmaxell There is?
 
At least done efficiently (which is a bit ironic)...
Absolutely
 
Could you give some examples?
 
Drm of any form. Sprites of any significant form. Most animations. Most functionality requiring significant user interaction...
 
@ircmaxell Whats Drm?
You mean like that music thing?
 
digital rights management
 
10:39 PM
oh gosh
a great application for flash...
 
Content protection . Video, audio or basically anything else...
 
I'd rather see that as an argument against flash, but okay
I don't get the rest ("Sprites of any significant form. Most animations. Most functionality requiring significant user interaction...") though
Animations and stuff work just great in canvas, don't they?
 
"great"
 
I'd naively assume they work even much better than in flash
 
Then you don't understand the real world. Content is king. And producers that are publishing on the web want protection...
 
10:41 PM
@ircmaxell I do understand the world. They don't.
 
the HTML5 stuff could potentially be faster, but not nearly as reliable and accessible
 
As if they were protecting anything...
 
@ircmaxell drm is dead
 
Animations are slow, because the are forced to be single threaded. So by themselves they may be OK, but try to do anything complex. Even mozilla's mmo game they built runs like crap with trivial animations
 
so will flash be
 
10:43 PM
the discussion is drifting off a bit... there was a guy who posted a link to a site which should not be done in flash and some ppl told him so, that's all
 
tag:sigh]
 
everyone is discussing this from different contexts
 
Oh that's where you went.
 
Flash is more stable, reliable, and accessible than <canvas> or <video>, and until that changes, yes - flash is king. (for media)
 
10:44 PM
@ircmaxell If it weren't you, I'd now start calling you bad names :P
 
@markustharkun Sorry about that. We didn't have the expertise to answer his questions. It turns out he wants a website, and C++ is not well fit for website development
 
I am out. Not going to continue this over my cell phone...
 
@ircmaxell sorry
 
@ircmaxell bye
 
@sehe I wasn't sighing at you... just at this weird situation
 
10:45 PM
But I think you are overrating the Flash technology very much.
 
everybody is talking about something else but thinks they're talking to each other
 
At least when performance is concerned, I absolutely cannot see how it could beat convas in any modern (crazily hardware accelerated) browser
 
@markustharkun Ok, i'll uncomplicate things and retreat to my own room :)
 
@NikiC without hard data, that's just your guess vs his
 
@sehe :) come visit again
@NikiC maybe @ircmaxell is looking at it from the perspective of the interaction level of games
and such
 
10:49 PM
@orourkek Sure.
 
but we're talking about marketing-relevant company websites here
 
Probably I've read too much about browser optimization
 
I don't think anyone here will say that a website written entirely in flash is a good idea. And that's what this all started as!
 
@orourkek that's what I'm trying to tell everybody
 
Let's just drop this sad topic
Flash will die one day anyways ;)
All by itself :)
On mobile it already did ^^
 
10:52 PM
@orourkek there has been a very kewl website written completely in flash starred here some while back lemme see whether I can find it
 
"kewl" isn't a word I would want describing a business website
which is what this talk started as
 
This is why flash rocks! ;)
 
lol
i like the music
 
@NikiC and what is dead on mobile, is kind of dead... which is why I think flash is dying... especially after the latest trends clearly show that the iOS strategy beats the android strategy
flash can only be saved by apple changing their minds
or something else very unexpected happening
 
@markustharkun flash cannot be saved
 
11:01 PM
@RepWhoringPeeHaa well, I just can't look into the future but I tend to agree, if apple stays the course, the probability of death is very high...
well... ircmaxell can't always be right :)
 
@markustharkun nobody is
 
@RepWhoringPeeHaa :) guess so, the probability is very low... maybe one or two every couple of centuries
 
I hate android developers who try to use php as backend. It just seems to be an instant :(
 
11:22 PM
@RepWhoringPeeHaa There definitely is some correlation
I'm not sure how that can happen
Maybe Android programming is massively hyped now and attracts lots of new programmers?
 
@NikiC that and ofc what always seem to be the problem: bad examples
 
@RepWhoringPeeHaa What's that?
Oh "bad examples" ^^
 
I trained myself to skip reading the actual link text and just click on it ^^
 
triggerhappy much? ;)
@NikiC "parametrized"? Is that correct english?
 
11:36 PM
i hope so
It's what Firefox spelling correction told me :O
clearly it was wrong
 
lol. never trust the internet spell checkers ;)
 
fixed :)
thanks
and sorry :)
 
Don't be sorry. Firefox is the one who should be sorry :)
 
The conversation in the C++ chatroom is highly amusing
They got themselves a good troll :)
oh damn
Yeah, whatever you say
Just out of interest, what was that question you originally asked?
@LearningSlowly Now I see where all that stuff came from
Well, you see, "How to program a GUI in C++" is a very general question
There are many, many ways to program GUIs in C++
E.g. on Windows the native way would be to use the Win32 API (Which reaaaaally sucks)
As that's not portable (at all) and as I already mentioned is a hell to work with, it's better to use a framework
Like Qt
So I'd say a good starting point for you would be: Search for a Qt tutorial :)
OpenGL is a graphics library
For two or three dimensional computer graphics
It's not really for the GUI itself
 
11:59 PM
...
 

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