How do you initialise a constant in a header file?
For example:
@interface MyClass : NSObject {
const int foo;
}
@implementation MyClass
-(id)init:{?????;}
What is the advantage of using a ConcurrentBag(Of MyType) against just using a List(Of MyType)?
The MSDN page on the CB (http://msdn.microsoft.com/en-us/library/dd381779(v=VS.100).aspx) states that
ConcurrentBag(Of T) is a thread-safe
bag implementation, optimized for
scenarios where the same thread will
be both producing and consuming data
stored in the bag
So what is the advantage? I can understand the advantage of the other collection types in the Concurrency namespace, but this one puzzled me.
Thanks.
Is it possible to create a simple server in Java that returns a response based on a given key?
So it would be a simple program, that stores a hashmap and returns the result based on a key provided by the client.
What would be the fasted implementation, to have it over HTTP or a socket? The client will be a web based application.
I just want ask for your comments/suggestions on how to create a customized listview (if that's a good implementation) in WPF that displays images coming from a table from a database (more like a playlist) that rotates similar to a film (moving horizontally - on loop)
Any ideas?
Hi,
In C++, there is a fwrite() which writes a buffer to a file on disk:
http://www.cplusplus.com/reference/clibrary/cstdio/fwrite/
Can you please tell me if there is any buffer inside that fwrite implementation?
i.e. if I call fwrite() multiple times (say 10 times), does it actually invoke file i/o 10 different times?
Thank you.
Already tried:
dofactory
Sourcemaking+their video
"GOF" book
"Head First Design Patterns" book
But still have problems with implementation scenarios on practice. Maybe i have too little experience? (almost 2 years using C#) Or maybe there are other resources or some methods to learn to see them?
I'm using the JQuery autocomplete plugin. I wish to override the implementation of the filllist() function. Can someone point me to an example of how to do this?
I'd basically like to get
/path/file+name+with+plusses.mp3
to rewrite to
/path/file name with plusses.mp3
In my case wordpress is intercepting the request and giving a 404. But the file does indeed exist.
Given the constraints of the regex in mod_rewrite implementation, I haven't yet seen a straightforward way of doing this.
Hi i am developing game level editor.Currently I am using win32 with directX.But with win32 I cant achieve fully object oriented implementation.So I am thinking to develop it in MFC.
Will it be better option than win32?
Which technology(MFC/Win32) is widely used in industry?
Also which technology is most suitable for my project?
Hi!
I'm a c# guy giving Java a try .. so how would I do the following in java.
in C#
public T create_an_instance_of<T>(){
T instance = default (T);
// here's usually some factory to create the implementation
instance = some_factory.build<T>();
// or even..
instance = some_factory.build(typeOf(T) );
return instance;
}
I would like to define a class that accept the pointer to it's parent class as an Argument, but would it be possible to somehow pass it without needing to pass it directly such as:
class Child
{
public:
Child(Parent* hiddenArg);
};
class Parent
{
public:
Child myChild;
};
I know this is weird, but I am making my own Signal/Slot implementation and Child would be a signal defined, but I would like to get the parent so I can use it's Event Dispatcher...
I have seen different type of js function call like
function aTestFunction(param)
{
// function body
}
and also:
aTestFunction = function(param)
{
// function body
}
what is the difference in above to implementaion? Also, i found that jquery/prototype js framework uses the second implementation in most cases. Is there any special reason for that?
Sorry, I am a novice so this question may be silly to someone but will be helpful me if any guru out there helps me with this silly question. Thanks in advance.
hi.
does vector::operator= change vector capacity? if so, how?
does copy constructor copy capacity?
I looked through documentation but could not find specific answer.
is it implementation dependent?
Thanks
For a data-binding application, I am trying to draw parallels among RelaxNG, C++ and C.
RelaxNG.Elements === C++.Class === C.Struct
RelaxNG.Attributes === C++.class-members === C.structure-members
Only that the Elements in RelaxNG can also have a data-type (i.e. it seems Attribute is a special case of the Element).
Do I have the above equivalence correct? If I use the above convention in my implementation, will I be breaking some data-binding libraries?
I'm using the Enterprise Application Block and my application is hosted in a Cloud Environment. I was wondering what else I need to do with my implementation to make it as efficient as possible.
I'm trying to figure out if I have points that make for example a square:
* *
* *
and let's say I know the center of this square.
I want a formula that will make it for eample twice its size but from the center
* *
* *
* *
* *
Therefore the new shape is twice as large and from the center of the polygon. It has to work for any shape not just squares.
I'm looking more for the theory behind it more than the implementation.
Thanks
Is this safe? I'm not using any virtual functions in my actual implementation, but I'm tempted to believe that even if I was, it would still be safe.
class Foo
{
Foo()
{
// initialize things
}
Foo( int )
{
new ( this ) Foo();
}
}
When I derive an activity from NativeActivity, I can access Workflow executionproperties using the NativeActivityContext like this:
context.Properties.Find("propertyname");
Some of my activities derive from Activity, because I they define a coded workflow using the Implementation property. An Activity has an ActivityContext, which does not provide access to the workflow execution properties, it does not have a Properties property.
Is there another way to get access to the workflow execution properties from within an Activity
These 3 types of lock are apparently bad.
What other type of locking is bad?
Are there Stylecop / FxCop rules that would catch this?
If not, then would you please help me with a custom rule implementation? They code for all of them must be similar, right?
Thank you.
template <typename T>
struct Foo
{
void operator()(T& t) { t(); }
};
Is there any standart or boost functor with the similar implementation?
I need it to iterate over container of functors:
std::for_each(beginIter, endIter, Foo<Bar>());
Or maybe there are other way to do it?
I am using JSF 1.2 - My Faces Implementation. I have a form , I use h:inputText to display few values. There are 2 input boxes which should not be edited but shown to the user and should be submitted to the server when the submit it clicked. I tried readonly="true" and disabled="true", both did not solve the purpose! Any suggestions?
I've read in many threads that it is impossible to turn off garbage collection on Sun's JVM. However, for the purpose of our research project we need this feature. Can anybody recommend a JVM implementation which does not have garbage collection or which allows turning it off? Thank you.
I have been searching for ages now for a good .Net based VoIP library.
After having tried conaito and SIP.Net I have still haven't found anything that truly fits my needs.
Basically all of these are constructed using ActiveX.
Unfortunately ActiveX and WPF don't play well together. And ClickOnce Deployment doesn't register Interop COM components.
I need to find a good, pure .Net managed code implementation.
Hi,
I want to check whether a string starts with any character in a list. My current implementation in C# is as follows:
char[] columnChars = new char[] { 'A', 'B', 'C', 'D', 'E' };
private bool startWithColumn(string toCheck)
{
for(int i=0; i<columnChars.Length; i++)
if (toCheck.StartsWith(columnChars[i]+""))
{
return true;
}
return false;
}
I would like to know if any solution is better?