« first day (1007 days earlier)      last day (3944 days later) » 

8:00 PM
@rdlowrey I think the redundant argument would be a redundant argument
 
@tereško I'll agree, it has the potential to ruin space flight for a generation. I don't think it will personally, but we can agree to disagree on that.
 
user895378
@DaveRandom Well I was just looking at it like a form of "inheritance" but for functions. Makes them more like first class objects.
 
anyone willing to proof-read that:
0
A: Advantages of using strategy pattern in php.

GordonThe intent of the Strategy pattern is to: Define a family of algorithms, encapsulate each one, and make them interchangeable. Strategy lets the algorithm vary independently from clients that use it. [GoF:349] To understand what this means, you have to (emphasis mine) Consider what sh...

 
@rdlowrey Umm... just use objects? :-P
 
user895378
@DaveRandom Sometimes objects are stupid.
 
8:02 PM
@Jasper a lot of people see it s waste of money .. if it goes horribly wrong, then it can get portrayed as "waste of money an life" .. media loves sensationalizing things
 
user895378
@DaveRandom Also, you were right:
 
user895378
[QUERY_STRING] => var1=aasfsdf
[REQUEST_URI] => /?var1=aasfsdf
 
@rdlowrey yes, that could be useful.
 
@rdlowrey I have this really childish desire to respond with "sometimes you're stupid" which I am unable to fight
 
user895378
@DaveRandom It's okay, I have the same problem compulsion :)
 
8:03 PM
:-P
 
@David when you show a page with missing product, you have two options - either you send a 404 header, which redirects user to a standalone error page OR when assembling page one of the templates that gets used is a "missing product template" ... basically you have the big "page template" some "widget templates" , maybe a "interactive/dynamic footer template" and a "content template" .. in this case as the content template you use and "error message"
 
@DaveRandom: its 28c outside... its WAY above that inside
its 30c in the coolest room of my house
 
Hey, where the hell is that @Lusitanian character hiding? I'm not impressed at his lack of commitment to the cause.
 
@Gordon Lokos good. Might be better with a non-programming analogy (e.g. a Mixing console of which you want to change what the buttons and switches do) but is pretty clear as is
 
user895378
@Baba Also, it will probably bleed into tomorrow before I can finish that multi-protocol chat demo. I've had to do some real work today :)
 
8:04 PM
infact, it is so hot in the room i am in, i think i am about to begin nuclear fusion
 
@rdlowrey well done ...
 
@bizzehdee I wanted to get the A/C out but it's in the cellar, it's really heavy, and ironically I'm too hot to lug it upstairs
 
@tereško ok cool thanks. mvc isn't for the faint hearted
 
@Jasper thanks
 
@David if you aim for full realization , then it is for large scale applications
for small things you will be better off by simply adhering to SoC
 
8:07 PM
@DaveRandom: dont have an air con, bought one once, it burst into flames about 20 minutes after turning it on, so havnt had one since
 
$curry($operator('*'), 2) is shorter than function($a){return 2*$a;} :-D
 
user895378
@DaveRandom Something else to note because I'm masochistic ... I'm thinking runkit might provide the functionality you'd need for implementing a live in-browser websocket-based PHP codepad a-la $ php -a
 
@tereško this is just for my own project and learning experience but the project would get messy if I didn't use MVC I would say
 
you have to understand that the point of MVC is to bring additional restrictions to a well organized object oriented codebase, which becomes too large to handle without thos additional constraints
 
@ircmaxell operator is awesome. operators being functions just makes sense.
 
8:07 PM
@igorw I stole the idea from @NikiC
I did it a bit differently than he did though
 
@ircmaxell wth are you experimenting with?
 
@Gordon I wrote a small lib that started out doing iterator-based "Set" manipulation (collection really), and then I started adding functional primitives to it...
 
in a small "lets make a blog" applications, you will be well of with rails-like architecture, where you have just removed the major design flaws
 
and it kind-of has grown from there
 
@ircmaxell (reduce + 0 [1 2 3])
 
8:09 PM
@tereško yeah thats true but i am slightly addicted to MVC since i started learning about it
 
@rdlowrey I'm sorry but it's just too horrifying for me. I'm sure better men that myself are capable, but I'm just not confident enough in my security skillz to really take it any further. I mean at the end of the day it's actually not that mechanically complex, it's the security issue that's the real... issue.
 
everyday I code at work and come home trying to learn more and improve my MVC implementation
 
you should focus less on the MVC itself and more on the principles which it uses
 
user895378
@DaveRandom lol yeah it's terrifying ... But I think that with the options runkit provides you could prevent most/all of the potential issues.
 
@igorw $reduce([1, 2, 3], $operator('+'))
no need for the initial, because it'll use the first value in that case :-P
 
8:11 PM
@tereško yeah true. do you think by the time everything has gone good and you get to the template there should be zero none logic left to do at all
 
@David yeah, shake the addiction. It's a rather unimportant design detail.
 
it should just have data to place into the template and it's as simple as that
 
user895378
@Baba I can't duplicate your issue? Is it possible I misunderstood? See img:
 
user895378
 
@Gordon i will someday. ive been on it for over a year now with no signs of stopping
 
8:13 PM
var_dump(
    $zip(["this", "hist", "isth", "sthi"])->map($curry('implode', ""))->toArray()
);
 
@rdlowrey can i see $myApp code
 
@Gordon i find it quite disturbing , since he's generating like 20% of mvc related question in
 
user895378
@Baba yes:
 
user895378
$myApp = function(array $asgiEnv) {
    $body = '<html><body><h1>Hello, world.</h1>';
    $body.= '<h3>Your request environment is ...</h3>';
    $body.= '<pre>' . print_r($asgiEnv, TRUE) . '</pre>';
    $body.= '</body></html>';
    return [$status = 200, $reason = 'OK', $headers = [], $body];
};
 
@tereško how much rep did you make from it? :)
 
8:14 PM
@tereško i have cut down lately i used to do on average maybe 2 a day. now it likes one everyday 2 days
 
@rdlowrey am ruing :
	$myApp = function(array $asgiEnv) {
		var_dump($asgiEnv);
	    $body = '<html><body><h1>Hello, World.</h1></body></html>';
	    return [$status = 200, $reason = 'OK', $headers = [], $body];
	};
 
@ircmaxell in this case yes. but it's only possible if a) you have more than one element and b) your reduction function actually expects that value. which may not be the case when you're reducing into a list or a map.
 
@Gordon ~1000 .. approximately
 
one every 2 days*
 
@rdlowrey viewing the URL directly in the server command prompt
 
8:14 PM
@tereško you made all that from me?
 
@igorw quite true... But this case :-P
 
user895378
@Baba That var_dump happens in the console -- for anything to be sent to the client you have to return it in the response array.
 
@tereško you shouldn't feel disturbed but thankful then ;)
 
user895378
It's not like a PHP web SAPI -- anything you output to STDOUT shows up in the STDOUT of the server. It's not sent to the client.
 
ive actually got loads and loads more MVC questions but I stop myself from putting them up
 
8:15 PM
@rdlowrey I still think that starting with Viper-7's codez is the best jumping off point, if you really want to try and make it happen. I know (s)he (reasonably certain he?) used to roam various freenode channels but that was while ago.
 
like my one a 30 mins ago I had another to put up right after that but i decided not to. especially now since @tereško mentioned people are noticing...
 
@rdlowrey a URL http://localhost:1337/erere/erewrewrew/ewrew was requested .. i want to parse it and send info to client ??? are you saying var_dump would manipulate that the data because its cli ?
 
@David well ... in general you will still have some logic in form of <?php echo isset($foo)?$foo:''; ?>, but yes , templates should work either with prepared data or maybe (I'm still thinking on it) with presentation objects.
 
@David you likely focus too much on concrete implementations. MVC as a high level pattern is dirt simple
 
user895378
@Baba No, I'm saying do this:
 
user895378
8:16 PM
$myApp = function(array $asgiEnv) {
    $body = '<html><body><h1>Hello, World.</h1><pre>'.print_r($asgiEnv, TRUE).'</pre></body></html>';
    return [$status = 200, $reason = 'OK', $headers = [], $body];
};
 
implode(" ", $zip(["Tcwci", "haoat", "inrn?", "stk "])->map($curry('implode', ""))->map('trim')->toArray())
 
@tereško i have been looking into those presentation objects. read the martin fowler article 2 or 3 times. at the moment I think they are better for applications with state like a desktop one
 
Anyone know of a good brief mercurial (hg) tutorial?
 
Yay questions that the title answers the question: PHP UNIX socket XAMPP
 
@Gordon yeah i do. i seem to be trying to make this ultimate perfect MVC app
 
8:18 PM
@ircmaxell I'd rename curry to partial
 
@David they are for repeating fragments of UI logic. For example: navigation
 
user895378
@Baba Note that for anything sufficiently complex you wouldn't want to use a closure. You'd be better served to put it in a class with __invoke and specify the string class name in the 'application' => 'MyApp' part of the config.
 
I found Joel's tutorial, but it's assuming you don't know dvcs at all, meaning that it's far from quick
 
your every page would have a main menu , but you do not want to repeat the logic for it again and again and again
 
@David it would be the first
 
8:19 PM
@rdlowrey i have an issue with this
 
^ what Gordon said
 
Listening for HTTP traffic on *:1337
CON: 127.0.0.1:42508 | (1)
CON: 127.0.0.1:42509 | (2)
REQ: 127.0.0.1:42508 | GET /erere/erewrewrew/ewrew HTTP/1.1
string(23) "/erere/erewrewrew/ewrew"
RES: 127.0.0.1:42508 | HTTP/1.1 200 OK
REQ: 127.0.0.1:42508 | GET /favicon.ico HTTP/1.1
string(12) "/favicon.ico"
RES: 127.0.0.1:42508 | HTTP/1.1 200 OK
CON: 127.0.0.1:42679 | (3)
DIS: 127.0.0.1:42509 | (2)
DIS: 127.0.0.1:42508 | (1)
DIS: 127.0.0.1:42679 | (0)
 
@igorw why? (curious)
 
@rdlowrey ^^^
 
@tereško i use a composite view though where the header/navigation is its own View
 
8:20 PM
@igorw so curry => partial, and curryLeft => curry?
 
user895378
$config = [
    'options' => [
        'verbosity' => Server::QUIET
    ],
]
 
@ircmaxell because it's not currying. currying is transforming foo(1, 2, 3) into foo(1)(2)(3)
 
@rdlowrey not that
 
so i am finding it hard to see how the presentation objects would help
 
Ahh, partial and partialLeft?
 
8:21 PM
@David on a side note: stackoverflow.com/questions/14101939/… is not about MVC.
 
@rdlowrey using var_dump($asgiEnv['REQUEST_URI']); i get string(23) "/erere/erewrewrew/ewrew" and string(12) "/favicon.ico" in cli
 
definition of partialLeft?
 
@ircmaxell too much magic, imho
 
well, afaik partial usually adds the args to the left
 
partial(f(x,y,z), x) == g(y, z), partialLeft(f(x,y,z), z) == g(x, y)
 
8:22 PM
@Gordon your right. that question may be back before i found out about MVC on the web
 
and I guess that's simply based on the fact that you sometimes don't know how many args you actually have
so it's hard to tell which one you should be replacing on the right
if there are varargs
 
that's why left just appends the arg to the end of the resulting arg list, and non-left appends the new args:
        'partial' => function($a, $arg) {
            return function() use ($a, $arg) {
                return call_user_func_array($a, Set([$arg])->append(func_get_args())->toArray());
            };
        },
        'partialLeft' => function($a, $arg) {
            return function() use ($a, $arg) {
                return call_user_func_array($a, Set(func_get_args())->append([$arg])->toArray());
            };
        },
 
one of the things react/curry (a misnomer) supports is placeholders.
 
i have 51 questions. more than i thought
90% are MVC i'd say
 
$firstChar = Curry\bind('substr', Curry\…(), 0, 1);
$mapped = array_map($firstChar, array('foo', 'bar', 'baz'));
 
8:24 PM
@David here is a direction for you : try learning advanced native javascript
 
That would be: $partialLeft($partialLeft('substr', 1), 0) here
 
it's a rare skill these days
 
@Simon_eQ on SO? Yeah....
 
ok. well maybe a default of right makes sense for PHP, I don't know.
 
@Baba I'm having difficulty seeing why that's not what you expect from the above?
 
8:25 PM
@tereško me and javascript not so good
i can do stuff with the DOM and use jquery to do some AJAX etc but
 
well ... start looking at it
 
are you being serious?
 
quite
 
what would i learn out of that besides native javascript
 
@igorw Actually, no... the full would be: $first($partialLeft($partialLeft('substr', 1), 0))
where $first cuts all but the first argument away
 
8:26 PM
FYI jQuery is not DOM manipulation, it's string manipulation
 
it would also improve your PHP code, since in 5.3+ you can use aspects of functional programming
 
i could be posting 10 javascript questions a day
 
(most of the time)
 
hmmm
did you have a look at GO?
seen a video on youtube has a good amount of views but still haven't watched it
 
@David for example , the "provider" bit here comes directly from stuff i learned with JS
 
8:28 PM
@David I also highly recommend you learn JS inside out. I also highly recommend you never listen to anything I have to say on the subject apart from the sentence before this one.
 
@ircmaxell Moin! I'm not banned anymore and I have still no answer from your side. What is your plan to implement toInt() and friends if you are not talking to developers?
 
as a PHP-only developer you do not understand the point of closures
 
@DaveRandom i can do enough to get by but i can't do anything crazy with it
 
@DaveRandom It was my mistake .. /favicon.ico made the second request that is why i did not see the variables
 
8:29 PM
@tereško no i do not
@tereško i did that stuff in college with Java
did not go in much so can't remember a thing
 
@tereško I saw that semi-pattern in another answer of yours the other day, it had never occurred to me that you could implement things like that with closures in PHP before even though I do it in JS all the time. I have always just passed in classes with a single method, then you decouple it with an interface and you have two whole entities there just to deal with 3 lines of code :-S
 
@igorw I don't know either. This is just me futzing around messing with some things...
 
I am being quite serious, @David . Stop pushing for "perfect MVC". Let it sit in the back of your brain for some time and instead expand the list of tools that are available for you.
 
no such thing as a general perfect mvc, only one that "is good enough" for what you want it for
same with almost any design pattern or framework
 
@ircmaxell I recently thought about sets as well, and that it would be nice to have them in core.
 
8:34 PM
At all: would you like PHP supporting magic mehtods like __toInt(), __toBoolean(), __toDouble() ?
 
@Baba Yeh favicon.ico has got me in various ways a few times in the past. I would like browsers to unilaterally stop looking for the default icon and only request it when <link rel="icon"> is present. Although obviously that will never happen, so I would at least be able to disable it in my browser settings. I don't like my dev sites making requests I didn't explicitly ask them to.
 
@hek2mgl hell yeah
 
heh, looks I missed a bit of drama 5h hours ago
 
@hek2mgl missing: __toArray() and __toResource()
 
@hek2mgl and maybe a __toUserType($typeName)
 
8:37 PM
@Gordon i just don't want to see this room turning into php version of javascript room =/
 
@tereško Are you on the "in true MVC applied to the web the V should be implemented in JS" brain-train again?
 
@DaveRandom nope
 
@DaveRandom is this a good practice for servers to request favicon even if it was not requested via link ?
 
Shame. I was considering it last night :-P
 
8:38 PM
we all do , once-in-a-while
but it is not really viable
 
@Orangepill Yeah! me too! ;)
 
@Baba Good? No. Standard? Yes. :-(
 
@tereško @DaveRandom wasn't twitter doing that?
 
@tereško me neither, but the JS solution is definitely nicer than the regular gallery mode
 
@DaveRandom ok thanks
 
8:39 PM
@tereško With websockets and the history API it might be.
 
@igorw this is more about Collections, but yes
 
(is my current line of thinking, we'll see how that pans out :-P)
 
@Gordon i would be just fine with administrative bot that cannot speak
 
@tereško right, because a few useful macros is so bad. Especially for link generation and common things we repeat all the time
 
user895378
@DaveRandom I tend to agree with you on this. I think Websockets could make it feasible.
 
8:41 PM
@ircmaxell do you recall , how people acted when they figured out "you can write tags in the chat" ?
no factor in the ability to make dynamic queries
 
@Orangepill It seems that we must unite to make that happen once a day
 
@tereško yeah, nothing. It made things a little more colorful, but it wasn't a great tragedy
 
@tereško wait, are you saying you don't like the ?!?!
 
8:43 PM
@rdlowrey I'm currently kicking it around the back of my brain periodically. I may be up for looking at making it really happen at some point in the future
@Baba (IMHO - I don't believe the client should be doing anything I didn't ask it to)
 
@NikiC i'm saying that abuse is a problem .. also, evidentially - the configuration and maintenance too
tags are static .. the novelty worn of in a day
 
user895378
@Baba see what happens if you access a site using an iPad (or other apple product). It will make at least four requests trying to get icons for every one URI the browser actually requests.
 
@DaveRandom That is exactly the way i feel too
 
the JS room still gets flash floods of "lets talk to the bot" several month after the introduction of that bot
 
user895378
I wonder how many terrabytes of internet bandwidth is wasted on favicon requests every day :)
 
8:45 PM
@rdlowrey not noticed that .. would set up a proxy and try it out
 
@rdlowrey none
 
@rdlowrey it's how i share my ISOs
 
@rdlowrey and is redirectected to nsa, china, and private hackers
 
user895378
@Gordon Only if people actually serve the favicons. As long as you don't provide one browsers keep asking for it.
 
@rdlowrey nah, even then it's spelled terabytes ;)
 
user895378
8:47 PM
@Gordon <--- guilty.
 
♫♪ and the judge's gavel fell. you got stripes … ♫♪
 
user895378
Sentenced to 30 seconds in spelling jail.
 
Regardless, I'm sure it's a terafying amount of wasted bandwidth
...and I'm going to bad-pun-jail for a lot more than 30 seconds
 
@DaveRandom it will terahole into your harddrives
 
@rdlowrey running Syn Flood on the server at the moment ... standing strong ...
 
user895378
8:52 PM
@Baba nice!
 
Forgive me Aerys, for I have syned
 
user895378
@DaveRandom lol. must. not. star.
 
Right, I'm banning myself from talking for 5 mins after that
 
user895378
I appreciate the old man humor because ... well ... I'm an old man.
 
@rdlowrey 30,0000 request still runing
@rdlowrey 50,000
 
user895378
8:54 PM
@Baba Have you tried out ModLimit yet to rate limit IPs?
 
@rdlowrey nope
 
@Baba It's possible the OS is stepping in at that kind of rate
 
user895378
@Baba just add this to the 'mods' section of your host's config:
 
@DaveRandom Mostly Likely
 
user895378
'mods' => [
    'limit' => [
        60 => 150
    ]
]
 
user895378
8:56 PM
That will rate limit individual IPs to 150 requests per minute.
 
What does 60 mean?
 
user895378
@DaveRandom That's the time period in seconds.
 
@rdlowrey Wouldn't it be per minute then?
 
user895378
@DaveRandom yeah, but the point is you can specify as many different combinations as you like.
 
8:57 PM
@rdlowrey Crashed at last
 
@Baba Memory?
 
user895378
@DaveRandom I'm just going to ninja edit that and pretend like it didn't happen (seconds)
 
@Baba Crazy behaviour!
 
@Baba unplug the network cable, if possible
 
8:59 PM
Also what happens if I specify 0 => 150 ? ignored?
 
user895378
I'd have to look at the code -- wrote it months ago.
 
user895378
@DaveRandom It looks like at the moment you'd just rate limit every single request :)
 
user895378
But obviously that's as simple as you not being a moron in your config file or me adding a filter_var call up front to eliminate the possibility of you being a moron in your config file.
 
@rdlowrey why not reading the manual?
 
user895378
@Baba The cool thing about the mod system is that you could take something like ModLimit and extend it to automatically update iptables or whatever firewall system with bad IP addresses before an attack became a real problem.
 
9:02 PM
@rdlowrey Indeed, but this is the kind of thing that Apache gets regularly criticised for - specifying stupid things in the config file often passes validation and produces equally stupid results
 
user895378
@DaveRandom I agree with you -- when possible I've tried to insert as much validation as possible for up-front configuration settings like this.
 
@rdlowrey OS crashed .... i had to restart
 
- also OT from pretty much everyone here's music tastes I would imagine (including mine), but it doesn't stop it being awesome
 
@rdlowrey Seems that you are a smart guy! wow! :)
 
Also Friday night is Florence night
 
9:04 PM
what is with __toInt()? who is with my patch?
I need YOU
 
@DaveRandom i would need to run it again .... Windows crashed
 
@Baba lulz
 
user895378
Okay gentlemen, time for me to go do some normal people things so I don't feel bad when I come back and code some more later tonight.
 
__toInt()
 
9:06 PM
@rdlowrey totally unacceptable
 
@DaveRandom Your computer was not assigned an address from the network (by the DHCP Server) for the Network Card with network address 0x0C60762487BA. The following error occurred: 0x79. Your computer will continue to try and obtain an address on its own from the network address (DHCP) server.
@DaveRandom looking at the event log
 
@DaveRandom I like Dean Martin
 
alcohol + __toInt() will do the job
__toInt()
 
@hek2mgl There was a feature request for a __toInt but it was shot down.
 
@hek2mgl can you please stop spamming? Thanks!
 
9:08 PM
Faulting application name: php.exe, version: 5.4.14.0, time stamp: 0x5165bed9
Faulting module name: php5ts.dll, version: 5.4.14.0, time stamp: 0x5165ce81
Exception code: 0xc0000005
Fault offset: 0x0004f4e0
Faulting process id: 0x27e4
Faulting application start time: 0x01ce84be0b33f450
Faulting application path: C:\php\php.exe
Faulting module path: C:\php\php5ts.dll
Report Id: b9a471c8-f0b5-11e2-8618-b1d6e9ac23fe
 
Yay tiny avatars
@Gordon Good man. I liked you.
 
@Gordon Note that I'm drunken. I'll try. Sorry
 
I might crack the Matt Monro out shortly
 
@hek2mgl then get off the keyboard please (or contribute to CodeIgniter) ;)
 
*CodeIsShiter
 
9:10 PM
@Gordon maybe you are right when saying: 'Get off the keyboard'
 
@hek2mgl yeah, I have habit of saying things that are maybe right :)
 
@Gordon hehe
 
My mouse has gone missing AGAIN. I blame @PeeHaa.
 
Does anyone have a recommendation for an example codebase where the URLs for a rest API are autowired up from the domain objects?
Or library for doing that.
 
@Danack .Net MVC 4?
 
9:22 PM
stackoverflow.com/questions/17753910/… although it's hard to find an decent close reason now that TL doesn't exist.
 
@DaveRandom he found the solution with your help. I guess it doesnt hurt to keep it around just in case
hmm … I had expected this vodka red bull to have a more wasting effect :/
 
It definitely falls into the "specific moment in time" category that TL used to apply to though. Also it seems a little bit rtfm/basic debugging (is something broken? am I running the latest version? no? upgrade and retest) although at the same time rtfm isn't necessarily an acceptable close reason
@Gordon I only drink vodbulls in clubs, I wonder if it maybe more of a psychological effect?
 
Anonymous
@Orangepill Just hard to believe, thats all.
 
@Simon_eQ the secret is I only sleep about 4 hours a night :)
 
Yellow !
 
Anonymous
9:34 PM
@Orangepill and the other 20? oO
 
@DaveRandom I'll just have another one
 
Anonymous
@HamZa suuuuup
 
@Gordon There are few situations in life where that's not a good idea
 
Tired, one busy day ...
Left up at 2:45 (am) and at something
After that worked on a CTF challenge
sleeped for 2hours
had an exam far away
slept for 1h
worked for 3h
And you ?
 
@DaveRandom I'm a moderator on this site. what could possibly go wrong?
heh, I am smart. I now got a vodbullmeister
 
Anonymous
9:38 PM
@HamZa Nothing. Just bored as usual.
 
@Gordon I'm proposing a new badge on meta
 
@Simon_eQ heh, don't give up :)
 
Anonymous
@HamZa hmm, a lot easier said, than done.
 
@DaveRandom what do you get it for?
 
@Simon_eQ I know :(
 
Anonymous
9:41 PM
I tried to jump off a bridge, but couldn't find any, nearby, so I just came back :p @HamZa
 
@Gordon Editing a comment 10 times where levenshtein($oldPost, $newPost) <= 3
 
Anonymous
@HamZa did you read what I sent you, yesterday?
 
@Simon_eQ lol you serious ?
 
@DaveRandom wait? WHAT? I do ALL TEH TIME! :(
 
@Simon_eQ I did read some of them, bunch of retards or egoist helpvampires ...
 
Anonymous
They are funny though, at-least the way they wrote it @HamZa
 
Anybody got any fire they can spare? github.com/wordnik/swagger-core/wiki/java-jax-rs
@Path("/pet.json")
@Api(value = "/pet", description = "Operations about pets")
@Produces({"application/json"})
public class PetResource {
  @GET
  @Path("/{petId}")
  @ApiOperation(value = "Find pet by ID", notes = "Add extra notes here", responseClass = "com.wordnik.swagger.sample.model.Pet")
    @ApiErrors(value = { @ApiError(code = 400, reason = "Invalid ID supplied"),
    @ApiError(code = 404, reason = "Pet not found") })
  public Response getPetById (
    @ApiParam(value = "ID of pet that needs to be fetched", allowableValues = "range[1,5]", required = true) @PathParam("petId") String 
 
@Simon_eQ I really want to answer all of them, but no time for that and maybe not worth it
 
that look reasonable .. not
 
Seriously when number of comments > number of lines of code, YOU'RE DOING IT WRONG.
 
9:44 PM
@Gordon It has to be the same comment edited 10 times within the grace period, that's probably harder to do
 
@DaveRandom I do lots of spelling mistakes!
 
Anonymous
@HamZa How would you validate foo.php?foo=foo in regex? meaning, foo could be anything ... ?
 
damn, it's hard. that was eight only.
 
It's probably easier with a longer post
You're clearly not drunk enough yet
 
@Simon_eQ can you give a more "realistic" example ?
 
9:47 PM
@DaveRandom glass ain't even half empty
 
or do you just want
letters [dot] php [question mark] letters [equal sign] letters ?
 
Anonymous
Exactly @HamZa
 
@Gordon Ahh, so you're glass-half-full kind of guy?
:-P
 
nah, half full usually
 
@Simon_eQ In php ?
 
Anonymous
9:51 PM
@HamZa yup
 
well in regex php you can use \p{L} for letters see http://php.net/manual/en/regexp.reference.unicode.php
So it becomes:
^\p{L}+\.php\?\p{L}+=\p{L}+$

^       : match begin of line
\p{L}+  : match a letter one or more times
\.php\? : match .php?
\p{L}+  : match a letter one or more times
=       : match =
\p{L}+  : match a letter one or more times
$       : match end of line
If you want to include digits then use a character class
[\d\p{L}]+
Note that \d will also match hindo digits for example
 
Anonymous
@HamZa thanks a lot, and for the details too. I will check it now.
 
@Simon_eQ You're welcome
 
Anonymous
What does the backward slash / mean by itself, anyway?
 
/ is a forwards slash, \ by itself would just be `\` codepad.org/3b9e7HPH
 
9:58 PM
@DaveRandom vodbullmeister. whoah. I guess I'ma get off teh keyboard now too :D
 
@Simon_eQ where ? in the regex ?
 

« first day (1007 days earlier)      last day (3944 days later) »