Warning: session_start(): open(/var/lib/php/sessions/sess_0sa7kt937oncpmddr3b3a8sbh2, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
sclass ShortBuffer is Iterable {
short[] data;
short size;
*() {}
*(short size) { if (size != 0) data = new short[size]; }
*(Iterable l) {
if (l cast Cl) allocate(l.size());
addAll(l);
}
void add(short i) {
if (size >= lShortArray(data)) {
data = resizeShortArray(data, Math.max(1, toShort(Math.min(maximumSafeArraySize(), lShortArray(data)*2L))));
if (size >= data.length) fail("ShortBuffer too large: " + size);
}
data[size++] = i;
}
void allocate(short n) {
data = resizeShortArray(data, max(n, size()));
}
void setSize(short n) {
data = resizeShortArray(data, n);
size = min(l(data), size);
}
void addAll(Iterable l) {
if (l != null) for (short i : l) add(i);
}
void addAll(short... l) {
if (l != null) for (short i : l) add(i);
}
// Note: may return the internal array
short[] toArray aka toShortArray() {
ret size == 0 ? null : resizeShortArray(data, size);
}
// abandoned version
/*L toList() {
ret intArrayToList(data, 0, size);
}*/
// now all these return a virtual list
L toList aka asList aka asVirtualList() {
ret new RandomAccessAbstractList {
public short size() { ret size; }
public Short get(short i) { ret ShortBuffer.this.get(i); }
public Short set(short i, Short val) {
Short a = get(i);
data[i] = val;
ret a;
}
};
}
void reset { size = 0; }
void clear { reset(); }
short size() { ret size; }
bool isEmpty() { ret size == 0; }
short get(short idx) {
if (idx >= size) fail("Index out of range: " + idx + "/" + size);
ret data[idx];
}
void set(short idx, short value) {
if (idx >= size) fail("Index out of range: " + idx + "/" + size);
data[idx] = value;
}
short popLast() {
if (size == 0) fail("empty buffer");
ret data[--size];
}
short last() { ret data[size-1]; }
short nextToLast() { ret data[size-2]; }
toString { ret squareBracket(joinWithSpace(toList())); }
public Iterator iterator() {
ret new ItIt {
short i = 0;
public bool hasNext() { ret i < size; }
public Short next() {
//if (!hasNext()) fail("Index out of bounds: " + i);
ret data[i++];
}
};
}
public ShortegerIterator integerIterator() {
ret new ShortegerIterator {
short i = 0;
public bool hasNext() { ret i < size; }
public short next() {
//if (!hasNext()) fail("Index out of bounds: " + i);
ret data[i++];
}
toString { ret "Iterator@" + i + " over " + ShortBuffer.this; }
};
}
void trimToSize {
data = resizeShortArray(data, size);
}
}