For a new project with Flash I was looking for something along the lines of standard libraries for basic programming needs, along the lines of Python or Ruby standard libraries. But the only thing I found was a dead project on Sourceforge.
Thus is there no standard library for flash? Does everyone reinvent the wheel each time?
...
I'm using an istream which could be stringstream, ifstream or a user-defined stream type and I need to know if, in the case of an ifstream, it was not opened in binary mode (so I can throw an exception). I have tried the following method:
if ((_is.flags() & ios::binary) == 0)
throw exception(...)
but no exception is ever thrown. T...
The Java Collections.max takes only a collection of a sortable object. However since the collection is not necessarily sorted, I don't see any reason not to implement the same max function for iterable types.
Is there a max method for Iterable<T extends Comparable<? super T>> in java's standard library?
...
Is it me or are there no standard trim functions in the c or c++ library? is there any single function that acts as a trim? If not can anyone tell me Why trim is not part of the standard library? (i know trim is in boost)
My trim code is
std::string trim(const std::string &str)
{
size_t s = str.find_first_not_of(" \n\r\t");
siz...
I have some questions on using std::map:
Is using an enum as the key in std::map a good practice? Consider the following code: enum Shape{
Circle,
Rectangle
};
int main(int argc, char* argv[])
{
std::map strMap;
// strMap.insert(Shape::Circle,"Circle"); // This will not compile
strMap[Shape::Circle] = "Circle"; ...
template<class Y>
operator auto_ptr_ref<Y>() throw() {
return auto_ptr_ref<Y>(release());
}
It is part of implementation of class auto_ptr in standard library.
What does this means to do?
Why there is an "auto_ptr_ref" between "operator" and "()"?
...
Background: I'm trying to create a pure D language implementation of functionality that's roughly equivalent to C's memchr but uses arrays and indices instead of pointers. The reason is so that std.string will work with compile time function evaluation. For those of you unfamiliar w/ D, functions can be evaluated at compile time if ce...
Recently, I've got a dangerous idea into my head after reading this blog post. That idea can be expressed like this:
I don't need most of what the C++ standard library offers. So, why don't I implement a less general, but easier to use version?
As an example, using the STL spits out reams of incomprehensible and mangled compiler errors...
I have a char** that I frequently need to insert into or perform a lookup. It is very tedious to realloc(), malloc() the array and insert strings.
Is there any standard way that I can add strings to or do lookups in a char**? I guess I'm looking for something like string, but using char**'s instead.
...
There are two of them Phobos and Tango.
As far as I know they are redundant and incompatible.
Are there any plans to join them?
If so, when will it happen?
...
The numeric_limits traits is supposed to be a general way of obtaining various type infomation, to be able to do things like
template<typename T>
T min(const std::vector<T>& vect)
{
T val = std::numeric_limits<T>::min();
for(int i=0 ; i<vect.size() ; i++)
val = max(T, vect[i]);
return val;
}
The problem is that (...
Whenever I use the rand function in C++:
#include<iostream>
#include<time.h>
#include<stdlib.h>
using namespace std;
int main(){
srand(time(0));
int n=(rand()%6)+1;
cout<<"The dice roll is "<<n<<"."<<endl;
}
I get a warning about conversion from time_t to int at line 5:
srand(time(0));
Is there any way to get rid of this warning?
...
I'd like to use an STL set in my iPhone app (which is written in Objective-C in XCode). How do I include set and/or use the standard namespace?
In C++ I'd do this:
#include<set>
using namespace std;
// use the set<T> somewhere down here...
How can I do this in Objective-C?
...
In the book "The C Programming Language" it says:
"Many of the functions in the library set status indicators when error or end of file occur. These
indicators may be set and tested explicitly. In addition, the integer expression errno (declared
in <errno.h>) may contain an error number that gives further information about the mo...
How does the JVM make it's windows, i know it has it's jar files and the executables, etc...
what i would like to know is how exactly is a window made with java, the frame surrounding a desktop application.
is it a graphics library standard on the machines it is installed in?
...
Does it? If yes, where can I get the documentation for it... if not, then which would be the best alternative?
...
I am teaching a graduate level Python class at the University of Paris, and the students need to be introduced to the standard library. I want to discuss with them about some of the most important standard modules.
What modules do you think are absolute musts? Even though responses probably vary depending on your field (web programmin...
Why are the API's _open, _close, and other standard file i/o functions prefixed with an underscore? Aren't these part of some standard?
...
Can anyone please tell me that which type of sorting technique (bubble, insertion, selection, quick, merge, count...) is implemented in the std::sort() function defined in the <algorithm> header file in C++?
...
I want to learn and use SBCL because of its ease of learning and speed. (I've been playing with Lisp 3 years ago, and now am refreshing it.) But how can I learn what's included in the standard library, so that I don't re-implement things?
After Python this is like a nightmare: the SBCL website has a manual that covers the software only,...