I have the following code
public class A extends Iterable<Integer> {
...
public Iterator<Integer> iterator() {
return new Iterator<Integer>() {
A a;
public boolean hasNext() {
...
}
public Integer next() {
...
}
…
I started to stumble Facebook App development and can't get my Application to be added as a tab in the fan page, I think my Application should have a support for being able to be installed as a tab? what is the best practice the one I found on docs - Profile.setFBML method, but they are saying that it will be removed soon, can't get what is the…
I have a naive question about RSS feeds.
I have a series of timed events which appear on my site and that I make available as an RSS feed for other applications to import.
Who is typically responsible for truncating this feed? Over the next year, I can see my feed having thousands of items. Should the URL mysite.com/rss always return all…
I am using a custom panel as a ItemsPanel for a ItemsControl in a with a custom template that provides for a scroll viewer. (See Xaml below.) So long as my panel does not implement IScrollInfo, scrolling works in this scenerio.
I implement IScrollInfo and update my viewport and extent sizes in measure override. The scroll bar shows the…
I am writing a basic Graph API in C++ (I know libraries already exist, but I am doing it for the practice/experience). The structure is basically that of an adjacency list representation. So there are Vertex objects and Edge objects, and the Graph class contains:
list<Vertex *> vertexList
list<Edge *> edgeList
Each Edge…
I've been asked to develop a system wherein employees can mark on a form their availability on a given day of the week - for instance an employee could mark themselves as available on a given time on a given week, and unavailable on some other time. It looks a little like this:
Currently this works by rendering checkboxes within…
I used Term::shellUI module and almost every thing
is working as expected but the issue is when I pressed ctrl+c I want to
print "Please use ctrl+d to exit the shell" ,
for that I handle the signal but the message print only after I pressed the new line
how to resolve this !
Thanks in advance !
Why on earth won't this compile? Scala 2.8.0RC3:
Java
public interface X {
void logClick(long ts, int cId, String s, double c);
}
Scala
class Y extends X {
def logClick(ts: Long, cId: Int,sid: java.lang.String,c: Double) : Unit = {
...
}
}
Error
class Y needs to be abstract, since method logClick in trait X of…
Supose we have a very simple model:
Station has at least one Train
Train has at least two Stations
The model has to allow to check what stations any given train visits and to check what trains visit a particular station.
How to model it in Haskell?
I am a Haskell newbie, so please correct me: once an object is created, you…
Getting into Play 2.0, overall, blown away, great stuff.
Anyway, wondering how one can achieve DRY forms in Play? If you look at the create & edit examples in the Computer Database Sample, you'll see that the form elements are repeated. With just 4 fields (in the sample form), no big deal, but when you're dealing with…
A while back a found a great-looking framework that allowed .net developers to implement a virtual file system. I thought I had bookmarked it, but it seems I haven't.
Does anyone know any frameworks for doing this?
EDIT: Here's a hint... It had a catchy, short name and it's own domain. Sorry, that's all I can remember :p
With alle the new paralell programming features in .NET 4.0, what would be a a simple and fast way to implement the producer-consumer pattern (where at least one thread is producing/enqueuing task items and another thread executes/dequeues these tasks). Can we benfit from all these new APIs? What is your preferred…
If I want to Webhooks-enable a web application (I'm referring to the server-side of things, ie the server where the event happens and the callback is initiated from), are there libraries for this, or is this functionality typically part of the web server stack?
Or, am I looking at this incorrectly, and to…
I am using Doctrine and trying to implement an infinite scroll on a collection of notes displayed on the user's browser.
The application is very dynamic, therefore when the user submits a new note, the note is added to the top of the collection straightaway, besides being sent (and stored) to the server. …
Hi all ,
I'm looking for an open source library that implements the OAuth protocol , I need the server side implementation . Say I have a Social network system , and I want to give my users an OAth abiliy to my API , like facebook.
Do you have any suggestion , sure examples .
Thanks in advance ...
I'm familiar with the way Qt uses D-pointers for managing data. How do I do this in my code?
I tried this method:
1) move all data into a struct
2) add a QAtomicInt to the struct
3) implement a = operator and change my constructor/deconstructor to check-up on the reference count.
The issue is, when I go…
Hello,
I maintain a large document archive and I often use bit fields to record the status of my documents during processing or when validating them. My legacy code simply uses static int constants such as:
static int DOCUMENT_STATUS_NO_STATE = 0
static int DOCUMENT_STATUS_OK = 1
static int…
I'm building a class that derives from Stream to wrap a COM IStream. However I've come across an issue where I need to release the COM IStream deteministically.
Ok so that's easy just use Marshal.ReleaseComObject in the Dispose method. However I'm not sure its that simple. The Stream…
Hey guys,
I am little stumped: I have a simple messenger client program (pure python, sockets), and I wanted to add proxy support (http/s, socks), however I am a little confused on how to go about it. I am assuming that the connection on the socket level will be done to the proxy server,…
I would like to create a web server that will serve/accept json files through REST. The JSON files being served will come from a database query and format the results into JSON.
Any suggestions for a good java library. I have tried using Apache HTTPComponents.
While maybe I can just…
In a newer OpenGL there is no matrix stack. I am working on a simple display engine, and I am going to implement the transformation stack.
What is a common strategy here? Should I build a push/pop stack, and use it with a tree representing my model? I suppose this is the "old"…
well I see some interesting discussions here about static vs. dynamic typing
I generally prefer static typing, due to compile type checking, better documented code,etc. However I do agree that they do clutter up the code if done the way Java does it, for example.
so Im about…
In the XKCD comic 195 a design for a map of the internet address space is suggested using a hilbert curve so that items from a similar IPs will be clustered together.
Given an IP address, how would I calculate the 2D coordinates (in the range zero to one) that this IP is…