I've written an antlr grammar for parsing Php files. It's still missing some features and it doesn't support the new stuff that was added in Php 5.3. You can get more details on the project page.
Or you could directly go ahead and download the source and the jars.
For people who get a lot of phone calls, a service to allow callers to join a queue of callers who will be automatically notified when the callee is free.
Case 1: Caller calls number. Is informed that callee is busy at the moment and will call back when available. The caller is added to queue of callers and is automatically called when callee is available.
Case 2: Caller uses web interface to book a slot with callee at a specific time. The caller is automatically called at that time and connected with callee.
There will be a webui with estimated waiting time for the call to get through and information about the size queue. The caller will also be ale to configure when the call should be made.
Non-Believer: God doesn't exist.
God: Ok, I can fix that.
Nu-Believer: How do I know what I know is right.
The heart is in the right place. But the stories are weak sauce.
It's the trailer for Spike Jonz' new movie. I'm really looking forward to this. The best part of the trailer was Arcade Fire's
Wake Up playing in the background.
Here is a simple function I wrote to collect the results of multiple asynchronous function calls and pass them as a list to a single function.
function parallelExecuter(executer, operationCount){
var parameters = [];
var n = 0;
var ctr = 0;
function makeParallel(operation){
var id = n;
n++;
function cookie(){
parameters[id] = arguments;
ctr++;
if(ctr == operationCount){
executer(parameters);
}
}
operation(cookie);
}
return makeParallel;
}
Using it is quite simple. Define two functions getOne and getTwo, which will act as asynchronous functions. Each accepts one paramerter which is called with an integer value as it's parameter. And a function, sum, that totals the the numbers in a list and displays an alert box with that value.
function getOne(callback){
callback(1);
}
function getTwo(callback){
callback(2);
}
function sum(l){
var total=0;
for(var i=0; i < l.length; i++) {
total+=l[i];
}
alert(total);
}
Call parallelExecuter with the final function to call and the number of asynchronous operations, here sum and 2 respectively. This returns a function which is used to queue the asynchronous calls, getOne and getTwo. Note that the number of asyncronous operations should be the same as was specified for creating the function or the code will break.
pe = parallelExecuter(sum,2);
pe(getOne);
pe(getTwo);
This will display an alert box containing the value 3.
A better design would be to aggregate all the pieces into a single request, but this might not be possible at times.
Antlr is a pretty good parser generator. It targets a number of languages, including Java, Python and C. I've been working on a Php target for Antlr. The code is still in early stages but quite usable. Have a look at the documentation to get started.
There is also a pre built Antlr download to use. The source is available on svn.
svn checkout http://antlrphpruntime.googlecode.com/svn/trunk/ antlrphpruntime
Lots of stuff works, but I still have a long way to go before it is anywhere near complete. So expect issues. The best way to find out what works is to look at the test cases in the svn repository.
It's time to get rid of the male references from the word. The color red marks the objectionable part.
- woman
- woperson
- woperchild
Another step towards the emancipation of woperchilds from the tyranny of men.