« first day (1168 days earlier)      last day (3795 days later) » 

6:00 PM
you can it call 'init.php' or 'launcher.php' ... whatever
the point is, apache modules can fail
when (not "if") they fail, all of your code, that is located in document root will be readable for everyone
you do not want to expose your code and/or configuration details to the google's cache
 
sorry but i dont get your last point
what permission i have to give to /project directory?
 
what would happen if everyone on the internet could read the source code of all your php files, that are located in your document root? would the site still be secure ?
 
yeah i got your point it should be tree like structure
 
> drwxr-x--- 5 karan www 512 Nov 9 00:12 some_project_name/
that would be the simple version
 
ohh damm it
i do not know any thing ,,thanx alot... you saved my life
how u get this drwxr-x--- 5 karan www 512 Nov 9 00:12 some_project_name/?
 
6:12 PM
there are commands "chmod" and "chown" on nix (linux, bsd, osx) systems
you can read about them if you write: man chmod in console
 
should i remove chmod($_SERVER['DOCUMENT_ROOT'] . "/photos/".$p_name, 0777); ?
 
to change permissions of directory you would write chmod 750 folderName
 
yeah i know i gave 777
total access to my server,,, so it should be 750
 
to change the owner you would write chown user:group folderName
 
and i have to give www-data group to my project ?
 
6:15 PM
you have to read about permission system in unix-like systems
the permissions are split in three groups: owner, group and everyone
7 stand for rwx, 4 is r--, 6 is rw- ... etc. Binary flags
 
in 750 , first number is for owner, second - group, third - everyone
 
hmm got it
so project should be under www-data group which should having 750 permission?
 
maybe this helps
it's from freebsd manual, but will apply to linux and osx systems as well
 
6:21 PM
you will be interested in the "sticky bit", which will govern whether all the files in the directory inherit the permissions or not
 
k
you told abt /var/www/project_name/public/ root directory so what it should contain in it ?
 
Is it possible to relay received emails on GMail to a script on my web server (Whenever I receive an email from foo@bar.com, GMail automatically makes an HTTP request to my site baz.com/script?from=...&body=....)
(I'm trying to automate this process, since it would take me days to figure out the PayPal API)
 
@ŠimeVidas yes, it's quite possible. See davidwalsh.name/gmail-php-imap
 
Can you use php variables in javascript?
 
@karanpujara a lone index.php file , all of your css and javascript files, custom fonts (if you use any) and images that are part of design
 
6:26 PM
@jmalais have you tried googling it?
php is much slower... based on tests i made some time ago if you are not on a good host as you need to read the content 2 times. nodejs handles this type of communication faster. yql query is on the yahoo servers and some data is already cached. jquery is bah.. — cocco 12 secs ago
 
@tesko i am usiing laravel 3 mvc so how can i split like that ?
 
@BenjaminGruenbaum Very nice :)
 
@BenjaminGruenbaum My question was can I append a php variable to the body using jquery
 
@jmalais Yes. Glad to help.
 
@karanpujara please don't call it "laravel 3 mvc", it is an application which used laravel 3 framework .. it has nothing to do with MVC architecture
as for "how" .. gimme a moment
 
6:30 PM
@PeeHaa i believe so
 
@BenjaminGruenbaum Since I am not sure on how to pass a php variable through jquery and how to write a function that appends to the body, could you please give me a template to go off of?
 
@jmalais Yes, I could.
 
@teresko sorry friend ..i am using laravel 3 framework for my web app ....
 
Thinking about it now, it might just be better to use a <style> tag in the body rather than appending it to the body tag. So, nevermind but that you
@BenjaminGruenbaum No worries, I'm going another route.
 
Do you use the same syntax for getting a variable out of a post, a get and a request in PHP?
 
6:33 PM
@karanpujara according to this, laravel already by default has a separated /public folder
 
$temp = $_REQUEST['s'];
the same as
$temp = $_POST['s'];
if s is posted?
 
@akh2103 normal people do not use $_REQUEST
 
who the heck +1d that
a same cpu server handles the content of a nodejs script much faster than php. i wrote also a nice curl example witch is relatively fast wich reads the content with a write function and flusches the data.. but for a short answer like that it's prolly not necessary. — cocco 3 mins ago
 
@akh2103 no
 
@tereško I am looking at legacy code that uses requeset
 
6:34 PM
@teresko so finally how should i split my directory structure ?
 
@tereško that is not advised
?
@tereško ?
 
@akh2103 please avoid pinging people multiple times - it's very annoying. When someone is giving you free professional help the least you can do is not bug them about it.
 
@karanpujara laravel already by default has the directory structure separated in somewhat acceptable fashion
at lease, if you did not mess with how it has set up originally
... I am going by what I see in github.com/laravel/laravel/tree/3.0
@BenjaminGruenbaum already ignored
 
@teresko yeah you are right it has already tree like structured
 
6:37 PM
you only need to add a folder for uploads there
also, on a related note, I hope you are not working on a new project, because Laravel 3 is considered to be "legacy software"
there is already 4.1 version out
 
my code is completed but problem i facing is with hosting and server configuration
as u say i put my code in /var/www/project_name/application/
and uploads photos in /var/www/project_name/uploads/
 
Jay
which is the best way to do this. at the moment I am using base64_decone/encode
 
@BenjaminGruenbaum got it
 
Jay
I need to encode param1=something&param2=somethingelse
so the url will be: download.php?link=ENCODED_DATA
 
@teresko so in laravel app should i need
<?php
include '../application/bootstrap.php'; ?
 
6:43 PM
@karanpujara it already does it, here: github.com/laravel/laravel/blob/3.0/public/index.php#L34
 
so my code is just under www/mysite is okay?
 
I kinda doubt
I get a feeling that you have deviated from the original structure a lot
 
y?
@teresko so how can i access my photo from /www/mysite/photos ? oyu told that i cant use chmod($_SERVER['DOCUMENT_ROOT'] it will expose server
 
no
i did not tell that
I was trying to make you understand, that you were trying to link file that is outside of the document root using it's full system path
 
so how to access files from other directory ? by realpath or basedir() ?
 
6:51 PM
there are two parts to this: 1. you have to upload the file to that external location 2. you have to retrieve the file from taht external location
when you are moving the uploaded file from temp location to the storage, you will be using full system path
but when you are tring to display that uploaded file, you have to use a script which servers it
 
yeah i successfull store uploaded my photos to /www/photos but when i access it from /www/mysite/ then it was correct path but phots was not displaying
@tere
@teresko thanx a lot for helping me from basics
have a great day
 
@karanpujara as far as i remember, directories usually have 755 and files have 644.. just so you know. ^_^
 
though i'm not sure how 750 would affect everything.. (never tried it yet)
seems its working since you're in the same group, so it's fine. :)
 
7:06 PM
ok
 
7:41 PM
fuck
there is too much to learn
 
abstract class PermissionModelAbstract implements PermissionModelInterface
{
    public function setDataValidator(string $action, string $method, DataPermissionValidatorInterface $validator = new DefaultDataValidator())
    {
        $this->model[$action . '/' . $method]['validator'] = $validator;
    }
}
This works? (The new keyword in the default argument value)
 
shouldn't
@MadaraUchiha 3v4l.org/dQq7J
 
Good afternoon.
 
I remember a question like this being posted here somewhere: stackoverflow.com/q/20806960/871050
I've looked at the class, it's definitely not worthy of being advertised on SO like that.
 
8:05 PM
Ugh not enough narUto manga!
 
@MadaraUchiha Downvoted. It's really horrible, imo.
 
Evening people
 
Hey @PeeHaa
 
@MadaraUchiha omfg that thing sucks :P
Jo @Fabien
 
@MadaraUchiha aknowledged
gooooooood evening
i love my new cat.
it's a pitty it will go away with the new year :/
 
8:12 PM
I hate cats!
Eeeerrrh I mean hats ;-)
 
it's not a hat, it's just a cat :D
 
@hakre Is it a kitten?
 
it's on top of my avatar :D
 
Ah so I was right it is a hat :P
 
So.. what did you all get for Christmas?
 
8:18 PM
morning
 
Hey @crypticツ
 
I got to ask
guys and gals, how do you keep up with the stuff that you need to learn ?
 
I don't.
My assumption is people specialise.
Some people have a wider ability than others though.
 
we are web-developers ... a specialized web-developer has to know about ~1000 different subjects
 
I always hop around from subject to subject, so a little of this and a little of that
 
8:22 PM
@tereško Dicking around mostly
 
Yeah, but I mean like @rdowlery and Sockets/HTTP. @ircmaxell and security
You and MVC
 
No @tereško has no idea about MVC. He just recognizes when code is not MVC.
 
heh well I am not one to really understand what anyone's speciality is.
I would like to find an aspect of programming that I could see myself really focusing on as a priority, but I don't see it yet.
 
I really hate that composer doesn't really use releases. They want me to run an install script and solve my problems.
I don't want to run an install script.
I want to download a specific version and install it somewhere specific.
Yet they release 'releases' infrequently, and don't provide easily accessible documentation on how to install from git.
 
user image
2
 
8:33 PM
@Fabien omg, that solves my hand hurting problem when holding my phone in bed. Also I loved that movie!
 
heh. As cool as it seems, you'd need to also enjoy sleeping on your back
 
@LeviMorrison Yeah, and it's not just composer, but also Satis: github.com/composer/satis/issues/85#issuecomment-31256986
 
I actually have one of these
@PeeHaa Not easy to find royalty free hipster pictures.
 
Gaddamn hipsters!
 
@Fabien this always works comes in two models I have 4
 
8:40 PM
lol
I'll be honest, I use my wifes head in a similar fashion when she's dead asleep.
 
Friend made me get a diaspora account because he was against google using his data. Now I am on diaspora and I think the advice was solid. Wouldn't want google utilising those funny youtube videos he keeps posting for world domination.
 
8:57 PM
May order some RAM for PC. 8GB just isnt cutting it
 
sounds yummy ...
so quick question if anyone has 5 minutes ...
I'd like a description of the last thing that you had to debug, that you consider debugging and how you went about solving it ... I'd like real examples which is the reason for asking, when I think about the kind of bugs I've been looking at, the intended audience won't understand the description of the bug even ... so real world php normal bugs ....
 
@Fabien i use my notebook for watching anime though, not my phone.. but yeah, my hand hurts after reading 9gag on mobile for so long :P
 
(I pretty much know the description will include var_dump or whatever, that's fine, just however you actually do it for a real bug that you remember solving) ...
 
@JoeWatkins Probably some stupidity (as usual). I often take the same approach when debugging shit. a) quickly glance at code and find bug b) fix it c) find out that's not the bug d) isolate the problem (which is easy with sane code) e) fix the bug d) add test e) confirm
 
ok what about when you have to engage in exploratory debugging, so go in and change control flow/variables or whatever, when it's not immediately obvious in the code ? same thing, look around, have a go, deploy, test, back to square 1 ?
 
9:12 PM
Yes basically. It does not happen a lot that shit is hard to debug. In my experience the things that are hard to debug are hidden typos which are overlooked.
Everything else should be easy to find or otherwise I would have to probably rewrite it either way
$0.02
 
cool cool, tis useful all the same ...
 
fwiw I will try to keep in mind your question when I am stuck
It is an interesting question though
Let's make it an friday room 11 poll :-)
 
What is the name of the pattern where I can register( $id, $object_or_callback ) and unregister( $id ) something? I have seen it, but are not sure what to serach for.
 
cool
 
9:18 PM
@toscho E_NEEDS_CONTEXT
 
@PeeHaa the registered objects are called in a specific context or event.
 
observer?
 
hmm, maybe
 
objects aren't called .... I'd go with observer ... or just callbacks really, an observer isn't implicitly a list, this appears to be a list of callbacks ... but as mentioned E_NEEDS_CONTEXT ...
 
@JoeWatkins Here is an interface for a module manager I am using. Might be doing too much currently. :)
Each module might provide an interface for settings.
 
9:29 PM
What are you going to do with objects that implement that thing?
 
Manager is a stupid name, and I use similar patterns in other cases, so I want a better name.
The objects are controllers, they create views and/or models
 
Not sure what I am looking at is a specific pattern. Looks more like a simple collection to me
But it all depends what you are going to do with that thing
 
@JoeWatkins I was debugging Auryn PR #40 and I used XDebug (integrated with PhpStorm) to step through test cases to see what was happening.
 
RAM really is more expensive these days :(
 
9:48 PM
@JoeWatkins At present most of my debugging is just for stupid stuff. Check spelling mistakes, then check each conditionals along the line. I sometimes just do 'echo "I am line: ". __ LINE __;' to see what's happening or isn't happening. But I don't do much complex stuff :(
 
morning
 
@happy Morning
 
thx, I hope you had a nice time with your family
 
10:48 PM
Yes nice time and luckily not tha much family ;)
 
noone honored friday today? ^^
 
There's still time. Quick!
 
9 hours ago, by bwoebi
It's holidays. Fridays aren't important now.
 
@hakre yeah
I didn't know we were friday until NOW
 
@bwoebi true, true.
 
11:01 PM
@hakre and now… in our tz it's Saturday^^
 
@bwoebi yay :D
 
@bwoebi technically speaking each day could be friday depending on tz and schedule ;)
 
1 message moved to Trash can
 
i.stack.imgur.com/HtWqc.png never tough you woulds invite me somewhere
 
:P
 
11:07 PM
@happy next thing you know, it's long walks on a beach, and all downhill from there =oP
 
@crypticツ lol
 
Is there some resource online that shows when which PCRE feature was introduced?
Right now I'm just wondering about non-capturing groups ((?:....)), it's perhaps pretty old, isn't it`?
 
@hakre Version 2.00 24-Sep-98
 
Version 2.00 24-Sep-98
LOL + big thanks!
that is a nice changelog btw.
 
11:14 PM
that's the oldest non-capturing group entry in the log, so the actual feature is older, but just not in there.
 
@happy when a room owner moves your message to another room. You automatically get an invitation
 
@HamZa I understand but it was kind of a joke because even dough I do respect @tereško, he have such a great experience of programming but his personality is atrocious.
 
@happy A person can't be perfect :)
 
@HamZa true, still I do respect him very much. His presence add something.
 
I agree
 
11:19 PM
@crypticツ 98 is pretty safe for the backwards compat I'd like to provide ... :)
sometimes it's better to check.
 
@hakre I've never considered BC for regexs, mainly because when I do use a "new" feature it turns out it has been out for a decade and I never knew about it =oP
 
@crypticツ see, you somehow checked that. not that non-capturing was new to me, as it wasn't used at that place, I wondered why not. So I checked.
 
living under a rock is the best way to achieve backwards compatibility
 
> "être un polar"!
well, it's the path of least resistance probably as well.
 
Should I bother to minify a JS or CSS file if I am gzipping it when requested?
 
11:27 PM
@crypticツ do so and compare. most likely gzip does it better, doesn't it?
you can also store it already gzipped on your host.
 
@hakre ~35% smaller if I minify then gzip compared to just gzipping
 
@crypticツ then try with bzip ^^
 
will a browser still be able to open it to display page?
 
@crypticツ good question. I guess most browsers don't have bzip support.
 
bzip is slightly larger by a few hundred bytes
 
11:34 PM
well, it's perhaps worth to minify then
but I wonder how CSS can be drastically minified as the selectors need to be preserved. maybe short notations.
 
dropping last semi colons and whitspace mostly iirc
 
@JoeWatkins last bug was in a testcase I wondered about. Used phpstorm + xdebug to step through.
@PeeHaa and removing comments :)
 
@hakre mainly the minification is removing extra whitespace, and yes using shorthands for say colors. I don't have anything change the shorthand syntax for things like border, background, etc as likely to break something.
 
@hakre People have comments in the stylesheets? I thought we have dev tools for that :P
 
@PeeHaa The comments are mostly "Fuck IE".
 
11:39 PM
:-D
 
#this-is-to-fix-ie-bug {...} psssh comments, for noobs. Real devs write selectors to self document =oP
 
hehehe
 
@crypticツ btw you are storing the gzipped file on your server right? So you can send content-length headers when serving the gzipped content?
 
@Danack well Apache or Nginx will be serving it gzipped, I should be storing it already compressed since the files are really not going to change.
but what happens when a useragent can't decompress? At least if server is doing it it should be doing it only if client says it can accept it.
 
@PeeHaa dev tools do not compute well with css if you're a purist.
 
11:43 PM
@hakre explain?
 
@crypticツ "but what happens when a useragent can't decompress?" They're using a browser from 1998 and don't expect much on the internet to work.
 
@Danack but what if a client asks for IE4 support >.<
 
FLY YOU FOOLS!
 
@PeeHaa basically most of that stuff is bloatware. well, actually not the tools fault, it's just that css is not written anymore today. which is kinda sad.
 
@crypticツ There are issues around http1.0 clients - basically serving gzipped content will make the connection keep alive from working for the connection that gets the gzip content, but the benefit to gzipping far outweighs that.
 
11:46 PM
Just so we are talking about the same thing. I was talking about the browsers developer tools to inspect the css :-) @hakre
 
5
A: Serving gzipped CSS and JavaScript from Amazon CloudFront via S3

DanackCloudfront supports gzipping. Cloudfront connects to your server via HTTP 1.0. By default some webservers, including nginx, dosn't serve gzipped content to HTTP 1.0 connections, but you can tell it to to by adding: gzip_http_version 1.0 to your nginx config. The equivalent config could be se...

The only real gotcha is that you really need to set the content length, (or have the webserver set it) otherwise Amazons (and presumably other) CDN cache and serve broken content.
 
@PeeHaa okay, I mean those nice thingies you can extrapolate some DSL into CSS.
 
Thought so :) Tools like that always confuse the hell out of me :P
80
Q: Trolling homework questions - sorting

VictorI am intending to make this a new category of programming puzzle (let's call it "code-trolling"). So you could expect this to be the first question of the series. The idea of this category is: Suppose that some lazy guy in StackOverflow or elsewhere, asks a homework give-me-dah-codez questio...

 
@hakre DSL?
er, nsfw
 
well, true code trolling would be to ask the user for the input, and also ask the user for the answers, wouldn't it?
 
user1063295
11:53 PM
hm, much troll.
 
another way to code-troll would be to crash the user's computer, and send a specific error message telling the user the output.
But how would one demonstrate true code trolling?
how could you differentiate between the better and the worst?
 
user1063295
yes, there aren't many thick guidelines.
 
there is always a more complicated way, isn't there?
or there's the troll code-troll answers: check the post above by PeeHaa.
second answer.
 
@TheThinker stop starring all that shit
 
11:56 PM
I'd agree
@PeeHaa I like your website
 
@PeeHaa: Do you know what the difference is between excluded_dirs and filter -> excluded_paths in Scrutinizer?
 
@think123 I hope you're not talking about the design, because I think it is ugly as hell :P
@hakre Nope bot sure tbh. Isn't it that some tools use paths filter and some use exluded dirs?
 
i create syntax template like smarty ... this syntax like
[var:"a"end var]
[if:"a","do any thing [else] do that"end if]
 
@happy search the chat for that youtube link .. see how many results you come up with
 
@PeeHaa as far as I can see, it's that tools have both of these options.
 

« first day (1168 days earlier)      last day (3795 days later) »