FAQ Database Discussion Community


AICC standards documents and sample package

standards,scorm
I'm reading about some learning management system (LMS) standards and found that SCORM and AICC are quite common nowadays. I have tried to find things related to them. With SCORM, it is easy, but with AICC, all things I have found via Google are pointed to the AICC's home page...

Can an implementation specify undefined behavior

c,standards,language-lawyer,undefined-behavior,c11
3.4.1 1 implementation-defined behavior unspecified behavior where each implementation documents how the choice is made Can an implementation specify that, implementation-defined behavior is undefined behavior in cases where undefined behavior is a possible outcome? For example: 6.3.1.3 Signed and unsigned integers 3 Otherwise, the new type is signed and...

Integer division overflows

c++,c,cross-platform,standards,integer-overflow
The Problem I have been thinking about integer (type int) overflows, and it occurs to me that division could overflow. Example: On my current platform, I have INT_MIN == -INT_MAX - 1 and thus INT_MIN < -INT_MAX and thus INT_MIN / -1 > -INT_MAX / -1 and thus INT_MIN /...

Why does c++ standard still not include file system and networking? [closed]

c++,networking,filesystems,standards
I have been wondering about this for a while, and haven't found out relevant answer anywhere. So do you have any clue, why the C++ standard committee is not even thinking about adding such an essential features in the future? In my opinion every programming language, in order to be...

Why can you assign nullptr to std::string?

c++,string,c++11,standards
So today I wrote a fairly hard to find bug where I initialized a std::string to nullptr (not a pointer to std::string, but the value itself). I've found apparently it's only possible to do in C++11 or later with clang. #include <string> #include <iostream> using namespace std; class Meh{ int...

What is included in C Standard library?

c,linux,posix,standards,language-lawyer
I will give an example from The GNU C Library documentation: 13.1 Opening and Closing Files This section describes the primitives for opening and closing files using file descriptors. The open and creat functions are declared in the header file fcntl.h, while close is declared in unistd.h. My question is:...

Is there any test(quiz) description format?

api,standards,specifications
In the field of automation of education there SCORM specification and Tin Can API. Is there something like that or any standard or format for describing and storing tests (especially psychological). On the Internet you can find a lot of tests implemented in the form of applications, as well as...

Java label irregularity (possible bug?)

java,label,java-8,standards
If we look at the Java standard §14.7, we see that statements may have label prefixes, e.g.: LabeledStatement:      Identifier : Statement In theory, a label should be able to label any succeeding statement. So, for example, the following compiles accordingly: public class Test { public static void main(String[] args) {...

C++11 Allocation Requirement on Strings

c++,string,c++11,memory,standards
I had heard that C++11 was going to require strings to be allocated in contiguous memory. I even thought I saw a stack overflow question on it, but I can't seem to find it. I know that in practice both gcc and Visual Studio do allocate strings contiguously, I'm just...

Does the C standard guarantee buffers are not touched past their null terminator?

c,standards,c-standard-library
In the various cases that a buffer is provided to the standard library's many string functions, is it guaranteed that the buffer will not be modified beyond the null terminator? For example: char buffer[17] = "abcdefghijklmnop"; sscanf("123", "%16s", buffer); Is buffer now required to equal "123\0efghijklmnop"? Another example: char buffer[10];...

What's the purpose of allowing duplicate property names?

javascript,standards,ecmascript-6
I'm reading the MDN javascript reference, accordingly the following code no longer returns false: function haveES6DuplicatePropertySemantics(){ "use strict"; try { ({ prop: 1, prop: 2 }); // No error thrown, duplicate property names allowed in strict mode return true; } catch (e) { // Error thrown, duplicates prohibited in strict...

Existing standard(s) for passing MIDI via OSC?

standards,midi,osc
I am using OSC to feed into MIDI - so the many OSC controller apps can be used on standard MIDI kit. Just for 'proof of concept' I used this format:- /midi/note_on/<note-number> /midi/note_off/<note-number> /midi/control_change/<control>/<value> etc... Now it seems to be doable... is there already a standard I could steal for...

How to request a c++ feature?

c++,inheritance,standards,composition,code-reuse
How could I request a C++ feature ? Who do I have to write to ? The feature I would like to request is a mere syntax commodity : When using composition, we need a better syntax in order to provide method forwarding. Something like what follows : class Object{...

Where can I read the ANSI terminal standard?

terminal,standards
I'd thinking about creating my own Terminal Emulation library, and I'd like to start by trying to get the latest standard for ANSI terminals. I know there are a lot resources out there, but I'd like to read the actual standard if I can. If the standard costs "a lot...

The standard C function declaration syntax (WINAPI) [duplicate]

c++,c,standards
This question already has an answer here: What does “WINAPI” in main function mean? 4 answers I know you might think this question already been answered but it is not, or at least it was not very clear to me. int WINAPI WinMain (){} This is a pseudo form...

Avoiding Concurrent Modification

java,rendering,standards,deep-copy,concurrentmodification
Let's say I'm making a game where the screen is updates as often as possible within the frame-rate limit, but objects are only updated on a game-tick clock. How would I render complex objects without risking concurrent modification? For instance, if I needed the rendering engine to access detailed information...

UNION ALL two SELECTs with different column types - expected behaviour?

sql,standards,sqldatatypes,union-all
What is the expected behaviour due to SQL Standard when we perform UNION on two tables with different data types: create table "tab1" ("c1" varchar(max)); create table "tab2" ("c3" integer); insert into tab1 values(N'asd'), (N'qweqwe'); insert into tab2 values(123), (345); select c_newname as myname from ( select "c1" as c_newname...

What is the “char-sequence” argument to NaN generating functions for?

c,standards,nan,c99
Aside from the NAN macro, C99 has two ways to generate a NaN value for a floating point number, the nanf(const char *tagp) function and strtof("NAN(char-sequence)"). Both of these methods of generating a NaN take an optional string argument (*tagp in nanf() and the char-sequence in the strtof method). What...

Const and non-const in one variable definition list in C++

c++,variables,standards,definition
Why it is not possible to define const and non-const variables in one definition list? For example, in using for loop: for (size_t i = 0, const iCount = data.size(); i < iCount; ++i); It would be better from const-correctness viewpoint I guess. P.S. I've asked this question wrong at...

Is it really bad practice to assign a variable multiple times, as per a NetBeans warning?

php,netbeans,standards
I have a function that is basically like this: //Init variable $ready = FALSE; //if submit filter_input(INPUT_POST, "submit") ? $ready = TRUE : $ready = FALSE ; //return the result return $ready; NetBeans is warning me against multiple assignments. In other languages this is pretty normal to do. It is...

Why are execv*() arguments inconsistent with execl*()?

c,exec,standards,argv
Why are the argv arguments for the execv*() family of functions char * const [] whereas the execl*() family of arg0...n args are const char *? Is this just a mistake in the standard, and it should be const char * const [] or is there a reason for the...

Why was the ISO standard for prolog a failure? [closed]

module,prolog,standards,iso,iso-prolog
In the introduction here, it states that the ISO standard for Prolog was a failure. Can anyone elaborate on this?

Are all types extending std::is_floating_point required to implement FENV in C++11 standard?

c++11,floating-point,standards
I'm implementing a function as follows: template <typename FP> void do_something(FP f){ static_assert(std::is_floating_point<FP>::value, "not a floating point"); ... } In this context, any floating point can be used (native or custom, i.e. multi-precision float libraries). I wonder if standard states anything about what to expect from types overloading the is_floating_point....

How to protect private Thread without using SecurityManager

java,multithreading,security,standards
Like ThreadPoolExecutor class, I'm using private background thread in my class (MyClass). However, once I start my thread, anyone can invoke my thread's method like this: Thread[] threads = new Thread[10]; Thread.currentThread().getThreadGroup().enumerate(threads); threads[**index of my thread**].run(); and this kind of invocation breaks structure of MyClass. Of cource, I can use...

why I can't decode the ‘utf8’ string in python2.7?

python,python-2.7,utf-8,standards,decode
I use python write: '\xF5\x90\x90\x90'.decode('utf8') But it make error: UnicodeDecodeError: 'utf8' codec can't decode byte 0xf5 in position 0: invalid start byte The string\xF5\x90\x90\x90 is a standard 'utf8' string. It's binary is 11110101 10010000 10010000 10010000. Comply with the rules of utf8 :11110xxx 10xxxxxx 10xxxxxx 10xxxxxx why I can't decode...

Passing arguments to a perl package while using it

perl,documentation,arguments,standards,packages
it is possible to pass some arguments while using a package, for example: use Test::More tests => 21; I wasn't able to find any valuable documentation about this featue. Are there any pros and cons of passing such arguments? Best, R....

Syntactical Sour

c,for-loop,syntax,standards
Well there are just some weird syntax question thrown to you by some author of the books just to check the understanding of the syntax while I think these kind of weird syntax may not be used by any programmer but just for the sake of understanding, I would like...

Does the change in lower bounds for the char type in C++14 break compatibility with ones' complement systems?

c++,range,standards
Why was char in C++14 ever defined as specifically one less than the amount of values that a char could hold before, and what was their reasoning for changing such things for the C++14 Standard? It appears that from http://en.cppreference.com/w/cpp/language/types that C++14 has changed the lower limit from -127 to...

Does Java have builtin ability or standard patterns for static deserialization?

java,deserialization,standards
Serialization makes sense as an instance method - an object might reasonably be able to serialize itself. An object should only ever be in a valid state, and all valid states of an object should be permissible to serialize. There is nothing invalid about this idea. But deserialization does not...

Namespace entries in PSR-1 standard?

php,namespaces,standards,psr-1
I am looking for the correct way (if either is correct please let me know) to write namespaces in PHP classes that follow PSR-1 standard. I looked around but didn't see anything specific. Is the correct way to use Namespace Foo\Bar; or is it correct to use curly braces such...

Strict aliasing in relation to aggregate or union types

c,gcc,standards,c99,strict-aliasing
I'm trying to understand the implications of the following statement in the C99 standard (C99; ISO/IEC 9899:1999 6.5/7) An object shall have its stored value accessed only by an lvalue expression that has one of the following types 73) or 88): (other statements unrelated to question omitted) an aggregate or...

Getting file size platform-independently (C)

c,file,cross-platform,standards,filesize
I am looking for some platform-independent C code to determine the size of a given file. First, I read the following answer: http://stackoverflow.com/a/238607 The answer uses fseek with SEEK_END and ftell. Now, my problem is that I found the following C standard quotes. Setting the file position indicator to end-of-file,...

Nonstandard type declaration in Fortran 2003

standards,variable-declaration,fortran2003
I've written a scientific fortran code without using any specific fortran standard. But I have now to declare which fortran standard I'm using. I said I'm using fortran 2003 because I need the get_command_argument and command_argument_count intrinsic functions. However when using the flag -std=f2003 to check the code standards the...

rmdir (2) used for directory tree removal

filesystems,standards,system-calls,syscall,standards-compliance
If a particular filesystem supports cheap removal of whole directories (with everything inside), would it be acceptable by POSIX / Linux / de-facto standards to let rmdir syscall delete a directory successfully even if it was not empty? Manpage for rmdir(2) syscall specifies an error ENOTEMPTY can (or should?) be...

Add integers safely, and prove the safety

c++,c,standards,verification,correctness
Programming course assignment asks to write a (safe) function that adds two integers, and show that the function is safe. The following code represents my solution. I am not an expert on the C standard (or on formal verification methods). So I would like to ask: Are there better (or...

Java Standard On Result Of Casting A Double To An Int

java,java-8,standards,standards-compliance
Say I have the following... double d = 1.6; int q = ( ( int ) d ); Will this always drop the just decimal point according to the Java standard, or could it round up or down according to the standard (Which more or less exists)?...

C++: digits vs bits?

c++,boost,standards,bit,digits
I am trying to understand the difference of vocabulary used in the C++ language between digits and bits as in : CHAR_BIT; std::numeric_limits<char>::digits; Is there a conceptual difference? Maybe for weird architectures? If so, what would be called the result of the operator[] of std::bitset. Does it give access to...

Can I seek a position beyond 2GB in C using the standard library?

c,file,standards,standard-library,seek
I am making a program that reads disk images in C. I am trying to make something portable, so I do not want to use too many OS-specific libraries. I am aware there are many disk images that are very large files but I am unsure how to support these...

Swift Industry standard for curly braces [closed]

function,loops,swift,standards
In Swift, I am trying to figure out whether I should do if(true) { //stuff } else { //other stuff } Or if(true){ //stuff } else{ //other stuff } I know that technically it doesn't make a difference, but I was wondering what the industry standard was, and why the...

How to do a bit representation in a C-standard way?

c,bit-manipulation,standards,bit
As per the C standard the value representation of a integer type is implementation defined. So 5 might not be represented as 00000000000000000000000000000101 or -1 as 11111111111111111111111111111111 as we usually assume in a 32-bit 2's complement. So even though the operators ~, << and >> are well defined, the bit...

C++ Standard On The Address of Inherited Members

c++,c++11,inheritance,standards,memory-address
Does the C++ standard say anything on the address of inherited members? For example if I inherit an int member or a non - virtual method, does it say anything about its address, or a virtual member: if I dont overide it, if I do? The constructor, if I use...

Protocols and standards that take advantage of the huge IPv6 address space [closed]

networking,protocols,standards,ipv6
Unsure if this is the correct place for this kind of question (Server Fault is for administrators) but I'm looking for examples of (networking) protocols and standards that leverage the huge IPv6 address space towards some specific benefits. Reason is I'm writing a paper about something that does this and...

Is calling delete operator on a memory allocated by new[] operator undefined behavior?

c++,standards,c++14,delete-operator
I am pretty much sure it is but if I am interpreting correctly the standard (Section 18.6.1.2 new.delete.array) mentions that: void operator delete[](void* ptr) noexcept; pointer. . 13 Default behavior: Calls operator delete(ptr) Since in its default behavior delete[] just calls its delete(ptr) equivalent why should it matter which version...

Strict Standards: Non-static method should not be called statically, assuming $this from incompatible context

php,static,standards,strict,non-static
This is a question specific to a custom wrote CMS we have taken over. We moved servers and the PHP version changed from 5.3.8 to 5.4.1. Since then we can't get the CMS to work and are getting this error: Strict Standards: Non-static method Vox_Model_Setting::getMapper() should not be called statically,...

Convert double to time_t

c++,time,standards,chrono,time-t
I have a double containing seconds. I would like to convert this into a time_t. I can't find a standard function which accomplishes this. Do I have to fill out the time_t by hand?...

Software Testing Standards for web applications

testing,standards,software-engineering
Can someone define the software testing standards for web application? We have our own set of standards on which we done testing. Its very simple like text font size, error message display locations, alignment of text boxes, proper validation etc. I am very much interested in knowing the ISO standards...

Address of an instance emplaced to std::vector is invalid

c++11,vector,standards,emplace
I have 2 std::vectors: to first vector, I emplace instance to second vector, I want to store the address of the instance just emplaced But it does not work, i.e., the stored address differs from the emplaced instance's address. If it matters at all, I'm on Linux and using g++...