« first day (261 days earlier)      last day (4669 days later) » 
01:00 - 13:0013:00 - 23:00

1:24 AM
hey ;-) anyone awake here?
 
 
2 hours later…
3:42 AM
hello :) anyone home? :) :D
 
 
2 hours later…
5:15 AM
Hello.
 
hi all, i am awake
 
Same here.
@dskanth Did/Do you work with ZendFramework?
 
5:27 AM
yes i worked on it, but know very little about it
 
@dskanth Okei. I just don't understand thoroughly Zend/Application/Resources. Do they load automatically when application starts or they are just somehow specifically available. In a few words, what is their purpose. They: classes from that directory.
 
does anybody happen to know the term for the part of a webpage that is visible when a page is opened. (without scrolling)
 
@Moak Should there be a specific term for that?
 
yea, well for marketing, business, advertising, this might not be the right place to ask, but figured most php devs work with webpages
 
That would be one reason, but most of PHP developers I know work with web pages quite a lot too.
Maybe you are talking about frames?
@Moak Might this be what you are asking for.
"Above the fold" is a graphic design concept that refers to the location of an important news story or a visually appealing photograph on the upper half of the of a newspaper. Most papers are delivered and displayed to customers folded up, meaning that only the top half of the front page is visible. Thus, an item that is "above the fold" may be one that the editors feel will entice people to buy the paper. Alternatively, it reflects a decision, on the part of the editors, that the article is one of the day's most important. By extension, the space above the fold is also preferred by adver...
 
5:40 AM
@Eugene cool, that helps
 
@Moak Just typed your question in google :)
> the term for the part of a webpage that is visible without scrolling
Also, that should help too motive.co.nz/glossary/fold.php.
 
Didn't quite appear "above the fold" when I was searching, however I'm in china and results here are quite inconsistent. Thanks again
 
Ohhh. China. Well, that probablly changes everything.
I think no one knows how they filter their search results there.
 
it does, I'm forced to use bing more than I want to admit to
 
@Moak Okei.
 
6:00 AM
@Eugene sorry, i am late. As per my knowledge, i believe that the resources will be automatically started with application, when they are configured in application.ini file...
 
@dskanth So basically it is used to init main framework components. Got it. Thanks.
 
@Eugene yes...
you are right
the zend libraries are automatically loaded with the application..
and we can specify what all additional resources or libraries we want to load at the start of application, by specifying them in the application.ini file...
 
6:19 AM
@dskanth Thank you very much, now it is clear.
 
6:45 AM
hello, is anyone here has experience on working with google map's api? i kinda need your advice..
 
isn't it javascript?
 
there are serverside APIs fo google maps too
 
i see
 
tho' it is hard to tell what he meant , especially since he still doesn't grasp the whole "don't ask to ask" thing
 
7:00 AM
:D
 
Aji
hey guys,i got a doubt
how do you prevent an HTML form from tampering the data?
 
lolwut
html is markup. it does not tamper with data
 
Aji
i meant,when you sent the form over the network
you can always intercept the request with tools such as burpproxy from the client side itself
and alter the form values and send,so what are the possible ways for preventing this>?
 
use https
 
Aji
but even then BEFORE sending you can intercept
got a resource,but still having some doubts on that.
 
7:12 AM
actually what you should take away from that article is : do not keep "state" where user can get to it
 
Aji
true,but there is a situation where there is no other way
 
then keep value in the cookie which contains value + timestamp + hash
 
Aji
i have to send the values to a gateway where it only understands values coming in a particular way
 
and what is : "gateway" ? because here this term refers to networking - en.wikipedia.org/wiki/Gateway_(telecommunications)
 
Aji
here is an example gateway
 
7:20 AM
that is NOT a gateway .. at least not something that people understand as gateway
and anyway , they are one who verify data integrity
or at least they should
 
Aji
yes
 
anyway , this all is beside the point
use HTTPS
period
 
Aji
thanks,think i will have to explore more on this topic..its very interesting.
 
honestly , if you visit a site, and it expects you to provide your credit card info , but page is not HTTPS, you should leave that site ASAP
8
 
'Morning all.
@teresko - I'm trying to further separate stuff in a "field"-type class. I'd like to separate design-time stuff from run-time stuff.
 
7:31 AM
you could always looks at the form as a MVC-like triad ( at least that's what i do )
 
Right now, I have:

class Field {
    static $desc_name = 'Hidden';
    static $desc_short = 'A hidden field';
    public function render(){}
    public function handle(){}
}
First of, I'm not sure I can avoid static this time.
 
huh ?!?
 
But the point isn't about static, but separating design-time attributes from run-time attributes.
 
i'm not sure i understand , what are you trying to achieve with static fields there
 
@teresko There will be a UI designer.
 
7:33 AM
.. still not following
 
Therefor, desc_name/short describe what the field class does.
 
that's what PHPDoc is for
 
Hmm.
So instead of doing this through code, I should use PHPDoc?
I do have a simplistic PHPDoc parser. Didn't think it would be useful in such a situation.
 
it all depends on how elastic you want the system
 
@teresko So what you're saying is the designer-specific (design-time) attributes should be in PHPDoc? Certainly an interesting concept.
 
7:37 AM
but keeping things like "class documentation" inside code is just plain wrong
 
And an unnecessary performance hog.
Ok, point taken. Thanks @teresko
hey, viper-7 did an update
The editable code now has syntax highlighting :D
 
nice
 
7:54 AM
morning
 
its a dup and all the answers are wrong
 
cv?
 
closevote
as compared to dv = downvote and delv = deletevote
and uv = upvote.. not that this would ever happen ;)
 
@Gordon Pity voting
 
voted for moving to serverfault
 
7:58 AM
so many different close votes :D
duplicate/OT/not a real question
 
i actually cv'ed as not a real question in the beginning because the answer is rhetorical and easily found by googling
then i searched and added the possible duplicate
4 upvotes for a wrong answer sigh do people actually read other peoples reasons for -1 them?
 
I get the feeling that SO sucks more and more every day, with noobs just asking and reasking always the same, most trivially answerable questions
stackoverflow.com/questions/6568690/… That one is one of the more decent ones - but even here we already had lot's of dups (But it's not "What does Headers already sent mean?" at least...)
 
@nikic i think it was like said all of the time.. you just have to be here for a certain time to notice :)
 
SO just needs a more aggressive policy on closing
 
all communities rot in time , the difference with SO is that people at least are trying to slow down the deterioration
 
8:05 AM
I saw a proposal somewhere to give all rep given to the answers + 10 for a successful close vote
That could solve the issue
Because as it stands know it is just more effective to quickly answer yet another f*cked up question instead of searching for dupes.
breakfast, cya
 
Is it good to put 500Kb or 1Mb size images on Server and parse it though JSON parser?
 
is it correct that cron resets each month?
> @Gordon: Just to be clear: your answer is also not 100% correct, as it will execute the job on the 1. and (if present in the month) 30. so there will be a 30-day gap and then a 1/2-day gap, because the trigger is reseted on every first of the month...
 
don't know, i always try to avoid cron
 
8:25 AM
sigh got an email
> i need some asistance from a pro like you, im still studing and im trying to do a page for my father, but i have some issue, i have posted here, can u please help me? i have been stucked in that error for more than a week
along with link to a Q on SO
1 rep user
 
I bet it's a really awful question
happy monday, folks :)
 
@salathe of course it is.. spaghetti code deluxe
and lots of it
and lots of SQL injection too cuz the OP puts $_POST values unsanitized
 
@Gordon Well, theoretically he could have sanitized it already in some code before the one he shared - but ... well, I don't believe that myself ^^
I think we need some great online tool you can give a piece of source code at and it automatically prints you messages about SQL Injections and XSS
(Like RATS or how it's called. Just online and mostly for single files)
 
morning
 
@nikic im afraid that OP's code is beyond hope. I'd rewrite it completely.
 
8:40 AM
@Gordon have you looked on those slides?
 
@KamilTomšík yes, i found them interesting and consider buying the book but am sceptical because its by Apress and Apress is soso quality
 
@Gordon yeah, apress books suck, but this one is real gem.
 
8:56 AM
@KamilTomšík @Gordon What book are you talking about?
 
omfg.. the dragon age ultimate edition is down 66% to 10,20 euro.. i paid ten times of that :(
 
9:14 AM
lol
 
thats at least 80 hours of good gameplay for ten bucks.. well worth the money
 
9:25 AM
I always wondered, which one is faster?

foreach($a as $b)
   if($c){
      testA();
   }else{
      testB();
   }

vs

if($c){
   foreach($a as $b)testA();
}else{
   foreach($a as $b)testB();
}

Reason tells me the second one is better...
 
and what does your profiler tell you?
 
@ChristianSciberras if $a contains no elements, first one will be faster :-P
 
Morning
 
@KamilTomšík - smart ass :P
@Gordon No profiling yet
 
@ChristianSciberras dont trust reason if you can have numbers
 
9:34 AM
@ChristianSciberras Note though that both codes don't do the same thing
They are not interchangeable
At least if $a is an Iterator both codes could behave differently (e.g. if $a can be iterated only once)
 
9:51 AM
It's either one, or the other, therefor iteration is only once.
@Gordon Do you recall anything that might cause an HTTP 504 error? Related to file uploads?
 
@ChristianSciberras apart from the obvious explanation of "server was acting as a gateway or proxy and did not receive a timely response from the upstream server."? No.
 
Incidentally, the server is being accessed directly.
This sucks :(
 
@ChristianSciberras Oops, sorry, don't know what I was thinking than I wrote that ^^
@ChristianSciberras 504 is an error you get with pretty many server errors. In my case it's often FastCGI / PHP-FPM related (i.e. I sometimes get it if all 50 worker processes are busy or something like that)
 
Well, the client is uploading a large image
And often gets a 504 error.
 
Hm
Maybe too strict post size limit? Or upload file size limit?
 
9:58 AM
Interestingly, I never got the error form uploading myself (large files as well).
Had to install fiddler to see this on the client pc. Double suckers.
The server script doesn't even fault.
 
Is your client using IE by chance?
 
@nikic - :D
Nope, firefox and chrome
msie faking server errors would be bad. really bad. :P
 
10:28 AM
@Gordon If you could choose method with 0, 1, 2 parameters, which one would you prefer?
 
@KamilTomšík 0/monadic
 
@Gordon right, less the better. I'm considering implementing new language, just for fun. I'd like to restrict max number of parameters to 1 or maybe even drop them at all... what do you think about that?

BTW: every function can be monadic, isn't that right?
 
@KamilTomšík if that would be possible or desirable wouldnt there be a language that already enforces that? I think less arguments is better is a good guideline but not necessarily a good rule to be enforced.
 
'lo all
 
@Gordon sorry for this one, but current languages are not even that far to admit that all data should be private. (public/protected modifiers)
 
10:40 AM
@JohnP yo. They got Dragon Age Ultimate Edition for 10 bucks :(
 
@Gordon haha yeah I noticed. DA2 down as well. Makes one wonder why we ever pay full price
 
@KamilTomšík tbh, i think using no return values and making everything monadic will only complicate the code
@JohnP i was tempted to buy da2 but have to resists until winter sale when its likely up for 10 bucks too
 
@KamilTomšík How is a language without parameters supposed to work (well, unless it uses globals always, but I doubt that you want that...)
 
@Gordon Yeah, better to wait till it's bundled with the DLC as well. Fallen prince or something
I picked up Just Cause 2 for 5 bucks yesterday
impulse purchase!
 
@Gordon which does not necessarily mean worse - and it depends on syntax - for example if closure would look like this: {code}, then it wouldn't be much more extra typing...
@nikic don't know - yet, I have one idea, but not sure if it will work...
 
10:45 AM
@KamilTomšík this isnt practial enough for me :)
 
@KamilTomšík Could you explain your idea? Cause I really can't imagine how it's supposed to work
 
@nikic implementing high-level code (your app) without parameters is possible, however low-level ones - that's where I've stopped for now. because I don't want any "language/code separation" magic, I want meta-circularity too, even numbers have to be implemented in that language.
@nikic I could, but I don't want to :) you would just laughed to me... that's why I want to implement this first - to try if it could work...
 
@KamilTomšík I promise, I won't laugh (too much :P)
 
@KamilTomšík you never care if I laugh about you
 
this time I do, because I'm not even sure, if I'm right...
 
10:52 AM
... just tell us ...
 
@KamilTomšík just the fact that you're thinking about creating a language is cool enough!
 
heh, ive been thinking about creating a language too. It's called UniX#orn
 
ok, here's my mind-process
1. less forms, less form fields, the better - same thing applies even to parameters.
2. so if UX and programming have this similarity, maybe they share something other too
3. what can we do if we need input from user, but we can't use any textbox?
4. sliders, selectboxes, buttons
5. which basically means - all possible parameters have to be there already, you'll just select which one you want.

@JohnP creating language is not hard - even DSL is language... I've already done a lot of them and I guess you did too.
@Gordon what is it about? :)
 
it works like this
program
    assemble with
        Developer
        MindMachineInterface
    respond with
        application

application
    run
 
11:02 AM
the program directive will read the application from the developer's mind with the MMI and compile it. Then application run will run it
this works the same for any application
so its all the code you'll ever need
 
@Gordon Your code is very verbose
 
@KamilTomšík say that to people who can't even do a FizzBuzz test : codinghorror.com/blog/2007/02/why-cant-programmers-program.html
 
@nikic yes, it's a DSL
 
@Gordon Is there some sort of MMI library I need to download, too?
 
@Aether no, its part of the language
 
11:04 AM
@Gordon now make it metacircular - write programming language, which will read your mind and program better programming language ;)
what do you think btw? about my thoughts?
 
@KamilTomšík it can do that and will finally respond with exec(42)
 
or it will open wormhole to another dimension and suck you in :-D
 
I recently saw a proposal for PHP to show an xkcd comic whenever goto 42; is invoked.
 
@KamilTomšík i think your programming language sounds like a UI toolkit
 
@KamilTomšík I don't think that you can write a language without parameters. It just won't work.
 
11:09 AM
next: fries
 
@Gordon yeah, my philosophy is that application should reflect desired UI. so that's probably the reason.
 
@KamilTomšík Furthermore: You can't always provide all possible values. E.g. if you have a form field somebody shall type his name in, you definitely can't provide a list of all possible names
 
@nikic yes, but you can provide alphabet
yeah, another thing I've forgot to mention - there won't be any immutable types...
 
@KamilTomšík Usability? ... I mean, it would take me a minute to create my name by selecting alphabet characters probably...
 
@KamilTomšík i think you might like naked objects
 
11:12 AM
@nikic UI layer can help you with this
@Gordon I didn't :-D
 
@KamilTomšík I don't understand. How will making the user select his name not make it a parameter?
 
you know - I'm glad you've said that it's impossible, will be a lot more fun to try it...
@JohnP he won't, he will "type" it - but not by setter, but rather by calling methods. typeA, typeB, etc... I know how it sounds, but it's just experiment - for now...
 
@KamilTomšík oh, I see. So even a letter is a method or type. You're proposing to model everything as primitive types?
 
@KamilTomšík Sounds crazy and complicated :D
 
it's still too early to say anything - I've just liked the idea of no parameters. so I want to give it a chance.
I'm partially convinced that typing will just disappear step by step - thanks to touch/voice recognition/ocr technologies. you already can get rid of half of your form fields, and then transform another half of them to sliders and selects. and make nothing required. so typing might not be a problem...
 
11:27 AM
Aren't typing, voice recognition, OCR all just different input types. Any way the data comes in, you're still having to deal with arbitrary strings, no?
 
yeah, but it can just call typeXxx methods - it won't be so painful...
 
@KamilTomšík It will
@KamilTomšík Especially if you get to voice, as you just mentioned
 
maybe :-)
 
:D
 
But if you're using typeA, typeE, typeT etc, when someone types a name, won't you still be calling those things even if you're getting your data from voice/OCR/wherever else? Is that the idea?
Or am I missing the point, and each letter isn't it's own method/type.
 
11:32 AM
each letter has to have its own method
 
what are the "documentable" items in PHP? class, function, variable, namespace
 
What do you mean by "documentable"? As in, can have it's own docblock comments?
 
@Aether yes
 
Only one I can think of that you're missing is file.
 
@ChristianSciberras file too
 
11:34 AM
file...?
 
Yeah, if you put a docblock at the top of the file, it's a file docblock.
<?php
/**
 *
 * This file is for...
 */
 
oh
that's the "default" docblock
 
Semantics. :P
 
I need to fix T_VARIABLE and my parser is of to go.
You see, class/function look like: T_FUNCTION, T_WHITESPACE, T_STRING ( function test() )
Same with class and namespace.
But variable is different
 
@ChristianSciberras What are you trying to do currently?
 
11:42 AM
@nikic PHP Doc parser in PHP
under 150 lines :P (with spacing, comments and all)
Should be finished, at 144 lines. :P
It was already finished, but I decided to make it relate to what follows the docblock.
In order to make it work with @teresko's idea.
Before that, it just parsed docblocks from a PHP file.
 
@ChristianSciberras but php can do that by itself... ReflectionClass::getDocComment()...
 
@KamilTomšík Surprise surprise. sigh
 
@KamilTomšík what else can it be used with? namespaces, functions, properties, constants?
 
I doubt about namespaces, but others should be supported - IMHO everything you can get from reflection...
 
11:48 AM
@KamilTomšík - Wait, but it doesn't actually parse the docblock?
 
@ChristianSciberras it does the most of hard work - like ignoring $var = "/** */class xxx{}";
 
I used token_get_all() to actually parse the source. The only real parsing I did was for phpdoc.
 
so you can use reflection instead of tokenizer...
but you'd have to load that classes, of course...
 
What if I wanted to parse whole file? :P
 
depends on your preference, I would choose reflection
 
11:51 AM
Well, if it's about a few known classes, reflection is certainly the way to go.
 
@ChristianSciberras I hope you don't :-P
I like kohana way of doing this - documentation is just another sub-app, so it's always concrete - it shows only what is available to you...
 
@KamilTomšík Well, this way I do get finer grained controls. Plus I'm not dependent on incomplete functionality.
What's kohana got to do with this?
> If you're using a bytecode cache like eAccelerator this method will return FALSE even if there is a properly formatted Docblock. It looks like the information required by this method gets stripped out by the bytecode cache.
Hehehe :P
 
@ChristianSciberras all of this is generated from doc comments of your already running application - which is nice... kohanaframework.org/3.1/guide/api
@ChristianSciberras yeah, right - but accelerators are for production, not for development - they have a lot of other nasty cons...
 
I'm using this in production though.
Not production as in on-site.
But by the backend managers.
 
find 10 mistakes : pastie.org/2162339
 
11:58 AM
well, feel free to do it your way :)
@teresko cool :-)
 
i suspect that Yii developers have to pay for each curly-brace they use
 
@teresko Why does createComponent get called inside getModule?
 
i'm not sure
 
statics, conditionals - even nested and bitwise, ===, no curly braces, arrays instead of objects, excessive number of parameters?
I can't even read it :-)
 
@ChristianSciberras what i know is that it will be executed in CWebApplication class , which extends CApplication class which extends this class ( CModule )
 
12:02 PM
@teresko :S
 
ooooh :-D
 
yeah , its a real state of art framework
 
> @KamilTomšík + @teresko + @ChristianSciberras = Drama / Serious Business
 
@teresko Don't insult modern art, will you?!
@Raynos :D
 
@Raynos cheers :-P
 
12:10 PM
Why don't we have one unified scripting language?
Called <strike> Script </strike> CommonLISP with one syntax.
Oh wait it already exists. Why don't we use commonLISP for everything?
 
posted on July 04, 2011

Latest PEAR Releases: pearweb_pepr 1.0.5 XML_RPC2 1.1.0 XML_RPC2 1.1.1 Mail_Queue 1.2.7 Net_DNS2 1.1.3 HTML_QuickForm_Renderer_Tableless 0.6.2

 
common lisp is so nice :)
 
I find it a pain to context switch between js, php, ruby and python. It would be nicer if they had the same syntax / api / are the same language
 
@Raynos lisp allows parameters in functions - and that sucks :-D
 
and this is how Yii::createComponent() looks like : pastie.org/2162383
 
12:12 PM
<?php

class foo {
public static $property = 'a';
}
class bar extends foo {}

var_dump(foo::$property);

bar::$property = 'b';

var_dump(foo::$property);
Can anyone explain why this gives me a and then b?
I mean, I set the static property on bar, not on foo
 
@Raynos pyjs, pyphp, pyruby, python?
 
still the property of foo changes too
 
@Raynos BTW: you can always implement your own lisp anywhere :-P
 
@nikic Since it's static, it gets from the parent.
I had that same issue with storing the currently calling class.
The non-static guys may have a point about static being bad. ;)
 
@ChristianSciberras No, that's another issue (late static binding). In this case foo gets the property from the child for some reason
 
12:14 PM
just stop abusing static variables
 
@salathe you've forgot the most interesting one... pypy
 
@nikic I fixed the issue, my issue was with storage.
 
@KamilTomšík ... We need paramaters. We need currying, we need partial applications, we need monads.
 
@teresko That is a question I was just asked, not something I use
 
@KamilTomšík the py on python is recursive :)
 
12:15 PM
@nikic Try changing the parent's property instead. It will change the child's too.
 
@salathe Can you confirm that the same static property is shared between all classes in a hierarchy?
Because that seems really strange
 
Well, I'm off for break. Cheers guys. :)
 
@salathe yeah, metacircularity - that's why it's so interesting... it makes python so special - like lisp, rubinius, narcissus, st
 
I always wonder why nobody uses Lisp :(
Is it just because people are scared of their s-expression syntax?
 
@nikic nobody? really? I doubt
 
12:19 PM
Or is it because websites about lisp always seem so ... ehm ... modern ... lispworks.com/documentation/HyperSpec/Front
@KamilTomšík Sure, people use it, but only few
 
@nikic unless explicitly overridden, yes
 
what about P. Graham?
 
@nikic and yes, it does seem really strange
 
@salathe Thanks
 
@nikic functional languages are powerful, however with great power there comes also great responsibility. how readable is function which returns function from fuction from some other function? lisp is great platform, but I wouldn't like to implement anything in "pure" lisp
 
12:22 PM
@KamilTomšík Lisp isn't functional ;) (Well, you can do functional programming in it, if you like, just like you could do in PHP, but per se it's not functional)
 
of course, you can make a lot of mess even in other programming languages, but for example in self, there is clear boundary between meta-programming and actual programming.
@nikic no? I thought it's the only known pure functional language...
 
@KamilTomšík Maybe you are mistaking lisp for haskell?
 
@nikic as far as I know - haskell is not pure... not even a little
 
@KamilTomšík Well, yeah, Haskell allows functions to have well defined side effects
 
to me pure functional language means 1. definition of functions 2. evaluation, without any possible side-effects
 
12:24 PM
Yeah, then Haskell isn't pure functional
Though I don't like function programming anyways
 
pure lisp should fulfill this definition, not commonLisp...
 
is it just me , or overwriting incoming values for method is a really bad style
 
me neither - pure functional programming is based on returns, you're always dependent on implementation of called function.
and its global by its nature anyway :-/
 
I wonder whether one can make a language that is as meta as lisp, but using a normal syntax
 
what is normal? have you looked on clojure?
 
12:34 PM
By normal syntax I mean not s-expression syntax ;)
 
@nikic but that's what makes lisp so powerful - code as data
 
Yeah
 
12:53 PM
@teresko depends, its great in js
 
@Gordon found something you'll like -- preg-match.com/manual/en/… :)
 
01:00 - 13:0013:00 - 23:00

« first day (261 days earlier)      last day (4669 days later) »