I think that stackoverflow is rendering me even lazier than usual, but...
The problem is simpler than knapsack (or a type of it, without values and only positive weights). It consists on checking if a number can be a combination of others, and the function shall return true or false.
Ex: 112 and a list with { 17, 100, 101 } should retu...
Hi, i am developing a framework for creating efficient applications in all sizes. Applications consist of modules (application is a module too) and performance is important for me. I know there are existing frameworks for modularization etc. but i needed to implement my own. Although i overthought about performance of individual modules...
I'm working on a framework for a EA (evolutionary alg) project in Scala. In this i have a trait that implements common EA-code and leaves problem spesific code like genotype convertion and fitness testing to classes that implement this trait. However, I don't want to fully implement the trait before it is actually run because of testing ...
This might be a bit silly, but where can I find a reference (not code) that tells me, what classes (in the .NET-Framework) implement an interface? Is this even available?
I am thinking of the list one gets in the Java-API-documentation unter "All Known Implementing Classes" (like here for example: http://java.sun.com/j2se/1.5.0/docs/api...
I find it very difficult to find an XPath 2.0 implementation outside of Saxon.
What are the XPath 2.0 options in other languages ?
Note :
This blog post made an interesting summary of the situation in 2007.
...
str has other methods like __rmod__, __rsub__ or __rmul__
int did have a __radd__ method
Weird, and I'd like to know why.
Example radd beeing called when first term HAS add method:
>>> class STR(str):
... def __radd__(self, other):
... print "jeje"
... return other.__add__(self)
...
>>> 'aaaaa' + STR('bbb...
I am using Visual C++ 2008 Express for the first time for a project. And I can't seem to be able to split the .h & .cpp files for classes I'm writing. I was under the impression that you add a header file and prototype the class in there, and then you add a .cpp file with the implementation into your source files directory. Then when ...
I want to make a global vector of my own object class called "Person". However, the compiler says that
error C2039: '{dtor}' : is not a member of 'System::IDisposable'
1> c:\windows\microsoft.net\framework\v2.0.50727\mscorlib.dll : see declaration of 'System::IDisposable'
So I looked up how to implement IDisposable (which I...
I have an implementation for local datasource at
http://javascript.kunalcholera.com/
I was wondering how we could extend this to datasources which are XHR and not local datasources.
...
for reasons beyond the scope of this discussion (say xcopy an aspx page to a directory, so that we dont have to get a new build out) , we would like to implement an interface in an aspx page.Say, if the page is myPage.aspx, it is usually your class in the codebehind mypage.aspx.cs which implements the interface. When I do something like...
I want to build some thing very similar to the iphone messages app that comes by default on the iphone. I am not sure of what UI elements that i should be using to build the conversation view of the messages app.
How are the balloons created and how are they placed in positions. What UI elements are used to create the balloons ?
I am ...
I'm trying to make a maze game in Java.
The Explorer class represents the user, and the DrawableExplorer is the code that graphically represents the user. DrawableExplorer implements the Drawable interface which contains:
import java.awt.Graphics;
public abstract interface Drawable
{
public abstract void draw(Graphic...
Looking at the source of Java 6, HashSet<E> is actually implemented using HashMap<E,Object>, using dummy object instance on every entry of the Set.
I think that wastes 4 byte (on 32-bit machines) for the size of the entry itself.
But, why is it still used? Is there any reason to use it besides making it easier to maintain the codes?
...
I am looking for Qt's implemention of the function QObject::qt_metacall(_c, _id, _a); this is where a given function name is converted into index. But I am not able to find the function implementation anywhere in their source code.
int ssObject::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QObject::qt_metacall(_c, _...
Can anyone explain how @encode works to extract the datatype elements present in a given object, struct, or datatype into a type definition to be used as a class descriptor for instantiation?
Or maybe a pointer to some resources for learning about the implementation of new preprocessor directives?
...
The @encode directive returns a const char * which is a coded type descriptor of the various elements of the datatype that was passed in. Example follows:
struct test
{ int ti ;
char tc ;
} ;
printf( "%s", @encode(struct test) ) ;
// returns "{test=ic}"
I could see using sizeof() to determine primitive types - and if it was a full ...
hi, like i posted earlier and it messed up. i need to add data to a tableview from another class but the problem is i got a tableviewcontroller class and a datacontroller class.
So i need to add data to the array list in datacontroller and reload data in tableviewcontroller? Im not very good with implementation system so. Anyone know?
...
Hey everyone, this is an EXTREMELY beginner question, and I'm somewhat ashamed I don't know it already: How can I execute code just once at the implementation of my object? I have an object that's of a subclass of UIView I want some code to be executed as soon as everything kicks off, but I'm only able to get code to be executed in resp...
I'm trying to get a string displayed in my UITextView the moment the app is launched. I have a UIView and (obviously) a UITextView in my interface, and one outlet, myText, which is connected to the UITextView. It doesn't seem to be working and I can't say why....
Here is the code in question:
MainView.h
#import <UIKit/UIKit.h>
#impo...
I'm using R language and the manuals on the R site are really informative. However, I'd like to see some more examples and implementations with R which can help me develop my knowledge faster. Any suggestions?
...